92e8e2f9bd0dae4a04fefd07bededaded62b9cff
bernd Systemuser-Modul hinzugefügt

bernd authored 17 years ago

modules/systemuser/accounts.php  1) <?php
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

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

bernd authored 17 years ago

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

bernd authored 14 years ago

modules/systemuser/accounts.php  9) title("System-Benutzeraccounts");
bernd Systemuser-Modul hinzugefügt

bernd authored 17 years ago

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

bernd authored 14 years ago

modules/systemuser/accounts.php 19)   $shells = available_shells();
bernd Systemuser-Modul hinzugefügt

bernd authored 17 years ago

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

bernd authored 14 years ago

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

bernd authored 17 years ago

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

bernd authored 14 years ago

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

bernd authored 17 years ago

modules/systemuser/accounts.php 48)   }
bernd Überarbeitetes Systemuser-M...

bernd authored 14 years ago

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