• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP isAllowedTo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: shd_frontpage_options

function shd_frontpage_options($return_config)
{
    global $context, $modSettings, $txt, $sourcedir, $smcFunc;
    // Since this is potentially dangerous, real admins only, thanks.
    isAllowedTo('admin_forum');
    $config_vars = array(array('select', 'shdp_frontpage_appear', array('always' => $txt['shdp_frontpage_appear_always'], 'firstload' => $txt['shdp_frontpage_appear_firstload'], 'firstdefault' => $txt['shdp_frontpage_appear_firstdefault'])), '', array('select', 'shdp_frontpage_type', array('php' => $txt['shdp_frontpage_type_php'], 'bbcode' => $txt['shdp_frontpage_type_bbcode'])), array('large_text', 'shdp_frontpage_content', 'size' => 30));
    $context['settings_title'] = $txt['shdp_frontpage'];
    $context['settings_icon'] = 'frontpage.png';
    // Are we actually going to display this, or bouncing it back just for admin search?
    if (!$return_config) {
        require_once $sourcedir . '/Subs-Post.php';
        require_once $sourcedir . '/Subs-Editor.php';
        loadTemplate('sd_plugins_template/SDPluginFrontPage');
        $context['sub_template'] = 'shd_frontpage_admin';
        $context['shdp_frontpage_content'] = !empty($modSettings['shdp_frontpage_content']) ? un_preparsecode($modSettings['shdp_frontpage_content']) : '';
        if (isset($_GET['save'])) {
            $_POST['shdp_frontpage_content'] = isset($_POST['shdp_frontpage_content']) ? $_POST['shdp_frontpage_content'] : '';
            if (!empty($_POST['shdp_frontpage_type']) && $_POST['shdp_frontpage_type'] == 'php') {
                $context['shdp_frontpage_content'] = $smcFunc['htmlspecialchars']($_POST['shdp_frontpage_content'], ENT_QUOTES);
            } else {
                $_POST['shdp_frontpage_content'] = $smcFunc['htmlspecialchars']($_POST['shdp_frontpage_content'], ENT_QUOTES);
                preparsecode($_POST['shdp_frontpage_content']);
                $context['shdp_frontpage_content'] = un_preparsecode($_POST['shdp_frontpage_content']);
                // So it's a known safe version.
            }
        }
        $modSettings['disable_wysiwyg'] = true;
        $editorOptions = array('id' => 'shdp_frontpage_content', 'value' => $context['shdp_frontpage_content'], 'labels' => array('post_button' => $txt['save']), 'preview_type' => 0, 'width' => '70%', 'disable_smiley_box' => false);
        create_control_richedit($editorOptions);
        $context['post_box_name'] = $editorOptions['id'];
    }
    return $config_vars;
}
开发者ID:jdarwood007,项目名称:SimpleDesk,代码行数:33,代码来源:SDPluginFrontPage.php


示例2: PackageGet

function PackageGet()
{
    global $txt, $scripturl, $context, $boarddir, $sourcedir, $modSettings;
    isAllowedTo('admin_forum');
    require_once $sourcedir . '/Subs-Package.php';
    // Still managing packages...
    adminIndex('manage_packages');
    // Use the Packages template... no reason to separate.
    loadLanguage('Packages');
    loadTemplate('Packages');
    // Add the appropriate items to the link tree.
    $context['linktree'][] = array('url' => $scripturl . '?action=packages', 'name' => &$txt['package1']);
    $context['linktree'][] = array('url' => $scripturl . '?action=packageget', 'name' => &$txt['smf182']);
    $context['page_title'] = $txt['package1'];
    // Here is a list of all the potentially valid actions.
    $subActions = array('servers' => 'PackageServers', 'add' => 'PackageServerAdd', 'browse' => 'PackageGBrowse', 'download' => 'PackageDownload', 'remove' => 'PackageServerRemove', 'upload' => 'PackageUpload');
    // Now let's decide where we are taking this...
    if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
        $context['sub_action'] = $_REQUEST['sa'];
    } elseif ($_REQUEST['action'] == 'pgdownload') {
        $context['sub_action'] = 'download';
    } else {
        $context['sub_action'] = 'servers';
    }
    // Now create the tabs for the template.
    $context['admin_tabs'] = array('title' => &$txt['package1'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array('title' => $txt['package3'], 'href' => $scripturl . '?action=packages;sa=browse'), 'packageget' => array('title' => $txt['download_packages'], 'description' => $txt['download_packages_desc'], 'href' => $scripturl . '?action=packageget', 'is_selected' => true), 'installed' => array('title' => $txt['installed_packages'], 'description' => $txt['installed_packages_desc'], 'href' => $scripturl . '?action=packages;sa=installed'), 'options' => array('title' => $txt['package_settings'], 'description' => $txt['package_install_options_ftp_why'], 'href' => $scripturl . '?action=packages;sa=options', 'is_last' => true)));
    $subActions[$context['sub_action']]();
}
开发者ID:alencarmo,项目名称:OCF,代码行数:28,代码来源:PackageGet.php


