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


PHP can_administer函数代码示例

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


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

示例1: can_administer_pm_log

 function can_administer_pm_log()
 {
     global $vbulletin;
     if ($vbulletin->userinfo['userid'] < 1) {
         // user is a guest - definitely not an administrator
         return false;
     }
     static $admin;
     require_once DIR . '/includes/adminfunctions.php';
     $return_value = false;
     // use this check only for admins, but not superadmins
     if (can_administer()) {
         if (!isset($admin)) {
             // query specific admin permissions from the administrator
             // table and assign them to $adminperms
             $getperms = $vbulletin->db->query_first("\n          SELECT `admin_view_pm_log`\n          FROM `" . TABLE_PREFIX . "administrator`\n          WHERE `userid` = " . $vbulletin->userinfo['userid']);
             $admin = $getperms;
         }
         $return_value = $admin['admin_view_pm_log'] ? true : false;
     }
     return $return_value;
 }
开发者ID:rcdesign-cemetery,项目名称:vb-pm_log,代码行数:22,代码来源:functions_rcd_pm_log.php

示例2: construct_banned_user_row

 function construct_banned_user_row($user, $canunbanuser)
 {
     global $vbulletin, $vbphrase;
     $vb5_config =& vB::getConfig();
     if ($user['liftdate'] == 0) {
         $user['banperiod'] = $vbphrase['permanent'];
         $user['banlift'] = $vbphrase['never'];
         $user['banremaining'] = $vbphrase['forever'];
     } else {
         $user['banlift'] = vbdate($vbulletin->options['dateformat'] . ', ~' . $vbulletin->options['timeformat'], $user['liftdate']);
         $user['banperiod'] = ceil(($user['liftdate'] - $user['bandate']) / 86400);
         if ($user['banperiod'] == 1) {
             $user['banperiod'] .= " {$vbphrase['day']}";
         } else {
             $user['banperiod'] .= " {$vbphrase['days']}";
         }
         $remain = $user['liftdate'] - TIMENOW;
         $remain_days = floor($remain / 86400);
         $remain_hours = ceil(($remain - $remain_days * 86400) / 3600);
         if ($remain_hours == 24) {
             $remain_days += 1;
             $remain_hours = 0;
         }
         if ($remain_days < 0) {
             $user['banremaining'] = "<i>{$vbphrase['will_be_lifted_soon']}</i>";
         } else {
             if ($remain_days == 1) {
                 $day_word = $vbphrase['day'];
             } else {
                 $day_word = $vbphrase['days'];
             }
             if ($remain_hours == 1) {
                 $hour_word = $vbphrase['hour'];
             } else {
                 $hour_word = $vbphrase['hours'];
             }
             $user['banremaining'] = "{$remain_days} {$day_word}, {$remain_hours} {$hour_word}";
         }
     }
     $cell = array("<a href=\"" . (can_administer('canadminusers') ? '../admincp/' : '') . 'user.php?' . vB::getCurrentSession()->get('sessionurl') . "do=edit&amp;u={$user['userid']}\"><b>{$user['username']}</b></a>");
     if ($user['bandate']) {
         $cell[] = $user['adminid'] ? "<a href=\"" . (can_administer('canadminusers') ? '../admincp/' : '') . 'user.php?' . vB::getCurrentSession()->get('sessionurl') . "do=edit&amp;u={$user['adminid']}\">{$user['adminname']}</a>" : $vbphrase['n_a'];
         $cell[] = vbdate($vbulletin->options['dateformat'], $user['bandate']);
     } else {
         $cell[] = $vbphrase['n_a'];
         $cell[] = $vbphrase['n_a'];
     }
     $cell[] = $user['banperiod'];
     $cell[] = $user['banlift'];
     $cell[] = $user['banremaining'];
     if ($canunbanuser) {
         $cell[] = construct_link_code($vbphrase['lift_ban'], 'banning.php?' . vB::getCurrentSession()->get('sessionurl') . "do=liftban&amp;u={$user['userid']}");
     }
     $cell[] = construct_link_code(!empty($user['reason']) ? $user['reason'] : $vbphrase['n_a'], 'banning.php?' . vB::getCurrentSession()->get('sessionurl') . "do=editreason&amp;userid=" . $user['userid']);
     return $cell;
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:56,代码来源:banning.php

示例3: error_reporting

\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE & ~8192);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 39862 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array('bookmarksitecache');
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_bookmarksite.php';
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('bookmarksiteid' => TYPE_INT));
log_admin_action($vbulletin->GPC['bookmarksiteid'] != 0 ? "bookmark site id = " . $vbulletin->GPC['bookmarksiteid'] : '');
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminsettings')) {
    print_cp_no_permission();
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['social_bookmarking_manager']);
// default action
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// ########################################################################
// when we want to add a new site from the site list page we need change the action before the main 'socialbookmarks_setpost' handler
// we came here if somebody press the add button in the sitelist edit/save form
if ($_POST['do'] == 'socialbookmarks_setpost' and $vbulletin->GPC['add']) {
    $_POST['do'] = 'add';
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:bookmarksite.php

示例4: error_reporting

|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 40911 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('reputation', 'user', 'reputationlevel');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_reputation.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminusers')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('reputationlevelid' => TYPE_INT, 'minimumreputation' => TYPE_INT));
// ############################# LOG ACTION ###############################
log_admin_action(iif($vbulletin->GPC['reputationlevelid'] != 0, " reputationlevel id = " . $vbulletin->GPC['reputationlevelid'], iif($vbulletin->GPC['minimumreputation'] != 0, "minimum reputation = " . $vbulletin->GPC['minimumreputation'], '')));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['user_reputation_manager']);
// *************************************************************************************************
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// *************************************************************************************************
if ($_REQUEST['do'] == 'add' or $_REQUEST['do'] == 'edit') {
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:adminreputation.php

示例5: print_table_header

         print_table_header(construct_phrase($vbphrase['edit_moderator_x_for_forum_y'], $moderator['username'], $moderator['forumtitle']));
     }
 }
 if ($_REQUEST['do'] != 'editglobal') {
     print_forum_chooser($vbphrase['forum_and_children'], 'forumid', $moderator['forumid']);
     if ($_REQUEST['do'] == 'add') {
         print_input_row($vbphrase['moderator_usernames'] . "<dfn>{$vbphrase['separate_usernames_semicolon']}</dfn>", 'modusername', $moderator['username'], 0);
     } else {
         if ($_REQUEST['do'] == 'edit') {
             print_input_row($vbphrase['moderator_username'], 'modusername', $moderator['username'], 0);
         }
     }
     construct_hidden_code('redir', $vbulletin->GPC['redir']);
 }
 // usergroup membership options
 if ($_REQUEST['do'] == 'add' and can_administer('canadminusers')) {
     $usergroups = array(0 => $vbphrase['do_not_change_usergroup']);
     foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) {
         $usergroups["{$usergroupid}"] = $usergroup['title'];
     }
     print_table_header($vbphrase['usergroup_options']);
     print_select_row($vbphrase['change_moderator_primary_usergroup_to'], 'usergroupid', $usergroups, 0);
     print_membergroup_row($vbphrase['make_moderator_a_member_of'], 'membergroupids', 2);
 }
 // post permissions
 print_description_row($vbphrase['post_thread_permissions'], false, 2, 'thead');
 print_yes_no_row($vbphrase['can_edit_posts'], 'modperms[caneditposts]', $moderator['caneditposts']);
 print_yes_no_row($vbphrase['can_delete_posts'], 'modperms[candeleteposts]', $moderator['candeleteposts']);
 print_yes_no_row($vbphrase['can_physically_delete_posts'], 'modperms[canremoveposts]', $moderator['canremoveposts']);
 // thread permissions
 print_yes_no_row($vbphrase['can_open_close_threads'], 'modperms[canopenclose]', $moderator['canopenclose']);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:moderator.php

