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


PHP General::redirect方法代码示例

本文整理汇总了PHP中General::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP General::redirect方法的具体用法?PHP General::redirect怎么用?PHP General::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在General的用法示例。


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

示例1: __grab

 function __grab($action, $redirect_on_error = true)
 {
     $domain = str_replace("http://", '', URL);
     $mandatory_fields = array("_a" => strtoupper($action), "_b" => $this->_parent->getConfigVar("build", "symphony"), "_DOMAIN" => $domain);
     foreach ($mandatory_fields as $key => $val) {
         $d[] = $key . "=" . urlencode($val);
     }
     $mandatory_fields = implode("&", $d);
     if (trim($this->_postfields) != "") {
         $mandatory_fields .= "&" . ltrim($this->_postfields, '&');
     }
     $this->setopt("POSTFIELDS", $mandatory_fields);
     $data = $this->exec();
     $this->flush();
     if ($data === false && $redirect_on_error) {
         General::redirect(URL . "/symphony/?page=/system/message/");
     }
     return $data;
 }
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:19,代码来源:class.account.php

示例2: intval

            @chmod($dest, intval($Admin->getConfigVar("write_mode", "file"), 8));
            ###
            # Delegate: Upload
            # Description: File successfully uploaded. Path to it is provided.
            $CampfireManager->notifyMembers('Upload', CURRENTPAGE, array('file' => $dest));
            General::redirect($Admin->getCurrentPageURL() . "&_f=upload-success&filter=" . str_replace("workspace", "", $_POST['destination']));
            ##Moving Failed
        } else {
            General::redirect($Admin->getCurrentPageURL() . "&_f=upload-fail&filter=" . $_REQUEST['filter']);
        }
        ##Could not move the file
    } else {
        General::redirect($Admin->getCurrentPageURL() . "&_f=upload-fail&filter=" . $_REQUEST['filter']);
    }
}
$checked = @array_keys($_POST['items']);
switch ($_POST["with-selected"]) {
    case 'delete':
        ###
        # Delegate: Delete
        # Description: Prior to deletion of files. Array of files selected is provided. This can be manipulated.
        $CampfireManager->notifyMembers('Delete', CURRENTPAGE, array('files' => &$checked));
        foreach ($checked as $f) {
            if (!preg_match('/\\/workspace\\//i', $f)) {
                break;
            }
            @unlink($f);
        }
        General::redirect($Admin->getCurrentPageURL() . "&_f=deleted&filter=" . $_REQUEST['filter']);
        break;
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_filemanager.php

示例3: intval

                    $fields['validator'] = intval($fields['validator']);
                    $fields['validation_rule'] = NULL;
                }
                if ($fields['type'] == 'checkbox') {
                    $fields['default_state'] = isset($fields['default_state']) ? 'checked' : 'unchecked';
                } else {
                    $fields['default_state'] = 'na';
                }
                include_once TOOLKIT . "/class.customfieldmanager.php";
                $CustomFieldManager = new CustomFieldManager($Admin);
                $CustomField =& $CustomFieldManager->create();
                $CustomField->set('id', $field_id);
                foreach ($fields as $key => $val) {
                    $CustomField->set($key, $val);
                }
                if ($CustomField->commit()) {
                    $Admin->rebuildWorkspaceConfig();
                    $Admin->flush_cache(array("entries", "customfields"));
                    ###
                    # Delegate: Edit
                    # Description: After editing a customfield. ID is provided.
                    $CampfireManager->notifyMembers('Edit', CURRENTPAGE, array('customfield_id' => $field_id));
                    if (@array_key_exists("save", $_POST['action'])) {
                        General::redirect($Admin->getCurrentPageURL() . "&id=" . $field_id . "&_f=saved");
                    }
                    General::redirect(URL . "/symphony/?page=/structure/customfields/");
                }
            }
        }
    }
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_structure_customfields_edit.php

示例4: array

<?php

