Fixed 1 more CRLF,
[specialops2.git] / user.php
blob225aeeb25a53d7c9d2266455af2580794e8b6c4f
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 try {
32 $sig = new message($user2->sig);
33 $quote = new message($user2->quote);
34 } catch ( InvalidMessageException $e ) {
35 $sig = new message($user2->sig, message::M_HTML_NONE);
36 $quote = new message($user2->quote, message::M_HTML_NONE);
39 echo
40 '<dl class="user-info">
41 <dt>User Name</dt>
42 <dd><strong>',$user2->alias,'</strong></dd>
43 <dt>Account ID</dt>
44 <dd>',$user2->userid,'</dd>
45 <dt>Points</dt>
46 <dd>',$user2->points,'</dd>
47 <dt>Last Active</dt>
48 <dd>',$user->fdate($user2->last_active_date),'</dd>
49 <dt>Registration Date</dt>
50 <dd>',$user->fdate($user2->register_date),'</dd>
51 <dt>Signature</dt>
52 <dd>',( $sig->output ? $sig->output : '<var>Empty</var>'),'</dd>
53 <dt>Quote</dt>
54 <dd>',( $quote->output ? $quote->output : '<var>Empty</var>'),'</dd>
55 <dt>Public E-mail Address</dt>
56 <dd>',( $user2->public_email ? $user2->public_email : '<var>Empty</var>'),'</dd>
57 <dt>Browser</dt>
58 <dd>',htmlspecialchars($user2->useragent),"</dd>
59 </dl>\n";
61 // Admin stuff
62 if ( defined('DEVELOPER') ) {
63 echo
64 '<h2 id="admin-info">Admin-only Information</h2>
65 <dl class="user-info">
66 <dt>Private E-Mail Address</dt>
67 <dd>',( $user2->private_email ? $user2->private_email : '<var>Empty</var>'),'</dd>
68 <dt>Signup E-Mail Address</dt>
69 <dd>',( $user2->reg_email ? $user2->reg_email : '<var>Empty</var>'),"</dd>\n";
71 $fields = array(
72 'Last Login From' => $user2->last_login_ip,
73 'Last Active From' => $user2->last_ip,
74 'Signed Up From' => $user2->reg_ip
77 foreach ( $fields as $title => $addr )
78 echo '<dt>',$title,"</dt>\n",
79 " <dd>",( is_null($addr) ? 'Unknown Address' : $addr ),"</dd>\n";
81 echo "</dl>\n";
84 if ( $user->userid == $uid ) {
85 echo
86 '<dl class="user-options">
87 <dt>User Options</dt>
88 <dd><a href="theme">Theme</a></dd>
89 <dd><a href="options">Options</a></dd>
90 <dd><a href="passwd">Change Password</a></dd>
91 <dd><a href="userlist">User Directory</a></dd>
92 <dd><a href="invites">Invite List</a></dd>
93 </dl>',"\n";
96 $page->pagefooter();