92f133ee96716791aa0cad3fd268fafdc9c507dc
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) 
9) $title = "System-Benutzeraccounts";
10) 
11) 
12) output("<h3>System-Benutzeraccounts</h3>");
13) 
14) if (! customer_may_have_useraccounts())
15) {
16)   warning("Sie haben bisher keine Benutzeraccounts. Der erste (»Stamm-«)Account muss von einem Administrator angelegt werden.");
17) }
18) else
19) {
20)   $accounts = list_useraccounts();
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

23)   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

24)   foreach ($accounts as $acc)
25)   {
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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