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;
 }
示例#2
0
 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;
 }
\*======================================================================*/
// ######################## 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';
示例#4
0
|| # ---------------- 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') {
示例#5
0
         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']);
示例#6
0
文件: ad.php 项目: Kheros/MMOver
|| # 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';
    }
}
示例#7
0
|| # 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);
示例#8
0
文件: modlog.php 项目: holandacz/nb4
|| # ---------------- 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();
示例#9
0
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)) {
示例#10
0
文件: notice.php 项目: 0hyeah/yurivn
/**
* 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';
    }
}
 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) {
         $savedprofile = vB_dB_Assertor::instance()->assertQuery('customprofile', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, 'userid' => -1));
         //We need to know whether we're updating or saving
         if ($savedprofile) {
             $current = $savedprofile->current();
         }
         $vars['userid'] = -1;
         if ($current) {
             $vars['customprofileid'] = $current['customprofileid'];
             $vars[vB_dB_Query::TYPE_KEY] = vB_dB_Query::QUERY_UPDATE;
         } else {
             unset($vars['customprofileid']);
             $vars[vB_dB_Query::TYPE_KEY] = vB_dB_Query::QUERY_INSERT;
         }
     } else {
         //These are what were passed to the page via ajax load,
         // and they are probably wrong. Certainly untrustworthy
         unset($vars['userid']);
         unset($vars['customprofileid']);
         if ($current) {
             $vars['customprofileid'] = $current['customprofileid'];
             $vars[vB_dB_Query::TYPE_KEY] = vB_dB_Query::QUERY_UPDATE;
         } else {
             $vars[userid] = $userinfo['userid'];
             $vars[vB_dB_Query::TYPE_KEY] = vB_dB_Query::QUERY_INSERT;
         }
     }
     $response = vB_dB_Assertor::instance()->assertQuery('customprofile', $vars);
     if ($response) {
         return 'user_profile_saved';
     } else {
         return 'update_failed';
     }
 }
示例#12
0
 /**
  * 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']);
 }
示例#13
0
    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
        {
示例#14
0
        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');
    }
|| #################################################################### ||
\*======================================================================*/
/**
 * 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';
    }
}
示例#16
0
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## 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('bbcode');
$specialtemplates = array('bbcodecache');
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/functions_misc.php';
require_once DIR . '/includes/class_bbcode.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminbbcodes')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('bbcodeid' => TYPE_INT));
log_admin_action(iif($vbulletin->GPC['bbcodeid'] != 0, "bbcode id = " . $vbulletin->GPC['bbcodeid']));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
if ($_REQUEST['do'] != 'previewbbcode') {
    print_cp_header($vbphrase['bb_code_manager']);
} else {
    print_cp_header();
}
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
示例#17
0
|| # ----------------- 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: 83432 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
global $phrasegroups, $specialtemplates, $vbphrase, $vbulletin;
$phrasegroups = array('cron', 'logging');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once dirname(__FILE__) . '/global.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (is_demo_mode() or !can_administer('canadmincron')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('cronid' => vB_Cleaner::TYPE_INT));
log_admin_action(iif($vbulletin->GPC['cronid'] != 0, 'cron id = ' . $vbulletin->GPC['cronid']));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vb5_config =& vB::getConfig();
print_cp_header($vbphrase['scheduled_task_manager_gcron']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// ############## quick enabled/disabled status ################
if ($_POST['do'] == 'updateenabled') {
示例#18
0
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
@set_time_limit(0);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 58699 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('cpuser');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminforums') or !can_administer('canadminstyles')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('navid' => TYPE_UINT, 'tabid' => TYPE_UINT));
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'list';
}
log_admin_action('navid = ' . $vbulletin->GPC['navid'] . ', tabid = ' . $vbulletin->GPC['tabid']);
require_once DIR . '/includes/adminfunctions_language.php';
if ($_REQUEST['do'] == 'list') {
    $navlist = build_navigation_list(true, $vbulletin->GPC['tabid']);
    if ($vbulletin->GPC_exists['tabid']) {
        if (!$navlist[$vbulletin->GPC['tabid']]) {
            print_stop_message('invalid_tabid');
        }
|| # 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: 83432 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
global $phrasegroups, $specialtemplates, $vbphrase, $npermscache;
$phrasegroups = array('cppermission', 'forum');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once dirname(__FILE__) . '/global.php';
require_once DIR . '/includes/adminfunctions_forums.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminpermissions')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('np' => vB_Cleaner::TYPE_INT, 'n' => vB_Cleaner::TYPE_INT, 'u' => vB_Cleaner::TYPE_INT));
log_admin_action(iif($vbulletin->GPC['np'] != 0, "nodepermission id = " . $vbulletin->GPC['np'], iif($vbulletin->GPC['n'] != 0, "node id = " . $vbulletin->GPC['n'] . iif($vbulletin->GPC['u'] != 0, " / usergroup id = " . $vbulletin->GPC['u']))));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
// Load defaultchannelpermissions datastore as its not loaded by default
vB::getDatastore()->fetch('defaultchannelpermissions');
print_cp_header($vbphrase['channel_permissions_manager']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// ###################### Start edit #######################
示例#20
0
文件: misc.php 项目: hungnv0789/vhtm
define('NOZIP', 1);

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('maintenance');
if ($_POST['do'] == 'rebuildstyles')
{
	$phrasegroups[] = 'style';
}
$specialtemplates = array('ranks');

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_databuild.php');

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminmaintain'))
{
	print_cp_no_permission();
}

// ############################# LOG ACTION ###############################
log_admin_action();

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################

print_cp_header($vbphrase['maintenance']);

if (empty($_REQUEST['do']))
{
示例#21
0
文件: avatar.php 项目: holandacz/nb4
|| # 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: 27796 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('attachment_image');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminimages')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
log_admin_action();
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['userpic_manager']);
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'storage';
}
// ###################### Start checkpath #######################
function verify_upload_folder($imagepath)
{
    global $vbphrase;
示例#22
0
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('cron', 'cpuser', 'prefix');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_prefix.php';
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// ############################# LOG ACTION ###############################
log_admin_action(!empty($vbulletin->GPC['rssfeedid']) ? 'RSS feed id = ' . $vbulletin->GPC['rssfeedid'] : '');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadmincron')) {
    print_cp_no_permission();
}
// #############################################################################
if ($_POST['do'] == 'updatestatus') {
    $vbulletin->input->clean_gpc('p', 'enabled', TYPE_ARRAY_UINT);
    $feeds_result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "rssfeed ORDER BY title");
    while ($feed = $db->fetch_array($feeds_result)) {
        $old = $feed['options'] & $vbulletin->bf_misc_feedoptions['enabled'] ? 1 : 0;
        $new = $vbulletin->GPC['enabled']["{$feed['rssfeedid']}"] ? 1 : 0;
        if ($old != $new) {
            $feeddata =& datamanager_init('RSSFeed', $vbulletin, ERRTYPE_ARRAY);
            $feeddata->set_existing($feed);
            $feeddata->set_bitfield('options', 'enabled', $new);
            $feeddata->save();
        }
示例#23
0
@set_time_limit(0);
ignore_user_abort(true);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 27113 $');
if ($_POST['do'] == 'updatetemplate' or $_POST['do'] == 'inserttemplate' or $_REQUEST['do'] == 'createfiles') {
    // double output buffering does some weird things, so turn it off in these three cases
    DEFINE('NOZIP', 1);
}
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('style');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_template.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminstyles')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('templateid' => TYPE_INT, 'dostyleid' => 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 ############################
// ########################################################################
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
} else {
    $nozipDos = array('inserttemplate', 'rebuild', 'kill', 'insertstyle', 'killstyle', 'updatestyle');
    if (in_array($_REQUEST['do'], $nozipDos)) {
        $vbulletin->nozip = true;
    }
示例#24
0
文件: faq.php 项目: holandacz/nb4
|| # ---------------- 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: 26229 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('cphome', 'help_faq', 'fronthelp');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/functions_faq.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminfaq')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
log_admin_action();
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['faq_manager']);
// #############################################################################
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// #############################################################################
if ($_POST['do'] == 'kill') {
    $vbulletin->input->clean_array_gpc('p', array('faqname' => TYPE_STR));
示例#25
0
文件: plugin.php 项目: Kheros/MMOver
define('FORCE_HOOKS', true);
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('plugins');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/class_hook.php';
require_once DIR . '/includes/class_block.php';
require_once DIR . '/includes/adminfunctions_plugin.php';
require_once DIR . '/includes/adminfunctions_template.php';
//inits classloader -- required to make vB_Cache work
require_once DIR . '/includes/class_bootstrap_framework.php';
vB_Bootstrap_Framework::init();
// ######################## CHECK ADMIN PERMISSIONS #######################
// don't allow demo version or admin with no permission to administer plugins
if (is_demo_mode() or !can_administer('canadminplugins')) {
    print_cp_no_permission();
}
$vbulletin->input->clean_array_gpc('r', array('pluginid' => TYPE_UINT));
// ############################# LOG ACTION ###############################
log_admin_action(iif($vbulletin->GPC['pluginid'] != 0, 'plugin id = ' . $vbulletin->GPC['pluginid']));
// #############################################################################
// ########################### START MAIN SCRIPT ###############################
// #############################################################################
if ($_REQUEST['do'] != 'download' and $_REQUEST['do'] != 'productexport') {
    print_cp_header($vbphrase['plugin_products_system']);
}
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
if (in_array($_REQUEST['do'], array('modify', 'files', 'edit', 'add', 'product', 'productadd', 'productedit'))) {
 /**
  * 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->registry->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 =& datamanager_init('User', $this->registry, 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'];
             $userdata->set_usertitle($this->info['user']['customtitle'] ? $this->info['user']['usertitle'] : '', false, $this->registry->usergroupcache["{$displaygroupid}"], ($this->info['user']['customtitle'] == 1 or $this->info['user']['permissions']['genericpermissions'] & $this->registry->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->registry->options['ignoremods']) {
         $rebuild_ignore_list = array();
         $ignored_moderators = $this->dbobject->query_read("SELECT userid FROM " . TABLE_PREFIX . "userlist WHERE relationid = " . $this->fetch_field('userid') . " AND type = 'ignore'");
         while ($ignored_moderator = $this->dbobject->fetch_array($ignored_moderators)) {
             $rebuild_ignore_list[] = $ignored_moderator['userid'];
         }
         if (!empty($rebuild_ignore_list)) {
             require_once DIR . '/includes/functions_databuild.php';
             $this->dbobject->query_write("DELETE FROM " . TABLE_PREFIX . "userlist WHERE relationid = " . $this->fetch_field('userid') . " AND type = 'ignore'");
             foreach ($rebuild_ignore_list as $userid) {
                 build_userlist($userid);
             }
         }
     }
     ($hook = vBulletinHook::fetch_hook('moderatordata_postsave')) ? eval($hook) : false;
 }
示例#27
0
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 32878 $');

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('cppermission');
$specialtemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_misc.php');

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminforums'))
{
	print_cp_no_permission();
}

$vbulletin->input->clean_array_gpc('r', array(
	'userid'      => TYPE_INT,
	'usergroupid' => TYPE_INT,
	'forumid'     => TYPE_INT,
));

// ############################# LOG ACTION ###############################
log_admin_action(iif($vbulletin->GPC['userid'], "user id = " . $vbulletin->GPC['userid'], iif($vbulletin->GPC['usergroupid'], "usergroup id = " . $vbulletin->GPC['usergroupid'], iif($vbulletin->GPC['forumid'], "forum id = " . $vbulletin->GPC['forumid']))));

// ########################################################################
// ######################### START MAIN SCRIPT ############################
示例#28
0
文件: tag.php 项目: hungnv0789/vhtm
define('CVS_REVISION', '$RCSfile$ - $Revision: 28048 $');

// ################### DEFINE LOCAL SCRIPT CONSTANTS ######################

// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('tagscategories');
$specialtemplates = array();

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once DIR . "/includes/functions.php";
require_once DIR . "/includes/class_dm.php";
require_once(DIR . '/includes/class_taggablecontent.php');

// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadmintags'))
{
	print_cp_no_permission();
}

// ############################# LOG ACTION ###############################
log_admin_action();

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################


if (empty($_REQUEST['do']))
{
	$action = 'modify';
示例#29
0
    if (can_administer('canadminthreads')) {
        exec_header_redirect($vbulletin->config['Misc']['admincpdir'] . '/index.php?' . $vbulletin->session->vars['sessionurl_js'] . 'loc=' . urlencode('thread.php?' . $vbulletin->session->vars['sessionurl_js'] . 'do=move'));
    } else {
        if (can_moderate($foruminfo['forumid'], 'canmassmove')) {
            exec_header_redirect($vbulletin->config['Misc']['modcpdir'] . '/index.php?' . $vbulletin->session->vars['sessionurl_js'] . 'loc=' . urlencode('thread.php?' . $vbulletin->session->vars['sessionurl_js'] . 'do=move'));
        } else {
            print_no_permission();
        }
    }
}
// #############################################################################
if ($_REQUEST['do'] == 'prune') {
    if (!$foruminfo['forumid']) {
        eval(standard_error(fetch_error('invalidid', $vbphrase['forum'], $vbulletin->options['contactuslink'])));
    }
    if (can_administer('canadminthreads')) {
        exec_header_redirect($vbulletin->config['Misc']['admincpdir'] . '/index.php?' . $vbulletin->session->vars['sessionurl_js'] . 'loc=' . urlencode('thread.php?' . $vbulletin->session->vars['sessionurl_js'] . 'do=prune'));
    } else {
        if (can_moderate($forumid, 'canmassprune')) {
            exec_header_redirect($vbulletin->config['Misc']['modcpdir'] . '/index.php?' . $vbulletin->session->vars['sessionurl_js'] . 'loc=' . urlencode('thread.php?' . $vbulletin->session->vars['sessionurl_js'] . 'do=prune'));
        } else {
            print_no_permission();
        }
    }
}
// #############################################################################
if ($_REQUEST['do'] == 'modposts') {
    if (can_moderate(0, 'canmoderateposts')) {
        exec_header_redirect($vbulletin->config['Misc']['modcpdir'] . '/index.php?' . $vbulletin->session->vars['sessionurl_js'] . 'loc=' . urlencode('moderate.php?' . $vbulletin->session->vars['sessionurl_js'] . 'do=posts'));
    } else {
        print_no_permission();
示例#30
0
|| # ---------------- 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: 25644 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('calendar', 'cppermission', 'holiday');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/functions_calendar.php';
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadmincalendars')) {
    print_cp_no_permission();
}
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('moderatorid' => TYPE_INT, 'calendarid' => TYPE_INT));
log_admin_action(iif($vbulletin->GPC['moderatorid'] != 0, " moderator id = " . $vbulletin->GPC['moderatorid'], iif($vbulletin->GPC['calendarid'] != 0, "calendar id = " . $vbulletin->GPC['calendarid'], '')));
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$monthsarray = array();
foreach ($months as $index => $month) {
    $monthsarray["{$index}"] = $vbphrase["{$month}"];
}
$daysarray = array();
foreach ($days as $index => $day) {
    $daysarray["{$index}"] = $vbphrase["{$day}"];