示例3: ManageCalendar

function ManageCalendar()
{
    global $context, $txt, $scripturl, $modSettings;
    isAllowedTo('admin_forum');
    // Administrative side bar, here we come!
    adminIndex('manage_calendar');
    // Everything's gonna need this.
    loadLanguage('ManageCalendar');
    // Default text.
    $context['explain_text'] =& $txt['calendar_desc'];
    // Little short on the ground of functions here... but things can and maybe will change...
    $subActions = array('editholiday' => 'EditHoliday', 'holidays' => 'ModifyHolidays', 'settings' => 'ModifySettings');
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'settings';
    // Set up the two tabs here...
    $context['admin_tabs'] = array('title' => &$txt['manage_calendar'], 'help' => 'calendar', 'description' => $txt['calendar_settings_desc'], 'tabs' => array('holidays' => array('title' => $txt['manage_holidays'], 'description' => $txt['manage_holidays_desc'], 'href' => $scripturl . '?action=managecalendar;sa=holidays'), 'settings' => array('title' => $txt['calendar_settings'], 'description' => $txt['calendar_settings_desc'], 'href' => $scripturl . '?action=managecalendar;sa=settings', 'is_last' => true)));
    // Select the tab they're at...
    if (isset($context['admin_tabs']['tabs'][$_REQUEST['sa']])) {
        $context['admin_tabs']['tabs'][$_REQUEST['sa']]['is_selected'] = true;
    }
    // Some settings may not be enabled, disallow these from the tabs as appropriate.
    if (empty($modSettings['cal_enabled'])) {
        unset($context['admin_tabs']['tabs']['holidays']);
    }
    $subActions[$_REQUEST['sa']]();
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:25,代码来源:ManageCalendar.php


示例4: Memberlist

function Memberlist()
{
    global $scripturl, $txt, $modSettings, $context, $settings;
    // Make sure they can view the memberlist.
    isAllowedTo('view_mlist');
    loadTemplate('Memberlist');
    $context['listing_by'] = !empty($_GET['sa']) ? $_GET['sa'] : 'all';
    // $subActions array format:
    // 'subaction' => array('label', 'function', 'is_selected')
    $subActions = array('all' => array(&$txt[303], 'MLAll', $context['listing_by'] == 'all'), 'search' => array(&$txt['mlist_search'], 'MLSearch', $context['listing_by'] == 'search'));
    // Set up the sort links.
    $context['sort_links'] = array();
    foreach ($subActions as $act => $text) {
        $context['sort_links'][] = array('label' => $text[0], 'action' => $act, 'selected' => $text[2]);
    }
    $context['num_members'] = $modSettings['totalMembers'];
    // Set up the columns...
    $context['columns'] = array('isOnline' => array('label' => $txt['online8'], 'width' => '20'), 'realName' => array('label' => $txt[35]), 'emailAddress' => array('label' => $txt[307], 'width' => '25'), 'websiteUrl' => array('label' => $txt[96], 'width' => '25'), 'ICQ' => array('label' => $txt[513], 'width' => '25'), 'AIM' => array('label' => $txt[603], 'width' => '25'), 'YIM' => array('label' => $txt[604], 'width' => '25'), 'MSN' => array('label' => $txt['MSN'], 'width' => '25'), 'ID_GROUP' => array('label' => $txt[87]), 'registered' => array('label' => $txt[233]), 'posts' => array('label' => $txt[21], 'width' => '115', 'colspan' => '2'));
    $context['linktree'][] = array('url' => $scripturl . '?action=mlist', 'name' => &$txt[332]);
    $context['can_send_pm'] = allowedTo('pm_send');
    // Jump to the sub action.
    if (isset($subActions[$context['listing_by']])) {
        $subActions[$context['listing_by']][1]();
    } else {
        $subActions['all'][1]();
    }
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:27,代码来源:Memberlist.php


示例5: AdkAdmin

function AdkAdmin()
{
    global $txt, $context, $settings, $adkportal, $boardurl, $adkFolder;
    //Is allowed to manage adkportal
    isAllowedTo('adk_portal');
    //Load my template
    adktemplate('Adk-Admin');
    //Load Adk Language
    adkLanguage('Adk-Admin');
    $subActions = array('view' => 'view', 'adksettings' => 'adksettings', 'adksavesettings' => 'adksavesettings', 'manageicons' => 'manageicons');
    //Set subactions for standalone mode
    if ($adkportal['adk_enable'] == 2) {
        $subActions += array('standalone' => 'SettingsStandAlone', 'save_stand' => 'SaveSettingsStandAlone');
    }
    $context['html_headers'] .= getCss('admin_adkportal');
    $context['html_headers'] .= getJs('admin');
    $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['adkadmin_settings'], 'description' => $txt['adkadmin_news_desc'], 'tabs' => array('view' => array('description' => $txt['adkadmin_news_desc'], 'label' => '<img style="vertical-align: middle;" alt="" src="' . $settings['default_theme_url'] . '/images/admin/news.png" />&nbsp;' . $txt['adkadmin_news']), 'adksettings' => array('description' => $txt['adkadmin_setting_desc'], 'label' => '<img style="vertical-align: middle;" alt="" src="' . $settings['default_theme_url'] . '/images/admin/settings.png" />&nbsp;' . $txt['adkadmin_setting']), 'manageicons' => array('description' => $txt['adkadmin_icons_desc'], 'label' => '<img style="vertical-align: middle;" alt="" src="' . $settings['default_theme_url'] . '/images/admin/icons.png" />&nbsp;' . $txt['adkadmin_icons'])));
    //The last thing... print the stand alone menu
    if ($adkportal['adk_enable'] == 2) {
        $context[$context['admin_menu_name']]['tab_data']['tabs']['standalone'] = array('description' => $txt['adkadmin_stand_desc'], 'label' => '<img style="vertical-align: middle;" alt="" src="' . $adkFolder['images'] . '/php.png" />&nbsp;' . $txt['adkadmin_stand']);
    }
    // Follow the sa or just go to View function
    if (!empty($_GET['sa']) && !empty($subActions[$_GET['sa']])) {
        $subActions[@$_GET['sa']]();
    } else {
        $subActions['view']();
    }
}
开发者ID:lucasruroken,项目名称:adkportal,代码行数:28,代码来源:Adk-Admin.php


示例6: ManagePostSettings

function ManagePostSettings()
{
    global $context, $txt, $scripturl;
    // Boldify "Posts and Topics" on the admin bar.
    adminIndex('posts_and_topics');
    $subActions = array('posts' => array('ModifyPostSettings', 'admin_forum'), 'bbc' => array('ModifyBBCSettings', 'admin_forum'), 'censor' => array('SetCensor', 'moderate_forum'), 'topics' => array('ModifyTopicSettings', 'admin_forum'));
    // Default the sub-action to 'view ban list'.
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('admin_forum') ? 'posts' : 'censor');
    // Make sure you can do this.
    isAllowedTo($subActions[$_REQUEST['sa']][1]);
    $context['page_title'] = $txt['manageposts_title'];
    // Tabs for browsing the different ban functions.
    $context['admin_tabs'] = array('title' => $txt['manageposts_title'], 'help' => 'posts_and_topics', 'description' => $txt['manageposts_description'], 'tabs' => array());
    if (allowedTo('admin_forum')) {
        $context['admin_tabs']['tabs'][] = array('title' => $txt['manageposts_settings'], 'description' => $txt['manageposts_settings_description'], 'href' => $scripturl . '?action=postsettings;sa=posts', 'is_selected' => $_REQUEST['sa'] == 'posts');
        $context['admin_tabs']['tabs'][] = array('title' => $txt['manageposts_bbc_settings'], 'description' => $txt['manageposts_bbc_settings_description'], 'href' => $scripturl . '?action=postsettings;sa=bbc', 'is_selected' => $_REQUEST['sa'] == 'bbc');
    }
    if (allowedTo('moderate_forum')) {
        $context['admin_tabs']['tabs'][] = array('title' => $txt[135], 'description' => $txt[141], 'href' => $scripturl . '?action=postsettings;sa=censor', 'is_selected' => $_REQUEST['sa'] == 'censor', 'is_last' => !allowedTo('admin_forum'));
    }
    if (allowedTo('admin_forum')) {
        $context['admin_tabs']['tabs'][] = array('title' => $txt['manageposts_topic_settings'], 'description' => $txt['manageposts_topic_settings_description'], 'href' => $scripturl . '?action=postsettings;sa=topics', 'is_selected' => $_REQUEST['sa'] == 'topics', 'is_last' => true);
    }
    // Call the right function for this sub-acton.
    $subActions[$_REQUEST['sa']][0]();
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:26,代码来源:ManagePosts.php


示例7: ManageNews

function ManageNews()
{
    global $context, $txt, $scripturl;
    // First, let's do a quick permissions check for the best error message possible.
    isAllowedTo(array('edit_news', 'send_mail', 'admin_forum'));
    // Administrative side bar, here we come!
    adminIndex('news');
    loadTemplate('ManageNews');
    // Format: 'sub-action' => array('function', 'permission')
    $subActions = array('editnews' => array('EditNews', 'edit_news'), 'mailingmembers' => array('SelectMailingMembers', 'send_mail'), 'mailingcompose' => array('ComposeMailing', 'send_mail'), 'mailingsend' => array('SendMailing', 'send_mail'), 'settings' => array('ModifyNewsSettings', 'admin_forum'));
    // Default to sub action 'main' or 'settings' depending on permissions.
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('edit_news') ? 'editnews' : (allowedTo('send_mail') ? 'mailingmembers' : 'settings'));
    // Have you got the proper permissions?
    isAllowedTo($subActions[$_REQUEST['sa']][1]);
    // Create the tabs for the template.
    $context['admin_tabs'] = array('title' => $txt['news_title'], 'help' => 'edit_news', 'description' => $txt[670], 'tabs' => array());
    if (allowedTo('edit_news')) {
        $context['admin_tabs']['tabs'][] = array('title' => $txt[7], 'description' => $txt[670], 'href' => $scripturl . '?action=news', 'is_selected' => $_REQUEST['sa'] == 'editnews');
    }
    if (allowedTo('send_mail')) {
        $context['admin_tabs']['tabs'][] = array('title' => $txt[6], 'description' => $txt['news_mailing_desc'], 'href' => $scripturl . '?action=news;sa=mailingmembers', 'is_selected' => substr($_REQUEST['sa'], 0, 7) == 'mailing');
    }
    if (allowedTo('admin_forum')) {
        $context['admin_tabs']['tabs'][] = array('title' => $txt['settings'], 'description' => $txt['news_settings_desc'], 'href' => $scripturl . '?action=news;sa=settings', 'is_selected' => $_REQUEST['sa'] == 'settings');
    }
    $context['admin_tabs']['tabs'][count($context['admin_tabs']['tabs']) - 1]['is_last'] = true;
    $subActions[$_REQUEST['sa']][0]();
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:28,代码来源:ManageNews.php


示例8: RegCenter

function RegCenter()
{
    global $modSettings, $context, $txt, $db_prefix, $scripturl;
    // Old templates might still request this.
    if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'browse') {
        redirectexit('action=viewmembers;sa=browse' . (isset($_REQUEST['type']) ? ';type=' . $_REQUEST['type'] : ''));
    }
    $subActions = array('register' => array('AdminRegister', 'moderate_forum'), 'agreement' => array('EditAgreement', 'admin_forum'), 'reservednames' => array('SetReserve', 'admin_forum'), 'settings' => array('AdminSettings', 'admin_forum'));
    // Work out which to call...
    $context['sub_action'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('moderate_forum') ? 'register' : 'settings');
    // Must have sufficient permissions.
    isAllowedTo($subActions[$context['sub_action']][1]);
    // Set the admin area...
    adminIndex('registration_center');
    // Loading, always loading.
    loadLanguage('Login');
    loadTemplate('Register');
    // Next create the tabs for the template.
    $context['admin_tabs'] = array('title' => &$txt['registration_center'], 'help' => 'registrations', 'description' => $txt['admin_settings_desc'], 'tabs' => array('register' => array('title' => $txt['admin_browse_register_new'], 'description' => $txt['admin_register_desc'], 'href' => $scripturl . '?action=regcenter;sa=register', 'is_selected' => $context['sub_action'] == 'register', 'is_last' => !allowedTo('admin_forum'))));
    if (allowedTo('admin_forum')) {
        $context['admin_tabs']['tabs']['agreement'] = array('title' => $txt['smf11'], 'description' => $txt['smf12'], 'href' => $scripturl . '?action=regcenter;sa=agreement', 'is_selected' => $context['sub_action'] == 'agreement');
        $context['admin_tabs']['tabs']['reservednames'] = array('title' => $txt[341], 'description' => $txt[699], 'href' => $scripturl . '?action=regcenter;sa=reservednames', 'is_selected' => $context['sub_action'] == 'reservednames');
        $context['admin_tabs']['tabs']['settings'] = array('title' => $txt['settings'], 'description' => $txt['admin_settings_desc'], 'href' => $scripturl . '?action=regcenter;sa=settings', 'is_last' => true, 'is_selected' => $context['sub_action'] == 'settings');
    }
    // Finally, get around to calling the function...
    $subActions[$context['sub_action']][0]();
}
开发者ID:alencarmo,项目名称:OCF,代码行数:27,代码来源:ManageRegistration.php


