2007-08-01 17:11:46 +00:00
|
|
|
<?php
|
|
|
|
|
2007-08-23 11:15:18 +00:00
|
|
|
class CustomUserPageTheme extends UserPageTheme {
|
2007-08-01 17:11:46 +00:00
|
|
|
public function display_login_page($page) {
|
|
|
|
$page->set_title("Login");
|
|
|
|
$page->set_heading("Login");
|
|
|
|
$page->add_block(new NavBlock());
|
|
|
|
$page->add_block(new Block("Login There",
|
|
|
|
"There should be a login box to the left"));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function display_user_links($page, $user, $parts) {
|
|
|
|
$page->add_block(new Block("User Links", join(", ", $parts), "main", 10));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function display_user_block($page, $user, $parts) {
|
|
|
|
# $h_name = html_escape($user->name);
|
|
|
|
# $html = "Logged in as $h_name<br>";
|
|
|
|
# $html .= join("\n<br/>", $parts);
|
|
|
|
# $page->add_block(new Block("User Links", $html, "left", 90));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function display_signup_page($page) {
|
|
|
|
global $config;
|
|
|
|
$tac = $config->get_string("login_tac", "");
|
|
|
|
|
|
|
|
$tfe = new TextFormattingEvent($tac);
|
|
|
|
send_event($tfe);
|
|
|
|
$tac = $tfe->formatted;
|
|
|
|
|
|
|
|
if(empty($tac)) {$html = "";}
|
|
|
|
else {$html = "<p>$tac</p>";}
|
|
|
|
|
|
|
|
$html .= "
|
|
|
|
<form action='".make_link("user_admin/create")."' method='POST'>
|
2007-08-06 19:24:42 +00:00
|
|
|
<table style='width: 300px;'>
|
2007-08-01 17:11:46 +00:00
|
|
|
<tr><td>Name</td><td><input type='text' name='name'></td></tr>
|
|
|
|
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
|
|
|
|
<tr><td>Repeat Password</td><td><input type='password' name='pass2'></td></tr>
|
|
|
|
<tr><td>Email (Optional)</td><td><input type='text' name='email'></td></tr>
|
|
|
|
<tr><td colspan='2'><input type='Submit' value='Create Account'></td></tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
|
|
|
|
$page->set_title("Create Account");
|
|
|
|
$page->set_heading("Create Account");
|
|
|
|
$page->add_block(new NavBlock());
|
|
|
|
$page->add_block(new Block("Signup", $html));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function display_ip_list($page, $uploads, $comments) {
|
2007-08-06 19:24:42 +00:00
|
|
|
$html = "<table id='ip-history' style='width: 400px;'>";
|
2007-08-01 17:11:46 +00:00
|
|
|
$html .= "<tr><td>Uploaded from: ";
|
|
|
|
foreach($uploads as $ip => $count) {
|
|
|
|
$html .= "<br>$ip ($count)";
|
|
|
|
}
|
|
|
|
$html .= "</td><td>Commented from:";
|
|
|
|
foreach($comments as $ip => $count) {
|
|
|
|
$html .= "<br>$ip ($count)";
|
|
|
|
}
|
|
|
|
$html .= "</td></tr>";
|
|
|
|
$html .= "<tr><td colspan='2'>(Most recent at top)</td></tr></table>";
|
|
|
|
|
|
|
|
$page->add_block(new Block("IPs", $html));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function display_user_page($page, $duser, $user) {
|
|
|
|
$page->disable_left();
|
2007-08-23 11:15:18 +00:00
|
|
|
parent::display_user_page($page, $duser, $user);
|
2007-08-01 17:11:46 +00:00
|
|
|
}
|
|
|
|
|
2007-08-23 11:15:18 +00:00
|
|
|
protected function build_options($duser) {
|
2007-08-01 17:11:46 +00:00
|
|
|
global $database;
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
$html = "";
|
|
|
|
$html .= "
|
|
|
|
<form action='".make_link("user_admin/change_pass")."' method='POST'>
|
|
|
|
<input type='hidden' name='name' value='{$duser->name}'>
|
|
|
|
<input type='hidden' name='id' value='{$duser->id}'>
|
2007-08-06 19:24:42 +00:00
|
|
|
<table style='width: 300px;'>
|
2007-08-01 17:11:46 +00:00
|
|
|
<tr><td colspan='2'>Change Password</td></tr>
|
|
|
|
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
|
|
|
|
<tr><td>Repeat Password</td><td><input type='password' name='pass2'></td></tr>
|
|
|
|
<tr><td colspan='2'><input type='Submit' value='Change Password'></td></tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
";
|
|
|
|
return $html;
|
|
|
|
}
|
|
|
|
// }}}
|
|
|
|
}
|
|
|
|
?>
|