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


PHP force_authentication函数代码示例

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


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

示例1: sendannouncement_showpage

function sendannouncement_showpage()
{
    // Method for identifying modules rather than pagename
    define('modulename', 'send_announcement');
    // $main_smarty->assign('modulename', modulename);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 0) {
        header("Location: " . my_base_url . my_pligg_base);
        die;
    }
    global $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    // breadcrumbs
    $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
    $navwhere['link1'] = getmyurl('admin', '');
    $navwhere['text2'] = "Send Announcement";
    $main_smarty->assign('navbar_where', $navwhere);
    $main_smarty->assign('posttitle', "Send Annoucement");
    // breadcrumbs
    $main_smarty->assign('tpl_center', send_announcement_tpl_path . 'sendannouncement');
    $main_smarty->display($the_template . '/pligg.tpl');
}
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:29,代码来源:send_announcement_main.php

示例2: hello_world_showpage

function hello_world_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        define('pagename', 'hello_world');
        $main_smarty->assign('pagename', pagename);
        // Method for identifying modules rather than pagename
        define('modulename', 'hello_world');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(hello_world_tpl_path . '/blank.tpl');
        $navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_hello_world_BreadCrumb');
        $navwhere['link2'] = URL_hello_world;
        $navwhere['text3'] = '';
        $navwhere['link3'] = '';
        $navwhere['text4'] = '';
        $navwhere['link4'] = '';
        $main_smarty = do_sidebar($main_smarty);
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', hello_world_tpl_path . 'hello_world_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:30,代码来源:hello_world_main.php

示例3: multibox_admin_showpage

function multibox_admin_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        define('pagename', 'multibox_admin');
        $main_smarty->assign('pagename', pagename);
        define('modulename', 'multibox_admin');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(multibox_admin_tpl_path . '/blank.tpl');
        $main_smarty = do_sidebar($main_smarty);
        $sql = "SELECT * FROM " . table_totals;
        $results = $db->get_results($sql);
        $main_smarty->assign('results', object_2_array($results));
        if (isset($_REQUEST['action'])) {
            $main_smarty->assign('action', $_REQUEST['action']);
            totals_regenerate();
            $sql = "SELECT * FROM " . table_totals;
            $results = $db->get_results($sql);
            $main_smarty->assign('new_results', object_2_array($results));
        }
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', multibox_admin_tpl_path . 'multibox_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        echo "Page Forbidden";
    }
}
开发者ID:pantofla,项目名称:waterfan,代码行数:33,代码来源:multibox_admin_main.php

示例4: captcha_showpage

function captcha_showpage()
{
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        global $main_smarty, $the_template;
        $navwhere['text1'] = 'Captcha';
        $navwhere['link1'] = URL_captcha;
        define('pagename', 'captcha');
        $main_smarty->assign('pagename', pagename);
        // New method for identifying modules rather than pagename
        define('modulename', 'captcha');
        $main_smarty->assign('modulename', modulename);
        $main_smarty = do_sidebar($main_smarty, $navwhere);
        if (isset($_REQUEST['action'])) {
            $action = $_REQUEST['action'];
        } else {
            $action = '';
        }
        if ($action == 'enable') {
            if (isset($_REQUEST['captcha'])) {
                $captcha = $_REQUEST['captcha'];
            } else {
                $captcha = '';
            }
            enable_captcha($captcha);
        }
        if ($action == 'configure') {
            if (isset($_REQUEST['captcha'])) {
                $captcha = $_REQUEST['captcha'];
            } else {
                $captcha = '';
            }
            include_once captcha_captchas_path . '/' . $captcha . '/main.php';
            captcha_configure();
            $main_smarty->assign('tpl_center', captcha_tpl_path . '../captchas/' . $captcha . '/captcha_configure');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
            die;
        }
        if ($action == 'EnableReg') {
            $value = isset($_REQUEST['value']) ? $_REQUEST['value'] : '';
            if ($value != '') {
                misc_data_update('captcha_reg_en', $value);
            }
            header('Location: ' . URL_captcha);
        }
        $captcha = get_misc_data('captcha_method');
        if ($captcha == '') {
            $captcha = 'recaptcha';
        }
        $main_smarty->assign('captcha_method', $captcha);
        $main_smarty->assign('tpl_center', captcha_tpl_path . '/captcha_home');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    }
}
开发者ID:pantofla,项目名称:waterfan,代码行数:56,代码来源:captcha_main.php

