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


PHP GWF_User::isOptionEnabled方法代码示例

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


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

 public function execute()
 {
     GWF3::setConfig('log_request', false);
     $_GET['ajax'] = 1;
     $cut = time() - GWF_ONLINE_TIMEOUT;
     $user = new GWF_User();
     $table = GDO::table('GWF_Session');
     $profiles = '';
     if (false === ($result = $table->select('sess_user,user_name,user_options,user_level', "sess_time>={$cut}", 'user_name ASC', array('user')))) {
         return;
     }
     $guest = 0;
     $member = 0;
     $total = 0;
     $u_count = array();
     $u_users = array();
     while (false !== ($row = $table->fetch($result, GDO::ARRAY_A))) {
         $total++;
         $uid = $row['sess_user'];
         if ($uid == 0) {
             $guest++;
             continue;
         }
         $member++;
         $user->setGDOData($row);
         if ($user->isOptionEnabled(GWF_User::HIDE_ONLINE)) {
             continue;
         }
         if (isset($u_count[$uid])) {
             $u_count[$uid]++;
         } else {
             $u_count[$uid] = 1;
             $u_users[$uid] = $user->displayProfileLink();
         }
     }
     $table->free($result);
     foreach ($u_count as $uid => $cnt) {
         $multi = $cnt > 1 ? "(x{$cnt})" : '';
         $profiles .= ', ' . $u_users[$uid] . $multi;
     }
     $profiles = $profiles === '' ? '.' : ': ' . substr($profiles, 2) . '.';
     return sprintf('%s Online%s', $total, $profiles);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:43,代码来源:Beat.php

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

示例4: changeFlag

 private function changeFlag(GWF_User $user, $flagname, $bits)
 {
     $newFlag = Common::getPost($flagname) !== false;
     $oldFlag = $user->isOptionEnabled($bits);
     if ($newFlag === $oldFlag) {
         return '';
     }
     if (!$user->saveOption($bits, $newFlag)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_' . $flagname . ($newFlag ? '_on' : '_off'));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:Form.php


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