<?php Module_WeChall::includeForums(); $chall = $tVars['chall']; $chall instanceof WC_Challenge; $headers = array(array($tLang->lang('th_length'), 'wmc_length'), array($tLang->lang('th_csolve_date'), 'wmc_date'), array($tLang->lang('th_user_name'), 'user_name'), array($tLang->lang('th_solution'), 'wmc_solution')); $chall->showHeader(true); echo GWF_Box::box($tVars['table_title']); echo $tVars['page_menu']; echo GWF_Table::start(); //echo GWF_Table::displayHeaders1($headers, $tVars['sort_url'], 'wmc_date', 'ASC', 'by', 'dir', $tVars['table_title']); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); $guest = GWF_Guest::getGuest(); $userr = new GWF_User(false); foreach ($tVars['data'] as $row) { if ($row['user_name'] === NULL) { $username = GWF_HTML::lang('guest'); } else { $userr->setGDOData($row); $username = $userr->displayProfileLink(); } echo GWF_Table::rowStart(); echo GWF_Table::column($row['wmc_length'], 'gwf_num'); echo GWF_Table::column(GWF_Time::displayDate($row['wmc_date']), 'gwf_date'); echo GWF_Table::column($username); echo GWF_Table::column($row['wmc_solution']); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo $tVars['page_menu'];
public static function getStaticOrGuest() { return false === ($user = GWF_Session::getUser()) ? GWF_Guest::getGuest() : $user; }
/** * @return GWF_User */ public function getUser() { if (false === ($user = $this->getVar('order_uid'))) { return GWF_Guest::getGuest(); } $user->loadGroups(); return $user; }
/** * @return GWF_User */ public function getUser($return_guest = true) { if (false === ($user = $this->getVar('post_uid')) || $user->getID() == '0') { return $return_guest ? GWF_Guest::getGuest() : false; } return $user; }
public static function onLogout() { if (self::$USER === false) { return true; } GWF_Hook::call(GWF_HOOK::LOGOUT, self::$USER); if (self::$USER->isWebspider()) { self::$USER = false; return self::createSession(); } # Mark the session to be recreated as human // if (self::$USER->isWebspider()) // { // self::create(); // self::setCookies($id, $uid, $sessid)$webspider_killer = true; // } self::$USER = false; if (false === self::$SESSION->saveVars(array('sess_user' => 0, 'sess_ip' => null))) { return false; } self::$SESSION->setVar('sess_user', GWF_Guest::getGuest()); return true; }
/** * @return GWF_User */ public function getReceiver() { return false === ($user = GWF_User::getByID($this->getVar('pm_to'))) ? GWF_Guest::getGuest() : $user; }