示例6: error_reporting

|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 35402 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('advertising', 'notice');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
// ############################# LOG ACTION ###############################
if (!can_administer('canadminads')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('adid' => TYPE_UINT));
log_admin_action($vbulletin->GPC['adid'] != 0 ? "ad id = " . $vbulletin->GPC['adid'] : '');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['advertising']);
if (!in_array($_REQUEST['do'], array('add', 'edit', 'update', 'delete', 'remove', 'locate', 'flipcoin'))) {
    if (!empty($_REQUEST['adid'])) {
        $_REQUEST['do'] = 'edit';
    } else {
        $_REQUEST['do'] = 'modify';
    }
}
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:ad.php

示例7: error_reporting

|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 26900 $');
define('DEFAULT_FILENAME', 'vbulletin-language.xml');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('language');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_language.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminlanguages')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('dolanguageid' => TYPE_INT));
// ############################# LOG ACTION ###############################
log_admin_action(iif(!empty($vbulletin->GPC['dolanguageid']), "Language ID = " . $vbulletin->GPC['dolanguageid']));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
if (($current_memory_limit = ini_size_to_bytes(@ini_get('memory_limit'))) < 128 * 1024 * 1024 and $current_memory_limit > 0) {
    @ini_set('memory_limit', 128 * 1024 * 1024);
}
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
$langglobals = array('title' => TYPE_NOHTML, 'userselect' => TYPE_INT, 'options' => TYPE_ARRAY_BOOL, 'languagecode' => TYPE_STR, 'charset' => TYPE_STR, 'locale' => TYPE_STR, 'imagesoverride' => TYPE_STR, 'dateoverride' => TYPE_STR, 'timeoverride' => TYPE_STR, 'registereddateoverride' => TYPE_STR, 'calformat1override' => TYPE_STR, 'calformat2override' => TYPE_STR, 'logdateoverride' => TYPE_STR, 'decimalsep' => TYPE_STR, 'thousandsep' => TYPE_STR);
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:language.php

