summaryrefslogtreecommitdiffstats
path: root/pages/content/Users:Handle.xml
blob: 27b5a3e496b2b0e101a442312d0bfd2007dcdc03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="UTF-8" ?>
<page>
  <info>
    <name>Users:Handle</name>
    <template>phpexec</template>
    <access>0:0</access>
    <type>c</type>
  </info>
  <data>
    <code>
      <![CDATA[
        <?PHP
          Uses('links', 'user');
          
          
          if(isset($_POST['new'])) {
            $title = 'Neuer Benutzer';  
          ?>
          <h2>Neuer Benutzer</h2>
          
          <form method="post" action="<?PHP echo $GLOBALS['links']->GetNeonLink('Users:New'); ?>">
            <div class="spaced-bottom">Name: <input type="text" id="username" name="name" size="70" /></div>
            Gruppe:<br />
            <select name="gid" size="15" class="grouplist spaced-bottom">
              <option value="0">Administrator</option>
              <?PHP
                $res = $GLOBALS['db']->Execute('SELECT * FROM groups ORDER BY name');
                
                while($group = $res->FetchRow()) {
                  echo '<option value="' . $group[0] . '">' . htmlspecialchars($group[1]) . '</option>';
                }
              ?>
            </select><br />
            Passwort:<br />
            <input type="password" class="spaced-bottom" name="password" size="30" /><br />
            Bestätigen:<br />
            <input type="password" class="spaced-bottom" name="password2" size="30" /><br />
            <input type="submit" value="Neu" />
            <input type="submit" name="back" value="Zurück" />
          </form>
          <?PHP
          }
          elseif(isset($_POST['group'])) {
            if($_POST['id']) {
              $name = htmlspecialchars($GLOBALS['user']->GetName($_POST['id']));
              $gid = $GLOBALS['user']->GetGid($_POST['id']);
              
              $title = 'Gruppe von \'' . $name . '\' ändern';
              
              echo '<h2>Gruppe von \'' . $name . '\' ändern</h2>';
              
              echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Group') . '">';
              echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
              echo 'Neue Gruppe:<br />';
              
              echo '<select name="gid" size="15" class="grouplist spaced-bottom">';
              
              $res = $GLOBALS['db']->Execute('SELECT * FROM groups ORDER BY name');
              $groups = $res->GetArray();
              array_unshift($groups, array(0, 'Administrator'));
              
              foreach($groups as $group) {
                echo '<option value="' . $group[0] . '"';
                if($group[0] == $gid) echo ' selected="selected"';
                echo '>' . htmlspecialchars($group[1]) . '</option>';
              }
              
              echo '</select><br />';
              
              echo '<input type="submit" value="Ändern" /> ';
              echo '<input type="submit" name="back" value="Zurück" />';
              echo '</form>';
            }
          }
          elseif(isset($_POST['password'])) {
            if($_POST['id']) {
              $name = htmlspecialchars($GLOBALS['user']->GetName($_POST['id']));
              
              $title = 'Passwort von \'' . $name . '\' ändern';
              
              echo '<h2>Passwort von \'' . $name . '\' ändern</h2>';
              
              echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Password') . '">';
              echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
              echo 'Neues Passwort:<br />';
              echo '<input type="password" name="password" class="spaced-bottom" size="30" /><br />';
              echo 'Bestätigen:<br />';
              echo '<input type="password" name="password2" class="spaced-bottom" size="30" /><br />';
              echo '<input type="submit" value="Ändern" /> ';
              echo '<input type="submit" name="back" value="Zurück" />';
              echo '</form>';
            }
          }
          elseif(isset($_POST['rename'])) {
            if($_POST['id']) {
              $name = htmlspecialchars($GLOBALS['user']->GetName($_POST['id']));
              
              $title = '\'' . $name . '\' umbenennen';
              
              echo '<h2>\'' . $name . '\' umbenennen</h2>';
              
              echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Rename') . '">';
              echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
              echo 'Neuer Name: ';
              echo '<input type="text" name="name" value="' . $name . '" size="70" /><br />';
              echo '<input type="submit" class="spaced-top" value="Umbenennen" /> ';
              echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
              echo '</form>';
            }
          }
          elseif(isset($_POST['delete'])) {
            if($_POST['id']) {
              $name = htmlspecialchars($GLOBALS['user']->GetName($_POST['id']));
              
              $title = '\'' . $name . '\' löschen';
              
              echo '<h2>\'' . $name . '\' löschen</h2>';
              
              echo '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Users:Delete') . '">';
              echo '<input type="hidden" name="id" value="' . $_POST['id'] . '" />';
              echo 'Wollen Sie den Benutzer \'' . $name . '\' wirklich löschen?<br />';
              echo '<input type="submit" class="spaced-top" value="Löschen" /> ';
              echo '<input type="submit" class="spaced-top" name="back" value="Zurück" />';
              echo '</form>';
            }
          }
        ?>
      ]]>
    </code>
  </data>
</page>