本文整理汇总了PHP中PKPRequest::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP PKPRequest::redirect方法的具体用法?PHP PKPRequest::redirect怎么用?PHP PKPRequest::redirect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PKPRequest
的用法示例。
在下文中一共展示了PKPRequest::redirect方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Save the form
*/
function execute()
{
$userEmail = $this->getData('email');
$notificationSettingsDao =& DAORegistry::getDAO('NotificationSettingsDAO');
if ($password = $notificationSettingsDao->subscribeGuest($userEmail)) {
Notification::sendMailingListEmail($userEmail, $password, 'NOTIFICATION_MAILLIST_WELCOME');
return true;
} else {
PKPRequest::redirect(null, 'notification', 'mailListSubscribed', array('error'));
return false;
}
}
示例2: redirect
/**
* Redirect to the specified page within Open Harvesting Systems.
* Shorthand for a common call to $request->redirect($dispatcher->url($request, ROUTE_PAGE, ...)).
* @param $page string The name of the op to redirect to.
* @param $op string optional The name of the op to redirect to.
* @param $path mixed string or array containing path info for redirect.
* @param $params array Map of name => value pairs for additional parameters
* @param $anchor string Name of desired anchor on the target page
*/
function redirect($page = null, $op = null, $path = null, $params = null, $anchor = null)
{
parent::redirect(null, $page, $op, $path, $params, $anchor);
}
示例3: savePassword
/**
* Save user's new password.
*/
function savePassword()
{
$this->validate();
$this->setupTemplate();
import('classes.user.form.LoginChangePasswordForm');
$passwordForm = new LoginChangePasswordForm();
$passwordForm->readInputData();
if ($passwordForm->validate()) {
if ($passwordForm->execute()) {
$user = Validation::login($passwordForm->getData('username'), $passwordForm->getData('password'), $reason);
}
PKPRequest::redirect(null, 'user');
} else {
$passwordForm->display();
}
}
示例4: validate
/**
* Redirect to index if system has already been installed.
*/
function validate()
{
if (Config::getVar('general', 'installed')) {
PKPRequest::redirect(null, 'index');
}
}
示例5: updateAnnouncementType
/**
* Save changes to an announcement type.
*/
function updateAnnouncementType()
{
$this->validate();
$this->setupTemplate(true);
import('manager.form.AnnouncementTypeForm');
$typeId = Request::getUserVar('typeId') == null ? null : (int) Request::getUserVar('typeId');
$announcementTypeDao =& DAORegistry::getDAO('AnnouncementTypeDAO');
if ($this->_announcementTypeIsValid($typeId)) {
$announcementTypeForm = new AnnouncementTypeForm($typeId);
$announcementTypeForm->readInputData();
if ($announcementTypeForm->validate()) {
$announcementTypeForm->execute();
if (Request::getUserVar('createAnother')) {
PKPRequest::redirect(null, null, 'createAnnouncementType');
} else {
PKPRequest::redirect(null, null, 'announcementTypes');
}
} else {
$templateMgr =& TemplateManager::getManager();
$templateMgr->append('pageHierarchy', array(Request::url(null, null, 'manager', 'announcementTypes'), 'manager.announcementTypes'));
if ($typeId == null) {
$templateMgr->assign('announcementTypeTitle', 'manager.announcementTypes.createTitle');
} else {
$templateMgr->assign('announcementTypeTitle', 'manager.announcementTypes.editTitle');
}
$announcementTypeForm->display();
}
} else {
PKPRequest::redirect(null, null, 'announcementTypes');
}
}
示例6: saveSubscribeMailList
/**
* Save the public notification email subscription form
*/
function saveSubscribeMailList()
{
$this->validate();
$this->setupTemplate(true);
import('notification.form.NotificationMailingListForm');
$notificationMailingListForm = new NotificationMailingListForm();
$notificationMailingListForm->readInputData();
if ($notificationMailingListForm->validate()) {
$notificationMailingListForm->execute();
PKPRequest::redirect(null, 'notification', 'mailListSubscribed', array('success'));
} else {
$notificationMailingListForm->display();
}
}
示例7: objectsForReviewLogin
/**
* Connector from AnthroNet. Receives a token in the 'token' query string argument
* that is used to fetch author information via SOAP, create/or validate the author login,
* and redirect to author home page.
* @param array $args
* @param PKPRequest $request
*/
function objectsForReviewLogin($args, $request)
{
$token = $request->getUserVar('token');
if ($token) {
$authToken = $this->_doAuthenticate();
if ($authToken) {
$user = $this->_doUserRequest($token, $authToken);
if ($user) {
$sessionManager =& SessionManager::getManager();
$sessionManager->regenerateSessionId();
$session =& $sessionManager->getUserSession();
$session->setSessionVar('userId', $user->getId());
$session->setUserId($user->getId());
$session->setSessionVar('username', $user->getUsername());
$request->redirect(null, 'objectsForReview');
// place them on the landing page for available objects.
} else {
$request->redirect(null, 'user');
}
}
}
}
示例8: redirect
/**
* Redirect to the specified page within OCS.
* Shorthand for a common call to $request->redirect($dispatcher->url($request, ROUTE_PAGE, ...)).
* @param $conferencePath string The path of the conference to redirect to.
* @param $schedConfPath string The path of the conference to redirect to.
* @param $page string The name of the op to redirect to.
* @param $op string optional The name of the op to redirect to.
* @param $path mixed string or array containing path info for redirect.
* @param $params array Map of name => value pairs for additional parameters
* @param $anchor string Name of desired anchor on the target page
*/
function redirect($conferencePath = null, $schedConfPath = null, $page = null, $op = null, $path = null, $params = null, $anchor = null)
{
parent::redirect(array($conferencePath, $schedConfPath), $page, $op, $path, $params, $anchor);
}
示例9: viewFile
/**
* Download an article file
* @param array $args
* @param PKPRequest $request
*/
function viewFile($args, $request)
{
// For deprecated OJS 2.x URLs; see https://github.com/pkp/pkp-lib/issues/1541
$articleId = isset($args[0]) ? $args[0] : 0;
$galleyId = isset($args[1]) ? $args[1] : 0;
$fileId = isset($args[2]) ? (int) $args[2] : 0;
header("HTTP/1.1 301 Moved Permanently");
$request->redirect(null, null, 'download', array($articleId, $galleyId, $fileId));
}
示例10: objectsForReviewUnenroll
/**
* Unenroll a publisher.
* @param array $args
* @param PKPRequest $request
*/
function objectsForReviewUnenroll($args, &$request)
{
$publisherId = (int) Request::getUserVar('publisherId');
$userId = (int) Request::getUserVar('userId');
if ($publisherId && $userId) {
$ofrEdAssOrgDao = DAORegistry::getDAO('ObjectForReviewEditorAssignmentDAO');
$assignment = $ofrEdAssOrgDao->getByPublisherAndUserId($publisherId, $userId);
if ($assignment) {
$ofrEdAssOrgDao->deleteById($assignment->getId());
}
}
$request->redirect(null, 'editor', 'objectsForReviewEnrollPublishers');
}