示例9: Packages

function Packages()
{
    global $txt, $scripturl, $sourcedir, $context;
    isAllowedTo('admin_forum');
    // Managing packages!
    adminIndex('manage_packages');
    // Load all the basic stuff.
    require_once $sourcedir . '/Subs-Package.php';
    loadLanguage('Packages');
    loadTemplate('Packages');
    // Set up the linktree and title so it's already done.
    $context['linktree'][] = array('url' => $scripturl . '?action=packages', 'name' => &$txt['package1']);
    $context['page_title'] = $txt['package1'];
    // Delegation makes the world... that is, the package manager go 'round.
    $subActions = array('browse' => 'PackageBrowse', 'remove' => 'PackageRemove', 'list' => 'PackageList', 'install' => 'PackageInstallTest', 'install2' => 'PackageInstall', 'uninstall' => 'PackageInstallTest', 'uninstall2' => 'PackageInstall', 'installed' => 'InstalledList', 'options' => 'PackageOptions', 'flush' => 'FlushInstall', 'examine' => 'ExamineFile');
    // Work out exactly who it is we are calling.
    if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
        $context['sub_action'] = $_REQUEST['sa'];
    } else {
        $context['sub_action'] = 'browse';
    }
    // Set up some tabs...
    $context['admin_tabs'] = array('title' => &$txt['package1'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array('title' => $txt['package3'], 'href' => $scripturl . '?action=packages;sa=browse'), 'packageget' => array('title' => $txt['download_packages'], 'description' => $txt['download_packages_desc'], 'href' => $scripturl . '?action=packageget'), 'installed' => array('title' => $txt['installed_packages'], 'description' => $txt['installed_packages_desc'], 'href' => $scripturl . '?action=packages;sa=installed'), 'options' => array('title' => $txt['package_settings'], 'description' => $txt['package_install_options_ftp_why'], 'href' => $scripturl . '?action=packages;sa=options', 'is_last' => true)));
    // Attempt to automatically select the right tab.
    if (isset($context['admin_tabs']['tabs'][$context['sub_action']])) {
        $context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;
    } else {
        $context['admin_tabs']['tabs']['browse']['is_selected'] = true;
    }
    // Call the function we're handing control to.
    $subActions[$context['sub_action']]();
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:32,代码来源:Packages.php


