|
|
| 71 |
/** |
71 |
/** |
| 72 |
* Perform request access validation based on security settings. |
72 |
* Perform request access validation based on security settings. |
| 73 |
* @param $requiredContexts array |
73 |
* @param $requiredContexts array |
|
|
74 |
* @param $request Request |
| 74 |
*/ |
75 |
*/ |
| 75 |
function validate($requiredContexts = null) { |
76 |
function validate($requiredContexts = null, $request = null) { |
|
|
77 |
// FIXME: for backwards compatibility only - remove when request/router refactoring complete |
| 78 |
if (!isset($request)) { |
| 79 |
if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function call.'); |
| 80 |
$request =& Registry::get('request'); |
| 81 |
} |
| 82 |
|
| 76 |
foreach ($this->_checks as $check) { |
83 |
foreach ($this->_checks as $check) { |
| 77 |
// WARNING: This line is for PHP4 compatibility when |
84 |
// WARNING: This line is for PHP4 compatibility when |
| 78 |
// instantiating handlers without reference. Should not |
85 |
// instantiating handlers without reference. Should not |
|
|
| 85 |
if ( $check->redirectToLogin ) { |
92 |
if ( $check->redirectToLogin ) { |
| 86 |
Validation::redirectLogin(); |
93 |
Validation::redirectLogin(); |
| 87 |
} else { |
94 |
} else { |
| 88 |
PKPRequest::redirect(null, 'index'); |
95 |
$request->redirect(null, 'index'); |
| 89 |
} |
96 |
} |
| 90 |
} |
97 |
} |
| 91 |
} |
98 |
} |