本文整理汇总了PHP中Common::getGet方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::getGet方法的具体用法?PHP Common::getGet怎么用?PHP Common::getGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::getGet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
if (false === ($site = WC_Site::getByID(Common::getGet('siteid')))) {
return $this->module->error('err_site');
}
return $this->templateDDOS($site);
}
示例2: templateUsers
private function templateUsers($term = '')
{
$ipp = $this->module->cfgIPP();
$form = $this->getFormQuick();
$usertable = GDO::table('GWF_User');
$by = Common::getGet('by', '');
$dir = Common::getGet('dir', '');
$orderby = $usertable->getMultiOrderby($by, $dir);
if ($term === '') {
$users = array();
$page = 1;
$nPages = 0;
} else {
$eterm = GDO::escape($term);
$deleted = GWF_User::DELETED;
$conditions = "user_name LIKE '%{$eterm}%' AND user_options&{$deleted}=0";
$nItems = $usertable->countRows($conditions);
$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);
$page = Common::clamp(intval(Common::getGet('page', 1)), 1, $nPages);
$from = GWF_PageMenu::getFrom($page, $ipp);
$users = $usertable->selectObjects('*', $conditions, $orderby, $ipp, $from);
}
$href_pagemenu = GWF_WEB_ROOT . 'index.php?mo=Usergroups&me=Search&term=' . urlencode($term) . '&by=' . urlencode($by) . '&dir=' . urlencode($dir) . '&page=%PAGE%';
$tVars = array('form' => $form->templateX(false, false), 'users' => $users, 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=Usergroups&me=Search&term=' . urlencode($term) . '&by=%BY%&dir=%DIR%&page=1', 'page_menu' => GWF_PageMenu::display($page, $nPages, $href_pagemenu), 'href_adv' => $this->module->getMethodURL('SearchAdv'));
return $this->module->templatePHP('search.php', $tVars);
}
示例3: sanitize
private function sanitize()
{
$this->quoted = Common::getGet('quote') !== false;
if (false === ($pid = Common::getGet('pid'))) {
if (false === ($this->thread = $this->module->getCurrentThread())) {
return $this->module->error('err_post');
}
if (false === ($this->post = $this->thread->getLastPost())) {
// return $this->module->error('err_post');
}
$this->replyThread = true;
} elseif (false === ($this->post = $this->module->getCurrentPost())) {
return $this->module->error('err_post');
} else {
if (false === ($this->thread = $this->post->getThread())) {
return $this->module->error('err_post');
}
}
# Check Permission
$user = GWF_Session::getUser();
if (!$this->thread->hasReplyPermission($user, $this->module)) {
$a = GWF_HTML::display($this->post->getShowHREF());
return $this->module->error('err_reply_perm', array($a));
}
if (false !== ($last_post = $this->thread->getLastPost())) {
if ($last_post->getPosterID() === GWF_Session::getUserID()) {
if (!$this->module->cfgDoublePost()) {
$a = GWF_HTML::display($this->post->getShowHREF());
return $this->module->error('err_better_edit', array($a));
}
}
}
return false;
}
示例4: execute
public function execute()
{
if (false === ($gb = GWF_Guestbook::getByID(Common::getGet('gbid')))) {
return $this->module->error('err_gb');
}
if (!$gb->canSign(GWF_Session::getUser(), $this->module->cfgAllowGuest())) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
# In Reply To
if (false !== ($msgid = Common::getGet('msgid'))) {
if (false === ($gbe = GWF_GuestbookMSG::getByID($msgid))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if ($gbe->getVar('gbm_gbid') !== $gb->getID()) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
if (false !== Common::getPost('sign')) {
return $this->onSign($gb, $gbe);
}
return $this->templateReply($gb, $gbe);
}
if (false !== Common::getPost('sign')) {
return $this->onSign($gb);
}
return $this->templateSign($gb);
}
示例5: execute
public function execute()
{
if (false !== ($state = Common::getGet('rightpanel'))) {
GWF_Session::set('WC_RIGHT_PANEL', $state > 0);
GWF_Website::redirectBack();
}
}
示例6: execute
public function execute()
{
if (false === ($user = GWF_User::getByID(Common::getGet('userid')))) {
return GWF_HTML::err('ERR_UNKNOWN_USER');
}
$tmpfile = GWF_PATH . 'extra/temp/gpg/' . $user->getVar('user_id');
if (!is_file($tmpfile) || !is_readable($tmpfile)) {
return GWF_HTML::err('ERR_FILE_NOT_FOUND', array($tmpfile));
}
if (false === ($file_content = file_get_contents($tmpfile))) {
return GWF_HTML::err('ERR_FILE_NOT_FOUND', array($tmpfile));
}
if (false === unlink($tmpfile)) {
return GWF_HTML::err('ERR_WRITE_FILE', array($tmpfile));
}
if (false === ($fingerprint = GWF_PublicKey::grabFingerprint($file_content))) {
return $this->module->error('err_gpg_key');
}
if (Common::getGet('token') !== $fingerprint) {
return $this->module->error('err_gpg_token');
}
if (false === GWF_PublicKey::updateKey($user->getID(), $file_content)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (false === $user->saveOption(GWF_User::EMAIL_GPG, true)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_setup_gpg');
}
示例7: execute
public function execute()
{
if (Common::getGet('recalc') === 'all') {
return $this->onRecalcEverything();
}
if (false !== Common::getGet('fix_challs')) {
return $this->onFixChalls();
}
if (false !== Common::getGet('fix_irc')) {
return $this->onFixIRC();
}
if (false !== Common::getGet('chall_cache')) {
return $this->onCacheChallTags();
}
if (false !== Common::getGet('sitetags')) {
return $this->onCacheSiteTags();
}
if (false !== Common::getGet('remote_update')) {
return $this->templateRemoteUpdate();
}
if (false !== Common::getPost('remote_update')) {
return $this->onRemoteUpdate();
}
if (false !== Common::getPost('hardlink')) {
return $this->onHardlink() . $this->templateAdmin();
}
return $this->templateAdmin();
}
示例8: onSearch
public function onSearch()
{
$form = $this->getForm();
// if (false !== ($error = $form->validate($this->module))) {
// return $error.$this->templateSearch();
// }
$users = GDO::table('GWF_User');
$term = Common::getRequest('term');
if (false !== ($error = $this->validate_term($this->module, $term))) {
return $error;
}
$fields = array('user_name', 'user_email');
$by = Common::getGet('by', self::DEFAULT_BY);
$dir = Common::getGet('dir', self::DEFAULT_DIR);
$orderby = $users->getMultiOrderby($by, $dir);
if (false === ($conditions = GWF_QuickSearch::getQuickSearchConditions($users, $fields, $term))) {
$conditions = '0';
}
$hits = $users->countRows($conditions);
$ipp = $this->module->cfgUsersPerPage();
$nPages = GWF_PageMenu::getPagecount($ipp, $hits);
$page = Common::clamp((int) Common::getGet('page', 1), 1, $nPages);
$from = GWF_PageMenu::getFrom($page, $ipp);
$tVars = array('searched' => true, 'form' => $form->templateX($this->module->lang('ft_search')), 'hits' => $hits, 'users' => $users->selectObjects('*', $conditions, $orderby, $ipp, $from), 'term' => $term, 'pagemenu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'index.php?mo=Admin&me=UserSearch&term=' . urlencode($term) . '&by=' . urlencode($by) . '&dir=' . urlencode($dir) . '&page=1'), 'sort_url' => GWF_WEB_ROOT . 'index.php?mo=Admin&me=UserSearch&term=' . urlencode($term) . '&by=%BY%&dir=%DIR%&page=1');
return $this->module->templatePHP('user_search.php', $tVars);
}
示例9: execute
public function execute()
{
require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteAdmin.php';
if (false === ($site = WC_Site::getByID(Common::getGet('siteid')))) {
return $this->module->error('err_site');
}
$this->site = $site;
if (false === ($is_admin = GWF_User::isInGroupS(GWF_Group::STAFF))) {
if (false === $site->isSiteAdmin(GWF_Session::getUser())) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
}
if (false !== Common::getPost('add_sitemin')) {
return $this->onAddSitemin($site, $is_admin) . $this->templateEdit($site, $is_admin);
}
if (false !== Common::getPost('rem_sitemin')) {
return $this->onRemSitemin($site, $is_admin) . $this->templateEdit($site, $is_admin);
}
if (false !== Common::getPost('rem_logo')) {
return $this->onRemLogo($site, $is_admin) . $this->templateEdit($site, $is_admin);
}
if (false !== Common::getPost('set_logo')) {
return $this->onSetLogo($site, $is_admin) . $this->templateEdit($site, $is_admin);
}
if (false !== Common::getPost('edit')) {
return $this->onEdit($site, $is_admin) . $this->templateEdit($site, $is_admin);
}
return $this->templateEdit($site, $is_admin);
}
示例10: onApprove
private function onApprove($lid, $approve)
{
if (false === ($link = GWF_Links::getByID($lid))) {
return $this->module->error('err_link');
}
if (!$link->isInModeration()) {
return $this->module->error('err_approved');
}
if ($link->getToken() !== Common::getGet('token')) {
return $this->module->error('err_token');
}
if ($approve) {
if (false !== ($error = $link->insertTags($this->module))) {
return $error;
}
if (false === $link->saveOption(GWF_Links::IN_MODERATION, false)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (false === $link->setVotesEnabled(true)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
} else {
if (false !== ($error = $link->deleteLink($this->module))) {
return $error;
}
}
return $this->module->message($approve ? 'msg_approved' : 'msg_deleted');
}
示例11: sanitize
private function sanitize()
{
if (false === ($this->user = GWF_User::getByID(Common::getGet('uid')))) {
return GWF_HTML::err('ERR_UNKNOWN_USER');
}
return false;
}
示例12: getGDOHeaders2
public static function getGDOHeaders2(GWF_Module $module, GWF_Sortable $gdo, $user, $sortURL)
{
# Possible fields...
$fields = $gdo->getSortableFields($user);
# Gather the current selected sorting
$curBy = explode(',', Common::getGet('by', ''));
$curDir = explode(',', Common::getGet('dir', ''));
$cur = array();
foreach ($curBy as $i => $cby) {
if (preg_match('/^[a-zA-Z_]+&?[0-9]*$/', $cby) !== 1) {
continue;
}
if (!in_array($cby, $fields, true)) {
continue;
}
// if (false === ($cby = $gdo->getWhitelistedBy($cby, false))) {
// continue;
// }
$cd = isset($curDir[$i]) ? $curDir[$i] : 'ASC';
$cd = GDO::getWhitelistedDirS($cd, 'ASC');
$cur[$cby] = $cd;
}
$headers = array();
foreach ($fields as $field) {
$curV = array_key_exists($field, $cur) ? $cur[$field] : '';
$headers[] = array($module->lang('th_' . $field), $curV === 'ASC' ? self::getTHeadURL($sortURL, $cur, $field, 'ASC', $field) : self::getTHeadURL($sortURL, $cur, $field, 'ASC'), $curV === 'DESC' ? self::getTHeadURL($sortURL, $cur, $field, 'DESC', $field) : self::getTHeadURL($sortURL, $cur, $field, 'DESC'), $curV === 'ASC', $curV === 'DESC', $curV === '');
}
return $headers;
}
示例13: execute
public function execute()
{
# Permissions
if (false === ($gb = GWF_Guestbook::getByID(Common::getGet('gbid')))) {
return $this->module->error('err_gb');
}
if (false === $gb->canModerate(GWF_Session::getUser())) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
# Toggle Moderation Flag
if (false !== ($state = Common::getGet('set_moderation'))) {
return $this->onSetModeration($gb, Common::getGet('gbmid', 0), $state > 0);
}
# Toggle Public Flag
if (false !== ($state = Common::getGet('set_public'))) {
return $this->onSetPublic($gb, Common::getGet('gbmid', 0), $state > 0);
}
# Edit Guestbook
if (false !== Common::getPost('edit')) {
return $this->onEdit($gb) . $this->templateEditGB($gb);
}
# Edit Single Entry
if (false !== Common::getPost('edit_entry')) {
return $this->onEditEntry($gb, Common::getGet('gbmid', 0), false);
}
if (false !== Common::getPost('del_entry')) {
return $this->onEditEntry($gb, Common::getGet('gbmid', 0), true);
}
if (false !== Common::getGet('edit_entry')) {
return $this->templateEditEntry($gb, Common::getGet('gbmid', 0));
}
return $this->templateEditGB($gb);
}
示例14: execute
public function execute()
{
GWF_Website::plaintext();
$input = trim(Common::getGetString('username', ''));
if (false !== ($onsitename = Common::getGet('onsitename')) && false !== ($sitename = Common::getGet('sitename'))) {
die($this->rawOnSiteStats($sitename, $onsitename));
}
require_once GWF_CORE_PATH . 'module/WeChall/WC_RegAt.php';
if (Common::getGet('wechall') === 'yes') {
die($this->wechallChalls($input));
}
if ($input === '') {
$message = sprintf('Try %s?username=name/rank. New: ?username=!sitename username/rank. Or: ?username=!sites usernname', 'wechall.php');
die($message);
}
if (strpos($input, '!sites') === 0) {
$this->showSites($input);
} elseif (strpos($input, '!site') === 0) {
$this->showSiteDetail($input);
} elseif (strpos($input, '!') === 0) {
$this->showSite($input);
} else {
die($this->showGlobal($input));
}
}
示例15: prog2CheckResult
function prog2CheckResult(WC_Challenge $chall)
{
if (false === ($user = GWF_Session::getUser())) {
die($chall->lang('err_login'));
}
if (false === ($answer = Common::getGet('answer'))) {
die($chall->lang('err_no_answer'));
}
$solution = GWF_Session::getOrDefault('prog2_solution', false);
$startTime = GWF_Session::getOrDefault('prog2_timeout', false);
if ($solution === false || $startTime === false) {
die($chall->lang('err_no_request'));
}
$back = "";
if (trim($answer) !== $solution) {
$back .= $chall->lang('err_wrong', array(htmlspecialchars($answer, ENT_QUOTES), $solution));
} else {
$back .= $chall->lang('msg_correct');
}
$timeNeeded = microtime(true) - $startTime;
if ($timeNeeded > TIMELIMIT) {
return $back . $chall->lang('err_timeout', array(sprintf('%.02f', $timeNeeded), TIMELIMIT));
}
return trim($answer) === $solution ? true : $back;
}