示例10: ModifySettings

/**
 * This is the main dispatcher. Sets up all the available sub-actions, all the tabs and selects
 * the appropriate one based on the sub-action.
 *
 * Requires the admin_forum permission.
 * Redirects to the appropriate function based on the sub-action.
 *
 * @uses edit_settings adminIndex.
 */
function ModifySettings()
{
    global $context, $txt, $scripturl, $boarddir;
    // This is just to keep the database password more secure.
    isAllowedTo('admin_forum');
    // Load up all the tabs...
    $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['admin_server_settings'], 'help' => 'serversettings', 'description' => $txt['admin_basic_settings']);
    checkSession('request');
    // The settings are in here, I swear!
    loadLanguage('ManageSettings');
    $context['page_title'] = $txt['admin_server_settings'];
    $context['sub_template'] = 'show_settings';
    $subActions = array('general' => 'ModifyGeneralSettings', 'database' => 'ModifyDatabaseSettings', 'cookie' => 'ModifyCookieSettings', 'cache' => 'ModifyCacheSettings', 'loads' => 'ModifyLoadBalancingSettings', 'phpinfo' => 'ShowPHPinfoSettings');
    call_integration_hook('integrate_server_settings', array(&$subActions));
    // By default we're editing the core settings
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'general';
    $context['sub_action'] = $_REQUEST['sa'];
    // Any messages to speak of?
    $context['settings_message'] = isset($_REQUEST['msg']) && isset($txt[$_REQUEST['msg']]) ? $txt[$_REQUEST['msg']] : '';
    // Warn the user if there's any relevant information regarding Settings.php.
    if ($_REQUEST['sa'] != 'cache') {
        // Warn the user if the backup of Settings.php failed.
        $settings_not_writable = !is_writable($boarddir . '/Settings.php');
        $settings_backup_fail = !@is_writable($boarddir . '/Settings_bak.php') || !@copy($boarddir . '/Settings.php', $boarddir . '/Settings_bak.php');
        if ($settings_not_writable) {
            $context['settings_message'] = '<div class="centertext"><strong>' . $txt['settings_not_writable'] . '</strong></div><br />';
        } elseif ($settings_backup_fail) {
            $context['settings_message'] = '<div class="centertext"><strong>' . $txt['admin_backup_fail'] . '</strong></div><br />';
        }
        $context['settings_not_writable'] = $settings_not_writable;
    }
    // Call the right function for this sub-action.
    $subActions[$_REQUEST['sa']]();
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:43,代码来源:ManageServer.php


