本文整理汇总了PHP中admin::print_error方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::print_error方法的具体用法?PHP admin::print_error怎么用?PHP admin::print_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::print_error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
* Way Better Content Editing.
* Visit http://wbce.org to learn more and to join the community.
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @copyright WBCE Project (2015-)
* @license GNU GPL2 (or any later version)
*/
// do not display notices and warnings during installation
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
// Setup admin object
require '../../config.php';
$admin = new admin('Addons', 'languages_install', false);
if (!$admin->checkFTAN()) {
$admin->print_header();
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
}
// After check print the header
$admin->print_header();
// Check if user uploaded a file
if (!isset($_FILES['userfile'])) {
header("Location: index.php");
exit(0);
}
// Include the WB functions file
// Create temp string
$temp_string = '';
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double) microtime() * 1000000);
$i = 0;
while ($i <= 7) {
示例2: header
$common_field = 'page_id';
$table = TABLE_PREFIX . 'sections';
} else {
$id = $_GET['page_id'];
$id_field = 'page_id';
$common_field = 'parent';
$table = TABLE_PREFIX . 'pages';
}
} else {
header("Location: index.php");
exit(0);
}
// Create new admin object and print admin header
$admin = new admin('Pages', 'pages_settings');
// Create new order object an reorder
$order = new order($table, 'position', $id_field, $common_field);
if ($id_field == 'page_id') {
if ($order->move_up($id)) {
$admin->print_success($MESSAGE['PAGES_REORDERED']);
} else {
$admin->print_error($MESSAGE['PAGES_CANNOT_REORDER']);
}
} else {
if ($order->move_up($id)) {
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
} else {
$admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
}
}
// Print admin footer
$admin->print_footer();
示例3: Template
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('media_browse.htt')));
$template->set_file('page', 'media_browse.htt');
$template->set_block('page', 'main_block', 'main');
// Get the current dir
$currentHome = $admin->get_home_folder();
$directory = ($currentHome and !array_key_exists('dir', $_GET)) ? $currentHome : $admin->strip_slashes($admin->get_get('dir'));
if ($directory == '/' or $directory == '\\') {
$directory = '';
}
$dir_backlink = 'browse.php?dir=' . $directory;
// Check to see if it contains ../
if (!check_media_path($directory)) {
// $admin->print_header();
$admin->print_error($MESSAGE['MEDIA']['DIR_DOT_DOT_SLASH']);
}
if (!file_exists(WB_PATH . MEDIA_DIRECTORY . $directory)) {
// $admin->print_header();
$admin->print_error($MESSAGE['MEDIA']['DIR_DOES_NOT_EXIST']);
}
// Check to see if the user wanted to go up a directory into the parent folder
if ($admin->get_get('up') == 1) {
$parent_directory = dirname($directory);
header("Location: browse.php?dir={$parent_directory}");
exit(0);
}
if ($_SESSION['GROUP_ID'] != 1 && $pathsettings['global']['admin_only']) {
// Only show admin the settings link
$template->set_var('DISPLAY_SETTINGS', 'hide');
}
示例4: admin
* WebsiteBaker Community Edition (WBCE)
* Way Better Content Editing.
* Visit http://wbce.org to learn more and to join the community.
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @copyright WBCE Project (2015-)
* @license GNU GPL2 (or any later version)
*/
// Setup admin object
require '../../config.php';
// suppress to print the header, so no new FTAN will be set
$admin = new admin('Addons', 'templates_uninstall', false);
if (!$admin->checkFTAN()) {
$admin->print_header();
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
}
// After check print the header
$admin->print_header();
// Check if user selected template
if (!isset($_POST['file']) or $_POST['file'] == "") {
header("Location: index.php");
exit(0);
} else {
$file = $_POST['file'];
}
// Extra protection
if (trim($file) == '') {
header("Location: index.php");
exit(0);
}
示例5: dirname
require dirname(dirname(__DIR__)) . '/config.php';
}
if (!class_exists('admin', false)) {
require WB_PATH . '/framework/class.admin.php';
}
// suppress to print the header, so no new FTAN will be set
if (!$bAdvanced) {
$admin = new admin('Settings', 'settings_basic', false);
} else {
$admin = new admin('Settings', 'settings_advanced', false);
}
// Create a javascript back link
$js_back = ADMIN_URL . '/settings/index.php?advanced=' . $bAdvanced;
if (!$admin->checkFTAN()) {
$admin->print_header();
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back);
}
$admin->print_header();
$TOKENS = unserialize($_SESSION['TOKENS']);
$array = $_POST;
ksort($array);
$aInputs = array();
$aOutputs = array();
$sql = 'SELECT `name`, `value` FROM `' . TABLE_PREFIX . 'settings` ' . 'ORDER BY `name`';
if ($oSettings = $database->query($sql)) {
while ($aSetting = $oSettings->fetchRow(MYSQLI_ASSOC)) {
$aOutputs['_POST'][$aSetting['name']] = $aSetting['value'];
}
}
// After check print the header
// Work-out file mode
示例6: admin
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @copyright WBCE Project (2015-)
* @license GNU GPL2 (or any later version)
*/
// Print admin header
require '../../config.php';
include_once 'resize_img.php';
include_once 'parameters.php';
// require_once(WB_PATH.'/include/pclzip/pclzip.lib.php'); // Required to unzip file.
// suppress to print the header, so no new FTAN will be set
$admin = new admin('Media', 'media_upload', false);
if (!$admin->checkFTAN()) {
$admin->print_header();
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
}
// After check print the header
$admin->print_header();
// Target location
$requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']);
$target = isset(${$requestMethod}['target']) ? ${$requestMethod}['target'] : '';
// Include the WB functions file
$directory = $target == '/' ? '' : $target;
$dirlink = 'index.php?dir=' . $directory;
$rootlink = 'index.php?dir=';
// Check to see if target contains ../
if (!check_media_path($target, false)) {
$admin->print_error($MESSAGE['MEDIA_TARGET_DOT_DOT_SLASH']);
}
// Create relative path of the target location for the file
示例7: admin
}
$admin = new admin('Pages', 'pages_modify', (bool) $admin_header);
// get request method
$requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']);
$aRequestVars = isset(${$requestMethod}) ? ${$requestMethod} : null;
// Get page id (on error page_id == 0))
$page_id = intval(isset(${$requestMethod}['page_id']) ? ${$requestMethod}['page_id'] : (isset($page_id) ? $page_id : 0));
$requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']);
$section_id = intval(isset(${$requestMethod}['section_id']) ? ${$requestMethod}['section_id'] : (isset($section_id) ? $section_id : 0));
$module_dir = basename(dirname($_SERVER["SCRIPT_NAME"]));
// Create js back link
$js_back = ADMIN_URL . '/pages/sections.php?page_id=' . $page_id;
// Get perms
// unset($admin_header);
if (!is_numeric($page_id)) {
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
} elseif ($page_id > 0) {
$page = $admin->get_page_details($page_id, ADMIN_URL . '/pages/index.php');
} else {
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS'], ADMIN_URL);
}
$old_admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
$old_admin_users = explode(',', str_replace('_', '', $page['admin_users']));
$in_group = false;
foreach ($admin->get_groups_id() as $cur_gid) {
if (in_array($cur_gid, $old_admin_groups)) {
$in_group = true;
}
}
if (!$in_group && !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
print $admin->get_group_id() . $admin->get_user_id();
示例8: define
// to show position and section_id
if (!defined('DEBUG')) {
define('DEBUG', $debug);
}
// Create new admin object
require_once LEPTON_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages_modify');
// Check if we are supposed to add or delete a section
if (isset($_GET['section_id']) and is_numeric($_GET['section_id'])) {
// Get more information about this section
$section_id = intval($_GET['section_id']);
$sql = 'SELECT `module` FROM `' . TABLE_PREFIX . 'sections` ';
$sql .= 'WHERE `section_id` =' . $section_id;
$query_section = $database->query($sql);
if ($query_section->numRows() == 0) {
$admin->print_error('Section not found');
}
$section = $query_section->fetchRow(MYSQL_ASSOC);
// Include the modules delete file if it exists
if (file_exists(LEPTON_PATH . '/modules/' . $section['module'] . '/delete.php')) {
require LEPTON_PATH . '/modules/' . $section['module'] . '/delete.php';
}
$sql = 'DELETE FROM `' . TABLE_PREFIX . 'sections` ';
$sql .= 'WHERE `section_id` =' . $section_id . ' LIMIT 1';
$query_section = $database->query($sql);
if ($database->is_error()) {
$admin->print_error($database->get_error());
} else {
require LEPTON_PATH . '/framework/class.order.php';
$order = new order(TABLE_PREFIX . 'sections', 'position', 'section_id', 'page_id');
$order->clean($page_id);
示例9: explode
$sql .= 'WHERE `page_id` = ' . $page_id;
$results = $database->query($sql);
if ($database->is_error()) {
trigger_error($database->get_error(), E_USER_ERROR);
}
$results_array = $results->fetchRow(MYSQL_ASSOC);
$old_admin_groups = explode(',', str_replace('_', '', $results_array['admin_groups']));
$old_admin_users = explode(',', str_replace('_', '', $results_array['admin_users']));
$in_old_group = FALSE;
foreach ($admin->get_groups_id() as $cur_gid) {
if (in_array($cur_gid, $old_admin_groups)) {
$in_old_group = TRUE;
}
}
if (!$in_old_group and !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
}
// Get page module
$sql = 'SELECT `module` FROM `' . TABLE_PREFIX . 'sections` ';
$sql .= 'WHERE `page_id`=' . $page_id . ' AND `section_id`=' . $section_id;
$module = $database->get_one($sql);
if ($database->is_error()) {
trigger_error($database->get_error(), E_USER_ERROR);
}
if (!$module) {
$admin->print_error($database->is_error() ? $database->get_error() : $MESSAGE['PAGES_NOT_FOUND']);
}
// Update the pages table
$now = time();
$sql = 'UPDATE `' . TABLE_PREFIX . 'pages` SET ';
$sql .= '`modified_when` = ' . $now . ', `modified_by` = ' . $admin->get_user_id() . ' ';
示例10: header
<?php
/*
* @version 0.1
* @author Ruud Eisinga (Ruud)
* @date 2009-04-10
*/
require '../../config.php';
// Get id
if (!isset($_GET['slide_id']) or !is_numeric($_GET['slide_id'])) {
header("Location: " . ADMIN_URL . "/pages/index.php");
} else {
$slide_id = $_GET['slide_id'];
}
// Include WB admin wrapper script
require_once WB_PATH . '/framework/class.admin.php';
require_once WB_PATH . '/framework/functions.php';
$admintool_link = ADMIN_URL . '/admintools/index.php';
$module_edit_link = ADMIN_URL . '/admintools/tool.php?tool=capslider';
$admin = new admin('admintools', 'admintools');
$btable = TABLE_PREFIX . 'mod_capslider_slide';
$database->query("DELETE FROM " . $btable . " WHERE id = '{$slide_id}' LIMIT 1");
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error(), WB_URL . '/modules/capslider/modify_slide.php?slide_id=' . $slide_id);
} else {
$admin->print_success($TEXT['SUCCESS'], $module_edit_link);
}
// Print admin footer
$admin->print_footer();
示例11: foreach
foreach ($zip_files as $zip_file => $info) {
if (basename($info['filename']) == 'info.php') {
return '/' . dirname($info['filename']);
}
}
return '';
}
// do not display notices and warnings during installation
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
// Setup admin object
require '../../config.php';
require_once WB_PATH . '/framework/class.admin.php';
$admin = new admin('Addons', 'modules_install', false);
if (!$admin->checkFTAN()) {
$admin->print_header();
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
}
$admin->print_header();
// Check if module folder is writable
if (!is_writable(WB_PATH . '/modules/')) {
if (file_exists($temp_file)) {
unlink($temp_file);
}
// Remove temp file
$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']);
}
// Check if user uploaded a file
if (!isset($_FILES['userfile'])) {
header("Location: index.php");
exit(0);
}
示例12: exit
exit(0);
} else {
$page_id = $_GET['page_id'];
}
require_once LEPTON_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages_delete');
// Include the functions file
require_once LEPTON_PATH . '/framework/summary.functions.php';
// Get perms
$results = $database->query("SELECT admin_groups,admin_users FROM " . TABLE_PREFIX . "pages WHERE page_id = '{$page_id}'");
$results_array = $results->fetchRow();
// Find out more about the page
$query = "SELECT * FROM " . TABLE_PREFIX . "pages WHERE page_id = '{$page_id}'";
$results = $database->query($query);
if ($database->is_error()) {
$admin->print_error($database->get_error());
}
if ($results->numRows() == 0) {
$admin->print_error($MESSAGE['PAGES_NOT_FOUND']);
}
$results_array = $results->fetchRow();
$old_admin_groups = explode(',', str_replace('_', '', $results_array['admin_groups']));
$old_admin_users = explode(',', str_replace('_', '', $results_array['admin_users']));
$in_old_group = FALSE;
foreach ($admin->get_groups_id() as $cur_gid) {
if (in_array($cur_gid, $old_admin_groups)) {
$in_old_group = TRUE;
}
}
if (!$in_old_group and !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
示例13: dirname
* @filesource $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/tags/2.8.3/wb/modules/droplets/save_droplet.php $
* @lastmodified $Date: 2011-08-18 04:18:59 +0200 (Do, 18. Aug 2011) $
*
*/
require dirname(dirname(dirname(__DIR__))) . '/config.php';
if (!class_exists('admin', false)) {
require WB_PATH . '/framework/class.admin.php';
}
// Include WB admin wrapper script
$admintool_link = ADMIN_URL . '/admintools/index.php';
$ToolUrl = ADMIN_URL . '/admintools/tool.php?tool=droplets';
$admin = new admin('admintools', 'admintools', false);
$droplet_id = intval($admin->checkIDKEY('droplet_id', false, 'post'));
if (!$admin->checkFTAN() || !$droplet_id) {
$admin->print_header();
$admin->print_error($droplet_id . ' ) ' . $MESSAGE['GENERIC_SECURITY_ACCESS'], $ToolUrl);
}
$admin->print_header();
// Validate all fields
if ($admin->get_post('title') == '') {
$admin->print_error($MESSAGE['GENERIC_FILL_IN_ALL'] . ' ( Droplet Name )', $ToolUrl);
} else {
$title = $admin->add_slashes($admin->get_post('title'));
$active = (int) $admin->get_post('active');
$admin_view = (int) $admin->get_post('admin_view');
$admin_edit = (int) $admin->get_post('admin_edit');
$show_wysiwyg = (int) $admin->get_post('show_wysiwyg');
$description = $admin->add_slashes($admin->get_post('description'));
$tags = array('<?php', '?>', '<?');
$content = $admin->add_slashes(str_replace($tags, '', $_POST['savecontent']));
$comments = trim($admin->add_slashes($admin->get_post('comments')));
示例14: isset
} else {
$user_id = $_POST['user_id'];
}
// Gather details entered
$groups_id = isset($_POST['groups']) ? implode(",", $_POST['groups']) : '';
$active = addslashes($_POST['active'][0]);
$username_fieldname = str_replace(array("[[", "]]"), '', htmlspecialchars($admin->get_post('username_fieldname'), ENT_QUOTES));
$username = $admin->get_post_escaped($username_fieldname);
$password = $admin->get_post('password');
$password2 = $admin->get_post('password2');
$display_name = str_replace(array("[[", "]]"), '', htmlspecialchars($admin->get_post('display_name'), ENT_QUOTES));
$email = $admin->get_post_escaped('email');
$home_folder = $admin->get_post_escaped('home_folder');
// Check values
if ($groups_id == "") {
$admin->print_error($MESSAGE['USERS_NO_GROUP'], 'index.php');
}
if (strlen($username) < 3) {
$admin->print_error($MESSAGE['USERS_USERNAME_TOO_SHORT'], 'index.php');
}
if (!preg_match('/^[a-z]{1}[a-z0-9@\\._-]{2,}$/i', $username)) {
$admin->print_error($MESSAGE['USERS_NAME_INVALID_CHARS'], 'index.php');
}
if ($password != "" && $password2 != "") {
if (strlen($password) < AUTH_MIN_PASS_LENGTH) {
$admin->print_error($MESSAGE['USERS_PASSWORD_TOO_SHORT'], 'index.php');
}
if ($password != $password2) {
$admin->print_error($MESSAGE['USERS_PASSWORD_MISMATCH'], 'index.php');
}
}
示例15: admin
*
*/
require '../../config.php';
require_once WB_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages');
// Include the WB functions file
require_once WB_PATH . '/framework/functions.php';
// Get page list from database
// $database = new database();
$query = "SELECT * FROM " . TABLE_PREFIX . "pages WHERE visibility = 'deleted' ORDER BY level DESC";
$get_pages = $database->query($query);
// Insert values into main page list
if ($get_pages->numRows() > 0) {
while ($page = $get_pages->fetchRow()) {
// Delete page subs
$sub_pages = get_subs($page['page_id'], array());
foreach ($sub_pages as $sub_page_id) {
delete_page($sub_page_id);
}
// Delete page
delete_page($page['page_id']);
}
}
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error());
} else {
$admin->print_success($TEXT['TRASH_EMPTIED']);
}
// Print admin
$admin->print_footer();