|
|
@ -10,17 +10,19 @@ namespace SparkLib\Exception; |
|
|
|
|
|
|
|
class AuthenticationException extends SparkException |
|
|
|
{ |
|
|
|
public function __construct($message = "Authentication Required", $code = 0, Exception $previous = null) { |
|
|
|
if($message instanceof \SparkLib\Application\Link) { |
|
|
|
// this kind of feels dirty.
|
|
|
|
$this->_action = $message->getAction(); |
|
|
|
$this->_controller = $message->getController(); |
|
|
|
$message = 'Authentication Required'; |
|
|
|
} else { |
|
|
|
$this->_action = 'login'; |
|
|
|
$this->_controller = 'account'; |
|
|
|
public function __construct ($redirect = null, $code = 0, Exception $previous = null) |
|
|
|
{ |
|
|
|
$this->_app_name = 'Commerce'; |
|
|
|
$this->_controller = 'account'; |
|
|
|
$this->_action = 'login'; |
|
|
|
|
|
|
|
if ($redirect instanceof \SparkLib\Application\Link) { |
|
|
|
$this->_params = 'redirect=' . $redirect->path(false); |
|
|
|
} else if ($redirect) { |
|
|
|
$this->_params = 'redirect=' . $redirect; |
|
|
|
} |
|
|
|
|
|
|
|
$message = 'Please log in.'; |
|
|
|
parent::__construct($message, $code, $previous); |
|
|
|
} |
|
|
|
} |