示例11: PackageGet

function PackageGet()
{
    global $txt, $scripturl, $context, $boarddir, $sourcedir, $modSettings;
    isAllowedTo('admin_forum');
    require_once $sourcedir . '/Subs-Package.php';
    // Use the Packages template... no reason to separate.
    loadLanguage('Packages');
    loadTemplate('Packages', 'admin');
    $context['page_title'] = $txt['package'];
    // Here is a list of all the potentially valid actions.
    $subActions = array('servers' => 'PackageServers', 'add' => 'PackageServerAdd', 'browse' => 'PackageGBrowse', 'download' => 'PackageDownload', 'remove' => 'PackageServerRemove', 'upload' => 'PackageUpload');
    // Now let's decide where we are taking this...
    if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
        $context['sub_action'] = $_REQUEST['sa'];
    } elseif (isset($_GET['pgdownload'])) {
        $context['sub_action'] = 'download';
    } else {
        $context['sub_action'] = 'servers';
    }
    // We need to force the "Download" tab as selected.
    $context['menu_data_' . $context['admin_menu_id']]['current_subsection'] = 'packageget';
    // Now create the tabs for the template.
    $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['package_manager'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array(), 'packageget' => array('description' => $txt['download_packages_desc']), 'installed' => array('description' => $txt['installed_packages_desc']), 'perms' => array('description' => $txt['package_file_perms_desc']), 'options' => array('description' => $txt['package_install_options_ftp_why'])));
    $subActions[$context['sub_action']]();
}
开发者ID:Kheros,项目名称:MMOver,代码行数:25,代码来源:PackageGet.php


