public function toHTML() { $groupaccounts = array(); echo "<div class='leftcolumn'>"; echo "<h1>" . Settings::_("jsaccounts", "accounts") . "</h1>"; echo "<fieldset>"; $r = new RegisterPage(false, true); $r->toHTML(); echo "</fieldset>"; foreach ($this->accounts as $acc) { echo "<div class='accountitem'>\n\t\t\t\t\t\t<div class='delete'>\n\t\t\t\t\t\t\t<form action='?t=Adm&a=ADe' method='post'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='name' value='" . htmlentities($acc['login'], ENT_QUOTES, 'UTF-8') . "'>\n\t\t\t\t\t\t\t\t<input type='submit' value='x'>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>"; echo "<div class='name'>" . $acc['login'] . "</div>"; foreach ($acc['groups'] as $g) { $groupaccounts["{$g}"][] = $acc['login']; echo "<div class='inlinedel'><span class='rmgroup'>x</span><span class='groupname'>" . htmlentities($g, ENT_QUOTES, 'UTF-8') . "</span></div>"; } echo "</div>"; } echo "</div>"; echo "<div class='rightcolumn'>"; echo "<h1>" . Settings::_("jsaccounts", "groups") . "</h1>"; echo "<div class='newgroup'>"; echo "\n\t\t<form class='addgroup' method='post' action='?t=Adm&a=GC'>\n\t\t\t<fieldset>\n\t\t\t<span>" . Settings::_("jsaccounts", "groupname") . "</span>\n\t\t\t<div><input type='text' name='group' value='Group Name' /></div>\n\t\t\t</fieldset>\n\t\t\t<fieldset><input type='submit' value='" . Settings::_("jsaccounts", "addgroup") . "'></fieldset>\n\t\t\t</form>\n"; echo "</div>"; foreach ($this->groups as $g) { $gn = $g['name']; echo "<div class='groupitem'>\n\t\t\t\t\t\t<div class='delete'>\n\t\t\t\t\t\t\t<form action='?t=Adm&a=GDe' method='post'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='name' value='{$gn}'>\n\t\t\t\t\t\t\t\t<input type='submit' value='x'>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</div>"; echo "<div class='name'>" . $gn . "</div>"; if (isset($groupaccounts["{$gn}"])) { foreach ($groupaccounts["{$gn}"] as $g) { echo "<div class='inlinedel'><span class='rmacc'>x</span><span class='accname'>" . htmlentities($g, ENT_QUOTES, 'UTF-8') . "</span></div>"; } } echo "</div>"; } echo "</div>"; }
$layout->skinsparams["undermenu"] = array("button" => "button1"); $layout->skinsparams["fields"] = array("button" => "button1"); $layout->skinsparams["form"] = array("button" => "button1"); $layout->skinsparams["1"] = array("button" => "button1"); $layout->skinsparams["2"] = array("button" => "button1"); $layout->skinsparams["3"] = array("button" => "button1"); $params = array(); $params["id"] = $id; $params['xt'] =& $xt; $params['tName'] = $strTableName; $params["pageType"] = PAGE_REGISTER; $params["templatefile"] = "register.htm"; $params["needSearchClauseObj"] = false; $xt->assign("closewindow_attrs", 'style="display:none" id="closeWindowRegister"'); $xt->eventsObject =& $globalEvents; $pageObject = new RegisterPage($params); $pageObject->init(); $isUseCaptcha = $globalEvents->existsCAPTCHA(PAGE_REGISTER); // Before Process event if ($globalEvents->exists("BeforeProcessRegister")) { $globalEvents->BeforeProcessRegister($pageObject); } //Send activation link to user's email $includes = GetBaseScriptsForPage(false); if (@$_GET["a"] == "activate") { $username = base64_decode(@$_GET["u"]); $code = @$_GET["code"]; if ($regCipherer->isFieldEncrypted("username")) { $strUsername = $regCipherer->MakeDBValue("username", $username, "", true); } else { $strUsername = make_db_value("username", $username);
/** * Display a form to edit account * * */ public function toHTML() { $this->header(); echo "<div class='header'>"; echo "<h1>Account</h1>"; echo "</div>"; if (CurrentUser::$admin) { $r = new RegisterPage(false, true); $r->toHTML(); echo "<form class='niceform pure-form' method='post' action='#'>"; echo "<h2>" . Settings::_("account", "account") . "</h2>"; echo "<label>" . Settings::_("account", "editing") . "</label><select name='login'>"; foreach (Account::findall() as $a) { echo "<option value=\"" . addslashes($a['login']) . "\""; if ($this->login == $a['login']) { echo " selected "; } echo ">" . $a['login'] . "</option>"; } echo "</select>\n"; echo "<input type='submit' class='pure-button pure-button-primary'>\n"; echo "</form>"; } else { echo Settings::_("account", "editing") . htmlentities($this->login, ENT_QUOTES, 'UTF-8'); } echo "<form class='niceform pure-form pure-form-aligned' method='post' action='#'>\n"; echo "<h2>" . Settings::_("account", "account") . "</h2>"; /// Login echo "<div class='pure-control-group'>\r\n\t\t\t\t<label>" . Settings::_("account", "Login") . "</label>\r\n\t\t\t\t<input type='text' name='login' readonly='readonly' value=\"" . htmlentities($this->login, ENT_QUOTES, 'UTF-8') . "\">\r\n\t\t\t</div>"; /// Name echo "<div class='pure-control-group'>\r\n\t\t\t\t\t<label>" . Settings::_("account", "name") . "</label>\r\n\t\t\t\t\t<input type='text' name='name' value=\"" . htmlentities($this->name, ENT_QUOTES, 'UTF-8') . "\">\r\n\t\t\t\t</div>"; /// Email echo "<div class='pure-control-group'>\r\n\t\t\t\t\t<label>" . Settings::_("account", "email") . "</label>\r\n\t\t\t\t\t<input type='text' name='email' value=\"" . htmlentities($this->email, ENT_QUOTES, 'UTF-8') . "\">\r\n\t\t\t\t</div>"; /// Language echo "<div class='pure-control-group'>\r\n\t\t\t\t\t<label>" . Settings::_("settings", "language") . "</label>\r\n\t\t\t\t\t<select>\r\n\t\t\t\t"; foreach (Settings::$ava_loc as $l) { $p = substr(htmlentities($l, ENT_QUOTES, 'UTF-8'), 0, -4); echo "<option value=\"" . addslashes($p) . "\""; if ($p == $this->language) { echo " selected "; } echo ">" . $p . "</option>"; } echo "</select>\n"; /// Login echo "<div class='pure-control-group'>\r\n\t\t\t\t\t<label>" . Settings::_("account", "Key") . "</label>\r\n\t\t\t\t\t<input type='text' name='key' readonly='readonly' value=\"" . htmlentities($this->get_key(), ENT_QUOTES, 'UTF-8') . "\">\r\n\t\t\t\t</div>"; /// Password echo "<div class='pure-control-group'>\r\n\t\t\t\t\t<label>" . Settings::_("account", "password") . "</label>\r\n\t\t\t\t\t<input type='password' name='password' value=''>\r\n\t\t\t\t</div>"; if (CurrentUser::$admin) { echo "<input type='hidden' value='plip' name='edit'>"; } else { /// Old Pass echo "<div class='pure-control-group'>\r\n\t\t\t\t\t\t<label>" . Settings::_("account", "oldpass") . "</label>\r\n\t\t\t\t\t\t<input type='password' name='old_password' value=''>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</fieldset>\n"; } echo "<div class='pure-controls'>\r\n\t\t\t<input type='submit' class='pure-button pure-button-primary' value='" . Settings::_("account", "submit") . "'/>\r\n\t\t\t</div>"; echo "</form>\n"; echo "</div>\n"; }
function __construct() { /// Initialize variables Settings::init(); /// Initialize CurrentUser try { CurrentUser::init(); } catch (Exception $e) { $page = new RegisterPage(true); $page->toHTML(); return; } /// Check what to do switch (CurrentUser::$action) { case "Judge": // Same as page // Same as page case "Page": $page = new MainPage(); $page->toHTML(); break; case "Log": $page = new LoginPage(); $page->toHTML(); break; case "Reg": $page = new RegisterPage(); $page->toHTML(); break; case "JS": $page = new JS(); break; case "Img": Provider::Image(CurrentUser::$path); break; case "BDl": Provider::Image(CurrentUser::$path, false, true, true, true); break; case "Big": Provider::Image(CurrentUser::$path, false, true); break; case "Thb": Provider::Image(CurrentUser::$path, true); break; case "Zip": Provider::Zip(CurrentUser::$path); break; case "Acc": if (CurrentUser::$admin && isset($_POST['login'])) { $acc = new Account($_POST['login']); } else { $acc = CurrentUser::$account; } $acc->toHTML(); break; case "Adm": $page = new Admin(); $page->toHTML(); break; } }
$query = sanitize($_GET['q']); $format = sanitize($_GET['f']); $strict = sanitize($_GET['s']); switch ($action) { case "repo": $portdb = new PortList($dbhandle); break; case "search": $portdb = new SearchList($dbhandle, $strict); break; case "dups": $portdb = new DuplicateList($dbhandle); break; case "getup": $portdb = new GetUp($dbhandle); break; case "register": $portdb = new RegisterPage(); echo $portdb->toHTML(); exit; default: $portdb = new RepoList($dbhandle); } $result = $portdb->doQuery($query); switch ($format) { case "xml": echo $portdb->toXML($result); break; default: echo $portdb->toHTML($result); }
public function __construct() { /// Execute stuff automagically new Admin(); if (isset($_GET['j'])) { switch ($_GET['j']) { case "Pag": $m = new Menu(); $p = new Board(); $ap = new AdminPanel(); echo "<div id='menu' class='menu'>\n"; $m->toHTML(); echo "</div>\n"; echo "<div class='panel'>\n"; $p->toHTML(); echo "</div>\n"; echo "<div class='image_panel hidden'>\n"; echo "</div>\n"; if (CurrentUser::$admin) { echo "<div class='infos'>\n"; $ap->toHTML(); echo "</div>\n"; } break; case "Log": $p = new LoginPage(); $p->toHTML(); break; case "Reg": $p = new RegisterPage(); $p->toHTML(); break; case "Pan": if (is_file(CurrentUser::$path)) { $b = new ImagePanel(CurrentUser::$path); $b->toHTML(); } else { $b = new Board(CurrentUser::$path); $b->toHTML(); } break; case "Men": $m = new Menu(); $m->toHTML(); break; case "Pan": $f = new AdminPanel(); $f->toHTML(); break; case "Inf": $f = new Infos(); $f->toHTML(); break; case "Jud": $j = new Judge(CurrentUser::$path); $j->toHTML(); break; case "Acc": $f = new Group(); $f->toHTML(); break; case "Comm": $f = new Comments(CurrentUser::$path); $f->toHTML(); break; default: break; } } }