/***
 *
 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
if (!@is_file(WORKSPACE . "/masters/" . $_REQUEST['file'] . ".xsl")) {
    General::redirect(URL . "/symphony/?page=/blueprint/masters/new/");
}
$Admin->addScriptToHead('assets/editor.js');
$GLOBALS['pageTitle'] = 'Masters > ' . $_REQUEST['file'];
$fields = array();
$sql = "SELECT t1.*, t2.* " . "FROM `tbl_masters` as t1 " . "LEFT JOIN `tbl_metadata` as t2 ON t2.relation_id = t1.id AND t2.class = 'master' " . "WHERE t1.name = '" . $_REQUEST['file'] . "' " . "GROUP BY t1.id " . "LIMIT 1";
$fields = $DB->fetchRow(0, $sql);
$fields["name"] = $_REQUEST['file'];
$fields["body"] = @file_get_contents(WORKSPACE . "/masters/" . $_REQUEST['file'] . ".xsl");
$fields['data_sources'] = @explode(",", $fields['data_sources']);
$fields['events'] = @explode(",", $fields['events']);
$utilities = $DB->fetch("SELECT DISTINCT t1.*\n\t\t\t\t\t\t\t FROM `tbl_utilities` as t1\n\t\t\t\t\t\t\t LEFT JOIN `tbl_utilities2datasources` as t2 ON t1.id = t2.utility_id\n\t\t\t\t\t\t\t LEFT JOIN `tbl_utilities2events` as t3 ON t1.id = t3.utility_id\n\t\t\t\t\t\t\t WHERE (t2.`data_source` IS NULL AND t3.`event` IS NULL)\n\t\t\t\t\t\t\t OR (t2.`data_source` IN ('" . @implode("', '", $fields['data_sources']) . "')\n\t\t\t\t\t\t\t OR t3.`event` IN ('" . @implode("', '", $fields['events']) . "'))");
$date = $Admin->getDateObj();
if (defined("__SYM_ENTRY_MISSINGFIELDS__")) {
    $Admin->pageAlert("required", array(@implode(", ", $required)), false, 'error');
}
if (isset($_GET['_f'])) {
    switch ($_GET['_f']) {
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_masters_edit.php

示例5: array

if (isset($_POST['action']['uninstall'])) {
    $service = $_REQUEST['name'];
    ###
    # Delegate: Uninstall
    # Description: Triggered prior to any uninstallation. Array of selected services is provided.
    #              This cannot be modified.
    $CampfireManager->notifyMembers('Uninstall', CURRENTPAGE, array('service' => $service));
    list($owner, $name) = explode('/', $service);
    $CampfireManager->uninstall($name, $owner);
    General::redirect(URL . '/symphony/?page=/campfire/&_f=complete-uninstall');
} elseif (isset($_POST['action']['install'])) {
    $service = $_REQUEST['name'];
    ###
    # Delegate: Install
    # Description: Notifies of installing a Campfire services. service name is provided.
    #              This cannot be modified.
    $CampfireManager->notifyMembers('Install', CURRENTPAGE, array('service' => $service));
    list($owner, $name) = explode('/', $service);
    $CampfireManager->install($name, $owner);
    General::redirect(URL . '/symphony/?page=/campfire/&_f=complete-install');
} elseif (isset($_POST['action']['update'])) {
    $service = $_REQUEST['name'];
    ###
    # Delegate: Update
    # Description: Notifies of updating a Campfire services. service name is provided.
    #              This cannot be modified.
    $CampfireManager->notifyMembers('Update', CURRENTPAGE, array('service' => $service));
    list($owner, $name) = explode('/', $service);
    $CampfireManager->update($name, $owner);
    General::redirect(URL . '/symphony/?page=/campfire/&_f=complete-update');
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_campfire_info.php

示例6: die

 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
if (!is_file('../manifest/config.php')) {
    die("<h2>Error</h2><p>Symphony Engine could not be loaded.</p>");
}
require_once '../manifest/config.php';
//Fix for double login problem
$url_bits = parse_url(URL);
if ($_SERVER['HTTP_HOST'] != $url_bits['host'] && $_SERVER['HTTP_HOST'] != $url_bits['host'] . ':' . $url_bits['port']) {
    General::redirect(URL . "/symphony/?" . $_SERVER['QUERY_STRING']);
    exit;
}
require_once LIBRARY . "/class.admin.php";
$Admin =& new Admin(array("start_session" => true, "config" => $settings));
$Admin->addHeaderToPage("Content-Type", "text/html; charset=UTF-8");
$dbDriver = $Admin->getConfigVar("driver", "database");
if (!class_exists($dbDriver)) {
    $dbDriver = "MySQL";
}
$DB = new $dbDriver($Admin->getConfigVar("database"));
if (!$DB->isConnected()) {
    $Admin->fatalError(NULL, "<p>There was a problem establishing a connection to the MySQL server. Check that the details in your configuration file <code>/manifest/config.php</code> are correct.</p>", true, true);
}
if (!$DB->getSelected()) {
    $Admin->fatalError(NULL, "<p>There was a problem establishing a connection to the specified database. Check that the details in your configuration file <code>/manifest/config.php</code> are correct.</p>", true, true);
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:index.php

示例7: isset

            $fields['author_column'] = isset($fields['author_column']) ? 'show' : 'hide';
            $fields['date_column'] = isset($fields['date_column']) ? 'show' : 'hide';
            $fields['calendar_show'] = isset($fields['calendar_show']) ? 'show' : 'hide';
            #$fields['valid_xml_column'] = (isset($fields['valid_xml_column']) ? 'show' : 'hide');
            $fields['columns'][$current_primary_field] = 'on';
            $visable = @array_keys($fields['columns']);
            if (isset($fields['columns'])) {
                unset($fields['columns']);
            }
            if ($DB->update($fields, "tbl_sections", "WHERE `id` = '" . $section_id . "'")) {
                $DB->query("DELETE FROM `tbl_sections_visible_columns` WHERE `section_id` = '{$section_id}'");
                if (is_array($visable) && !empty($visable)) {
                    foreach ($visable as $v) {
                        $DB->query("INSERT INTO `tbl_sections_visible_columns` VALUES ('{$v}', '{$section_id}')");
                    }
                }
                $Admin->updateMetadata("section", $section_id);
                $Admin->rebuildWorkspaceConfig();
                $Admin->flush_cache(array("entries", "comments"));
                ###
                # Delegate: Edit
                # Description: After editing a Section. The ID is provided.
                $CampfireManager->notifyMembers('Edit', CURRENTPAGE, array('section_id' => $section_id));
                if (@array_key_exists("save", $_POST['action'])) {
                    General::redirect($Admin->getCurrentPageURL() . "&id=" . $section_id . "&_f=saved");
                }
                General::redirect(URL . "/symphony/?page=/structure/sections/");
            }
        }
    }
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_structure_sections_edit.php

示例8:

<?php

/***
 *
 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
if ($Admin->authorIsLoggedIn()) {
    General::redirect(URL . "/symphony/");
}
switch ($_GET['_f']) {
    case "error":
        $error = "Login invalid. <a href=\"" . URL . "/symphony/?page=/login/&amp;forgot\">Forgot your password?</a>";
        break;
}
if ((isset($_REQUEST['forgot']) || $_f == "forgot") && $_f != "newpass") {
    ?>

	<form action="<?php 
    print $Admin->getCurrentPageURL();
    ?>
" method="post">
  	<h2><span>Symphony &ndash; Email Login Details</span></h2>
		<fieldset>
			<?php 
    if (isset($error)) {
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_login.php

示例9: array

                        # Delegate: Edit
                        # Description: After saving the page. The Page's database ID is provided.
                        $CampfireManager->notifyMembers('Edit', CURRENTPAGE, array('page_id' => $page_id));
                        if (@array_key_exists("output", $_POST['action'])) {
                            General::redirect(URL . "/" . $Admin->resolvePagePath($page_id) . "/?debug");
                        }
                        if (@array_key_exists("save", $_POST['action'])) {
                            General::redirect($Admin->getCurrentPageURL() . "&id={$page_id}&_f=saved");
                        }
                        General::redirect(URL . "/symphony/?page=/blueprint/pages/&id={$page_id}&_f=saved");
                    }
                }
            }
        }
    }
}
if (@array_key_exists("delete", $_POST['action'])) {
    $page_id = $_REQUEST['id'];
    ###
    # Delegate: Delete
    # Description: Prior to deletion. Provided with Page's database ID
    $CampfireManager->notifyMembers('Delete', CURRENTPAGE, array('page' => $page_id));
    $page = $DB->fetchRow(0, "SELECT * FROM tbl_pages WHERE `id` = '{$page_id}'");
    $DB->delete("tbl_pages", "WHERE `id` = '{$page_id}'");
    $DB->delete("tbl_pages_hierarchy", "WHERE `entry_id` = '{$page_id}'");
    $DB->delete("tbl_metadata", "WHERE `relation_id` = '{$page_id}' AND `class` = 'page'");
    $DB->query("UPDATE tbl_pages SET `sortorder` = (`sortorder` + 1) WHERE `sortorder` < '{$page_id}'");
    unlink(WORKSPACE . "/pages/" . $page['handle'] . ".xsl");
    $Admin->flush_cache(array("pages"));
    General::redirect(URL . "/symphony/?page=/blueprint/pages/&_f=deleted");
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_pages_edit.php

示例10: array

/***
 *
 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
$Admin->addScriptToHead('assets/editor.js');
$fields = array();
$dsPath = DATASOURCES . "/data." . $_REQUEST['file'] . ".php";
if (!@is_file($dsPath)) {
    General::redirect(URL . "/symphony/?page=/blueprint/datasources/new/");
}
$sections = $DB->fetch("SELECT * FROM `tbl_sections`");
$xml_fields = array();
##Entries
$xml_fields['entries'] = array("date", "time", "rfc822-date", "pagination-info", "author::first-name", "author::last-name", "author::email", "author::username");
##Authors
$xml_fields['authors'] = array("entry-count", "first-name", "last-name", "email", "username", "status", "auth-token", "email-hash");
##Comments
$xml_fields['comments'] = array("spam", "author", "date", "time", "rfc822-date", "pagination-info", "authorised", "message", "url", "email", "email-hash");
$DSM = new DatasourceManager(array('parent' => &$Admin));
$oDataSource = $DSM->create($_REQUEST['file']);
$about = $oDataSource->about();
$GLOBALS['pageTitle'] = 'Data Sources > ' . $about['name'];
$allow_parse = $oDataSource->allowEditorToParse();
$type = $oDataSource->getType();
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:30,代码来源:sym_blueprint_datasources_edit.php

示例11: elseif

<?php

/***
 *
 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
if (!$Admin->authorIsOwner()) {
    $Admin->fatalError('Access Denied', '<p>Access denied. You are not authorised to access this page.</p>', true, true);
}
if (isset($_POST['action']['sync'])) {
    $retval = $Admin->synchroniseWorkspace();
    General::redirect($Admin->getCurrentPageURL() . '&' . ($retval ? 'sync=complete' : 'sync=failed'));
} elseif (isset($_POST['action']['uninstall'])) {
    $Admin->uninstall();
    $Admin->fatalError('Uninstall Successful', '<p>Any Campfire Services have been left intact, along with the <code>symphony</code> folder, <code>index.php</code> and your database.</p><p>To complete the uninstall you will need to remove the aforementioned items manually.</p>', true);
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:22,代码来源:sym_settings_actions.php

示例12: define

        define("__SYM_ENTRY_MISSINGFIELDS__", true);
    } elseif ($fields['password'] != $fields['password_confirm']) {
        $Admin->pageAlert("password-mismatch", NULL, false, 'error');
    } elseif ($authorManager->fetchByUsername($fields['username'])) {
        $Admin->pageAlert("duplicate", array("An Author", "username"), false, 'error');
    } else {
        $author =& $authorManager->create();
        $author->set('textformat', $fields['textformat']);
        $author->set('superuser', $fields['superuser']);
        $author->set('owner', '0');
        $author->set('email', $fields['email']);
        $author->set('username', $fields['username']);
        $author->set('firstname', General::sanitize($fields['firstname']));
        $author->set('lastname', General::sanitize($fields['lastname']));
        $author->set('last_refresh', NULL);
        $author->set('last_session', NULL);
        $author->set('password', md5($fields['password']));
        $author->set('allow_sections', @implode(",", $fields['allow_sections']));
        $author->set('auth_token_active', $fields['auth_token_active'] ? $fields['auth_token_active'] : 'no');
        if ($author_id = $author->commit()) {
            ###
            # Delegate: Create
            # Description: Creation of a new Author. The ID of the author is provided.
            $CampfireManager->notifyMembers('Create', CURRENTPAGE, array('author_id' => $author_id));
            if (@array_key_exists("save", $_POST['action'])) {
                General::redirect(URL . "/symphony/?page=/settings/authors/edit/&id={$author_id}&_f=saved");
            }
            General::redirect(URL . "/symphony/?page=/settings/authors/&_f=saved");
        }
    }
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_settings_authors_new.php

示例13: array

<?php

/***
 *
 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
$Admin->addScriptToHead('assets/editor.js');
if (!isset($_REQUEST['id'])) {
    General::redirect(URL . "/symphony/?page=/blueprint/utilities/new/");
}
$fields = array();
if (isset($_REQUEST['id'])) {
    $sql = "SELECT t1.*, t2.* " . "FROM `tbl_utilities` as t1 " . "LEFT JOIN `tbl_metadata` as t2 ON t2.relation_id = t1.id AND t2.class = 'transformation' " . "WHERE t1.id = '" . $_REQUEST['id'] . "' " . "GROUP BY t1.id " . "LIMIT 1";
    $fields = $DB->fetchRow(0, $sql);
    $GLOBALS['pageTitle'] = 'Utilities > ' . $fields['name'];
    $fields['data_source'] = $DB->fetchCol('data_source', "SELECT `data_source` FROM `tbl_utilities2datasources` WHERE utility_id = '" . $_REQUEST['id'] . "'");
    $fields['events'] = $DB->fetchCol('event', "SELECT `event` FROM `tbl_utilities2events` WHERE utility_id = '" . $_REQUEST['id'] . "'");
    $fields["body"] = @file_get_contents(WORKSPACE . "/utilities/" . $fields['handle'] . ".xsl");
}
if (defined("__SYM_ENTRY_MISSINGFIELDS__")) {
    $Admin->pageAlert("required", array(@implode(", ", $required)), false, 'error');
}
$date = $Admin->getDateObj();
if (isset($_GET['_f'])) {
    switch ($_GET['_f']) {
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_blueprint_utilities_edit.php

示例14: switch

<?php

/***
 *
 * Symphony web publishing system
 *
 * Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
 *
 * @version 1.7
 * @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
 *
 ***/
