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


PHP DiscussHelper::getSAUsersIds方法代码示例

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


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

示例1: getAdmins

 function getAdmins()
 {
     $db = DiscussHelper::getDBO();
     $query = 'SELECT `id`';
     $query .= ' FROM #__users';
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         $saUsersIds = DiscussHelper::getSAUsersIds();
         $query .= ' WHERE id IN (' . implode(',', $saUsersIds) . ')';
     } else {
         $query .= ' WHERE LOWER( `usertype` ) = ' . $db->Quote('super administrator');
     }
     $query .= ' AND `sendEmail` = ' . $db->Quote('1');
     $db->setQuery($query);
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
     }
     $result = $db->loadObjectList();
     return $result;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:19,代码来源:notification.php

示例2: getDefaultSAIds

 public static function getDefaultSAIds()
 {
     $saUserId = '62';
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         $saUsers = DiscussHelper::getSAUsersIds();
         $saUserId = $saUsers[0];
     }
     return $saUserId;
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:9,代码来源:helper.php

示例3: _verifyOnwerShip

 function _verifyOnwerShip($id)
 {
     $db = DiscussHelper::getDBO();
     $query = 'SELECT `id` FROM `#__users` WHERE `id` = ' . $db->Quote($id);
     $db->setQuery($query);
     $result = $db->loadResult();
     if (empty($result)) {
         if (DiscussHelper::getJoomlaVersion() >= '1.6') {
             $saUsersId = DiscussHelper::getSAUsersIds();
             $result = $saUsersId[0];
         } else {
             $result = $this->_getSuperAdminId();
         }
     }
     return $result;
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:16,代码来源:easydiscussusers.php

示例4: _removeUser16

 private function _removeUser16($id)
 {
     $db = DiscussHelper::getDBO();
     $currentUser = JFactory::getUser();
     $user = JFactory::getUser($id);
     $isUserSA = $user->authorise('core.admin');
     if ($isUserSA) {
         $msg = JText::_('You cannot delete a Super Administrator');
     } else {
         if ($id == $currentUser->get('id')) {
             $msg = JText::_('You cannot delete Yourself!');
         } else {
             $count = 2;
             if ($isUserSA) {
                 $saUsers = DiscussHelper::getSAUsersIds();
                 $count = count($saUsers);
             }
             if ($count <= 1 && $isUserSA) {
                 // cannot delete Super Admin where it is the only one that exists
                 $msg = "You cannot delete this Super Administrator as it is the only active Super Administrator for your site";
             } else {
                 // delete user
                 $user->delete();
                 $msg = JText::_('User Deleted.');
                 JRequest::setVar('task', 'remove');
                 JRequest::setVar('cid', $id);
                 // delete user acounts active sessions
                 $this->logout();
                 $success = true;
             }
         }
     }
     $result['success'] = $success;
     $result['msg'] = $msg;
     return $result;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:36,代码来源:user.php

示例5: getModeratorsDropdownOld

 public static function getModeratorsDropdownOld($categoryId)
 {
     $category = DiscussHelper::getTable('Category');
     if (!$category->load($categoryId)) {
         return '';
     }
     $moderators = array();
     $moderators[0] = JText::_('COM_EASYDISCUSS_MODERATOR_OPTION_NONE');
     $list = $category->getModerators();
     if ($list) {
         foreach ($list as $userId) {
             $profile = DiscussHelper::getTable('Profile');
             $profile->load($userId);
             $moderators[$profile->id] = $profile->getName();
         }
     }
     // Find super admins.
     $siteAdmins = DiscussHelper::getSAUsersIds();
     $ids = array_keys($moderators);
     foreach ($siteAdmins as $id) {
         if (!in_array($id, $ids)) {
             $profile = DiscussHelper::getTable('Profile');
             $profile->load($id);
             $moderators[$id] = $profile->getName();
         }
     }
     return $moderators;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:28,代码来源:moderator.php

示例6: _getAdministratorsEmails

 /**
  * Includes admins, custom admins, moderators, custom moderators
  * unique these emails
  */
 private static function _getAdministratorsEmails($catId, $notifyAdmins = false, $notifyModerators = false)
 {
     $config = DiscussHelper::getConfig();
     $db = DiscussHelper::getDBO();
     $admins = array();
     $customAdmins = array();
     $mods = array();
     $customMods = array();
     if ($notifyAdmins) {
         $query = 'SELECT `email` FROM `#__users`';
         if (DiscussHelper::getJoomlaVersion() >= '1.6') {
             $saUsersIds = DiscussHelper::getSAUsersIds();
             $query .= ' WHERE id IN (' . implode(',', $saUsersIds) . ')';
         } else {
             $query .= ' WHERE LOWER( `usertype` ) = ' . $db->Quote('super administrator');
         }
         $query .= ' AND `sendEmail` = ' . $db->Quote('1');
         $db->setQuery($query);
         $admins = $db->loadResultArray();
         $customAdmins = explode(',', $config->get('notify_custom'));
     }
     if ($notifyModerators) {
         $mods = DiscussHelper::getHelper('Moderator')->getModeratorsEmails($catId);
         $customMods = array();
         if ($catId) {
             $category = DiscussHelper::getTable('Category');
             $category->load($catId);
             $customMods = explode(',', $category->getParam('cat_notify_custom'));
         }
     }
     $emails = array_unique(array_merge($admins, $customAdmins, $mods, $customMods));
     return $emails;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:37,代码来源:mailer.php

示例7: defined

 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
// Load constants
require_once JPATH_ROOT . '/components/com_easydiscuss/constants.php';
require_once JPATH_ROOT . '/components/com_easydiscuss/helpers/helper.php';
// Require the base controller
require_once JPATH_COMPONENT . '/controllers/controller.php';
// Call ajax library
require_once DISCUSS_CLASSES . '/disjax.php';
require_once DISCUSS_CLASSES . '/themes.php';
DiscussHelper::getSAUsersIds();
// Process AJAX calls here
DiscussHelper::getHelper('Ajax')->process();
DiscussHelper::getUserGids();
// Load up config object.
$config = DiscussHelper::getConfig();
require_once dirname(__FILE__) . '/services.php';
// Compile javascripts
DiscussHelper::compileJS();
// Get the task
$task = JRequest::getCmd('task', 'display');
// We treat the view as the controller. Load other controller if there is any.
$controller = JRequest::getWord('controller', '');
if (!empty($controller)) {
    $controller = JString::strtolower($controller);
    $path = JPATH_COMPONENT . '/controllers/' . $controller . '.php';
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:31,代码来源:easydiscuss.php


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