當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IPSMember::processBanEntry方法代碼示例

本文整理匯總了PHP中IPSMember::processBanEntry方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::processBanEntry方法的具體用法?PHP IPSMember::processBanEntry怎麽用?PHP IPSMember::processBanEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IPSMember的用法示例。


在下文中一共展示了IPSMember::processBanEntry方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init


//.........這裏部分代碼省略.........
                 exit;
             } elseif (ipsRegistry::$settings['logins_over_https'] && (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on')) {
                 /* Bug 38301 */
                 ipsRegistry::getClass('output')->silentRedirect(str_replace('http://', 'https://', ipsRegistry::$settings['this_url']));
                 return;
             } else {
                 ipsRegistry::$request['module'] = 'login';
                 ipsRegistry::$request['core'] = 'login';
                 $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . "/modules_admin/login/manualResolver.php", 'admin_core_login_manualResolver');
                 $runme = new $classToLoad(self::instance());
                 $runme->doExecute(self::instance());
                 exit;
             }
         }
     } else {
         if (IPS_AREA == 'public') {
             /* Set up member */
             self::$handles['member']->finalizePublicMember();
             /* Proper no cache key <update:1> */
             ipsRegistry::$settings['noCacheKey'] = md5('$Rev: 12261 $');
             /* Are we banned: Via IP Address? */
             if (IPSMember::isBanned('ipAddress', self::$handles['member']->ip_address) === TRUE) {
                 self::instance()->getClass('output')->showError('you_are_banned', 2000, true, null, 403);
             }
             /* Are we banned: By DB */
             if (self::$handles['member']->getProperty('member_banned') == 1 or self::$handles['member']->getProperty('temp_ban')) {
                 /* Don't show this message if we're viewing the warn log */
                 if (ipsRegistry::$request['module'] != 'ajax' or ipsRegistry::$request['section'] != 'warnings') {
                     self::getClass('class_localization')->loadLanguageFile('public_error', 'core');
                     $message = '';
                     if (self::$handles['member']->getProperty('member_banned')) {
                         $message = self::getClass('class_localization')->words['no_view_board_b'];
                     } else {
                         $ban_arr = IPSMember::processBanEntry(self::$handles['member']->getProperty('temp_ban'));
                         /* No longer banned */
                         if (time() >= $ban_arr['date_end']) {
                             self::DB()->update('members', array('temp_ban' => ''), 'member_id=' . self::$handles['member']->getProperty('member_id'));
                         } else {
                             $message = sprintf(self::getClass('class_localization')->words['account_susp'], self::getClass('class_localization')->getDate($ban_arr['date_end'], 'LONG', 1));
                         }
                     }
                     /* Get anything? */
                     if ($message) {
                         $warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => 'wl_member=' . self::$handles['member']->getProperty('member_id') . ' AND wl_suspend<>0 AND wl_suspend<>-2', 'order' => 'wl_date DESC', 'limit' => 1));
                         if ($warn['wl_id'] and ipsRegistry::$settings['warn_show_own']) {
                             $moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} );'>" . self::getClass('class_localization')->words['warnings_moreinfo'] . "</a>";
                         }
                         self::instance()->getClass('output')->showError("{$message} {$moredetails}", 1001, true, null, 403);
                     }
                 }
             }
             /* Check server load */
             if (ipsRegistry::$settings['load_limit'] > 0) {
                 $server_load = IPSDebug::getServerLoad();
                 if ($server_load) {
                     $loadinfo = explode("-", $server_load);
                     if (count($loadinfo)) {
                         self::$server_load = $loadinfo[0];
                         if (self::$server_load > ipsRegistry::$settings['load_limit']) {
                             self::instance()->getClass('output')->showError('server_too_busy', 2001);
                         }
                     }
                 }
             }
             /* Specific Ajax Check */
             if (IPS_IS_AJAX and ipsRegistry::$request['section'] != 'warnings') {
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:67,代碼來源:ipsRegistry.php

示例2: save


//.........這裏部分代碼省略.........
     if ($removePoints) {
         IPSTime::setTimestamp(time());
         if ($removePointsUnit == 'h') {
             IPSTime::add_hours($removePoints);
         } else {
             IPSTime::add_days($removePoints);
         }
         $expireDate = IPSTime::getTimestamp();
     }
     /* Log */
     $warning = array('wl_member' => $this->_member['member_id'], 'wl_moderator' => $this->memberData['member_id'], 'wl_date' => time(), 'wl_reason' => $reason, 'wl_points' => $points, 'wl_note_member' => $noteForMember, 'wl_note_mods' => $noteForMods, 'wl_mq' => $mq, 'wl_mq_unit' => $mq_unit, 'wl_rpa' => $rpa, 'wl_rpa_unit' => $rpa_unit, 'wl_suspend' => $suspend, 'wl_suspend_unit' => $suspend_unit, 'wl_ban_group' => $banGroup, 'wl_expire' => $removePoints, 'wl_expire_unit' => $removePointsUnit, 'wl_acknowledged' => $this->settings['warnings_acknowledge'] ? 0 : 1, 'wl_content_app' => trim($this->request['from_app']), 'wl_content_id1' => $this->request['from_id1'], 'wl_content_id2' => $this->request['from_id2'], 'wl_expire_date' => $expireDate);
     /* Data Hook Location */
     $warning['actionData'] = $action;
     $warning['reasonsData'] = $this->reasons;
     IPSLib::doDataHooks($warning, 'memberWarningPre');
     unset($warning['actionData'], $warning['reasonsData']);
     $this->DB->insert('members_warn_logs', $warning);
     $warning['wl_id'] = $this->DB->getInsertId();
     /* Data Hook Location */
     $warning['actionData'] = $action;
     $warning['reasonsData'] = $this->reasons;
     IPSLib::doDataHooks($warning, 'memberWarningPost');
     unset($warning['actionData'], $warning['reasonsData']);
     //-----------------------------------------
     // Actually do it
     //-----------------------------------------
     $update = array();
     /* Add Points */
     if ($points) {
         $update['warn_level'] = $this->_member['warn_level'] + $points;
     }
     /* Set Punishments */
     if ($mq) {
         $update['mod_posts'] = $mq == -1 ? 1 : IPSMember::processBanEntry(array('unit' => $mq_unit, 'timespan' => $mq));
     }
     if ($rpa) {
         $update['restrict_post'] = $rpa == -1 ? 1 : IPSMember::processBanEntry(array('unit' => $rpa_unit, 'timespan' => $rpa));
     }
     if ($suspend) {
         if ($suspend == -1) {
             $update['member_banned'] = 1;
         } else {
             $update['temp_ban'] = IPSMember::processBanEntry(array('unit' => $suspend_unit, 'timespan' => $suspend));
         }
     }
     if ($banGroup > 0) {
         if (!$this->caches['group_cache'][$banGroup]['g_access_cp'] and !$this->caches['group_cache'][$banGroup]['g_is_supmod'] and $banGroup != $this->settings['guest_group']) {
             $update['member_group_id'] = $banGroup;
         }
     }
     if ($this->settings['warnings_acknowledge']) {
         $update['unacknowledged_warnings'] = 1;
     }
     /* Save */
     if (!empty($update)) {
         IPSMember::save($this->_member['member_id'], array('core' => $update));
     }
     //-----------------------------------------
     // Work out where this warning came from
     //-----------------------------------------
     if ($warning['wl_content_app'] and IPSLib::appIsInstalled($warning['wl_content_app'])) {
         $file = IPSLib::getAppDir($warning['wl_content_app']) . '/extensions/warnings.php';
         if (is_file($file)) {
             $classToLoad = IPSLib::loadLibrary($file, 'warnings_' . $warning['wl_content_app'], $warning['wl_content_app']);
             if (class_exists($classToLoad) and method_exists($classToLoad, 'getContentUrl')) {
                 $object = new $classToLoad();
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:67,代碼來源:warnings.php

示例3: acp_member_form_main

    /**
     * Main ACP member form
     *
     * @param	array 	Member data
     * @return	string	HTML
     */
    public function acp_member_form_main($member, $tabID)
    {
        $masks = array();
        ipsRegistry::DB()->build(array('select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name'));
        ipsRegistry::DB()->execute();
        while ($data = ipsRegistry::DB()->fetch()) {
            $masks[] = array($data['perm_id'], $data['perm_name']);
        }
        $_restrict_tick = '';
        $_restrict_timespan = '';
        $_restrict_units = '';
        $units = array(0 => array('h', $this->lang->words['m_hours']), 1 => array('d', $this->lang->words['m_days']));
        if ($member['restrict_post'] == 1) {
            $_restrict_tick = 'checked="checked"';
        } elseif ($member['restrict_post'] > 0) {
            $rest_arr = IPSMember::processBanEntry($member['restrict_post']);
            $hours = ceil(($rest_arr['date_end'] - time()) / 3600);
            if ($hours < 0) {
                $rest_arr['units'] = '';
                $rest_arr['timespan'] = '';
            } else {
                if ($hours > 24 and $hours / 24 == ceil($hours / 24)) {
                    $rest_arr['units'] = 'd';
                    $rest_arr['timespan'] = $hours / 24;
                } else {
                    $rest_arr['units'] = 'h';
                    $rest_arr['timespan'] = $hours;
                }
            }
        }
        $_restrict_timespan = ipsRegistry::getClass('output')->formSimpleInput('post_timespan', $rest_arr['timespan']);
        $_restrict_units = ipsRegistry::getClass('output')->formDropdown('post_units', $units, $rest_arr['units']);
        $_mod_tick = '';
        $_mod_timespan = '';
        $_mod_units = '';
        if ($member['mod_posts'] == 1) {
            $_mod_tick = 'checked="checked"';
        } elseif ($member['mod_posts'] > 0) {
            $mod_arr = IPSMember::processBanEntry($member['mod_posts']);
            $hours = ceil(($mod_arr['date_end'] - time()) / 3600);
            if ($hours < 0) {
                $mod_arr['units'] = '';
                $mod_arr['timespan'] = '';
            } else {
                if ($hours > 24 and $hours / 24 == ceil($hours / 24)) {
                    $mod_arr['units'] = 'd';
                    $mod_arr['timespan'] = $hours / 24;
                } else {
                    $mod_arr['units'] = 'h';
                    $mod_arr['timespan'] = $hours;
                }
            }
        }
        $_mod_timespan = ipsRegistry::getClass('output')->formSimpleInput('mod_timespan', $mod_arr['timespan']);
        $_mod_units = ipsRegistry::getClass('output')->formDropdown('mod_units', $units, $mod_arr['units']);
        $form_override_masks = ipsRegistry::getClass('output')->formMultiDropdown("org_perm_id[]", $masks, explode(",", $member['org_perm_id']), 8, 'org_perm_id');
        $form_posts = ipsRegistry::getClass('output')->formInput("posts", $member['posts']);
        $IPBHTML = "";
        $IPBHTML .= <<<EOF
\t
\t<div id='tab_MEMBERS_{$tabID}_content'>
\t\t<table class='ipsTable double_pad'>
\t\t\t
\t\t\t<tr>
\t\t\t\t<th colspan='2'>{$this->lang->words['sm_settings']}</th>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['mem_posts']}</strong></td>
\t\t\t\t<td class='field_field'>
\t\t\t\t\t<span id='MF__posts'>{$form_posts}</span>
\t\t\t\t</td>
\t\t\t</tr>
\t\t</table>
\t
\t\t<table class='ipsTable double_pad'>
\t\t\t<tr>
\t\t\t\t<th colspan='2'>{$this->lang->words['sm_access']}</th>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['m_overrride']}</strong></td>
\t\t\t\t<td class='field_field'>
\t\t\t\t\t<span id='MF__ogpm'>{$form_override_masks}</span>
\t\t\t\t</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td class='field_title'><strong class='title'>{$this->lang->words['m_modprev']}</strong></td>
\t\t\t\t<td class='field_field'>
\t\t\t\t\t<input type='checkbox' name='mod_indef' id='mod_indef' value='1' {$_mod_tick}> {$this->lang->words['m_modindef']}
\t\t\t\t\t<br />
\t\t\t\t\t{$this->lang->words['m_orfor']}
\t\t\t\t\t{$_mod_timespan} {$_mod_units}
\t\t\t\t</td>
\t\t\t</tr>
\t\t\t<tr>
//.........這裏部分代碼省略.........
開發者ID:mover5,項目名稱:imobackup,代碼行數:101,代碼來源:cp_skin_member_form.php

示例4: getActionsForForm

 /**
  * Action: Get actions for warning form
  */
 public function getActionsForForm()
 {
     //-----------------------------------------
     // Init
     //-----------------------------------------
     $id = intval($this->request['id']);
     $manuallySetPoints = TRUE;
     $setPoints = '';
     $allowCustomPunishment = $this->settings['warning_custom_noaction'];
     $setPunishment = $this->lang->words['warnings_verbal_only'];
     $mq = 0;
     $mq_unit = 'd';
     $rpa = 0;
     $rpa_unit = 'd';
     $suspend = 0;
     $suspend_unit = 'd';
     $banGroup = FALSE;
     $allowCustomRemovePoints = TRUE;
     $removePoints = '';
     $removePointsUnit = 'd';
     //-----------------------------------------
     // Fetch reason
     //-----------------------------------------
     if ($id != 0) {
         $reason = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$id}"));
         $manuallySetPoints = $reason['wr_points_override'];
         $setPoints = is_numeric($this->request['points']) ? intval($this->request['points']) : $reason['wr_points'];
         $removePoints = $reason['wr_remove'];
         $removePointsUnit = $reason['wr_remove_unit'];
         $allowCustomRemovePoints = $reason['wr_remove_override'];
     } elseif ($this->request['points'] !== '') {
         $setPoints = $this->request['points'];
     }
     //-----------------------------------------
     // Load Member
     //-----------------------------------------
     $member = IPSMember::load(intval($this->request['member']));
     if (!$member['member_id']) {
         $this->returnJsonError("NO_MEMBER");
     }
     //-----------------------------------------
     // Are they already being punished?
     //-----------------------------------------
     $currentPunishments = array();
     foreach (array('mq' => 'mod_posts', 'rpa' => 'restrict_post', 'suspend' => 'temp_ban') as $k => $mk) {
         if ($member[$mk]) {
             if ($member[$mk] == 1) {
                 $currentPunishments[$k] = sprintf($this->lang->words['warnings_already_' . $k . '_perm'], $member['members_display_name']);
             } else {
                 $_processed = IPSMember::processBanEntry($member[$mk]);
                 $currentPunishments[$k] = sprintf($this->lang->words['warnings_already_' . $k . '_time'], $member['members_display_name'], $this->lang->getDate($_processed['date_end'], 'SHORT'));
             }
         }
     }
     //-----------------------------------------
     // Okay, so do we have an action here?
     //-----------------------------------------
     $newPointLevel = floatval($member['warn_level'] + $setPoints);
     $action = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_points<={$newPointLevel}", 'order' => 'wa_points DESC', 'limit' => 1));
     if ($action) {
         $setPunishment = array();
         foreach (array('mq', 'rpa', 'suspend') as $k) {
             if ($action['wa_' . $k]) {
                 if ($action['wa_' . $k] == -1) {
                     $text = sprintf($this->lang->words['warnings_' . $k], $this->lang->words['warnings_permanently']);
                 } else {
                     $text = sprintf($this->lang->words['warnings_' . $k], sprintf($this->lang->words['warnings_for'], $action['wa_' . $k], $this->lang->words['warnings_time_' . $action['wa_' . $k . '_unit']]));
                 }
                 if ($currentPunishments[$k]) {
                     $text .= " <span class='error'>{$currentPunishments[$k]}{$this->lang->words['warnings_already_autochange']}</span>";
                 }
                 $setPunishment[] = $text;
             }
         }
         $setPunishment = empty($setPunishment) ? $this->lang->words['warnings_verbal_only'] : implode('<br />', $setPunishment);
         $allowCustomPunishment = $action['wa_override'];
         $mq = $action['wa_mq'];
         $mq_unit = $action['wa_mq_unit'];
         $rpa = $action['wa_rpa'];
         $rpa_unit = $action['wa_rpa_unit'];
         $suspend = $action['wa_suspend'];
         $suspend_unit = $action['wa_suspend_unit'];
         $banGroup = $action['wa_ban_group'];
     }
     $this->returnJsonArray(array('id' => $id, 'manuallySetPoints' => $this->memberData['g_access_cp'] ? TRUE : $manuallySetPoints, 'setPoints' => $setPoints, 'allowCustomPunishment' => $this->memberData['g_access_cp'] ? TRUE : $allowCustomPunishment, 'setPunishment' => $setPunishment, 'allowCustomRemovePoints' => $this->memberData['g_access_cp'] ? TRUE : $allowCustomRemovePoints, 'removePoints' => $removePoints, 'removePointsUnit' => $removePointsUnit, 'mq' => $mq, 'mq_unit' => $mq_unit, 'rpa' => $rpa, 'rpa_unit' => $rpa_unit, 'suspend' => $suspend, 'suspend_unit' => $suspend_unit, 'banGroup' => $banGroup));
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:89,代碼來源:warnings.php

示例5: _checkPostModeration

 /**
  * Checks to see if this member is forced to have their posts
  * moderated
  *
  * @access	private
  * @param	string	Type of post (new, reply, edit, poll)
  * @return	boolean	Whether to PUBLISH this topic or not
  */
 private function _checkPostModeration($type)
 {
     /* Does this member have mod_posts enabled? */
     if ($this->memberData['mod_posts']) {
         /* Mod Queue Forever */
         if ($this->memberData['mod_posts'] == 1) {
             return FALSE;
         } else {
             /* Do we need to remove the mod queue for this user? */
             $mod_arr = IPSMember::processBanEntry($this->memberData['mod_posts']);
             /* Yes, they are ok now */
             if (time() >= $mod_arr['date_end']) {
                 IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0)));
             } else {
                 return FALSE;
             }
         }
     }
     /* Group can bypass mod queue */
     if ($this->memberData['g_avoid_q']) {
         return TRUE;
     }
     /* Is the member's group moderated? */
     if ($this->_postClass->checkGroupIsPostModerated($this->memberData) === TRUE) {
         return FALSE;
     }
     /* Check to see if this forum has moderation enabled */
     $forum = $this->_postClass->getForumData();
     switch (intval($forum['preview_posts'])) {
         default:
         case 0:
             return TRUE;
             break;
         case 1:
             return FALSE;
             break;
         case 2:
             return $type == 'new' ? FALSE : TRUE;
             break;
         case 3:
             return $type == 'reply' ? FALSE : TRUE;
             break;
     }
     /* Our post can be seen! */
     return TRUE;
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:54,代碼來源:post.php

示例6: addCommentToDB

 /**
  * Adds a new profile comment to the database
  *
  * @access	public
  * @param	integer	$comment_for_id	Member id that this comment is for
  * @param	string	$comment		Text of the comment to create
  * @return	string					Error key on failure, blank on success
  */
 public function addCommentToDB($comment_for_id, $comment)
 {
     /* Load the member that this comment is for */
     $member = IPSMember::load($comment_for_id);
     /* Make sure we found a member */
     if (!$member['member_id']) {
         return 'error';
     }
     /* Are we allowed to comment? */
     if (!$this->memberData['g_reply_other_topics']) {
         return 'nopermission';
     }
     if ($this->memberData['restrict_post']) {
         if ($this->memberData['restrict_post'] == 1) {
             return 'nopermission';
         }
         $post_arr = IPSMember::processBanEntry($this->memberData['restrict_post']);
         if (time() >= $post_arr['date_end']) {
             /* Update this member's profile */
             IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
         } else {
             return 'nopermission';
         }
     }
     /* Does this member have mod_posts enabled? */
     $comment_approved = 1;
     if ($this->memberData['mod_posts']) {
         if ($this->memberData['mod_posts'] == 1) {
             $comment_approved = 0;
         } else {
             $mod_arr = IPSMember::processBanEntry($this->memberData['mod_posts']);
             if (time() >= $mod_arr['date_end']) {
                 /* Update this member's profile */
                 IPSMember::save($this->memberData['member_id'], array('core' => array('mod_posts' => 0)));
             } else {
                 $comment_approved = 0;
             }
         }
     }
     /* Format the comment */
     $comment = IPSText::truncate($comment, 400);
     $comment = preg_replace("#(\r\n|\r|\n|<br />|<br>){1,}#s", "\n", $comment);
     $comment = trim(IPSText::getTextClass('bbcode')->stripBadWords($comment));
     /* Make sure we still have a comment */
     if (!$comment) {
         return 'error-no-comment';
     }
     /* Comment requires approval? */
     if ($member['pp_setting_moderate_comments'] and $member['member_id'] != $this->memberData['member_id']) {
         $comment_approved = 0;
     }
     /* Member is ignoring you! */
     if ($comment_approved) {
         $_you_are_being_ignored = explode(",", $member['ignored_users']);
         if (is_array($_you_are_being_ignored) and count($_you_are_being_ignored)) {
             if (in_array($this->memberData['member_id'], $_you_are_being_ignored)) {
                 $comment_approved = 0;
             }
         }
     }
     /* Add comment to the DB... */
     $this->DB->insert('profile_comments', array('comment_for_member_id' => $comment_for_id, 'comment_by_member_id' => $this->memberData['member_id'], 'comment_date' => time(), 'comment_ip_address' => $this->member->ip_address, 'comment_approved' => $comment_approved, 'comment_content' => nl2br($comment)));
     $new_id = $this->DB->getInsertId();
     /* Send notifications.. */
     if (!$comment_approved and $member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) {
         IPSText::getTextClass('email')->getTemplate("new_comment_request", $member['language']);
         IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser=' . $member['member_id']));
         $message = IPSText::getTextClass('email')->message;
         $subject = IPSText::getTextClass('email')->subject;
         $to = $member;
         $from = $this->memberData;
         $return_msg = 'pp_comment_added_mod';
     } else {
         if ($member['pp_setting_notify_comments'] and $member['member_id'] != $this->memberData['member_id']) {
             IPSText::getTextClass('email')->getTemplate("new_comment_added", $member['language']);
             IPSText::getTextClass('email')->buildMessage(array('MEMBERS_DISPLAY_NAME' => $member['members_display_name'], 'COMMENT_NAME' => $this->memberData['members_display_name'], 'LINK' => $this->settings['board_url'] . '/index.' . $this->settings['php_ext'] . '?showuser=' . $member['member_id']));
             $message = IPSText::getTextClass('email')->message;
             $subject = IPSText::getTextClass('email')->subject;
             $to = $member;
             $from = $this->memberData;
             $return_msg = '';
         }
     }
     /* Got anything to send? */
     if ($message and $subject) {
         /* Email ? */
         if ($member['pp_setting_notify_comments'] == 'email' or $member['pp_setting_notify_comments'] and $member['members_disable_pm']) {
             IPSText::getTextClass('email')->subject = $subject;
             IPSText::getTextClass('email')->message = $message;
             IPSText::getTextClass('email')->to = $to['email'];
             IPSText::getTextClass('email')->sendMail();
         } else {
//.........這裏部分代碼省略.........
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:101,代碼來源:comments.php

示例7: getForSave

 /**
  * Process the entries for saving and return
  *
  * @author	Brandon Farber
  * @return   array 				Multi-dimensional array (core, extendedProfile) for saving
  */
 public function getForSave()
 {
     $return = array('core' => array(), 'extendedProfile' => array());
     $return['core']['posts'] = intval(ipsRegistry::$request['posts']);
     $return['core']['restrict_post'] = ipsRegistry::$request['post_indef'] ? 1 : (ipsRegistry::$request['post_timespan'] > 0 ? IPSMember::processBanEntry(array('timespan' => intval(ipsRegistry::$request['post_timespan']), 'unit' => ipsRegistry::$request['post_units'])) : '');
     $return['core']['mod_posts'] = ipsRegistry::$request['mod_indef'] ? 1 : (ipsRegistry::$request['mod_timespan'] > 0 ? IPSMember::processBanEntry(array('timespan' => intval(ipsRegistry::$request['mod_timespan']), 'unit' => ipsRegistry::$request['mod_units'])) : '');
     $return['core']['org_perm_id'] = ipsRegistry::$request['org_perm_id'] ? ',' . implode(",", ipsRegistry::$request['org_perm_id']) . ',' : '';
     return $return;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:15,代碼來源:member_form.php

示例8: member_view


//.........這裏部分代碼省略.........
        $_form_month = ipsRegistry::getClass('output')->formDropdown("bday_month", $months, $member['bday_month']);
        $_form_day = ipsRegistry::getClass('output')->formDropdown("bday_day", $days, $member['bday_day']);
        $form_time_offset = ipsRegistry::getClass('output')->formDropdown("time_offset", $time_zones, $member['time_offset'] ? floatval($member['time_offset']) : 0);
        $form_auto_dst = ipsRegistry::getClass('output')->formCheckbox("dstCheck", $member['members_auto_dst'], 1, "dst", "onclick='toggle_dst()'");
        $form_dst_now = ipsRegistry::getClass('output')->formCheckbox("dstOption", $member['dst_in_use'], 1, "dstManual");
        $form_language = ipsRegistry::getClass('output')->formDropdown("language", $languages, $member['language']);
        $form_allow_admin_mails = ipsRegistry::getClass('output')->formYesNo("allow_admin_mails", $member['allow_admin_mails']);
        $form_members_disable_pm = ipsRegistry::getClass('output')->formDropdown("members_disable_pm", $pm_options, $member['members_disable_pm']);
        $form_view_sig = ipsRegistry::getClass('output')->formYesNo("view_sigs", $member['view_sigs']);
        $form_reputation_points = ipsRegistry::getClass('output')->formInput('pp_reputation_points', $member['pp_reputation_points']);
        $bw_no_status_update = ipsRegistry::getClass('output')->formYesNo("bw_no_status_update", $member['bw_no_status_update']);
        $bw_disable_customization = ipsRegistry::getClass('output')->formYesNo("bw_disable_customization", $member['bw_disable_customization']);
        $form_uploader = ipsRegistry::getClass('output')->formDropdown("member_uploader", array(array('flash', $this->lang->words['mem__flashuploader']), array('default', $this->lang->words['mem__defuploader'])), $member['member_uploader']);
        $form_popup = ipsRegistry::getClass('output')->formYesNo("show_notification_popup", $member['_cache']['show_notification_popup']);
        $form_autotrack = ipsRegistry::getClass('output')->formYesNo("auto_track", $member['auto_track'] ? 1 : 0);
        $form_autotrackmthd = ipsRegistry::getClass('output')->formDropdown("auto_track_method", array(array('none', $this->lang->words['mem__auto_none']), array('immediate', $this->lang->words['mem__auto_immediate']), array('offline', $this->lang->words['mem__auto_delayed']), array('daily', $this->lang->words['mem__auto_daily']), array('weekly', $this->lang->words['mem__auto_weekly'])), $member['auto_track']);
        $secure_key = ipsRegistry::getClass('adminFunctions')->getSecurityKey();
        $ban_member_text = $member['member_banned'] ? $this->lang->words['sm_unban'] : $this->lang->words['sm_ban'];
        $spam_member_text = $member['bw_is_spammer'] ? $this->lang->words['sm_unspam'] : $this->lang->words['sm_spam'];
        $bw_disable_tagging = ipsRegistry::getClass('output')->formYesNo("bw_disable_tagging", $member['bw_disable_tagging']);
        $bw_disable_prefixes = ipsRegistry::getClass('output')->formYesNo("bw_disable_prefixes", $member['bw_disable_prefixes']);
        //-----------------------------------------
        // Comments and friends..
        //-----------------------------------------
        $pp_visitors = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_visitors", $member['pp_setting_count_visitors']);
        $pp_enable_comments = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_comments", $member['pp_setting_count_comments']);
        $pp_enable_friends = ipsRegistry::getClass('output')->formYesNo("pp_setting_count_friends", $member['pp_setting_count_friends']);
        $_commentsApprove = array(array('0', $this->lang->words['sm_comments_app_none']), array('1', $this->lang->words['sm_comments_app_on']));
        $_friendsApprove = array(array('0', $this->lang->words['sm_friends_app_none']), array('1', $this->lang->words['sm_friends_app_on']));
        $pp_comments_approve = ipsRegistry::getClass('output')->formDropdown("pp_setting_moderate_comments", $_commentsApprove, $member['pp_setting_moderate_comments']);
        $pp_friends_approve = ipsRegistry::getClass('output')->formDropdown("pp_setting_moderate_friends", $_friendsApprove, $member['pp_setting_moderate_friends']);
        $suspend_date = '';
        if ($member['temp_ban']) {
            $s_ban = IPSMember::processBanEntry($member['temp_ban']);
            $suspend_date = "<div class='warning'>" . $this->lang->words['member_supsended_til'] . ' ' . ipsRegistry::getClass('class_localization')->getDate($s_ban['date_end'], 'LONG', 1) . "</div>";
        }
        $IPBHTML = "";
        $IPBHTML .= <<<HTML
<script type="text/javascript" src="{$this->settings['js_main_url']}acp.members.js"></script>

<div class='section_title'>
\t<h2>{$this->lang->words['editing_member']} {$member['members_display_name']}</h2>
\t<ul class='context_menu'>
HTML;
        if (IPSLib::appIsInstalled('nexus')) {
            $IPBHTML .= <<<HTML
\t\t<li>
\t\t\t<a href="{$this->settings['base_url']}app=nexus&amp;module=customers&amp;section=view&amp;member_id={$member['member_id']}">
\t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icon_components/nexus.png' alt='{$this->lang->words['view_customer_data']}' />
\t\t\t\t{$this->lang->words['form_viewcustomer']}
\t\t\t</a>
\t\t</li>
HTML;
        }
        if ($this->registry->getClass('class_permissions')->checkPermission('member_login', 'members', 'members')) {
            if (IPSMember::isInactive($member)) {
                $IPBHTML .= <<<HTML
\t\t<li class='disabled'>
\t\t\t<a href="#" onclick='alert("{$this->lang->words['member_login_ban_or_spam']}")'>
\t\t\t\t<img src='{$this->settings['skin_acp_url']}/images/icons/key.png' alt='{$this->lang->words['member_login']}' />
\t\t\t\t{$this->lang->words['member_login']}
\t\t\t</a>
\t\t</li>
HTML;
            } else {
                $IPBHTML .= <<<HTML
開發者ID:mover5,項目名稱:imobackup,代碼行數:67,代碼來源:cp_skin_member.php

示例9: isOnModQueue

 /**
  * Check if a member's posts need to be approved
  * Note that this only takes into the global mod queue status, individual forums, etc. may
  * set posts to be moderated and have custom permissions
  *
  * @param	int|array		Member ID or array of data
  * @return	bool|null 		If TRUE - mod queue post. If FALSE - do not. If NULL - member is banned or restricted from posting and should not be able to post at all.
  */
 public static function isOnModQueue($memberData)
 {
     //-----------------------------------------
     // Get Data
     //-----------------------------------------
     if (!is_array($memberData) && $memberData > 0) {
         $memberData = IPSMember::load($memberData);
     }
     //-----------------------------------------
     // Check we can post at all
     //-----------------------------------------
     /* Banned */
     if ($memberData['member_banned']) {
         return NULL;
     }
     /* Suspended */
     if ($memberData['temp_ban']) {
         $data = IPSMember::processBanEntry($memberData['temp_ban']);
         if ($data['date_end']) {
             if (time() >= $data['date_end']) {
                 IPSMember::save($memberData['member_id'], array('core' => array('temp_ban' => 0)));
             } else {
                 return NULL;
             }
         } else {
             return NULL;
         }
     }
     /* Restricted from posting */
     if ($memberData['restrict_post']) {
         $data = IPSMember::processBanEntry($memberData['restrict_post']);
         if ($data['date_end']) {
             if (time() >= $data['date_end']) {
                 IPSMember::save($memberData['member_id'], array('core' => array('restrict_post' => 0)));
             } else {
                 return NULL;
             }
         } else {
             return NULL;
         }
     }
     //-----------------------------------------
     // So are we mod queued?
     //-----------------------------------------
     if ($memberData['mod_posts']) {
         $data = IPSMember::processBanEntry($memberData['mod_posts']);
         if ($data['date_end']) {
             if (time() >= $data['date_end']) {
                 IPSMember::save($memberData['member_id'], array('core' => array('mod_posts' => 0)));
             } else {
                 return TRUE;
             }
         } else {
             return TRUE;
         }
     }
     //-----------------------------------------
     // How about the group?
     //-----------------------------------------
     if ($memberData['g_mod_preview']) {
         /* Do we only limit for x posts/days? */
         if ($memberData['g_mod_post_unit']) {
             if ($memberData['gbw_mod_post_unit_type']) {
                 /* Days.. .*/
                 if ($memberData['joined'] > IPS_UNIX_TIME_NOW - 86400 * $memberData['g_mod_post_unit']) {
                     return TRUE;
                 }
             } else {
                 /* Posts */
                 if ($memberData['posts'] < $memberData['g_mod_post_unit']) {
                     return TRUE;
                 }
             }
         } else {
             /* No limit, but still checking moderating */
             return TRUE;
         }
     }
     //-----------------------------------------
     // Still here - which means we're fine
     //-----------------------------------------
     return FALSE;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:91,代碼來源:ipsMember.php

示例10: _doWarn


//.........這裏部分代碼省略.........
     // Member Content
     //-----------------------------------------
     if ($topicPosts_type == 'unapprove' or $topicPosts_type == 'approve') {
         $time = $topicPosts_lastxunits == 'd' ? $topicPosts_lastx * 24 : $topicPosts_lastx;
         $approve = $topicPosts_type == 'approve' ? TRUE : FALSE;
         if ($topicPosts_topics and $this->canApproveTopics and ($topicPosts_replies and $this->canApprovePosts)) {
             $moderatorLibrary->toggleApproveMemberContent($this->warn_member['member_id'], $approve, 'all', $time);
         } else {
             if ($topicPosts_topics and $this->canApproveTopics) {
                 $moderatorLibrary->toggleApproveMemberContent($this->warn_member['member_id'], $approve, 'topics', $time);
             } else {
                 if ($topicPosts_replies and $this->canApprovePosts) {
                     $moderatorLibrary->toggleApproveMemberContent($this->warn_member['member_id'], $approve, 'replies', $time);
                 }
             }
         }
     } else {
         if ($topicPosts_type == 'delete') {
             $time = $topicPosts_lastxunits == 'd' ? $topicPosts_lastx * 24 : $topicPosts_lastx;
             if ($topicPosts_topics and $this->canDeleteTopics and ($topicPosts_replies and $this->canDeletePosts)) {
                 $moderatorLibrary->deleteMemberContent($this->warn_member['member_id'], 'all', $time);
             } else {
                 if ($topicPosts_topics and $this->canDeleteTopics) {
                     $moderatorLibrary->deleteMemberContent($this->warn_member['member_id'], 'topics', $time);
                 } else {
                     if ($topicPosts_replies and $this->canDeletePosts) {
                         $moderatorLibrary->deleteMemberContent($this->warn_member['member_id'], 'replies', $time);
                     }
                 }
             }
         }
     }
     //-----------------------------------------
     // Member Suspension
     //-----------------------------------------
     if ($this->canModQueue) {
         if ($this->request['mod_indef'] == 1) {
             $mod_queue = 1;
         } elseif ($this->request['mod_value'] > 0) {
             $mod_queue = IPSMember::processBanEntry(array('timespan' => intval($this->request['mod_value']), 'unit' => $this->request['mod_unit']));
         }
     }
     if ($this->canRemovePostAbility) {
         if ($this->request['post_indef'] == 1) {
             $restrict_post = 1;
         } elseif ($this->request['post_value'] > 0) {
             $restrict_post = IPSMember::processBanEntry(array('timespan' => intval($this->request['post_value']), 'unit' => $this->request['post_unit']));
         }
     }
     if ($this->canSuspend) {
         if ($ban_indef) {
             $member_banned = 1;
         } else {
             if ($this->request['susp_value'] > 0) {
                 $susp = IPSMember::processBanEntry(array('timespan' => intval($this->request['susp_value']), 'unit' => $this->request['susp_unit']));
             }
         }
         /* Were banned but now unticked? */
         if (!$ban_indef and $member_banned) {
             $member_banned = 0;
         }
     }
     $save['wlog_mid'] = $this->warn_member['member_id'];
     $save['wlog_addedby'] = $this->memberData['member_id'];
     //-----------------------------------------
     // Enter into warn loggy poos (eeew - poo)
     //-----------------------------------------
     $this->DB->insert('warn_logs', $save);
     //-----------------------------------------
     // Update member
     //-----------------------------------------
     if ($this->request['level'] != 'nochange') {
         if ($this->request['level'] == 'custom') {
             $warn_level = $level_custom;
         } else {
             if ($this->request['level'] == 'add') {
                 $warn_level++;
             } else {
                 $warn_level--;
             }
         }
         if ($warn_level > $this->settings['warn_max']) {
             $warn_level = $this->settings['warn_max'];
         }
         if ($warn_level < intval($this->settings['warn_min'])) {
             $warn_level = intval($this->settings['warn_min']);
         }
     }
     IPSMember::save($this->warn_member['member_id'], array('core' => array('mod_posts' => $mod_queue, 'restrict_post' => $restrict_post, 'temp_ban' => $susp, 'member_banned' => $member_banned, 'warn_level' => $warn_level, 'warn_lastwarn' => time())));
     //-----------------------------------------
     // Now what? Show success screen, that's what!!
     //-----------------------------------------
     $this->lang->words['w_done_te'] = sprintf($this->lang->words['w_done_te'], $this->warn_member['members_display_name']);
     $tid = intval($this->request['t']);
     $topic = array();
     if ($tid > 0) {
         $topic = $this->DB->buildAndFetch(array('select' => 't.tid, t.title, t.title_seo', 'from' => array('topics' => 't'), 'where' => "t.tid={$tid}", 'add_join' => array(array('select' => 'f.id, f.name, f.name_seo', 'from' => array('forums' => 'f'), 'where' => 'f.id=t.forum_id', 'type' => 'left'))));
     }
     $this->output .= $this->registry->getClass('output')->getTemplate('mod')->warn_success($topic);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:101,代碼來源:warn.php

示例11: _getFastReplyData

 /**
  * Get fast reply status
  *
  * @return	string
  */
 public function _getFastReplyData()
 {
     /* Hang on, can we post? */
     if ($this->memberData['member_id']) {
         if ($this->memberData['unacknowledged_warnings'] and !$this->memberData['restrict_post']) {
             //return false;
         } elseif ($this->memberData['restrict_post']) {
             $data = IPSMember::processBanEntry($this->memberData['restrict_post']);
             if ($data['date_end']) {
                 if (time() >= $data['date_end']) {
                     IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
                 } else {
                     return false;
                 }
             } else {
                 return false;
             }
         }
     }
     /* Init */
     $topicData = $this->registry->getClass('topics')->getTopicData();
     $forumData = $this->forumClass->getForumById($topicData['forum_id']);
     $show = false;
     if ($this->registry->permissions->check('reply', $forumData) == TRUE and ($topicData['state'] != 'closed' or $this->memberData['g_post_closed']) and $topicData['_ppd_ok'] === TRUE and !$topicData['poll_only']) {
         $show = true;
     }
     return $show;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:33,代碼來源:topics.php

示例12: editBoxShow

 /**
  * Shows the edit box
  *
  * @access	public
  * @return	void
  */
 public function editBoxShow()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $pid = intval($this->request['p']);
     $fid = intval($this->request['f']);
     $tid = intval($this->request['t']);
     $show_reason = 0;
     //-----------------------------------------
     // Check P|T|FID
     //-----------------------------------------
     if (!$pid or !$tid or !$fid) {
         $this->returnString('error');
     }
     if ($this->memberData['member_id']) {
         if ($this->memberData['restrict_post']) {
             if ($this->memberData['restrict_post'] == 1) {
                 $this->returnString('nopermission');
             }
             $post_arr = IPSMember::processBanEntry($this->memberData['restrict_post']);
             if (time() >= $post_arr['date_end']) {
                 //-----------------------------------------
                 // Update this member's profile
                 //-----------------------------------------
                 IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
             } else {
                 $this->returnString('nopermission');
             }
         }
     }
     //-----------------------------------------
     // Get classes
     //-----------------------------------------
     if (!is_object($this->postClass)) {
         require_once IPSLib::getAppDir('forums') . "/sources/classes/post/classPost.php";
         require_once IPSLib::getAppDir('forums') . "/sources/classes/post/classPostForms.php";
         $this->registry->getClass('class_localization')->loadLanguageFile(array('public_editors'), 'core');
         $this->postClass = new classPostForms($this->registry);
     }
     # Forum Data
     $this->postClass->setForumData($this->registry->getClass('class_forums')->forum_by_id[$fid]);
     # IDs
     $this->postClass->setTopicID($tid);
     $this->postClass->setPostID($pid);
     $this->postClass->setForumID($fid);
     /* Topic Data */
     $this->postClass->setTopicData($this->DB->buildAndFetch(array('select' => 't.*, p.poll_only', 'from' => array('topics' => 't'), 'where' => "t.forum_id={$fid} AND t.tid={$tid}", 'add_join' => array(array('type' => 'left', 'from' => array('polls' => 'p'), 'where' => 'p.tid=t.tid')))));
     # Set Author
     $this->postClass->setAuthor($this->member->fetchMemberData());
     # Get Edit form
     try {
         $html = $this->postClass->displayAjaxEditForm();
         $html = $this->registry->output->replaceMacros($html);
         $this->returnHtml($html);
     } catch (Exception $error) {
         $this->returnString($error->getMessage());
     }
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:65,代碼來源:topics.php

示例13: fetchPostModerationStatusMessage

 /**
  * Fetch a status message about post moderation status
  *
  * @access	public
  * @param	array 		Array of member data
  * @param	array 		Array of forum data
  * @param	array 		Array of topic data
  * @param	string		reply/new (Type of message)
  * @return	string
  */
 public function fetchPostModerationStatusMessage($memberData, $forum, $topic, $type = 'reply')
 {
     if (is_array($memberData) and is_array($forum) and is_array($topic)) {
         $group = $this->caches['group_cache'][$memberData['member_group_id']];
         /* If our group can avoid the Q... */
         if ($group['g_avoid_q']) {
             return '';
         }
         /* Fetch correct language */
         if (!isset($this->lang->words['status_ppd_posts'])) {
             $this->registry->class_localization->loadLanguageFile(array('public_topic'), 'forums');
         }
         /* First - are we mod queued? */
         if ($memberData['mod_posts']) {
             if ($memberData['mod_posts'] == 1) {
                 return $this->lang->words['ms_mod_q'];
             } else {
                 /* Do we need to remove the mod queue for this user? */
                 $mod_arr = IPSMember::processBanEntry($memberData['mod_posts']);
                 /* Yes, they are ok now */
                 if (time() >= $mod_arr['date_end']) {
                     IPSMember::save($memberData['member_id'], array('core' => array('mod_posts' => 0)));
                     return FALSE;
                 } else {
                     return sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until'], $this->lang->getDate($mod_arr['date_end'], 'long'));
                 }
             }
         }
         /* Next, try to see if this is forum specific */
         switch (intval($forum['preview_posts'])) {
             case 1:
                 return $this->lang->words['ms_mod_q'];
                 break;
             case 2:
                 if ($type == 'new') {
                     return $this->lang->words['ms_mod_q'];
                 }
                 break;
             case 3:
                 if ($type == 'reply') {
                     return $this->lang->words['ms_mod_q'];
                 }
                 break;
         }
         /* Next, see if our group has moderator posties on */
         if ($group['g_mod_preview']) {
             /* Do we only limit for x posts/days? */
             if ($group['g_mod_post_unit']) {
                 if ($group['gbw_mod_post_unit_type']) {
                     /* Days.. .*/
                     if ($memberData['joined'] > time() - 86400 * $group['g_mod_post_unit']) {
                         return sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until'], $this->lang->getDate($memberData['joined'] + 86400 * $group['g_mod_post_unit'], 'long'));
                     }
                 } else {
                     /* Posts */
                     if ($memberData['posts'] < $group['g_mod_post_unit']) {
                         return sprintf($this->lang->words['ms_mod_q'] . ' ' . $this->lang->words['ms_mod_q_until_posts'], $group['g_mod_post_unit'] - $memberData['posts']);
                     }
                 }
             } else {
                 /* No limit, but still checking moderating */
                 return $this->lang->words['ms_mod_q'];
             }
         }
     }
     return '';
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:77,代碼來源:class_forums.php

示例14: doExecute


//.........這裏部分代碼省略.........
                }
            } else {
                $_open = true;
                //-----------------------------------------
                // Only check if we are not past the start time yet
                // i.e. if at 23:00 we know it's open
                //-----------------------------------------
                if (!($_currentHour >= $this->settings['ipschat_online_start'])) {
                    //-----------------------------------------
                    // Now, if we're past end time, it's closed
                    // since we already know it's not past start time
                    //-----------------------------------------
                    if ($_currentHour >= $this->settings['ipschat_online_end']) {
                        $_open = false;
                    }
                }
                if (!$_open) {
                    $this->_isOffline();
                }
            }
        }
        //-----------------------------------------
        // Did we request to leave chat?
        //-----------------------------------------
        if ($this->request['do'] == 'leave') {
            $this->_leaveChat();
        }
        //-----------------------------------------
        // Post restriction or unacknowledged warnings?
        //-----------------------------------------
        if ($this->memberData['member_id']) {
            $message = '';
            if ($this->memberData['restrict_post']) {
                $data = IPSMember::processBanEntry($this->memberData['restrict_post']);
                if ($data['date_end']) {
                    if (time() >= $data['date_end']) {
                        IPSMember::save($this->memberData['member_id'], array('core' => array('restrict_post' => 0)));
                    } else {
                        $message = sprintf($this->lang->words['warnings_restrict_post_temp'], $this->lang->getDate($data['date_end'], 'JOINED'));
                    }
                } else {
                    $message = $this->lang->words['warnings_restrict_post_perm'];
                }
                if ($this->memberData['unacknowledged_warnings']) {
                    $warn = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_rpa<>0", 'order' => 'wl_date DESC', 'limit' => 1));
                    if ($warn['wl_id']) {
                        $moredetails = "<a href='javascript:void(0);' onclick='warningPopup( this, {$warn['wl_id']} )'>{$this->lang->words['warnings_moreinfo']}</a>";
                    }
                }
                $this->registry->getClass('output')->showError("{$message} {$moredetails}", '10CHAT126', null, null, 403);
            }
            if (empty($message)) {
                if ($this->memberData['unacknowledged_warnings']) {
                    $unAcknowledgedWarns = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'members_warn_logs', 'where' => "wl_member={$this->memberData['member_id']} AND wl_acknowledged=0", 'order' => 'wl_date DESC', 'limit' => 1));
                    if ($unAcknowledgedWarns['wl_id']) {
                        $this->registry->getClass('output')->silentRedirect($this->registry->getClass('output')->buildUrl("app=members&amp;module=profile&amp;section=warnings&amp;do=acknowledge&amp;id={$unAcknowledgedWarns['wl_id']}"));
                    }
                }
            }
        }
        //-----------------------------------------
        // Moderator permissions
        //-----------------------------------------
        $permissions = 0;
        $private = 0;
        if ($this->settings['ipschat_mods']) {
開發者ID:mover5,項目名稱:imobackup,代碼行數:67,代碼來源:chat.php

示例15: _memberSuspendDo

 /**
  * Suspend a member [process]
  *
  * @access	private
  * @return	void		[Outputs to screen]
  */
 private function _memberSuspendDo()
 {
     $this->request['member_id'] = intval($this->request['member_id']);
     if (!$this->request['member_id']) {
         $this->registry->output->showError($this->lang->words['m_specify'], 11232);
     }
     $member = IPSMember::load($this->request['member_id']);
     if (!$member['member_id']) {
         $this->registry->output->showError($this->lang->words['m_noid'], 11233);
     }
     //-----------------------------------------
     // Allowed to suspend administrators?
     //-----------------------------------------
     if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_suspend_admin')) {
         $this->registry->output->global_message = $this->lang->words['m_suspadmin'];
         $this->_memberView();
         return;
     }
     //-----------------------------------------
     // Work out end date
     //-----------------------------------------
     $this->request['timespan'] = intval($this->request['timespan']);
     if ($this->request['timespan'] == "") {
         $new_ban = "";
     } else {
         $new_ban = IPSMember::processBanEntry(array('timespan' => intval($this->request['timespan']), 'unit' => $this->request['units']));
     }
     $show_ban = IPSMember::processBanEntry($new_ban);
     //-----------------------------------------
     // Update and show confirmation
     //-----------------------------------------
     IPSMember::save($member['member_id'], array('core' => array('temp_ban' => $new_ban)));
     // I say, did we choose to email 'dis member?
     if ($this->request['send_email']) {
         // By golly, we did!
         $msg = trim(IPSText::stripslashes($_POST['email_contents']));
         $msg = str_replace("{membername}", $member['members_display_name'], $msg);
         $msg = str_replace("{date_end}", ipsRegistry::getClass('class_localization')->getDate($show_ban['date_end'], 'LONG'), $msg);
         IPSText::getTextClass('email')->message = stripslashes(IPSText::getTextClass('email')->cleanMessage($msg));
         IPSText::getTextClass('email')->subject = $this->lang->words['m_acctsusp'];
         IPSText::getTextClass('email')->to = $member['email'];
         IPSText::getTextClass('email')->sendMail();
     }
     //-----------------------------------------
     // Redirect
     //-----------------------------------------
     ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_susplog'], $member['members_display_name']));
     $this->registry->output->doneScreen($this->lang->words['m_suspended'], $this->lang->words['m_search'], "{$this->form_code}&amp;do=viewmember&amp;member_id={$member['member_id']}", "redirect");
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:55,代碼來源:members.php


注:本文中的IPSMember::processBanEntry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。