示例12: file_source

/**
* file_source()
*
* - initialises all the basic context required for the database cleanup.
* - passes execution onto the relevant section.
* - if the passed action is not found it shows the main page.
*
* @return
*/
function file_source()
{
    global $smcFunc, $context, $table_prefix, $version;
    // You have to be allowed to do this
    isAllowedTo('admin_forum');
    // SMF 1 or 2 ?
    if (isset($smcFunc)) {
        db_extend('packages');
        $version = 2;
        $table_prefix = '{db_prefix}';
    } else {
        db_compat();
        $version = 1;
        $table_prefix = '';
    }
    $actions = array('examine' => 'examine', 'execute' => 'execute');
    $titles = array('examine' => 'Examine Database', 'execute' => 'Execute Changes');
    // Set a default action if none or an unsupported one is given
    if (!isset($_GET['action']) || !isset($actions[$_GET['action']])) {
        $current_action = 'examine';
    } else {
        $current_action = $actions[$_GET['action']];
    }
    // Set up the template information and language
    loadtext();
    $context['sub_template'] = $current_action;
    $context['page_title'] = $titles[$current_action];
    $context['page_title_html_safe'] = $titles[$current_action];
    $context['robot_no_index'] = true;
    $context['html_headers'] .= '
	<style type="text/css">
		.normallist li
		{
			list-style: circle;
			line-height: 1.5em;
		}
		.submit_button
		{
			text-align: center;
		}
		.error
		{
			background-color: #FFECEC;
		}
		.success
		{
			color: #00CC00;
		}
		.fail
		{
			color: #EE0000;
		}
	</style>';
    $current_action();
}
开发者ID:rhodefey,项目名称:tools,代码行数:64,代码来源:databasecleanup.php


