本文整理汇总了PHP中Redirect::page方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::page方法的具体用法?PHP Redirect::page怎么用?PHP Redirect::page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::page方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deletePage
function deletePage($key)
{
global $dbPages;
global $Language;
if ($dbPages->delete($key)) {
Alert::set($Language->g('The page has been deleted successfully'));
Redirect::page('admin', 'manage-pages');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the page.');
}
}
示例2: addPage
function addPage($args)
{
global $dbPages;
global $Language;
// Add the page.
if ($dbPages->add($args)) {
Alert::set($Language->g('Page added successfully'));
Redirect::page('admin', 'manage-pages');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the page.');
}
}
示例3: deletePost
function deletePost($key)
{
global $dbPosts;
global $Language;
if ($dbPosts->delete($key)) {
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
Alert::set($Language->g('The post has been deleted successfully'));
Redirect::page('admin', 'manage-posts');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the post.');
}
}
示例4: deletePage
function deletePage($key)
{
global $dbPages;
global $Language;
if ($dbPages->delete($key)) {
// Call the plugins after post created.
Theme::plugins('afterPageDelete');
Alert::set($Language->g('The page has been deleted successfully'));
Redirect::page('admin', 'manage-pages');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the page.');
}
}
示例5: addPost
function addPost($args)
{
global $dbPosts;
global $Language;
// Add the page.
if ($dbPosts->add($args)) {
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
Alert::set($Language->g('Post added successfully'));
Redirect::page('admin', 'manage-posts');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the post.');
}
return false;
}
示例6: addPage
function addPage($args)
{
global $dbPages;
global $Language;
// Add the page, if the $key is FALSE the creation of the post failure.
$key = $dbPages->add($args);
if ($key) {
// Call the plugins after page created.
Theme::plugins('afterPageCreate');
// Alert the user
Alert::set($Language->g('Page added successfully'));
Redirect::page('admin', 'manage-pages');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the page.');
}
}
示例7: addPost
function addPost($args)
{
global $dbPosts;
global $Language;
// Page status, published or draft.
if (isset($args['publish'])) {
$args['status'] = "published";
} else {
$args['status'] = "draft";
}
// Add the page.
if ($dbPosts->add($args)) {
Alert::set($Language->g('Post added successfully'));
Redirect::page('admin', 'manage-posts');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the post.');
}
}
示例8: addPost
function addPost($args)
{
global $dbPosts;
global $Language;
// Add the page, if the $key is FALSE the creation of the post failure.
$key = $dbPosts->add($args);
if ($key) {
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
// Call the plugins after post created.
Theme::plugins('afterPostCreate');
// Alert for the user
Alert::set($Language->g('Post added successfully'));
Redirect::page('admin', 'manage-posts');
} else {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the post.');
}
return false;
}
示例9: checkGet
function checkGet($args)
{
global $Security;
global $Language;
global $Login;
if ($Security->isBlocked()) {
Alert::set($Language->g('IP address has been blocked') . '<br>' . $Language->g('Try again in a few minutes'));
return false;
}
// Verify User sanitize the input
if ($Login->verifyUserByToken($args['username'], $args['tokenEmail'])) {
// Renew the tokenCRFS. This token will be the same inside the session for multiple forms.
$Security->generateToken();
Redirect::page('admin', 'dashboard');
return true;
}
// Bruteforce protection, add IP to blacklist.
$Security->addLoginFail();
return false;
}
示例10: restore
public function restore($file)
{
global $Language;
// get the absolute path to $file
$serveur = pluginBackup::full_path();
// redirection
$zip = new ZipArchive();
$res = $zip->open($file);
$removeDir = pluginBackup::removeDir(PATH_CONTENT);
if ($res === TRUE) {
$removeDir;
// Y ESO PARA QUE?
if (!is_dir(PATH_CONTENT) && (!@mkdir(PATH_CONTENT) || !@chmod(PATH_CONTENT, 0777))) {
}
// extract it to the path we determined above
$zip->extractTo(PATH_CONTENT);
$zip->close();
Alert::set($Language->get("Archive is restored!"));
Redirect::page('admin', 'configure-plugin/pluginBackup');
} else {
Alert::set($Language->get("There was a problem to restore the ZIP archive"));
Redirect::page('admin', 'configure-plugin/pluginBackup');
}
}
示例11: defined
<?php
defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
if ($Login->role() !== 'admin') {
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
// ============================================================================
// Main after POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
$themes = buildThemes();
示例12: unset
// ============================================================================
// POST Method
// ============================================================================
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Prevent editors to administrate other users.
if ($Login->role() !== 'admin') {
$_POST['username'] = $Login->username();
unset($_POST['role']);
}
if (isset($_POST['delete-user-all'])) {
deleteUser($_POST, true);
} elseif (isset($_POST['delete-user-associate'])) {
deleteUser($_POST, false);
} elseif (!empty($_POST['new-password']) && !empty($_POST['confirm-password'])) {
setPassword($_POST['username'], $_POST['new-password'], $_POST['confirm-password']);
} else {
editUser($_POST);
}
}
// ============================================================================
// Main after POST
// ============================================================================
if ($Login->role() !== 'admin') {
$layout['parameters'] = $Login->username();
}
$_user = $dbUsers->getDb($layout['parameters']);
// If the user doesn't exist, redirect to the users list.
if ($_user === false) {
Redirect::page('admin', 'users');
}
$_user['username'] = $layout['parameters'];
示例13: foreach
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
$_Plugin = false;
$pluginClassName = $layout['parameters'];
foreach ($plugins['all'] as $P) {
if ($P->className() == $pluginClassName) {
$_Plugin = $P;
}
}
// Check if the plugin exists.
if ($_Plugin === false) {
Redirect::page('admin', 'plugins');
}
// Check if the plugin has the method form()
if (!method_exists($_Plugin, 'form')) {
Redirect::page('admin', 'plugins');
}
// ============================================================================
// POST Method
// ============================================================================
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$_Plugin->setDb($_POST);
Alert::set($Language->g('the-changes-have-been-saved'));
}
// ============================================================================
// Main after POST
// ============================================================================
示例14: defined
<?php
defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Variables
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$token = isset($_POST['token']) ? Sanitize::html($_POST['token']) : false;
if (!$Security->validateToken($token)) {
Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying validate the token. Token ID: ' . $token);
// Destroy the session.
Session::destroy();
// Redirect to login panel.
Redirect::page('admin', 'login');
} else {
unset($_POST['token']);
}
}
// ============================================================================
// Main after POST
// ============================================================================
示例15: write_shortcode
public function write_shortcode()
{
global $Language;
# Shortcode file Path
$shortcodeFile = dirname(__FILE__) . DS . 'shortcodes.php';
$shortcodes = isset($_POST['shortcodes']) ? $_POST['shortcodes'] : '';
# Write in file
file_put_contents($shortcodeFile, $shortcodes);
# Write finish :)
Alert::set($Language->get("Shortcodes updated!"));
Redirect::page('admin', 'configure-plugin/pluginShorcode');
}