当前位置: 首页>>代码示例>>PHP>>正文


PHP Common::getPost方法代码示例

本文整理汇总了PHP中Common::getPost方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::getPost方法的具体用法?PHP Common::getPost怎么用?PHP Common::getPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common的用法示例。


在下文中一共展示了Common::getPost方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onPost

 private function onPost($nickname, $target, $message)
 {
     # Validate the crap!
     if (false !== ($error = GWF_ChatValidator::validate_yournick($this->module, $nickname))) {
         return $error;
     }
     if (false !== ($error = GWF_ChatValidator::validate_target($this->module, $target))) {
         $error;
     }
     if (false !== ($error = GWF_ChatValidator::validate_message($this->module, $message))) {
         return $error;
     }
     # Post it!
     $oldnick = $this->module->getNickname();
     $sender = Common::getPost('yournick', $oldnick);
     $target = trim($target);
     $message = str_replace("\n", '<br/>', Common::getPost('message'));
     if ($oldnick === false) {
         $sender = $this->module->getGuestPrefixed($sender);
         $this->module->setGuestNick($sender);
     } else {
         $sender = $oldnick;
     }
     if (false === GWF_ChatMsg::newMessage($sender, $target, $message)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '1';
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:28,代码来源:Ajax.php

示例2: execute

 public function execute()
 {
     if (false !== ($array = Common::getPost('delete'))) {
         return $this->onDelete($array);
     }
     return $this->templatePage();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:History.php

示例3: onRequest

 private function onRequest()
 {
     $form = $this->getForm();
     if (false !== ($errors = $form->validate($this->module))) {
         return $errors . $this->form();
     }
     $email = Common::getPost('email', '');
     $user1 = GWF_User::getByName(Common::getPost('username'));
     $user2 = GWF_Validator::isValidEmail($email) ? GWF_User::getByEmail($email) : false;
     # nothing found
     if ($user1 === false && $user2 === false) {
         return $this->module->error('err_not_found') . $this->form();
     }
     # Two different users
     if ($user1 !== false && $user2 !== false && $user1->getID() !== $user2->getID()) {
         return $this->module->error('err_not_same_user') . $this->form();
     }
     # pick the user and send him mail
     if ($user1 !== false && $user2 !== false) {
         $user = $user1;
     } elseif ($user1 !== false) {
         $user = $user1;
     } elseif ($user2 !== false) {
         $user = $user2;
     }
     return $this->sendMail($user);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:Form.php

示例4: execute

 public function execute()
 {
     if (false !== Common::getPost('gpg_create')) {
         return $this->onGPGSig() . $this->templateBase();
     }
     return $this->templateBase();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:BaseCFG.php

示例5: 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);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:Moderate.php

示例6: execute

 public function execute()
 {
     if (false !== Common::getPost('zipper')) {
         return $this->onZipB();
     }
     return $this->templateZipper();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Zipper.php

示例7: 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);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:29,代码来源:SiteEdit.php

示例8: execute

 public function execute()
 {
     if (false !== Common::getPost('add')) {
         return $this->onAdd();
     }
     return $this->templateAdd();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Add.php

示例9: onEditBoard

 private function onEditBoard()
 {
     $form = $this->getForm();
     if (false !== ($error = $form->validate($this->module))) {
         return $error;
     }
     if (!$this->board->isRoot()) {
         $bid = $this->board->getID();
         if ($bid !== ($newpid = (int) $form->getVar('moveboard'))) {
             if ($this->board->getParentID() !== $newpid) {
                 if (false !== ($newparent = GWF_ForumBoard::getBoard($newpid))) {
                     if (false === $this->board->move($newparent)) {
                         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
                     }
                 }
             }
         }
     }
     $this->board->saveVars(array('board_gid' => $form->getVar('groupid'), 'board_title' => $form->getVar('title'), 'board_descr' => $form->getVar('descr')));
     # Options
     $this->board->saveOption(GWF_ForumBoard::ALLOW_THREADS, Common::getPost('allow_threads') !== false);
     $this->board->saveOption(GWF_ForumBoard::LOCKED, Common::getPost('is_locked') !== false);
     $this->board->saveOption(GWF_ForumBoard::GUEST_POSTS, Common::getPost('guests') !== false);
     $this->board->saveOption(GWF_ForumBoard::GUEST_VIEW, Common::getPost('guest_view') !== false);
     if (!$this->board->isRoot()) {
         $this->board->saveOption(GWF_ForumBoard::INVISIBLE, Common::getPost('invisible') !== false);
     }
     return $this->module->message('msg_edited_board', array($this->board->getShowBoardHREF()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:29,代码来源:EditBoard.php

示例10: onRegister

 private function onRegister()
 {
     $form = $this->getForm();
     $errorsA = $errorsB = '';
     if (false !== ($errorsA = $form->validate($this->module)) || false !== ($errorsB = $this->onRegisterB())) {
         return $errorsA . $errorsB . $this->templateForm();
     }
     $username = Common::getPost('username');
     $password = Common::getPost('password');
     $email = Common::getPost('email');
     $birthdate = sprintf('%04d%02d%02d', Common::getPost('birthdatey'), Common::getPost('birthdatem'), Common::getPost('birthdated'));
     $default_country = $this->module->cfgDetectCountry() ? GWF_IP2Country::detectCountryID() : 0;
     $countryid = $form->getVar('countryid', $default_country);
     require_once GWF_CORE_PATH . 'module/Register/GWF_UserActivation.php';
     $token = GWF_UserActivation::generateToken();
     $ua = new GWF_UserActivation(array('username' => $username, 'email' => $email, 'token' => $token, 'birthdate' => $birthdate, 'countryid' => $countryid, 'password' => GWF_Password::hashPasswordS($password), 'timestamp' => time(), 'ip' => GWF_IP6::getIP(GWF_IP_EXACT)));
     if (false === $ua->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)) . $this->templateForm();
     }
     if ($this->module->wantEmailActivation()) {
         return $this->sendEmail($username, $email, $token, $password);
     } else {
         GWF_Website::redirect(GWF_WEB_ROOT . 'quick_activate/' . $token);
     }
     return $this->module->message('msg_registered');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:Form.php

示例11: execute

 public function execute()
 {
     if (false === ($user = GWF_Session::getUser()) && !$this->module->cfgGuestShouts()) {
         return GWF_HTML::err('ERR_LOGIN_REQUIRED');
     }
     if ($user !== false && $user->isWebspider()) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (false !== ($error = $this->isFlooding())) {
         return $error;
     }
     $message = Common::getPost('message', '');
     if (false !== ($error = $this->validate_message($message))) {
         return GWF_HTML::error('Shoutbox', $error);
     }
     $entry = new GWF_Shoutbox(array('shout_id' => '0', 'shout_uid' => GWF_Session::getUserID(), 'shout_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'shout_uname' => GWF_Shoutbox::generateUsername(), 'shout_message' => $message));
     if (false === $entry->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if ($this->module->cfgEMailModeration()) {
         $this->onEMailModeration($user, $entry);
     }
     $url = htmlspecialchars(GWF_Session::getLastURL());
     return $this->module->message('msg_shouted', array($url, $url));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Shout.php

示例12: execute

 public function execute()
 {
     if (false !== Common::getPost('purge')) {
         return $this->onPurge();
     }
     return $this->templatePurge();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:PurgeFiles.php

示例13: execute

 public function execute()
 {
     if (false !== Common::getPost('change')) {
         return $this->onChange() . $this->templateOptions();
     }
     return $this->templateOptions();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Options.php

示例14: execute

 public function execute()
 {
     if (false !== ($error = $this->sanitize())) {
         return $error;
     }
     $nav = $this->module->templateNav();
     $back = '';
     # Enable
     if (false !== Common::getPost('enable')) {
         $back .= $this->onEnable('enabled');
     } elseif (false !== Common::getPost('disable')) {
         $back .= $this->onEnable('disabled');
     } elseif (false !== Common::getPost('defaults')) {
         $back .= $this->onDefaults();
     } elseif (false !== Common::getPost('update')) {
         $back .= $this->onUpdate();
     } elseif (false !== Common::getPost('admin_sect')) {
         if ($this->mod->hasAdminSection()) {
             GWF_Website::redirect($this->mod->getAdminSectionURL());
             return '';
         } else {
             $back .= $this->module->error('err_no_admin_sect');
         }
     }
     # Form
     return $nav . $back . $this->templateModule();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:27,代码来源:Module.php

示例15: send

 private function send(GWF_User $user)
 {
     $form = $this->form($user);
     if (false !== ($errors = $form->validate($this->module))) {
         return $errors . $this->template($user);
     }
     $u = GWF_User::getStaticOrGuest();
     $sendermail = $u->getValidMail();
     if ($sendermail === '') {
         $sendermail = Common::getPost('email');
     }
     if ($sendermail === '') {
         $sendermail = GWF_HTML::lang('unknown');
     }
     $sendermail = GWF_HTML::display($sendermail);
     $mail = new GWF_Mail();
     $mail->setSender(GWF_BOT_EMAIL);
     $mail->setReceiver($user->getValidMail());
     $mail->setReply($sendermail);
     $mail->setSubject($this->module->langUser($user, 'mail_subj_mail', $sendermail));
     $mail->setBody($this->module->langUser($user, 'mail_subj_body', array($user->displayUsername(), $sendermail, GWF_Message::display($_POST['message']))));
     if (false === $mail->sendToUser($user)) {
         return GWF_HTML::err('ERR_MAIL_SENT');
     }
     return $this->module->message('msg_mailed', array($user->displayUsername()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:SendMail.php


注:本文中的Common::getPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。