cleaned up the css a bit and got rid of the retarded div#header thing
[specialops2.git] / user.php
blob4a6e347ab6fb1551bc4720f179a0d67d92b63284
1 <?php
2 // $Id$
4 $prefetch = array('`points`', '`last_active_date`', '`register_date`', '`sig`', '`quote`', '`reg_email`', '`public_email`', '`private_email`', '`useragent`',
5 'INET_NTOA(`last_login_ip`) AS `last_login_ip`', 'INET_NTOA(`last_ip`) AS `last_ip`', 'INET_NTOA(`reg_ip`) AS `reg_ip`');
7 require 'con.php';
8 $page->title = _('User Details');
10 if ( ! ($user instanceof authuser) )
11 $page->errorfooter('login');
13 $uid = isset($_GET['id']) ? intval($_GET['id']) : $user->userid;
15 if ( $user->userid != $uid && $DB->query('SELECT `userid` FROM `users` WHERE `userid` = '.$uid)->num_rows == 0 )
16 $page->errorfooter('userid');
18 if ( $user->userid == $uid ) {
19 $page->title = _('Your Details');
20 $user->userheader();
21 $user2 = $user;
23 echo
24 '<fieldset style="float:right" class="content"><legend>',_('Options Menu'),'</legend>
25 <ul>
26 <li><a href="theme">',_('Edit your theme'),'</a></li>
27 <li><a href="options">',_('Change settings and profile'),'</a></li>
28 <li><a href="passwd">',_('Change your password'),'</a></li>
29 <li><a href="userlist">',_('See user list'),'</a></li>
30 <li><a href="userlist?show=banned">',_('See banned user list'),'</a></li>
31 <li><a href="invites">',_('Check your invite list'),'</a></li>
32 </ul>
33 </fieldset>',"\n";
35 } else {
36 $user2 = new reguser($DB, $uid, $prefetch);
37 $page->title = sprintf(_('User Details for %s'), $user2->alias);
38 $user->userheader();
39 if ( LVL_RESTRICTED == $user2->level && LVL_ADMIN <= $user->level && isset($_POST['activate']) ) {
40 $user2->level = LVL_NEW;
41 echo '<p class="notice">',_('User account has been activated.'),'</p>';
45 echo "<dl>\n",
46 '<dt>',_('User Name'),'</dt>
47 <dd><strong>',$user2->alias,'</strong></dd>
48 <dt>',_('Account ID'),'</dt>
49 <dd>',$user2->userid,'</dd>
50 <dt>',_('Level'),'</dt>
51 <dd>',$user2->level,': ';
53 switch ( round($user2->level-5, -1) ) {
54 case LVL_NEW:
55 echo _('New Account'); break;
56 case LVL_USER:
57 echo _('Regular Account'); break;
58 case LVL_VETERAN:
59 echo _('Experienced User'); break;
60 case LVL_VIP:
61 echo _('Special User'); break;
62 case LVL_MOD:
63 echo _('Moderator'); break;
64 case LVL_ADMIN:
65 echo _('Administrator'); break;
66 case LVL_DEV:
67 echo '∞'; break;
68 case LVL_RESTRICTED:
69 default:
70 echo _('Restricted Account'); break;
73 echo '</dd>
74 <dt>',_('Points'),'</dt>
75 <dd>',$user2->points,'</dd>
76 <dt>',_('Last Active'),'</dt>
77 <dd>',$user->fdate($user2->last_active_date),'</dd>
78 <dt>',_('Registration Date'),'</dt>
79 <dd>',$user->fdate($user2->register_date),'</dd>
80 <dt>',_('Signature'),'</dt>
81 <dd>',nl2br(htmlspecialchars($user2->sig)),'</dd>
82 <dt>',_('Quote'),'</dt>
83 <dd>',nl2br(htmlspecialchars($user2->quote)),'</dd>
84 <dt>',_('Public E-mail Address'),'</dt>
85 <dd>',$user2->public_email,'</dd>
86 <dt>',_('Browser'),'</dt>
87 <dd>',htmlspecialchars($user2->useragent),'</dd>
88 </dl>';
90 //Admin stuff
91 if ( LVL_ADMIN <= $user->level ) {
92 echo "\n",
93 '<p class="notice">',_('Administrator Information'),"</p>\n",
94 "<dl>\n",
95 '<dt>',_('Private E-Mail Address'),"</dt>\n",
96 ' <dd>',$user2->private_email,"</dd>\n",
97 '<dt>',_('Signup E-Mail Address'),"</dt>\n",
98 ' <dd>',$user2->reg_email,"</dd>\n";
100 $fields = array(
101 _('Last Login From') => $user2->last_login_ip,
102 _('Last Active From') => $user2->last_ip,
103 _('Signed Up From') => $user2->reg_ip
106 foreach ( $fields as $title => $addr )
107 echo '<dt>',$title,"</dt>\n",
108 "\t<dd>",( is_null($addr) ? _('Unknown Address') : $addr.' &rarr; '.gethostbyaddr($addr) ),"</dd>\n";
110 echo "</dl>\n";
112 if ( LVL_RESTRICTED >= $user2->level )
113 echo "\n",
114 '<form action="',$_SERVER['PHP_SELF'],'?id=',$user2->userid,'" method="post" class="info">',"\n",
115 "\t<p>",_('This user is currently pending confirmation:'),
116 ' <input type="submit" name="activate" value="',_('Activate Account'),'"/></p>',"\n",
117 '</form>';
120 $page->pagefooter();