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


PHP GWF_User::getID方法代码示例

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


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

示例1: onAccess

 public static function onAccess(Module_Account $module, GWF_User $user)
 {
     $alert = false;
     $table = self::table(__CLASS__);
     # Check UA
     $ua = self::uahash();
     if ($user->isOptionEnabled(GWF_User::ALERT_UAS)) {
         if (!$table->selectVar('1', "accacc_uid={$user->getID()} AND accacc_ua=" . self::hashquote($ua))) {
             $alert = true;
         }
     }
     # Check exact IP
     $ip = GWF_IP6::getIP(GWF_IP_EXACT);
     if ($user->isOptionEnabled(GWF_User::ALERT_IPS)) {
         if (!$table->selectVar('1', "accacc_uid={$user->getID()} AND accacc_ip='" . $table->escape($ip) . "'")) {
             $alert = true;
         }
     }
     $isp = null;
     if ($user->isOptionEnabled(GWF_User::ALERT_ISPS)) {
         $isp = self::isphash();
         if (!$table->selectVar('1', "accacc_uid={$user->getID()} AND accacc_isp=" . self::hashquote($isp))) {
             $alert = true;
         }
     }
     if ($alert === true) {
         self::sendAlertMail($module, $user, 'record_alert');
     }
     $data = array('accacc_uid' => $user->getID(), 'accacc_ip' => $ip, 'accacc_isp' => $isp, 'accacc_ua' => $ua, 'accacc_time' => time());
     $table->insertAssoc($data);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:31,代码来源:GWF_AccountAccess.php

示例2: markSolved

 public static function markSolved(GWF_User $user, WC_Warchall $chall)
 {
     if (!self::table(__CLASS__)->insertAssoc(array('wc_wcid' => $chall->getID(), 'wc_uid' => $user->getID(), 'wc_solved_at' => GWF_Time::getDate(14)))) {
         return false;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:WC_Warchalls.php

示例3: onUserVote

 private function onUserVote(GWF_User $user)
 {
     if (false !== ($err = $this->votescore->onUserVoteSafe($this->score, $user->getID()))) {
         return $err;
     }
     return $this->onVoted($user);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Vote.php

示例4: onSolved

 private function onSolved(WC_Warflag $flag)
 {
     if ($this->box->isMultisolve()) {
         if (false !== ($err = $this->onMultiSolved($flag))) {
             return $err;
         }
     } else {
         if (false !== ($err = $this->onSingleSolved($flag))) {
             return $err;
         }
     }
     if (!$this->box->recalcPlayersAndScore()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === ($this->flags = WC_Warflag::getForBoxAndUser($this->box, $this->user, 'wf_order ASC'))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     $this->module->includeClass('WC_RegAt');
     if ($this->site->isUserLinked($this->user->getID())) {
         $result = $this->site->onUpdateUser($this->user);
         return $result->display($this->site->displayName());
     } else {
         return '_YOU_ARE_NOT_LINKED_TO_THE_SITE,_BUT_WELL_DONE!';
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:25,代码来源:Warsolve.php

示例5: onAssign

 public function onAssign(GWF_HelpdeskTicket $ticket, GWF_User $user)
 {
     if (false === $ticket->saveVars(array('hdt_worker' => $user->getID(), 'hdt_status' => 'working'))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_assigned', array($ticket->getID(), $user->displayUsername()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:AssignWork.php

示例6: mark

 public static function mark(GWF_User $user, GWF_Links $link, $bool)
 {
     $userid = $user->getID();
     $linkid = $link->getID();
     $is_fav = self::table(__CLASS__)->getRow($userid, $linkid) !== false;
     if ($is_fav === $bool) {
         return true;
     }
     $row = new self(array('lf_uid' => $userid, 'lf_lid' => $linkid));
     if ($bool) {
         if (!$row->replace()) {
             return false;
         }
     } else {
         if (!$row->delete()) {
             return false;
         }
     }
     if (false === $link->increase('link_favcount', $bool ? 1 : -1)) {
         return false;
     }
     if (false === $link->onCalcPopularity()) {
         return false;
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:GWF_LinksFavorite.php

示例7: isEnabledLyrics

 public static function isEnabledLyrics(Slay_Song $song, GWF_User $user)
 {
     if (false === ($row = self::getByIDs($song->getID(), $user->getID()))) {
         return true;
     }
     return $row->isOptionEnabled(self::ENABLED);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:Slay_Lyrics.php

示例8: send

 private function send()
 {
     $form = $this->getForm();
     if (false !== ($error = $form->validate($this->module))) {
         return $error . $this->templateSend();
     }
     # Get reply to field
     if (false !== ($otherid = Common::getGetInt('reply', false))) {
     } elseif (false !== ($otherid = Common::getGetInt('quote', false))) {
     }
     $parent1 = $parent2 = 0;
     if ($otherid !== false) {
         if (false !== ($otherpm = GWF_PM::getByID($otherid))) {
             $parent1 = $otherpm->getID();
             if (false !== ($p2 = $otherpm->getOtherPM())) {
                 $parent2 = $p2;
             }
         }
     }
     $result = $this->module->deliver($this->user->getID(), $this->getReceiver()->getID(), $form->getVar('title'), $form->getVar('message'), $parent1, $parent2);
     $mail = '';
     switch ($result) {
         case '1':
             return $this->module->message('msg_mail_sent', array($this->getReceiver()->display('user_name')));
         case '0':
             break;
         case '-4':
             return GWF_HTML::err('ERR_MAIL_SENT');
         default:
             return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__ . ' - Code: ' . $result));
     }
     return $mail . $this->module->message('msg_sent');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:Send.php

示例9: contactData

 private function contactData(GWF_User $user)
 {
     require_once GWF_CORE_PATH . 'module/Profile/GWF_Profile.php';
     if (false === ($p = GWF_Profile::getProfile($user->getID()))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if ($p->isGuestHidden() || $p->isHiddenLevel(0)) {
         return '';
     }
     $back = '';
     if ('' !== ($v = $p->getVar('prof_firstname'))) {
         $back .= 'FirstName:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_lastname'))) {
         $back .= 'LastName:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_street'))) {
         $back .= 'Street:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_city'))) {
         $back .= 'City:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_zip'))) {
         $back .= 'ZIPCode:' . $v . PHP_EOL;
     }
     if ($p->isContactHiddenLevel(0)) {
         return $back;
     }
     if ($user->isOptionEnabled(GWF_User::SHOW_EMAIL)) {
         if ('' !== ($v = $user->displayEMail())) {
             $back .= 'EMail:' . $v . PHP_EOL;
         }
     }
     if ('' !== ($v = $p->getVar('prof_tel'))) {
         $back .= 'Tel:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_mobile'))) {
         $back .= 'Mobile:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_icq'))) {
         $back .= 'ICQ:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_msn'))) {
         $back .= 'MSN:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_jabber'))) {
         $back .= 'Jabber:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_skype'))) {
         $back .= 'Skype:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_yahoo'))) {
         $back .= 'Yahoo!:' . $v . PHP_EOL;
     }
     if ('' !== ($v = $p->getVar('prof_aim'))) {
         $back .= 'AIM:' . $v . PHP_EOL;
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:59,代码来源:API_User.php

示例10: mayAddTag

 public static function mayAddTag(GWF_User $user)
 {
     if ($user->isStaff()) {
         return true;
     }
     $uid = $user->getID();
     return self::table(__CLASS__)->selectFirst('1', "st_uid={$uid}") === false;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Slay_Tag.php

示例11: getPMOptions

 /**
  * @param GWF_User $user
  * @return GWF_PMOptions
  */
 public static function getPMOptions(GWF_User $user)
 {
     $userid = $user->getID();
     //		if (false === ($back = self::table(__CLASS__)->selectFirstObject('*', "pmo_uid=$userid", '', array('pmo_user')))) {
     if (false === ($back = self::table(__CLASS__)->selectFirstObject('*', "pmo_uid={$userid}"))) {
         # , '', array('pmo_user')))) {
         return self::createPMOptions($user);
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:GWF_PMOptions.php

示例12: hasPermission

 public function hasPermission(GWF_User $user)
 {
     if ($user->getID() === $this->getVar('hdt_uid')) {
         return true;
     }
     if ($user->isStaff() || $user->isAdmin()) {
         return true;
     }
     return false;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:GWF_HelpdeskTicket.php

示例13: sendMail

 private static function sendMail(Module_Account $module, GWF_User $user, array $data)
 {
     $token = GWF_AccountChange::createToken($user->getID(), 'demo', serialize($data));
     $mail = new GWF_Mail();
     $mail->setSender($module->cfgMailSender());
     $mail->setReceiver($user->getVar('user_email'));
     $mail->setSubject($module->lang('chdemo_subj'));
     $username = $user->display('user_name');
     $timeout = GWF_Time::humanDuration($module->cfgChangeTime());
     $gender = GWF_HTML::display($user->getVar('user_gender'));
     $country = GWF_Country::getByIDOrUnknown($data['user_countryid'])->display('country_name');
     $lang1 = GWF_Language::getByIDOrUnknown($data['user_langid'])->display('lang_nativename');
     $lang2 = GWF_Language::getByIDOrUnknown($data['user_langid2'])->display('lang_nativename');
     $gender = GWF_HTML::lang('gender_' . $data['user_gender']);
     $birthdate = $data['user_birthdate'] > 0 ? GWF_Time::displayDate($data['user_birthdate'], true, 1) : GWF_HTML::lang('unknown');
     $link = self::getChangeLink($user->getID(), $token);
     $mail->setBody($module->lang('chdemo_body', array($username, $timeout, $gender, $country, $lang1, $lang2, $birthdate, $link)));
     return $mail->sendToUser($user) ? $module->message('msg_mail_sent') : GWF_HTML::err('ERR_MAIL_SENT');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:ChangeDemo.php

示例14: installPMBot

 private static function installPMBot(Module_PM $module)
 {
     $user = new GWF_User(array('user_name' => '_GWF_PM_BOT_', 'user_password' => 'x', 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_email' => GWF_BOT_EMAIL, 'user_birthdate' => GWF_Time::getDate(GWF_Time::LEN_DAY), 'user_countryid' => 0, 'user_langid' => 0, 'user_options' => GWF_User::BOT, 'user_lastactivity' => time()));
     if (false === $user->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === GWF_ModuleLoader::saveModuleVar($module, 'pm_bot_uid', $user->getID())) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:GWF_PMInstall.php

示例15: convert

 public static function convert(GWF_User $user, $password)
 {
     if (false === ($row = self::table(__CLASS__)->getRow($user->getID()))) {
         return true;
     }
     $oldHash = self::oldHash($password);
     if ($oldHash !== $row->getVar('pmap_password')) {
         return GWF_Module::getModule('WeChall')->error('err_password');
     }
     $row->delete();
     $user->saveVar('user_password', GWF_Password::hashPasswordS($password));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:13,代码来源:WC_PasswordMap.php


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