• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP GWF_User类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: calcRank

 private function calcRank(GWF_User $user, $bit)
 {
     $db = gdo_db();
     $bit = (int) $bit;
     $uid = $user->getVar('user_id');
     $score = $this->calcScore($user, $bit);
     $regat = GWF_TABLE_PREFIX . 'wc_regat';
     $query = "SELECT regat_uid, SUM(regat_score) AS sum " . "FROM {$regat} " . "WHERE regat_tagbits&{$bit} AND regat_options&4=0 " . "GROUP BY regat_uid " . "HAVING sum>{$score} OR (sum={$score} AND regat_uid<{$uid})";
     if (false === ($result = $db->queryRead($query, false))) {
         return -1;
     }
     $back = (int) $db->numRows($result);
     $db->free($result);
     return $back + 1;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:RankingTag.php


示例17: langUser

 /**
  * Get the translation for a user.
  * A user can have two languages set, and there is browser lang as third fallback;
  * Enter description here ...
  * @param GWF_User $user
  * @param unknown_type $key
  * @param unknown_type $args
  */
 public function langUser(GWF_User $user, $key, $args)
 {
     // Primary
     $iso1 = $user->getVar('user_langid');
     if (false !== $this->loadLanguage($iso1)) {
         return $this->translate($iso1, $key, $args);
     }
     // Secondary
     $iso2 = $user->getVar('user_langid2');
     if (false !== $this->loadLanguage($iso2)) {
         return $this->translate($iso2, $key, $args);
     }
     // Browser
     return $this->translate(self::getBrowserISO(), $key, $args);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:GWF_LangTrans.php


示例18: getUnreadPM

 /**
  * @todo create countUnread()
  * @param GWF_User $user
  * @param string $pattern
  * @param string $default
  * @return String
  */
 public static function getUnreadPM(GWF_User $user, $pattern = '[%s]', $default = '[0]')
 {
     if (false === self::loadModuleClass('PM', 'GWF_PM.php')) {
         return '';
     }
     if (false === $user->isGuest()) {
         $read = GWF_PM::READ;
         $userid = $user->getID();
         $count = GDO::table('GWF_PM')->countRows("pm_owner={$userid} AND pm_to={$userid} AND pm_options&{$read}=0");
         if ((int) $count > 0) {
             return sprintf($pattern, $count);
         }
     }
     return '';
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:GWF_Notice.php


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


示例20: templateSingleU

 private function templateSingleU($username)
 {
     if (false === ($user = GWF_User::getByName($username))) {
         return GWF_HTML::err('ERR_UNKNOWN_USER');
     }
     return $this->templateSingle($user->getCountryID(), $user);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:RankingCountry.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP GWF_Website类代码示例发布时间:2022-05-23
下一篇:
PHP GWF_Time类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap