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


PHP GWF_User类代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: createPMOptions

 private static function createPMOptions(GWF_User $user)
 {
     $row = new self(array('pmo_uid' => $user->getVar('user_id'), 'pmo_options' => 0, 'pmo_auto_folder' => 0, 'pmo_signature' => '', 'pmo_level' => 0));
     if (false === $row->replace()) {
         return false;
     }
     //		$row->setVar('pmo_uid', $user);
     return $row;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:GWF_PMOptions.php

示例9: onCrossLoginB

 private function onCrossLoginB(GWF_User $user)
 {
     if ($user->isDeleted()) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (false === GWF_Session::onLogin($user, false, true)) {
         return $this->module->error('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_cross_login');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:CrossLogin.php

示例10: insertFirstLink

 public static function insertFirstLink(GWF_User $user, WC_Site $site, $onsitename, $onsitescore)
 {
     $table = self::table(__CLASS__);
     $siteid = $site->getVar('site_id');
     if (false !== $table->getRow($onsitename, $siteid)) {
         return true;
     }
     $entry = new self(array('fili_onsitename' => $onsitename, 'fili_sid' => $siteid, 'fili_date' => GWF_Time::getDate(GWF_Date::LEN_DAY), 'fili_uid' => $user->getVar('user_id'), 'fili_username' => $user->getVar('user_name'), 'fili_sitename' => $site->getVar('site_name'), 'fili_percent' => $site->getPercent($onsitescore)));
     //		echo GWF_HTML::message('DEBUG', 'Insert First Link...');
     return $entry->insert();
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:WC_FirstLink.php

示例11: 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

示例12: getGroupSelect

 private function getGroupSelect(GWF_User $user)
 {
     $groups = GDO::table('GWF_Group')->selectAll('group_id, group_name');
     $data = array();
     $data[] = array('0', $this->module->lang('sel_group'));
     foreach ($groups as $group) {
         if (!$user->isInGroupID($group['group_id'])) {
             $data[] = array($group['group_id'], $group['group_name']);
         }
     }
     return GWF_Select::display('groups', $data, intval(Common::getPost('groups')));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:UserGroup.php

示例13: insertNote

 public static function insertNote(GWF_User $user, $note)
 {
     # no empty notes
     if ($note === '') {
         return false;
     }
     # insert it
     $entry = new self(array('accrm_uid' => $user->getVar('user_id'), 'accrm_note' => $note));
     if (false === $entry->replace()) {
         return false;
     }
     return $note;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:13,代码来源:GWF_AccountDelete.php

示例14: 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

示例15: onMailTicketB

 private function onMailTicketB(GWF_HelpdeskTicket $ticket, GWF_HelpdeskMsg $message, GWF_User $user)
 {
     if ('' === ($rec = $user->getValidMail())) {
         return;
     }
     $mail = new GWF_Mail();
     $mail->setSender(GWF_BOT_EMAIL);
     $mail->setReceiver($rec);
     $mail->setSubject($this->module->langUser($user, 'subj_nt', array($ticket->getID())));
     $href_work = Common::getAbsoluteURL($this->module->getMethodURL('AssignWork', '&ticket=' . $ticket->getID() . '&worker=' . $user->getID() . '&token=' . $ticket->getHashcode()), false);
     $mail->setBody($this->module->langUser($user, 'body_nt', array($user->displayUsername(), $ticket->getCreator()->displayUsername(), $ticket->displayTitle($user), $message->displayMessage(), $href_work)));
     return $mail->sendToUser($user);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:13,代码来源:CreateTicket.php


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