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"
));
}
/**
* #param User[] $users
*/
public function display_user_list(Page $page, array $users, User $user, int $page_num, int $page_total)
{
$page->set_title("User List");
$page->set_heading("User List");
$page->add_block(new NavBlock());
$html = "
";
$html .= "
";
$html .= "
Name
";
if ($user->can(Permissions::DELETE_USER)) {
$html .= "
";
$page->add_block(new Block("Users", $html));
$this->display_paginator($page, "user_admin/list", $this->get_args(), $page_num, $page_total);
}
protected function ueie($var)
{
if (isset($_GET[$var])) {
return $var."=".url_escape($_GET[$var]);
} else {
return "";
}
}
protected function get_args()
{
$args = "";
// Check if each arg is actually empty and skip it if so
if (strlen($this->ueie("username"))) {
$args .= $this->ueie("username")."&";
}
if (strlen($this->ueie("email"))) {
$args .= $this->ueie("email")."&";
}
if (strlen($this->ueie("class"))) {
$args .= $this->ueie("class")."&";
}
// If there are no args at all, set $args to null to prevent an unnecessary ? at the end of the paginator url
if (strlen($args) == 0) {
$args = null;
}
return $args;
}
public function display_user_links(Page $page, User $user, $parts)
{
# $page->add_block(new Block("User Links", join(", ", $parts), "main", 10));
}
public function display_user_block(Page $page, User $user, $parts)
{
$h_name = html_escape($user->name);
$html = 'Logged in as '.$h_name;
foreach ($parts as $part) {
$html .= ' '.$part["name"].'';
}
$page->add_block(new Block("User Links", $html, "left", 90));
}
public function display_signup_page(Page $page)
{
global $config;
$tac = $config->get_string("login_tac", "");
if ($config->get_bool("login_tac_bbcode")) {
$tfe = new TextFormattingEvent($tac);
send_event($tfe);
$tac = $tfe->formatted;
}
if (empty($tac)) {
$html = "";
} else {
$html = '
";
$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_signups_disabled(Page $page)
{
$page->set_title("Signups Disabled");
$page->set_heading("Signups Disabled");
$page->add_block(new NavBlock());
$page->add_block(new Block(
"Signups Disabled",
"The board admin has disabled the ability to create new accounts~"
));
}
public function display_login_block(Page $page)
{
global $config;
$html = '
'.make_form(make_link("user_admin/login"))."
";
if ($config->get_bool("login_signup_enabled")) {
$html .= "Create Account";
}
$page->add_block(new Block("Login", $html, "left", 90));
}
public function display_ip_list(Page $page, array $uploads, array $comments, array $events)
{
$html = "