示例5: karma_showpage

function karma_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('karma_submit_story', sanitize($_REQUEST['karma_submit_story'], 3));
            misc_data_update('karma_submit_comment', sanitize($_REQUEST['karma_submit_comment'], 3));
            misc_data_update('karma_story_publish', sanitize($_REQUEST['karma_story_publish'], 3));
            misc_data_update('karma_story_vote', sanitize($_REQUEST['karma_story_vote'], 3));
            misc_data_update('karma_story_unvote', sanitize($_REQUEST['karma_story_vote_remove'], 3));
            misc_data_update('karma_comment_vote', sanitize($_REQUEST['karma_comment_vote'], 3));
            misc_data_update('karma_story_discard', sanitize($_REQUEST['karma_story_discard'], 3));
            misc_data_update('karma_story_spam', sanitize($_REQUEST['karma_story_spam'], 3));
            misc_data_update('karma_comment_delete', sanitize($_REQUEST['karma_comment_delete'], 3));
            if ($_REQUEST['karma_username'] && $_REQUEST['karma_value'] != 0) {
                $db->query($sql = "UPDATE " . table_users . " SET user_karma=user_karma+'" . $db->escape($_REQUEST['karma_value']) . "' WHERE user_login='" . $db->escape($_REQUEST['karma_username']) . "'");
                if (!$db->rows_affected) {
                    $error = "Wrong username " . sanitize($_REQUEST['karma_username'], 1);
                }
            }
            $main_smarty->assign('error', $error);
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Karma";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=karma";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'karma');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modify_karma');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '"', get_karma_settings()));
        $main_smarty->assign('tpl_center', karma_tpl_path . 'karma_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:51,代码来源:karma_main.php

示例6: close_comments_showpage

function close_comments_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $close_comment_method = trim($_REQUEST['close_comment_method']);
            $close_comment_time = trim($_REQUEST['close_comment_time']);
            if ($close_comment_method == 'time') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } elseif ($close_comment_method == 'manual') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } elseif ($close_comment_method == 'both') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } else {
                $main_smarty->assign('module_error', "Method POST data did not contain an expected value");
            }
            if (is_numeric($close_comment_time)) {
                misc_data_update('close_comment_time', mysql_real_escape_string($close_comment_time));
            } else {
                $main_smarty->assign('module_error', "Time POST data did not contain a numerical value. Please give the second field a value of 0 or higher.");
            }
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'close_comments');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'close_comments_settings');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', get_close_comments_settings());
        $main_smarty->assign('tpl_center', close_comments_tpl_path . 'close_comments_settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:47,代码来源:close_comments_main.php

示例7: zip_install_preview_admin

function zip_install_preview_admin()
{
    global $main_smarty, $the_template, $db, $my_pligg_base;
    force_authentication();
    $amIgod = 0;
    $amIgod = $amIgod + checklevel('admin');
    if ($amIgod == 1) {
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(zip_install_tpl_path . '/blank.tpl');
        $navwhere['text2'] = 'ZIP Install';
        $navwhere['link2'] = my_pligg_base . '/module.php?module=zip_install';
        $navwhere['text3'] = '';
        $navwhere['link3'] = '';
        $navwhere['text4'] = '';
        $navwhere['link4'] = '';
        $main_smarty = do_sidebar($main_smarty);
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $action = $_REQUEST['action'];
        switch ($action) {
            case "modules":
                $main_smarty->assign('tpl_center', zip_install_tpl_path . 'zip_install_modules');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
            case "templates":
                $main_smarty->assign('tpl_center', zip_install_tpl_path . 'zip_install_templates');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
            case "filemod":
                if (uploadFile(zip_install_absolute_path, $_FILES, "modules")) {
                    redirect(my_pligg_base . '/admin/admin_modules.php?status=uninstalled');
                }
                break;
            case "filetem":
                if (uploadFile(zip_install_absolute_path, $_FILES, "templates")) {
                    redirect(my_pligg_base . '/admin/admin_config.php?page=Template');
                }
                break;
            default:
                $main_smarty->assign('tpl_center', zip_install_tpl_path . 'zip_install');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
        }
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:46,代码来源:zip_install_main.php

示例8: contactable_showpage

function contactable_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $contactable_input = $_REQUEST['contactable_mail'];
            $result = filter_var($contactable_input, FILTER_VALIDATE_EMAIL);
            // Checking if the email is valid. Returns 'false' if not valid.
            if (!$result) {
                // Email is not valid
                $msg = "Error! Your email address does not appear to be valid.";
            } else {
                // Add email address to database field
                misc_data_update('contactable_mail', mysql_real_escape_string($contactable_input));
            }
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'contactable');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_contactable');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('contactable', get_contactable_settings());
        $main_smarty->assign('tpl_center', contactable_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:42,代码来源:contactable_main.php

示例9: spam_trigger_showpage

function spam_trigger_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('spam_trigger_light', sanitize($_REQUEST['spam_light'], 3));
            misc_data_update('spam_trigger_medium', sanitize($_REQUEST['spam_medium'], 3));
            misc_data_update('spam_trigger_hard', sanitize($_REQUEST['spam_hard'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=spam_trigger");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify spam_trigger";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=spam_trigger";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'spam_trigger');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifyspam_trigger');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '"', get_spam_trigger_settings()));
        $main_smarty->assign('places', $spam_trigger_places);
        $main_smarty->assign('tpl_center', spam_trigger_tpl_path . 'spam_trigger_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:40,代码来源:spam_trigger_main.php

示例10: pligg_web_toolbar_showpage

function pligg_web_toolbar_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        define('pagename', 'pligg_web_toolbar');
        $main_smarty->assign('pagename', pagename);
        // Method for identifying modules rather than pagename
        define('modulename', 'pligg_web_toolbar');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_pligg_web_toolbar_BreadCrumb');
        $navwhere['link2'] = URL_pligg_web_toolbar;
        $navwhere['text3'] = '';
        $navwhere['link3'] = '';
        $navwhere['text4'] = '';
        $navwhere['link4'] = '';
        if (isset($_REQUEST['action'])) {
            $action = $_REQUEST['action'];
        } else {
            $action = '';
        }
        if ($action == 'enable') {
            enable_pligg_web_toolbar();
        }
        if ($action == 'disable') {
            disable_pligg_web_toolbar();
        }
        $main_smarty = do_sidebar($main_smarty);
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', pligg_web_toolbar_tpl_path . 'pligg_web_toolbar_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:40,代码来源:pligg_web_toolbar_main.php

示例11: analytics_showpage

function analytics_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $analytics_input = substr($_REQUEST['analytics_id'], 0, 14);
            // Shorten input to 14 characters (max length of Analytics IDs)
            if (strlen($analytics_input) > '14') {
                $msg = "Error! The value entered was more than 14 characters in length. Please try again.";
            }
            misc_data_update('analytics_id', mysql_real_escape_string($analytics_input));
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'analytics');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_analytics');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('settings', get_analytics_settings());
        $main_smarty->assign('tpl_center', analytics_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:38,代码来源:analytics_main.php

示例12: links_showpage

function links_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            misc_data_update('links_comments', sanitize($_REQUEST['links_comments'], 3));
            misc_data_update('links_stories', sanitize($_REQUEST['links_stories'], 3));
            misc_data_update('links_nofollow', sanitize($_REQUEST['links_nofollow'], 3));
            misc_data_update('links_host', sanitize($_REQUEST['links_host'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=links");
            die;
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'links');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifylinks');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', links_settings());
        $main_smarty->assign('tpl_center', links_tpl_path . 'links_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:36,代码来源:links_main.php

示例13: rss_import_showpage

function rss_import_showpage()
{
    global $main_smarty, $the_template, $db;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    require_once 'class.rssimport.php';
    require_once 'modules/rss_import/magpierss/rss_fetch.inc';
    define('MAGPIE_CACHE_DIR', 'cache/templates_c/');
    define('rss_import_export_version', '0.4');
    $smarty = $main_smarty;
    include_once mnminclude . 'qeip_0_3.php';
    force_authentication();
    $amIgod = 0;
    $amIgod = $amIgod + checklevel('god');
    // pagename
    define('modulename', 'rss_import');
    $main_smarty->assign('modulename', modulename);
    // breadcrumbs and page title
    $navwhere['text1'] = $smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
    $navwhere['link1'] = getmyurl('admin', '');
    $navwhere['text2'] = $smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport');
    $smarty->assign('navbar_where', $navwhere);
    $smarty->assign('posttitle', ' / ' . $smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_RSSImport'));
    // sidebar
    $main_smarty = do_sidebar($main_smarty);
    if ($amIgod == 1) {
        $tableexists = checkfortable(table_prefix . 'feeds');
        if (!$tableexists) {
            echo "Creating Tables<hr />";
            include_once 'create_feed_tables.php';
            die("<hr />If there are no errors then refresh this page to continue");
        }
        $filename = 'create_feed_tables.php';
        if (file_exists($filename)) {
            // die("Please delete or rename the file create_feed_tables.php, then refresh this page");
        }
        $smarty->register_function('feedsListFeeds', 'smarty_function_feedsListFeeds');
        $smarty->register_function('feedsListFeedLinks', 'smarty_function_feedsListFeedLinks');
        $smarty->register_function('feedsListFeedFields', 'smarty_function_feedsListFeedFields');
        $smarty->register_function('feedsListPliggLinkFields', 'smarty_function_feedsListPliggLinkFields');
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_name', 'key' => 'feed_id');
        // a unique identifier for the row
        $smarty->assign('qeip_FeedName', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_url', 'key' => 'feed_id');
        // a unique identifier for the row
        $smarty->assign('qeip_FeedURL', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_category', 'key' => 'feed_id');
        // a unique identifier for the row
        $smarty->assign('qeip_FeedCategory', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_freq_hours', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedFreqHours', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_votes', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedVotes', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_item_limit', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedItemLimit', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_url_dupe', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedURLDupe', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_title_dupe', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedTitleDupe', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_submitter', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedSubmitter', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feed_link', 'field_name' => 'feed_field', 'key' => 'feed_link_id', 'eip_type' => 'select');
        // the type of EIP field to show
        $smarty->assign('qeip_FeedLink_FeedField', $QEIPA);
        $QEIPA = array('table_name' => table_prefix . 'feed_link', 'field_name' => 'pligg_field', 'key' => 'feed_link_id', 'eip_type' => 'select');
        // the type of EIP field to show
        $smarty->assign('qeip_FeedLink_PliggField', $QEIPA);
        // feed oldest first
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_last_item_first', 'key' => 'feed_id');
        // a unique identifier for the row
        $smarty->assign('qeip_FeedLastItemFirst', $QEIPA);
        // feed random vote
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_random_vote_enable', 'key' => 'feed_id');
        // a unique identifier for the row
        $smarty->assign('qeip_FeedRandomVoteEnable', $QEIPA);
        // feed random vote min
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_random_vote_min', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedRandomVotesMin', $QEIPA);
        // feed random vote max
        $QEIPA = array('table_name' => table_prefix . 'feeds', 'field_name' => 'feed_random_vote_max', 'key' => 'feed_id', 'field_type' => 'number');
        // the type of database field we are reading from / writing to
        $smarty->assign('qeip_FeedRandomVotesMax', $QEIPA);
        $QEIP = new QuickEIP();
        if (!isset($_REQUEST['action'])) {
            $smarty->assign('tpl_center', rss_import_tpl_path . 'admin_rss_center');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
            echo $QEIP->ShowOnloadJS();
        } else {
            if ($_REQUEST['action'] == "addnewfieldlink") {
                $RSSImport = new RSSImport();
//.........这里部分代码省略.........
开发者ID:pantofla,项目名称:geez,代码行数:101,代码来源:rss_import_main.php

示例14: upload_showpage

function upload_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('upload_thumb', sanitize($_REQUEST['upload_thumb'], 3));
            $sizes = unserialize(get_misc_data('upload_sizes'));
            for ($i = 0; $i < sizeof($sizes); $i++) {
                if (@in_array($sizes[$i], $_POST['delsize'])) {
                    if ($_REQUEST['upload_defsize'] == $sizes[$i]) {
                        $_REQUEST['upload_defsize'] = 'orig';
                    }
                    array_splice($sizes, $i--, 1);
                }
            }
            if (is_numeric($_POST['upload_width']) && $_POST['upload_width'] > 0 && is_numeric($_POST['upload_height']) && $_POST['upload_height'] > 0) {
                $size = sanitize($_POST['upload_width'] . 'x' . $_POST['upload_height'], 3);
                if (!@in_array($size, $sizes)) {
                    $sizes[] = $size;
                    $files = $db->get_results($sql = "SELECT a.* FROM " . table_prefix . "files a\n\t\t\t\t\t\t\t\t    LEFT JOIN " . table_prefix . "files b ON a.file_id=b.file_orig_id AND b.file_size='{$size}'\n\t\t\t\t\t\t\t\t    WHERE a.file_size='orig' AND ISNULL(b.file_id)");
                    if ($files) {
                        misc_data_update('upload_sizes', serialize($sizes));
                        misc_data_update('upload_thumb_format', $_REQUEST['upload_thumb_format']);
                        misc_data_update('upload_quality', $_REQUEST['upload_quality'] <= 100 && $_REQUEST['upload_quality'] >= 1 ? $_REQUEST['upload_quality'] : 80);
                        $settings = get_upload_settings();
                        foreach ($files as $file) {
                            generate_thumbs(strpos($file->file_name, 'http') === 0 ? $file->file_name : mnmpath . sanitize($_REQUEST['upload_directory'], 3) . '/' . $file->file_name, $file->file_link_id, $settings, $file->file_id, $size);
                        }
                    }
                }
            }
            $fields = unserialize(base64_decode(get_misc_data('upload_fields')));
            for ($i = 0; $i < sizeof($fields); $i++) {
                if (in_array($fields[$i], $_POST['delfield'])) {
                    array_splice($fields, $i--, 1);
                }
            }
            if ($_POST['upload_new_field']) {
                $fields[] = sanitize($_POST['upload_new_field'], 3);
            }
            if ($_POST['alternate']) {
                foreach ($_POST['alternate'] as $k => $v) {
                    $alternates[$k] = sanitize($v, 3);
                }
            }
            $mandatory = array();
            if ($_POST['mandatory']) {
                foreach ($_POST['mandatory'] as $k => $v) {
                    $mandatory[$k] = sanitize($v, 3);
                }
            }
            $display = array();
            if ($_POST['display']) {
                foreach ($_POST['display'] as $k => $v) {
                    $display[$k] = sanitize($v, 3);
                }
            }
            misc_data_update('upload_sizes', serialize($sizes));
            misc_data_update('upload_fields', base64_encode(serialize($fields)));
            misc_data_update('upload_alternates', base64_encode(serialize($alternates)));
            misc_data_update('upload_mandatory', serialize($mandatory));
            misc_data_update('upload_display', serialize($display));
            misc_data_update('upload_place', sanitize($_REQUEST['upload_place'], 3));
            misc_data_update('upload_defsize', sanitize($_REQUEST['upload_defsize'], 3));
            misc_data_update('upload_external', sanitize($_REQUEST['upload_external'], 3));
            misc_data_update('upload_format', $_REQUEST['upload_format']);
            misc_data_update('upload_pre_format', $_REQUEST['upload_pre_format']);
            misc_data_update('upload_post_format', $_REQUEST['upload_post_format']);
            misc_data_update('upload_thumb_format', $_REQUEST['upload_thumb_format']);
            misc_data_update('upload_t_pre_format', $_REQUEST['upload_thumb_pre_format']);
            misc_data_update('upload_t_post_format', $_REQUEST['upload_thumb_post_format']);
            misc_data_update('upload_allow_hide', sanitize($_REQUEST['upload_allow_hide'], 3));
            misc_data_update('upload_quality', $_REQUEST['upload_quality'] <= 100 && $_REQUEST['upload_quality'] >= 1 ? $_REQUEST['upload_quality'] : 80);
            misc_data_update('upload_link', sanitize($_REQUEST['upload_link'], 3));
            misc_data_update('upload_directory', sanitize($_REQUEST['upload_directory'], 3));
            misc_data_update('upload_thdirectory', sanitize($_REQUEST['upload_thdirectory'], 3));
            misc_data_update('upload_filesize', sanitize($_REQUEST['upload_filesize'], 3));
            misc_data_update('upload_maxnumber', sanitize($_REQUEST['upload_maxnumber'], 3));
            misc_data_update('upload_extensions', sanitize($_REQUEST['upload_extensions'], 3));
            misc_data_update('upload_fileplace', sanitize($_REQUEST['upload_fileplace'], 3));
            misc_data_update('upload_allow_comment', sanitize($_REQUEST['upload_allow_comment'], 3));
            misc_data_update('upload_commentplace', sanitize($_REQUEST['upload_commentplace'], 3));
            misc_data_update('upload_cfilelist', sanitize($_REQUEST['upload_commentfilelist'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=upload");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Upload";
//.........这里部分代码省略.........
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:101,代码来源:upload_main.php

示例15: dropbox_backup_showpage

function dropbox_backup_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save Settings
        if ($_POST['submit']) {
            misc_data_update('dropbox_backup_email', sanitize($_REQUEST['dropbox_backup_email'], 3));
            /*
            misc_data_update('dropbox_backup_save', sanitize($_REQUEST['dropbox_backup_save'], 3));
            $dropbox_backup_save=escapeshellcmd(get_misc_data('dropbox_backup_save'));
            if ($dropbox_backup_save == "Yes"){
            	misc_data_update('dropbox_backup_pass', sanitize($_REQUEST['dropbox_backup_pass'], 3));
            } else {
            	misc_data_update('dropbox_backup_pass', '');
            }
            */
            misc_data_update('dropbox_backup_dir', sanitize($_REQUEST['dropbox_backup_dir'], 3));
            $dropbox_pass = sanitize($_REQUEST['dropbox_backup_pass'], 3);
            // Current Directory
            $path = "admin/backup/";
            $db_path = "modules/dropbox_backup/backup/";
            // Check if it is Writable
            $backup_permissions = substr(sprintf('%o', fileperms($db_path)), -4);
            if ($backup_permissions !== '0777') {
                $error = 'The directory /' . $db_path . ' is not writable! Set the CHMOD permissions to 777 and try again.';
            } else {
                $files = array();
                $dir = opendir('admin/backup');
                while (($file = readdir($dir)) !== false) {
                    if ($file !== '.' && $file !== '..' && !is_dir($file) && $file !== 'index.htm') {
                        $files[] = $file;
                    }
                }
                closedir($dir);
                sort($files);
                if (count($files) != '0') {
                    /*
                    Copyright (c) 2011 http://ramui.com. All right reserved.
                    This product is protected by copyright and distributed under licenses restricting copying, distribution. Permission is granted to the public to download and use this script provided that this Notice and any statement of authorship are reproduced in every page on all copies of the script.
                    */
                    class recurseZip
                    {
                        private function recurse_zip($src, &$zip, $path)
                        {
                            $dir = opendir($src);
                            while (false !== ($file = readdir($dir))) {
                                if ($file != '.' && $file != '..') {
                                    if (is_dir($src . '/' . $file)) {
                                        $this->recurse_zip($src . '/' . $file, $zip, $path);
                                    } else {
                                        $zip->addFile($src . '/' . $file, substr($src . '/' . $file, $path));
                                    }
                                }
                            }
                            closedir($dir);
                        }
                        public function compress($src, $dst = '')
                        {
                            if (substr($src, -1) === '/') {
                                $src = substr($src, 0, -1);
                            }
                            if (substr($dst, -1) === '/') {
                                $dst = substr($dst, 0, -1);
                            }
                            $path = strlen(dirname($src) . '/');
                            $rand = substr(md5(microtime()), rand(0, 26), 5);
                            $zipname = 'Pligg' . "_" . date("Y-m-d_H-i-s") . '_' . $rand . '.zip';
                            $dst = empty($dst) ? $zipname : $dst . '/' . $zipname;
                            @unlink($dst);
                            $zip = new ZipArchive();
                            $res = $zip->open($dst, ZipArchive::CREATE);
                            if ($res !== TRUE) {
                                $status = 'error';
                                $message = 'Error: Unable to create zip file';
                            }
                            if (is_file($src)) {
                                $zip->addFile($src, substr($src, $path));
                            } else {
                                if (!is_dir($src)) {
                                    $zip->close();
                                    @unlink($dst);
                                    $status = 'error';
                                    $message = 'Error: File not found';
                                }
                                $this->recurse_zip($src, $zip, $path);
                            }
                            $zip->close();
                            return $dst;
                        }
                    }
                    //Source file or directory to be compressed.
//.........这里部分代码省略.........
开发者ID:hyrmedia,项目名称:modules,代码行数:101,代码来源:dropbox_backup_main.php


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