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


PHP admin_securityChecks函数代码示例

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


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

示例1: define

<?php

define('OFFSET_PATH', 3);
require_once "../../admin-globals.php";
require_once SERVERPATH . '/' . ZENFOLDER . '/template-functions.php';
admin_securityChecks(ALBUM_RIGHTS, currentRelativeURL());
function unpublishSubalbums($album)
{
    global $_zp_gallery;
    $albums = $album->getAlbums();
    foreach ($albums as $albumname) {
        $subalbum = newAlbum($albumname);
        $subalbum->setShow(false);
        $subalbum->save();
        unpublishSubalbums($subalbum);
    }
}
$report = false;
$publish_albums_list = array();
$publish_images_list = array();
if (isset($_POST['set_defaults'])) {
    XSRFdefender('publishContent');
    $_zp_gallery->setAlbumPublish((int) isset($_POST['album_default']));
    $_zp_gallery->setImagePublish((int) isset($_POST['image_default']));
    $_zp_gallery->save();
    $report = 'defaults';
} else {
    if (isset($_POST['publish'])) {
        $action = sanitize($_POST['publish']);
        unset($_POST['publish']);
        XSRFdefender('publishContent');
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:31,代码来源:publishContent.php

示例2: define

<?php

/**
 * Bulk enable/disable of plugins
 * @package core
 */
// force UTF-8 Ø
define('OFFSET_PATH', 3);
require_once dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))) . "/zp-core/admin-globals.php";
admin_securityChecks(ADMIN_RIGHTS, $return = currentRelativeURL());
XSRFdefender('pluginEnabler');
if (isset($_GET['pluginsRemember'])) {
    setOption('pluginEnabler_currentset', serialize(array_keys(getEnabledPlugins())));
    $report = gettext('Current enabled plugins remembered');
}
if (isset($_GET['pluginsEnable'])) {
    $paths = getPluginFiles('*.php');
    $pluginlist = array_keys($paths);
    switch ($setting = sanitize_numeric($_GET['pluginsEnable'])) {
        case 0:
            $report = gettext('Plugins disabled');
            break;
        case 1:
            $report = gettext('Zenphoto plugins enabled');
            break;
        case 2:
            $report = gettext('Remembered plugins enabled');
            $savedlist = getSerializedArray(getOption('pluginEnabler_currentset'));
            break;
        case 3:
            $report = gettext('All plugins enabled');
开发者ID:benuri,项目名称:DevTools,代码行数:31,代码来源:handler.php

示例3: define

<?php

define('OFFSET_PATH', 3);
require_once dirname(dirname(__FILE__)) . '/admin-functions.php';
$_zp_loggedin = NULL;
if (isset($_POST['auth'])) {
    $hash = sanitize($_POST['auth']);
    $id = sanitize($_POST['id']);
    $_zp_loggedin = $_zp_authority->checkAuthorization($hash, $id);
}
admin_securityChecks(UPLOAD_RIGHTS, $return = currentRelativeURL(__FILE__));
if (!empty($_FILES)) {
    $gallery = new Gallery();
    $name = trim(basename(sanitize($_FILES['file']['name'], 3)));
    if (isset($_FILES['Filedata']['error']) && $_FILES['file']['error']) {
        $error = $_FILES['Filedata']['error'];
        debugLogArray('Uploadify error:', $_FILES);
        trigger_error(sprintf(gettext('Uploadify error on %1$s. Review your debug log.'), $name));
    } else {
        $tempFile = sanitize($_FILES['file']['tmp_name'], 3);
        $folder = trim(sanitize($_POST['http_folder'], 3));
        if (substr($folder, 0, 1) == '/') {
            $folder = substr($folder, 1);
        }
        if (substr($folder, 0, 1) == '/') {
            $folder = substr($folder, 1);
        }
        if (substr($folder, -1) == '/') {
            $folder = substr($folder, 0, -1);
        }
        $folder = zp_apply_filter('admin_upload_process', $folder);
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:uploader.php

示例4: define

 * zenpage admin-edit.php
 *
 * @author Malte Müller (acrylian)
 * @package plugins
 * @subpackage zenpage
 */
define("OFFSET_PATH", 4);
require_once dirname(dirname(dirname(__FILE__))) . '/admin-globals.php';
require_once "admin-functions.php";
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/tag_suggest.php';
if (is_AdminEditPage('page')) {
    $rights = ZENPAGE_PAGES_RIGHTS;
} else {
    $rights = ZENPAGE_NEWS_RIGHTS;
}
admin_securityChecks($rights, currentRelativeURL());
updatePublished('news');
updatePublished('pages');
$saveitem = '';
$reports = array();
if (is_AdminEditPage('page')) {
    $_GET['tab'] = $tab = 'pages';
    $new = 'newPage';
    $update = 'updatePage';
} else {
    if (is_AdminEditPage('newsarticle')) {
        $_GET['tab'] = $tab = 'news';
        $new = 'newArticle';
        $update = 'updateArticle';
    } else {
        if (is_AdminEditPage('newscategory')) {
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-edit.php

示例5: define

<?php

/**
 */
define('OFFSET_PATH', 1);
require_once dirname(__FILE__) . '/admin-globals.php';
admin_securityChecks(FILES_RIGHTS, currentRelativeURL(__FILE__));
printAdminHeader('upload', 'files');
echo "\n</head>";
?>

<body>

<?php 
printLogoAndLinks();
?>
<div id="main">
	<?php 
printTabs();
?>
	<div id="content">
		<div id="container">
			<?php 
$subtab = printSubtabs();
?>
			<div class="tabbox">
				<?php 
zp_apply_filter('admin_note', 'upload', $subtab);
?>
				<h1><?php 
echo gettext('File Manager');
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:admin-filemanager.php

示例6: define

<?php

// force UTF-8 Ø
define('OFFSET_PATH', 3);
require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/admin-globals.php";
admin_securityChecks(ZENPAGE_PAGES_RIGHTS | ZENPAGE_NEWS_RIGHTS, '');
if (extensionEnabled('zenpage')) {
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . "/zenpage/zenpage-template-functions.php";
}
header('Last-Modified: ' . ZP_LAST_MODIFIED);
header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
?>
<!-- tinyZenpage - A TinyMCE plugin for Zenphoto with Zenpage
		 Version: 1.4.6
		 Author: Malte Müller (acrylian), Stephen Billard (sbillard)
		 inspired by Alessandro "Simbul" Morandi's  ZenphotoPress (http://simbul.bzaar.net/zenphotopress)
		 License: GPL v2 or later http://www.gnu.org/licenses/gpl.html -->
<!DOCTYPE html>
<html>
	<head>
		<title>tinyZenpage</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<script type="text/javascript" src="<?php 
echo WEBPATH . '/' . ZENFOLDER;
?>
/js/htmlencoder.js"></script>
		<script type="text/javascript" src="<?php 
echo WEBPATH . '/' . ZENFOLDER;
?>
/js/jquery.js"></script>
开发者ID:rb26,项目名称:zenphoto,代码行数:30,代码来源:tinyzenpage.php

示例7: define

<?php

/**
 * provides the Comments tab of admin
 * @package admin
 */
// force UTF-8 Ø
define('OFFSET_PATH', 1);
require_once '../../admin-globals.php';
admin_securityChecks(COMMENT_RIGHTS, currentRelativeURL());
if (isset($_GET['page'])) {
    $page = sanitize($_GET['page']);
} else {
    $page = '';
}
if (isset($_GET['fulltext']) && $_GET['fulltext']) {
    $fulltext = true;
} else {
    $fulltext = false;
}
if (isset($_GET['viewall'])) {
    $viewall = true;
} else {
    $viewall = false;
}
/* handle posts */
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case "spam":
            XSRFdefender('comment_update');
            $comment = new Comment(sanitize_numeric($_GET['id']));
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-comments.php

示例8: define

<?php

/**
 * provides the Options tab of admin
 * @package admin
 */
// force UTF-8 Ø
define('OFFSET_PATH', 1);
require_once dirname(__FILE__) . '/admin-globals.php';
require_once SERVERPATH . '/' . ZENFOLDER . '/functions-config.php';
admin_securityChecks(OPTIONS_RIGHTS, currentRelativeURL());
define('PLUGINS_PER_PAGE', max(1, getOption('plugins_per_page')));
if (isset($_GET['subpage'])) {
    $subpage = sanitize_numeric($_GET['subpage']);
} else {
    if (isset($_POST['subpage'])) {
        $subpage = sanitize_numeric($_POST['subpage']);
    } else {
        $subpage = 0;
    }
}
if (!isset($_GET['page'])) {
    if (array_key_exists('options', $zenphoto_tabs)) {
        $_GET['page'] = 'options';
    } else {
        $_GET['page'] = 'users';
        // must be a user with no options rights
    }
}
$_current_tab = sanitize($_GET['page'], 3);
/* handle posts */
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:31,代码来源:admin-options.php

示例9: define

<?php

/**
 * Use this utility to reset your album thumbnails to either "random" or from an ordered field query
 *
 * @package admin
 */
define('OFFSET_PATH', 3);
require_once dirname(dirname(__FILE__)) . '/admin-globals.php';
require_once dirname(dirname(__FILE__)) . '/template-functions.php';
$buttonlist[] = array('category' => gettext('Database'), 'enable' => true, 'button_text' => gettext('Reset album thumbs'), 'formname' => 'reset_albumthumbs.php', 'action' => 'utilities/reset_albumthumbs.php', 'icon' => 'images/reset.png', 'title' => gettext('Reset album thumbnails to either random or most recent'), 'alt' => '', 'hidden' => '', 'rights' => MANAGE_ALL_ALBUM_RIGHTS | ADMIN_RIGHTS);
admin_securityChecks(MANAGE_ALL_ALBUM_RIGHTS, $return = currentRelativeURL());
if (isset($_REQUEST['thumbtype']) || isset($_REQUEST['thumbselector'])) {
    XSRFdefender('reset_thumbs');
}
$buffer = '';
$webpath = WEBPATH . '/' . ZENFOLDER . '/';
$zenphoto_tabs['overview']['subtabs'] = array(gettext('Thumbs') => '');
printAdminHeader('overview', 'thumbs');
echo '</head>';
?>

<body>
	<?php 
printLogoAndLinks();
?>
	<div id="main">
		<?php 
printTabs();
?>
		<div id="content">
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:reset_albumthumbs.php

示例10: define

/**
 * zenpage admin-edit.php
 *
 * @author Malte Müller (acrylian)
 * @package plugins
 * @subpackage zenpage
 */
define("OFFSET_PATH", 4);
require_once dirname(dirname(dirname(__FILE__))) . '/admin-globals.php';
require_once "zenpage-admin-functions.php";
if (is_AdminEditPage('newsarticle')) {
    $rights = ZENPAGE_NEWS_RIGHTS;
} else {
    $rights = ZENPAGE_PAGES_RIGHTS;
}
admin_securityChecks($rights, currentRelativeURL(__FILE__));
$saveitem = '';
$reports = array();
if (is_AdminEditPage('page')) {
    $tab = 'pages';
    if (isset($_GET['titlelink'])) {
        $result = new ZenpagePage(urldecode($_GET['titlelink']));
    } else {
        if (isset($_GET['update'])) {
            XSRFdefender('update');
            $result = updatePage($reports);
            if (getCheckboxState('copy_delete_object')) {
                switch (sanitize($_POST['copy_delete_object'])) {
                    case 'copy':
                        $as = trim(sanitize(sanitize($_POST['copy_object_as'])));
                        if (empty($as)) {
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:admin-edit.php

示例11: define

<?php

/**
 * This template is used to generate cache images. Running it will process the entire gallery,
 * supplying an album name (ex: loadAlbums.php?album=newalbum) will only process the album named.
 * Passing clear=on will purge the designated cache before generating cache images
 * @package plugins
 */
// force UTF-8 Ø
define('OFFSET_PATH', 3);
require_once "../../admin-globals.php";
require_once SERVERPATH . '/' . ZENFOLDER . '/template-functions.php';
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/cacheManager/functions.php';
admin_securityChecks(NULL, $return = currentRelativeURL());
XSRFdefender('cacheDBImages');
$zenphoto_tabs['overview']['subtabs'] = array(gettext('Cache images') => PLUGIN_FOLDER . '/cacheManager/cacheImages.php?page=overview&tab=images', gettext('Cache stored images') => PLUGIN_FOLDER . '/cacheManager/cacheDBImages.php?page=overview&tab=DB&XSRFToken=' . getXSRFToken('cacheDBImages'));
printAdminHeader('overview', 'DB');
echo "\n</head>";
echo "\n<body>";
printLogoAndLinks();
echo "\n" . '<div id="main">';
printTabs();
echo "\n" . '<div id="content">';
printSubtabs('Cache');
?>
<div class="tabbox">
	<?php 
zp_apply_filter('admin_note', 'cache', '');
?>
	<p class="notebox">
		<?php 
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:cacheDBImages.php

示例12: define

<?php

/**
 * provides the Upload tab of admin
 *
 * @author Stephen Billard (sbillard)
 *
 * @package admin
 */
// force UTF-8 Ø
define('OFFSET_PATH', 1);
require_once dirname(__FILE__) . '/admin-globals.php';
admin_securityChecks(UPLOAD_RIGHTS | FILES_RIGHTS, $return = currentRelativeURL());
if (isset($_GET['page'])) {
    $page = sanitize($_GET['page']);
} else {
    $link = $zenphoto_tabs['upload']['link'];
    if (strpos($link, 'admin-upload.php') == false) {
        header('location: ' . $link);
        exitZP();
    }
    $page = "upload";
    $_GET['page'] = 'upload';
}
if (isset($_GET['type'])) {
    $uploadtype = sanitize($_GET['tab']);
    zp_setCookie('uploadtype', $uploadtype);
} else {
    $uploadtype = zp_getcookie('uploadtype');
    $_GET['tab'] = $uploadtype;
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-upload.php

示例13: define

<?php

/**
 * ZenPhoto20 object paster for tinyMCE
 *
 * @author Stephen Billard (sbillard)
 *
 * Copyright 2014 by Stephen L Billard for use in {@link https://github.com/ZenPhoto20/ZenPhoto20 ZenPhoto20}
 *
 */
// force UTF-8 Ø
define('OFFSET_PATH', 3);
require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/admin-globals.php";
admin_securityChecks(ALBUM_RIGHTS | ZENPAGE_PAGES_RIGHTS | ZENPAGE_NEWS_RIGHTS, NULL);
header('Last-Modified: ' . ZP_LAST_MODIFIED);
header('Content-Type: text/html; charset=' . LOCAL_CHARSET);
function getIPSizedImage($size, $image)
{
    $wmt = getWatermarkParam($image, WATERMARK_IMAGE);
    $args = getImageParameters(array($size, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $wmt), $image->album->name);
    return getImageProcessorURI($args, $image->album->name, $image->filename);
}
?>
<!DOCTYPE html>
<html>
	<head>
		<?php 
printStandardMeta();
?>
		<title>tinyMCE:obj</title>
		<script type="text/javascript" src="<?php 
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:pasteobj.php

示例14: define

<?php

/**
 * Theme file editor
 *
 * @package admin
 * @author Ozh
 */
// force UTF-8 Ø
define('OFFSET_PATH', 1);
require_once dirname(dirname(dirname(__FILE__))) . '/admin-globals.php';
admin_securityChecks(THEMES_RIGHTS, currentRelativeURL());
if (!isset($_GET['theme'])) {
    header("Location: " . FULLWEBPATH . "/" . ZENFOLDER . "/admin-themes.php");
    exitZP();
}
$ok_extensions = array('css', 'php', 'js', 'txt', 'inc');
function isTextFile($file)
{
    global $ok_extensions;
    $ext = strtolower(getSuffix($file));
    return in_array($ext, $ok_extensions);
}
$messages = $file_to_edit = $file_content = null;
$what = 'edit';
$themes = $_zp_gallery->getThemes();
$theme = basename(sanitize($_GET['theme']));
$themedir = SERVERPATH . '/themes/' . internalToFilesystem($theme);
$themefiles = listDirectoryFiles($themedir);
$themefiles_to_ext = array();
if (themeIsEditable($theme)) {
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:themes-editor.php

示例15: define

 * This plugin shows statistical graphs and info about your gallery\'s images and albums
 *
 * @package admin
 */
define('OFFSET_PATH', 3);
chdir(dirname(dirname(__FILE__)));
require_once dirname(dirname(__FILE__)) . '/admin-globals.php';
require_once dirname(dirname(__FILE__)) . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
if (getOption('zp_plugin_zenpage')) {
    require_once dirname(dirname(__FILE__)) . '/' . PLUGIN_FOLDER . '/zenpage/zenpage-admin-functions.php';
}
$button_text = gettext('Gallery Statistics');
$button_hint = gettext('Shows statistical graphs and info about your gallery\'s images and albums.');
$button_icon = 'images/bar_graph.png';
$button_rights = OVERVIEW_RIGHTS;
admin_securityChecks(OVERVIEW_RIGHTS, currentRelativeURL(__FILE__));
$gallery = new Gallery();
$gallery->garbageCollect();
$webpath = WEBPATH . '/' . ZENFOLDER . '/';
printAdminHeader(gettext('utilities'), gettext('statistics'));
?>
<link rel="stylesheet" href="../admin-statistics.css" type="text/css" media="screen" />
<?php 
/*
 * http://php.net/manual/de/function.filesize.php
 *
 * @author Jonas Sweden
*/
function gallerystats_filesize_r($path)
{
    if (!file_exists($path)) {
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:gallery_statistics.php


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