if (isset($_POST['action']['apply'])) {
    $checked = @array_keys($_POST['items']);
    if (!empty($checked) && is_array($checked)) {
        switch ($_POST["with-selected"]) {
            case 'delete':
                ###
                # Delegate: Delete
                # Description: Prior to deletion of entries. Section ID and Array of Entries is provided.
                #              The array can be manipulated
                $CampfireManager->notifyMembers('Delete', CURRENTPAGE, array('section_id' => $_REQUEST['_sid'], 'entry_id' => &$checked));
                include_once TOOLKIT . "/class.entrymanager.php";
                $entryManager = new EntryManager($Admin);
                $entryManager->delete($checked);
                $Admin->flush_cache(array("entries", "authors", "comments"));
                General::redirect($Admin->getCurrentPageURL() . "&_sid=" . $_REQUEST['_sid'] . "&_f=complete");
        }
    }
}
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:30,代码来源:sym_publish_section.php

示例15: elseif

    $fields = $_POST['fields'];
} elseif ($author_id) {
    $sql = "SELECT *  " . "FROM `tbl_authors` " . "WHERE `id` = '" . addslashes($_GET['id']) . "' ";
    if ($fields = $DB->fetchRow(0, $sql)) {
        $fields['allow_sections'] = @explode(",", $fields['allow_sections']);
    } else {
        General::redirect(URL . "/symphony/?page=/settings/authors/new/");
    }
} else {
    General::redirect(URL . "/symphony/?page=/settings/authors/new/");
}
if (!$Admin->authorIsOwner() && !($isOwner = $author_id == $Admin->getAuthorID())) {
    if (!$Admin->authorIsSuper()) {
        General::redirect(URL . "/symphony/?page=/settings/authors/summary/&id={$author_id}");
    } elseif ($fields['superuser'] == '1' || $fields['owner'] == '1') {
        General::redirect(URL . "/symphony/?page=/settings/authors/summary/&id={$author_id}");
    }
}
$date = $Admin->getDateObj();
if (isset($_GET['_f'])) {
    switch ($_GET['_f']) {
        case "saved":
            $Admin->pageAlert("saved-time", array("Author profile", date("h:i:sa", $date->get(true, false))));
            break;
    }
}
$GLOBALS['pageTitle'] = 'Authors > ' . $fields['firstname'] . ' ' . $fields['lastname'];
if (defined("__SYM_ENTRY_MISSINGFIELDS__")) {
    $Admin->pageAlert("required", array(@implode(", ", $required)), false, 'error');
}
$TFM = new TextformatterManager(array('parent' => &$Admin));
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_settings_authors_edit.php


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