Commit 7300bd94 authored by Nigel McNie's avatar Nigel McNie
Browse files

Adding AccessTotallyDeniedException - forbids further processing without trying for a login page.

The MNET code uses this a bit.
parent 7c792942
......@@ -77,7 +77,7 @@ function start_jump_session($peer, $instanceid, $wantsurl="") {
if (false == $approved) {
// This shouldn't happen: the user shouldn't have been presented with
// the link
throw new SystemException('Host not approved for sso');
throw new AccessTotallyDeniedException('Host not approved for sso');
}
// set up the session
......
......@@ -55,7 +55,7 @@ $instanceid = param_variable('ins');
$wantsurl = param_variable('wantsurl');
if (!get_config('enablenetworking')) {
throw new XmlrpcClientException('Sorry - networking has been disabled for this Mahara site.');
throw new AccessTotallyDeniedException(get_string('networkingdisabledonthissite', 'auth.xmlrpc'));
}
$peer = new Peer();
......
......@@ -50,7 +50,7 @@ require(dirname(dirname(dirname(__FILE__))).'/init.php');
// If networking is turned off, it's safer to die immediately
if (!get_config('enablenetworking')) {
throw new AccessDeniedException(get_string('networkingdisabledonthissite', 'auth.xmlrpc'));
throw new AccessTotallyDeniedException(get_string('networkingdisabledonthissite', 'auth.xmlrpc'));
}
require_once(get_config('docroot') .'api/xmlrpc/client.php');
......
......@@ -786,6 +786,23 @@ class AccessDeniedException extends UserException {
}
}
/**
* Exception - Access totally denied, the user won't be able to access it even if they log in
* as the administrator
*/
class AccessTotallyDeniedException extends UserException {
public function strings() {
return array_merge(parent::strings(),
array('message' => get_string('accessdeniedexception', 'error'),
'title' => get_string('accessdenied', 'error')));
}
public function render_exception() {
header("HTTP/1.0 403 Forbidden", true);
return parent::render_exception();
}
}
/**
* something has happened during import.
* either: the user is there, in which case they get the bug screen,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment