Userlevel checks are gone, as are the defines. SQL code is next.
[specialops2.git] / user.php
blobd7df94921f2dc7b68f1a8f379ff0767e6bf53b6c
1 <?php
2 // $Id$
4 $prefetch = array('`points`', '`last_active_date`', '`register_date`', '`sig`', '`quote`',
5 '`reg_email`', '`public_email`', '`private_email`', '`useragent`',
6 'INET_NTOA(`last_login_ip`) AS `last_login_ip`',
7 'INET_NTOA(`last_ip`) AS `last_ip`',
8 'INET_NTOA(`reg_ip`) AS `reg_ip`');
10 require 'con.php';
11 $page->title = 'User Details';
13 if ( ! ($user instanceof authuser) )
14 $page->errorfooter('login');
16 $uid = is_numeric($_SERVER['QUERY_STRING']) ? intval($_SERVER['QUERY_STRING']) : $user->userid;
18 if ( $user->userid != $uid && $DB->query('SELECT `userid` FROM `users` WHERE `userid` = '.$uid)->num_rows == 0 )
19 $page->errorfooter('userid');
21 if ( $user->userid == $uid ) {
22 $page->title = 'Your Details';
23 $user->userheader();
24 $user2 = $user;
25 } else {
26 $user2 = new reguser($uid, $prefetch);
27 $page->title = 'User Details for '.$user2->alias;
28 $user->userheader();
31 $sig = new message($user2->sig);
32 $quote = new message($user2->quote);
34 echo '<dl class="userinfo">
35 <dt>User Name</dt>
36 <dd><strong>',$user2->alias,'</strong></dd>
37 <dt>Account ID</dt>
38 <dd>',$user2->userid,'</dd>
39 <dt>Points</dt>
40 <dd>',$user2->points,'</dd>
41 <dt>Last Active</dt>
42 <dd>',$user->fdate($user2->last_active_date),'</dd>
43 <dt>Registration Date</dt>
44 <dd>',$user->fdate($user2->register_date),'</dd>
45 <dt>Signature</dt>
46 <dd>',( $sig->output ? $sig->output : '<var>Empty</var>'),'</dd>
47 <dt>Quote</dt>
48 <dd>',( $quote->output ? $quote->output : '<var>Empty</var>'),'</dd>
49 <dt>Public E-mail Address</dt>
50 <dd>',( $user2->public_email ? $user2->public_email : '<var>Empty</var>'),'</dd>
51 <dt>Browser</dt>
52 <dd>',htmlspecialchars($user2->useragent),"</dd>
53 </dl>\n";
55 // Admin stuff
56 if ( defined('DEVELOPER') ) {
57 echo
58 '<h2>Admin-only Information</h2>
59 <dl class="userinfo">
60 <dt>Private E-Mail Address</dt>
61 <dd>',( $user2->private_email ? $user2->private_email : '<var>Empty</var>'),'</dd>
62 <dt>Signup E-Mail Address</dt>
63 <dd>',( $user2->reg_email ? $user2->reg_email : '<var>Empty</var>'),"</dd>\n";
65 $fields = array(
66 'Last Login From' => $user2->last_login_ip,
67 'Last Active From' => $user2->last_ip,
68 'Signed Up From' => $user2->reg_ip
71 foreach ( $fields as $title => $addr )
72 echo '<dt>',$title,"</dt>\n",
73 " <dd>",( is_null($addr) ? 'Unknown Address' : $addr ),"</dd>\n";
75 echo "</dl>\n";
78 if ( $user->userid == $uid ) {
79 echo
80 '<dl>
81 <dt>User Options</dt>
82 <dd><a href="theme">Theme</a></dd>
83 <dd><a href="options">Options</a></dd>
84 <dd><a href="passwd">Change Password</a></dd>
85 <dd><a href="userlist">User Directory</a></dd>
86 <dd><a href="invites">Invite List</a></dd>
87 </dl>',"\n";
90 $page->pagefooter();