Subversion Repositories taios

Rev

Rev 471 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
169 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Manage Account', '../');
6
$page->drawHeader();
7
$page->drawMiddle();
8
 
9
$page->checkLoggedIn();
10
 
11
$userID = $page->getGetID();
12
$user = $page->getUserByID($userID);
13
 
471 muzer 14
if (($page->getLoggedInUser()->ID == $userID || $page->isUserAdmin($page->getLoggedInUser())) && $user && $page->isUserNormal($page->getLoggedInUser()))
169 tom 15
{
16
?>
17
 
18
<p class="bold">Here you can edit your account.</p>
19
<p>Only change the password value if you want to change your password.</p>
20
<br />
21
 
22
<form action="account-do.php" method="POST">
23
<table>
185 tom 24
<tr><td class="bold">ID: </td><td><input type="hidden" name="id" value="<?php echo $user->ID; ?>" /><?php echo $user->ID; ?></td></tr>
169 tom 25
<?php
26
if ($page->isUserAdmin($page->getLoggedInUser()))
27
{
28
    write('<tr><td class="bold">AccessID: </td><td><input type="text" name="accessID" value="' . $user->accessID . '" /></td></tr>');
29
}
30
else
31
{
32
    write('<tr><td class="bold">AccessID: </td><td>' . $user->accessID . '</td></tr>');
33
}    
34
?>
522 muzer 35
<tr><td class="bold">Username: </td><td><?php echo htmlentities($user->username, ENT_QUOTES); ?></td></tr>
169 tom 36
<tr><td class="bold">Password: </td><td><input type="password" name="password" /></td></tr>
522 muzer 37
<tr><td class="bold">Email Address: </td><td><input type="text" name="email" value="<?php echo htmlentities($user->emailAddress, ENT_QUOTES); ?>" /></td></tr>
38
<tr><td class="bold">Name: </td><td><input type="text" name="name" value="<?php echo htmlentities($user->name, ENT_QUOTES); ?>" /></td></tr>
169 tom 39
<tr><td></td><td><input type="submit" value="Update Account" /></td></tr>
40
</table>
41
</form>
42
 
43
<?php
44
}
45
else
46
{
47
    if (!$user)
48
    {
183 tom 49
        $page->drawError('No such user, #' . $userID);
169 tom 50
    }
51
    else
52
    {
183 tom 53
        $page->drawError('You do not have permission to access this page.');
169 tom 54
    }
55
}
56
 
57
$page->drawFooter();
58
 
59
?>
60