示例13: action_stats

 /**
  * Display some useful/interesting board statistics.
  *
  * What it does:
  * - Gets all the statistics in order and puts them in.
  * - Uses the Stats template and language file. (and main sub template.)
  * - Requires the view_stats permission.
  * - Accessed from ?action=stats.
  *
  * @uses Stats language file
  * @uses Stats template, statistics sub template
  */
 public function action_stats()
 {
     global $txt, $scripturl, $modSettings, $context;
     // You have to be able to see these
     isAllowedTo('view_stats');
     // Page disabled - redirect them out
     if (empty($modSettings['trackStats'])) {
         fatal_lang_error('feature_disabled', true);
     }
     if (!empty($_REQUEST['expand'])) {
         $context['robot_no_index'] = true;
         $month = (int) substr($_REQUEST['expand'], 4);
         $year = (int) substr($_REQUEST['expand'], 0, 4);
         if ($year > 1900 && $year < 2200 && $month >= 1 && $month <= 12) {
             $_SESSION['expanded_stats'][$year][] = $month;
         }
     } elseif (!empty($_REQUEST['collapse'])) {
         $context['robot_no_index'] = true;
         $month = (int) substr($_REQUEST['collapse'], 4);
         $year = (int) substr($_REQUEST['collapse'], 0, 4);
         if (!empty($_SESSION['expanded_stats'][$year])) {
             $_SESSION['expanded_stats'][$year] = array_diff($_SESSION['expanded_stats'][$year], array($month));
         }
     }
     // Just a lil' help from our friend :P
     require_once SUBSDIR . '/Stats.subs.php';
     // Handle the XMLHttpRequest.
     if (isset($_REQUEST['xml'])) {
         // Collapsing stats only needs adjustments of the session variables.
         if (!empty($_REQUEST['collapse'])) {
             obExit(false);
         }
         $context['sub_template'] = 'stats';
         getDailyStats('YEAR(date) = {int:year} AND MONTH(date) = {int:month}', array('year' => $year, 'month' => $month));
         $context['yearly'][$year]['months'][$month]['date'] = array('month' => sprintf('%02d', $month), 'year' => $year);
         return;
     }
     // Stats it is
     loadLanguage('Stats');
     loadTemplate('Stats');
     loadJavascriptFile('stats.js');
     // Build the link tree......
     $context['linktree'][] = array('url' => $scripturl . '?action=stats', 'name' => $txt['stats_center']);
     // Prepare some things for the template page
     $context['page_title'] = $context['forum_name'] . ' - ' . $txt['stats_center'];
     $context['sub_template'] = 'statistics';
     // These are the templates that will be used to render the statistics
     $context['statistics_callbacks'] = array('general_statistics', 'top_statistics');
     // Call each area of statics to load our friend $context
     $this->loadGeneralStatistics();
     $this->loadTopStatistics();
     $this->loadMontlyActivity();
     // Custom stats (just add a template_layer or another callback to add it to the page!)
     call_integration_hook('integrate_forum_stats');
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:67,代码来源:Stats.controller.php


示例14: Staff

function Staff()
{
    global $context, $mbname, $txt;
    //Check if the current user can view the staff list
    isAllowedTo('view_stafflist');
    loadtemplate('Staff');
    //Load the main staff template
    $context['sub_template'] = 'main';
    //Set the page title
    $context['page_title'] = $mbname . ' - ' . $txt['smfstaff_stafflist'];
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:11,代码来源:Staff.php


示例15: RepairBoards

function RepairBoards()
{
    global $txt, $scripturl, $db_connection, $context, $sourcedir;
    global $salvageCatID, $salvageBoardID, $smcFunc, $errorTests;
    isAllowedTo('admin_forum');
    // Try secure more memory.
    @ini_set('memory_limit', '128M');
    // Print out the top of the webpage.
    $context['page_title'] = $txt['admin_repair'];
    $context['sub_template'] = 'repair_boards';
    $context[$context['admin_menu_name']]['current_subsection'] = 'general';
    // Load the language file.
    loadLanguage('ManageMaintenance');
    // Make sure the tabs stay nice.
    $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['maintain_title'], 'help' => '', 'description' => $txt['maintain_info'], 'tabs' => array());
    // Start displaying errors without fixing them.
    if (isset($_GET['fixErrors'])) {
        checkSession('get');
    }
    // Will want this.
    loadForumTests();
    // Giant if/else. The first displays the forum errors if a variable is not set and asks
    // if you would like to continue, the other fixes the errors.
    if (!isset($_GET['fixErrors'])) {
        $context['error_search'] = true;
        $context['repair_errors'] = array();
        $context['to_fix'] = findForumErrors();
        if (!empty($context['to_fix'])) {
            $_SESSION['repairboards_to_fix'] = $context['to_fix'];
            $_SESSION['repairboards_to_fix2'] = null;
            if (empty($context['repair_errors'])) {
                $context['repair_errors'][] = '???';
            }
        }
    } else {
        $context['error_search'] = false;
        $context['to_fix'] = isset($_SESSION['repairboards_to_fix']) ? $_SESSION['repairboards_to_fix'] : array();
        require_once $sourcedir . '/Subs-Boards.php';
        // Get the MySQL version for future reference.
        $mysql_version = $smcFunc['db_server_info']($db_connection);
        // Actually do the fix.
        findForumErrors(true);
        // Note that we've changed everything possible ;)
        updateSettings(array('settings_updated' => time()));
        updateStats('message');
        updateStats('topic');
        updateSettings(array('calendar_updated' => time()));
        if (!empty($salvageBoardID)) {
            $context['redirect_to_recount'] = true;
        }
        $_SESSION['repairboards_to_fix'] = null;
        $_SESSION['repairboards_to_fix2'] = null;
    }
}
开发者ID:Kheros,项目名称:MMOver,代码行数:54,代码来源:RepairBoards.php


示例16: SaveNote

function SaveNote()
{
    global $db_prefix;
    //Check if they are allowed to admin forum.
    isAllowedTo('admin_forum');
    //Make the html safe if used so it does not mess up the page
    $anotes = htmlspecialchars($_POST['txtnotes'], ENT_QUOTES);
    //Insert the admin notes into the database
    db_query("REPLACE INTO {$db_prefix}settings\n\t\t\t(variable, value)\n\t\tVALUES ('adminnotes','{$anotes}')", __FILE__, __LINE__);
    //Redirect to the main admin page to see the changed notes
    redirectexit('action=admin');
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:12,代码来源:Notepad.php


示例17: pre_dispatch

 /**
  * Set up the context for the announce topic function (action=announce).
  * This function is called before the flow is redirected to action_selectgroup() or action_send().
  *
  * checks the topic announcement permissions and loads the announcement template.
  * requires the announce_topic permission.
  * uses the Announce template and Post language file.
  */
 public function pre_dispatch()
 {
     global $context, $txt, $topic;
     isAllowedTo('announce_topic');
     validateSession();
     if (empty($topic)) {
         fatal_lang_error('topic_gone', false);
     }
     loadLanguage('Post');
     loadTemplate('Announce');
     $context['page_title'] = $txt['announce_topic'];
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:20,代码来源:Announce.controller.php


示例18: SaveNote

function SaveNote()
{
    global $smcFunc;
    // Check if they are allowed to admin forum.
    isAllowedTo('admin_forum');
    // Make the html safe if used so it does not mess up the page
    $anotes = htmlspecialchars($_POST['txtnotes'], ENT_QUOTES);
    // Insert the admin notes into the database
    updateSettings(array('adminnotes' => $anotes));
    // Redirect to the main admin page to see the changed notes
    redirectexit('action=admin');
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:12,代码来源:Notepad2.php


示例19: ViewMembers

/**
 * The main entrance point for the Manage Members screen.
 * As everyone else, it calls a function based on the given sub-action.
 * Called by ?action=admin;area=viewmembers.
 * Requires the moderate_forum permission.
 *
 * @uses ManageMembers template
 * @uses ManageMembers language file.
 */
function ViewMembers()
{
    global $txt, $scripturl, $context, $modSettings, $smcFunc;
    $subActions = array('all' => array('ViewMemberlist', 'moderate_forum'), 'approve' => array('AdminApprove', 'moderate_forum'), 'browse' => array('MembersAwaitingActivation', 'moderate_forum'), 'search' => array('SearchMembers', 'moderate_forum'), 'query' => array('ViewMemberlist', 'moderate_forum'));
    call_integration_hook('integrate_manage_members', array(&$subActions));
    // Default to sub action 'index' or 'settings' depending on permissions.
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'all';
    // We know the sub action, now we know what you're allowed to do.
    isAllowedTo($subActions[$_REQUEST['sa']][1]);
    // Load the essentials.
    loadLanguage('ManageMembers');
    loadTemplate('ManageMembers');
    // Get counts on every type of activation - for sections and filtering alike.
    $request = $smcFunc['db_query']('', '
		SELECT COUNT(*) AS total_members, is_activated
		FROM {db_prefix}members
		WHERE is_activated != {int:is_activated}
		GROUP BY is_activated', array('is_activated' => 1));
    $context['activation_numbers'] = array();
    $context['awaiting_activation'] = 0;
    $context['awaiting_approval'] = 0;
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        $context['activation_numbers'][$row['is_activated']] = $row['total_members'];
    }
    $smcFunc['db_free_result']($request);
    foreach ($context['activation_numbers'] as $activation_type => $total_members) {
        if (in_array($activation_type, array(0, 2))) {
            $context['awaiting_activation'] += $total_members;
        } elseif (in_array($activation_type, array(3, 4, 5))) {
            $context['awaiting_approval'] += $total_members;
        }
    }
    // For the page header... do we show activation?
    $context['show_activate'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 || !empty($context['awaiting_activation']);
    // What about approval?
    $context['show_approve'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 || !empty($context['awaiting_approval']) || !empty($modSettings['approveAccountDeletion']);
    // Setup the admin tabs.
    $context[$context['admin_menu_name']]['tab_data'] = array('title' => $txt['admin_members'], 'help' => 'view_members', 'description' => $txt['admin_members_list'], 'tabs' => array());
    $context['tabs'] = array('viewmembers' => array('label' => $txt['view_all_members'], 'description' => $txt['admin_members_list'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=all', 'is_selected' => $_REQUEST['sa'] == 'all'), 'search' => array('label' => $txt['mlist_search'], 'description' => $txt['admin_members_list'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=search', 'is_selected' => $_REQUEST['sa'] == 'search' || $_REQUEST['sa'] == 'query'), 'approve' => array('label' => sprintf($txt['admin_browse_awaiting_approval'], $context['awaiting_approval']), 'description' => $txt['admin_browse_approve_desc'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=approve', 'is_selected' => false), 'activate' => array('label' => sprintf($txt['admin_browse_awaiting_activate'], $context['awaiting_activation']), 'description' => $txt['admin_browse_activate_desc'], 'url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=activate', 'is_selected' => false, 'is_last' => true));
    // Sort out the tabs for the ones which may not exist!
    if (!$context['show_activate'] && ($_REQUEST['sa'] != 'browse' || $_REQUEST['type'] != 'activate')) {
        $context['tabs']['approve']['is_last'] = true;
        unset($context['tabs']['activate']);
    }
    if (!$context['show_approve'] && ($_REQUEST['sa'] != 'browse' || $_REQUEST['type'] != 'approve')) {
        if (!$context['show_activate'] &&am 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP isArchive函数代码示例发布时间:2022-05-15
下一篇:
PHP isAksi函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap