* ByteHoard 2.1 * Copyright (c) Andrew Godwin & contributors 2004 * * Module * $Id: edituser.inc.php,v 1.2 2005/06/17 18:52:00 andrewgodwin Exp $ * */ #name Edit User #author Andrew Godwin #description Lets you edit a user. #iscore 1 $editusername = $_GET['username']; if (!empty($_POST['user'])) { $user = $_POST['user']; # Update details $userobj = new bhuser($editusername); $userobj->userinfo['fullname'] = $user['fullname']; $userobj->userinfo['email'] = $user['email']; $userobj->saveuserinfo(); if ($user['quota'] == "0" || trim($user['quota']) == "") { $quota = ""; } else { if (!is_numeric($user['quota']) || $user['quota'] < 0) { bh_add_error($bhlang['error:quota_not_a_number']); require "error.inc.php"; return; } else { $quota = round($user['quota'] * 1024 * 1024); } } # Update type & disabled
<?php $str .= "\n\n<br>\n<table class='toolbar' cellspacing='0' cellpadding='0' width='90%' align='center'>\n\t<tr height='10'>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/tl.png'></td>\n\t\t<td background='" . $this->skinpath . "images/sidebar/tc.png'></td>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/tr.png'></td>\n\t</tr>\n\t<tr height='30'>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/lc.png' width='10' height='30'></td>\n\t\t<td background='" . $this->skinpath . "images/sidebar/titlebg.png' align='center' valign='middle'><b>" . $bhlang['title:user_administration'] . "</b></td>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/rc.png' width='10' height='30'></td>\n\t</tr>\n\t<tr>\n\t\t<td width='10' background='" . $this->skinpath . "images/sidebar/lc.png'> </td>\n\t\t<td valign='middle' align='center'><br><br>\n\t\t\t" . $bhlang['explain:user_administration'] . "<br><br>\n\t\t\t\n\t\t\t<table width='95%'>\n\t\t\t"; foreach ($this->content1 as $group => $users) { if ($group == $this->content2) { $str .= "<tr bgcolor='#DEE1F8'><td><b><font color='#000000'>" . $group . "</font></b></td></tr>\n\r<tr><td><table cellpadding='5' cellspacing='0'>"; # Table heading. Column names, etc. $str .= "\n\r<tr bgcolor='#EBEBEB'><td align='center'>" . $bhlang['column:user_type'] . "</td><td></td><td align='center''>" . $bhlang['column:username'] . "</td><td align='center' colspan='2'>" . $bhlang['column:used_space'] . "</td><td align='center'>" . $bhlang['column:bandwidth_30_days'] . "</td><td align='center'>" . $bhlang['column:actions'] . "</td></tr>"; foreach ($users as $user) { # If the username is not shown then don't show it if ($user == "guest") { } else { $thisuserobj = new bhuser($user); $usrimgfile = $thisuserobj->type . ".png"; # This is pretty nasty. Lots of tables. # Note I use the humanfilesize() function here for bandwidth - it's bytes all the way, so it sort of makes sense. # Also, this is hardcoded to show last 30 days bandwidth. It may be possible to change this on the user end in the future. # Also note that getbandwidth() accepts a third parameter, end time. Might use it for graphs. # # sec min hr days (rounded) $bandwidthstart = time() - 60 * 60 * 24 * 30; # # e.g. for a year #$bandwidthstart = time() - (60 * 60 * 24 * 356); # # or for last week #$bandwidthstart = time() - (60 * 60 * 24 * 7); # # or yesterday #$bandwidthstart = time() - (60 * 60 * 24); # etc.