f2550e90ad37215b9d890155806986336bf0170c
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

1) <?php
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

2) require_once('inc/base.php');
3) require_once('inc/icons.php');
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

4) 
5) require_once('useraccounts.php');
6) 
7) require_role(ROLE_CUSTOMER);
8) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

9) title("System-Benutzeraccounts");
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

10) 
11) 
12) if (! customer_may_have_useraccounts())
13) {
14)   warning("Sie haben bisher keine Benutzeraccounts. Der erste (»Stamm-«)Account muss von einem Administrator angelegt werden.");
15) }
16) else
17) {
18)   $accounts = list_useraccounts();
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

19)   $shells = available_shells();
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

20)   output("<p>Folgende Benutzeraccounts haben Sie bisher:</p>");
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

21)   output("<table><tr><th>Benutzeraccount</th><th>Speicherplatz<sup>*</sup></th><th>Aktionen</th></tr>");
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

22)   foreach ($accounts as $acc)
23)   {
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

24)     $shell = $shells[$acc['shell']];
25)     $usedquota = get_used_quota($acc['uid']);
26)     $quota = array();
27)     foreach ($usedquota as $q)
28)     {
29)       $percent = round(( $q["used"] / $q["quota"] ) * 100 );
30)       $color = ( $percent > 99 ? 'red' : ($percent > 80 ? "yellow" : "green" ));
31)       $width = 2 * min($percent, 100);
32)       $quota[] = "<p>Server <strong>{$q['server']}</strong><br />{$percent}%: {$q['used']} MB von {$q['quota']} MB belegt.</p> 
33)         <div style=\"margin: 0; padding: 0; width: 200px; border: 1px solid black;\"><div style=\"font-size: 1px; background-color: {$color}; height: 10px; width: {$width}px; margin: 0; padding: 0;\">&#160;</div></div>";
34) 
35)     }
36)     $realname = $acc['name'] ? $acc['name'] : $_SESSION['customerinfo']['name'];
37)     $quotastring = implode('', $quota);
38)     output("<tr><td><p><strong>{$acc['username']}</strong> - {$realname}</p><p style=\"color: #555;\">Existiert seit {$acc['erstellungsdatum']}<br />Verwendete Shell: {$shell}</p></td>");
39)     output("<td>{$quotastring}</td>");
40)     output("<td>".internal_link('edit', other_icon('user_edit.png', 'Bearbeiten'), "uid={$acc['uid']}"));
41)     
42)     if (! customer_useraccount($acc['uid']))
43)     {
44)       output(" &#160; ".internal_link('pwchange', icon_pwchange('Passwort neu setzen'), "uid={$acc['uid']}"));
45)       #output(" &#160; ".internal_link('deluser', other_icon('user_delete.png', 'Benutzer löschen'), "uid={$acc['uid']}"));
46)     }
47)     output("</td></tr>\n");
bernd Systemuser-Modul hinzugefügt

bernd authored 16 years ago

48)   }
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

49)   output("</table><p><sup>*</sup>) Die Werte für den verbrauchten Speicherplatz werden periodisch eingelesen und hier erst verspätet angezeigt!</p>");