示例8: error_reporting

|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 26275 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('logging', 'threadmanage');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/functions_log_error.php';
// ############################# LOG ACTION ###############################
if (!can_administer('canadminmodlog')) {
    print_cp_no_permission();
}
log_admin_action();
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['moderator_log']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'choose';
}
// ###################### Start view #######################
if ($_REQUEST['do'] == 'view') {
    $vbulletin->input->clean_array_gpc('r', array('perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT, 'userid' => TYPE_UINT, 'modaction' => TYPE_STR, 'orderby' => TYPE_NOHTML, 'product' => TYPE_STR, 'startdate' => TYPE_UNIXTIME, 'enddate' => TYPE_UNIXTIME));
    $princids = array('poll_question' => $vbphrase['question'], 'post_title' => $vbphrase['post'], 'thread_title' => $vbphrase['thread'], 'forum_title' => $vbphrase['forum'], 'attachment_title' => $vbphrase['attachment']);
    $sqlconds = array();
开发者ID:holandacz,项目名称:nb4,代码行数:31,代码来源:modlog.php

示例9: array

global $masterset, $only;
global $SHOWTEMPLATE, $vbphrase;
$phrasegroups = array('style');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once dirname(__FILE__) . '/global.php';
require_once DIR . '/includes/adminfunctions_template.php';
if ($_POST['do'] == 'updatetemplate' or $_POST['do'] == 'inserttemplate' or $_REQUEST['do'] == 'createfiles') {
    if (!vB::getUserContext()->hasAdminPermission('canadmintemplates')) {
        print_cp_no_permission();
    }
    // double output buffering does some weird things, so turn it off in these three cases
    DEFINE('NOZIP', 1);
}
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminstyles') and !vB::getUserContext()->hasAdminPermission('canadmintemplates')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('templateid' => vB_Cleaner::TYPE_INT, 'dostyleid' => vB_Cleaner::TYPE_INT));
// ############################# LOG ACTION ###############################
log_admin_action(!empty($vbulletin->GPC['templateid']) ? 'template id = ' . $vbulletin->GPC['templateid'] : !empty($vbulletin->GPC['dostyleid']) ? 'style id = ' . $vbulletin->GPC['dostyleid'] : '');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vb5_config =& vB::getConfig();
$vb5_options = vB::getDatastore()->getValue('options');
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
} else {
    $nozipDos = array('inserttemplate', 'rebuild', 'kill', 'insertstyle', 'killstyle', 'updatestyle');
    if (in_array($_REQUEST['do'], $nozipDos)) {
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:31,代码来源:template.php

示例10: error_reporting

/**
* To disable the Javascript-based disabling of criteria in the notice add/edit code,
* define NOTICE_CRITERIA_JS as 'false' in config.php
*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 62562 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('notice');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_notice.php';
// ############################# LOG ACTION ###############################
if (!can_administer('canadminnotices')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('noticeid' => TYPE_INT));
log_admin_action($vbulletin->GPC['noticeid'] != 0 ? "notice id = " . $vbulletin->GPC['noticeid'] : '');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['notices_manager']);
if (empty($_REQUEST['do'])) {
    if (!empty($_REQUEST['noticeid'])) {
        $_REQUEST['do'] = 'edit';
    } else {
        $_REQUEST['do'] = 'modify';
    }
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:notice.php

示例11: saveUserTheme

 public static function saveUserTheme($usertheme, $userinfo)
 {
     $vars = array('font_family' => vB_Cleaner::TYPE_STR, 'fontsize' => vB_Cleaner::TYPE_STR, 'title_text_color' => vB_Cleaner::TYPE_STR, 'page_background_color' => vB_Cleaner::TYPE_STR, 'page_background_image' => vB_Cleaner::TYPE_STR, 'page_background_image' => vB_Cleaner::TYPE_STR, 'page_background_repeat' => vB_Cleaner::TYPE_STR, 'module_text_color' => vB_Cleaner::TYPE_STR, 'module_link_color' => vB_Cleaner::TYPE_STR, 'module_background_color' => vB_Cleaner::TYPE_STR, 'module_background_image' => vB_Cleaner::TYPE_STR, 'module_background_repeat' => vB_Cleaner::TYPE_STR, 'module_border' => vB_Cleaner::TYPE_STR, 'moduleinactive_text_color' => vB_Cleaner::TYPE_STR, 'moduleinactive_link_color' => vB_Cleaner::TYPE_STR, 'moduleinactive_background_color' => vB_Cleaner::TYPE_STR, 'moduleinactive_background_image' => vB_Cleaner::TYPE_STR, 'moduleinactive_background_repeat' => vB_Cleaner::TYPE_STR, 'moduleinactive_border' => vB_Cleaner::TYPE_STR, 'headers_text_color' => vB_Cleaner::TYPE_STR, 'headers_link_color' => vB_Cleaner::TYPE_STR, 'headers_background_color' => vB_Cleaner::TYPE_STR, 'headers_background_image' => vB_Cleaner::TYPE_STR, 'headers_background_repeat' => vB_Cleaner::TYPE_STR, 'headers_border' => vB_Cleaner::TYPE_STR, 'content_text_color' => vB_Cleaner::TYPE_STR, 'content_link_color' => vB_Cleaner::TYPE_STR, 'content_background_color' => vB_Cleaner::TYPE_STR, 'content_background_image' => vB_Cleaner::TYPE_STR, 'content_background_repeat' => vB_Cleaner::TYPE_STR, 'content_border' => vB_Cleaner::TYPE_STR, 'button_text_color' => vB_Cleaner::TYPE_STR, 'button_background_color' => vB_Cleaner::TYPE_STR, 'button_background_image' => vB_Cleaner::TYPE_STR, 'button_background_repeat' => vB_Cleaner::TYPE_STR, 'button_border' => vB_Cleaner::TYPE_STR, 'page_link_color' => vB_Cleaner::TYPE_STR);
     //We only do this if we're logged in as a user.
     if (!intval($userinfo['userid'])) {
         return false;
     }
     //We need the array to pass to the GPC cleaner
     $vars = array('themeid' => vB_Cleaner::TYPE_UINT, 'deletetheme' => vB_Cleaner::TYPE_UINT, 'saveasdefault' => vB_Cleaner::TYPE_UINT);
     //Since we're here, we need to know which vars are controlled by which permission
     //might as well do that since we're scanning the array.
     $bg_vars = $color_vars = $border_vars = array();
     foreach (self::$themevars as $varname) {
         $vars[$varname] = vB_Cleaner::TYPE_STR;
         if (strpos(varname, 'border') !== false) {
             $border_vars[] = $varname;
         } else {
             if (strpos(varname, 'background') !== false) {
                 $bg_vars[] = $varname;
             } else {
                 $color_vars[] = $varname;
             }
         }
     }
     if (!self::$permissions) {
         self::setPermissions();
     }
     vB::$vbulletin->input->clean_array_gpc('r', $vars);
     $userid = $userinfo['userid'];
     //see if the user is trying to save as default
     if (vB::$vbulletin->GPC_exists['saveasdefault'] and vB::$vbulletin->GPC['saveasdefault'] == 1) {
         require_once DIR . '/includes/adminfunctions.php';
         if (can_administer('cansetdefaultprofile')) {
             $userid = -1;
         }
     }
     $savedprofile = vB_dB_Assertor::instance()->assertQuery('customprofile', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'userid' => $userid));
     //We need to know whether we're updating or saving
     if ($savedprofile) {
         $current = $savedprofile->current();
     }
     //If the user has passed theme = 0 or theme = -1, that means they want the default.
     //So we delete their record if it exists.
     if (vB::$vbulletin->GPC_exists['deletetheme'] and intval(vB::$vbulletin->GPC['deletetheme']) and $current) {
         //We just clear the settings;
         $response = vB_dB_Assertor::instance()->assertQuery('customprofile', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_DELETE, 'customprofileid' => $current['customprofileid']));
         return 'user_profile_reset_to_default';
     }
     //Now we confirm permissions. We unset every variable for which
     // they don't have permission.
     if ($userid != -1) {
         if (!self::$permissions['caneditfontfamily']) {
             unset($vars['font_family']);
         }
         if (!self::$permissions['caneditfontsize']) {
             unset($vars['fontsize']);
         }
         if (!self::$permissions['caneditcolors']) {
             foreach ($color_vars as $varname) {
                 unset($vars[$varname]);
             }
         }
         if (!self::$permissions['caneditbgimage']) {
             foreach ($bg_vars as $varname) {
                 unset($vars[$varname]);
             }
         }
         if (!self::$permissions['caneditborders']) {
             foreach ($border_vars as $varname) {
                 unset($vars[$varname]);
             }
         }
     }
     //let's set the submitted variables
     foreach ($vars as $varname => $value) {
         if (vB::$vbulletin->GPC_exists[$varname]) {
             if (vB::$vbulletin->GPC[$varname] == 'null') {
                 if (strpos($varname, 'image')) {
                     $vars[$varname] = 'none';
                 } else {
                     if (strpos($varname, 'repeat')) {
                         $vars[$varname] = 'no-repeat';
                     } else {
                         $vars[$varname] = 'inherit';
                     }
                 }
             } else {
                 if (strpos($varname, 'repeat')) {
                     $vars[$varname] = self::cleanRepeat(vB::$vbulletin->GPC[$varname]);
                 } else {
                     $vars[$varname] = vB::$vbulletin->GPC[$varname];
                 }
             }
         } else {
             unset($vars[$varname]);
         }
     }
     $vars['themeid'] = 0;
     //If we are setting as site default, we're ready to save
     if ($userid == -1) {
//.........这里部分代码省略.........
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:101,代码来源:profilecustomize.php

示例12: post_save_each

 /**
  * Additional data to update after a save call (such as denormalized values in other tables).
  *
  * @param	boolean	Do the query?
  */
 function post_save_each($doquery = true)
 {
     $moderatorid = $this->fetch_field('moderatorid');
     // update usergroupid / membergroupids
     if (!$this->condition and !in_array($this->moderator['userid'], explode(',', $this->config['SpecialUsers']['undeletableusers'])) and can_administer('canadminusers')) {
         $update_usergroupid = $this->info['usergroupid'] > 0;
         $update_membergroup = (!empty($this->info['membergroupids']) and is_array($this->info['membergroupids']));
         if ($update_usergroupid or $update_membergroup) {
             $userdata = new vB_Datamanager_User($this->registry, vB_DataManager_Constants::ERRTYPE_SILENT);
             if (!$this->info['user'] and $this->moderator['userid']) {
                 $this->info['user'] = fetch_userinfo($this->moderator['userid']);
             }
             $userdata->set_existing($this->info['user']);
             cache_permissions($this->info['user'], false);
             $displaygroupid = $update_usergroupid ? $this->info['usergroupid'] : $this->info['user']['displaygroupid'];
             $this->usergroupcache = vB::getDatastore()->get_value('usergroupcache');
             $userdata->set_usertitle($this->info['user']['customtitle'] ? $this->info['user']['usertitle'] : '', false, $this->usergroupcache["{$displaygroupid}"], ($this->info['user']['customtitle'] == 1 or $this->info['user']['permissions']['genericpermissions'] & $this->bf_ugp_genericpermissions['canusecustomtitle']) ? true : false, $this->info['user']['customtitle'] == 1 ? true : false);
             $userdata->set_failure_callback(array(&$this, 'update_user_failed_insert'));
             if ($update_usergroupid) {
                 $userdata->set('usergroupid', $this->info['usergroupid']);
                 $userdata->set('displaygroupid', $this->info['usergroupid']);
             }
             if ($update_membergroup) {
                 $membergroupids = preg_split('#,#', $this->info['user']['membergroupids'], -1, PREG_SPLIT_NO_EMPTY);
                 $membergroupids = array_unique(array_merge($membergroupids, $this->info['membergroupids']));
                 if ($key = array_search($this->info['user']['usergroupid'], $membergroupids)) {
                     unset($membergroupids["{$key}"]);
                 }
                 sort($membergroupids);
                 $userdata->set('membergroupids', $membergroupids);
             }
             if ($userdata->errors) {
                 $this->errors = array_merge($this->errors, $userdata->errors);
                 return;
             }
             $userdata->save();
         }
     }
     if (!$this->condition and !$this->options['ignoremods']) {
         $rebuild_ignore_list = array();
         $ignored_moderators = $this->assertor->getRows('userlist', array('relationid' => $this->fetch_field('userid'), 'type' => 'ignore'));
         foreach ($ignored_moderators as $ignored_moderator) {
             $rebuild_ignore_list[] = $ignored_moderator['userid'];
         }
         if (!empty($rebuild_ignore_list)) {
             require_once DIR . '/includes/functions_databuild.php';
             $this->assertor->delete('userlist', array('relationid' => $this->fetch_field('userid'), 'type' => 'ignore'));
             foreach ($rebuild_ignore_list as $userid) {
                 build_userlist($userid);
             }
         }
     }
     // Legacy Hook 'moderatordata_postsave' Removed //
     vB_Cache::instance(vB_Cache::CACHE_FAST)->event('userPerms_' . $this->moderator['userid']);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:60,代码来源:moderator.php

示例13: define

    define('THIS_SCRIPT', 'rcd_pm_log');
}
define('MOVE_FIRST', 10);
define('MOVE_LAST', 20);
define('MOVE_PREV', 30);
define('MOVE_NEXT', 40);
// ############## PRE-CACHE TEMPLATES AND DATA ############################
$phrasegroups = array('style', 'pm', 'user', 'fronthelp', 'attachment_image', 'posting');
$actiontemplates = array();
// ############## REQUIRE BACK-END ########################################
require_once './global.php';
require_once DIR . '/includes/adminfunctions.php';
require_once DIR . '/includes/adminfunctions_template.php';
require_once DIR . '/includes/functions_rcd_pm_log.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!(can_administer('adminviewpmlog') or can_administer_pm_log())) {
    print_cp_no_permission();
}
// ############## START MAIN SCRIPT #######################################
$usermenus = array();
// ############## LIST PM MESSAGES ########################################
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'search';
}
if ($_REQUEST['do'] == 'search') {
    print_cp_header($vbphrase['rcd_pm_log_acp_menu']);
    ?>

    <style type="text/css" id="vbulletin_css">
        .tborder
        {
开发者ID:rcdesign-cemetery,项目名称:vb-pm_log,代码行数:31,代码来源:rcd_pm_log.php

示例14: define

        define('CP_REDIRECT', 'blog_admin.php?do=moderators');
        print_stop_message('saved_moderator_x_successfully', $vbulletin->GPC['modusername']);
    }
}
// ###################### Start Remove moderator #######################
if ($_REQUEST['do'] == 'removemod') {
    $vbulletin->input->clean_array_gpc('r', array('blogmoderatorid' => TYPE_UINT));
    if (!can_administer('canblogpermissions')) {
        print_cp_no_permission();
    }
    print_delete_confirmation('blog_moderator', $vbulletin->GPC['blogmoderatorid'], 'blog_admin', 'killmod', 'moderator');
}
// ###################### Start Kill moderator #######################
$vbulletin->input->clean_array_gpc('p', array('blogmoderatorid' => TYPE_UINT));
if ($_POST['do'] == 'killmod') {
    if (!can_administer('canblogpermissions')) {
        print_cp_no_permission();
    }
    $getuserid = $db->query_first("\r\n\t\tSELECT user.userid, usergroupid\r\n\t\tFROM " . TABLE_PREFIX . "blog_moderator AS blog_moderator\r\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user USING (userid)\r\n\t\tWHERE blogmoderatorid = " . $vbulletin->GPC['blogmoderatorid']);
    if (!$getuserid) {
        print_stop_message('user_no_longer_moderator');
    } else {
        $userinfo = array('bloguserid' => $getuserid['userid']);
        $dataman =& datamanager_init('Blog_User', $vbulletin, ERRTYPE_SILENT);
        $dataman->set_existing($userinfo);
        $dataman->set('isblogmoderator', 0);
        $dataman->save();
        $db->query_write("\r\n\t\t\tDELETE FROM " . TABLE_PREFIX . "blog_moderator\r\n\t\t\tWHERE blogmoderatorid = " . $vbulletin->GPC['blogmoderatorid']);
        define('CP_REDIRECT', 'blog_admin.php?do=moderators');
        print_stop_message('deleted_moderator_successfully');
    }
开发者ID:Kheros,项目名称:MMOver,代码行数:31,代码来源:blog_admin.php

示例15: error_reporting

|| #################################################################### ||
\*======================================================================*/
/**
 * To disable the Javascript-based disabling of criteria in the userscleanup
 * add/edit code, define userscleanup_CRITERIA_JS as 'false' in config.php
 */
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('cpuser', 'user', 'notice');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
// ############################# LOG ACTION ###############################
if (!can_administer('adminuserscleanup')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('ruleid' => TYPE_INT));
log_admin_action($vbulletin->GPC['ruleid'] != 0 ? "userscleanup id = " . $vbulletin->GPC['ruleid'] : '');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
require_once DIR . '/includes/functions_users_cleanup.php';
if (empty($_REQUEST['do'])) {
    if ($vbulletin->GPC['ruleid']) {
        $_REQUEST['do'] = 'edit';
    } else {
        $_REQUEST['do'] = 'list';
    }
}
开发者ID:rcdesign-cemetery,项目名称:vb-users_cleanup,代码行数:31,代码来源:users_cleanup.php


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