Fixed Paypal IPN and other minor items

This commit is contained in:
Deon George
2013-12-04 21:37:09 +11:00
parent 06b87c5135
commit 8ba487a4a6
12 changed files with 44 additions and 71 deletions

View File

@@ -63,8 +63,9 @@ class Controller_Reseller_Account extends Controller_Account {
public function action_view() {
$ao = ORM::factory('Account',$this->request->param('id'));
if (! $ao->loaded() OR ! $ao->status)
HTTP::redirect(URL::link('reseller','welcome'));
if (! $ao->loaded() OR ! $ao->status OR ! Auth::instance()->authorised($ao))
throw HTTP_Exception::factory(403,'Account either doesnt exist, or you are not authorised to see it');
Block::factory()
->title(sprintf('Active Service for Account: %s',$ao->accnum()))

View File

@@ -1,15 +0,0 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's 403 Exception
*
* @package OSB
* @category Exceptions
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class HTTP_Exception_403 extends HTTP_Exception {
protected $_code = 403;
}
?>

View File

@@ -1,15 +0,0 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's 404 Exception
*
* @package OSB
* @category Exceptions
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class HTTP_Exception_404 extends HTTP_Exception {
protected $_code = 404;
}
?>

View File

@@ -1,15 +0,0 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's 501 Exception to catch OSB specific errors
*
* @package OSB
* @category Exceptions
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class HTTP_Exception_501 extends HTTP_Exception {
protected $_code = 501;
}
?>

View File

@@ -46,6 +46,7 @@ class Kohana_Exception extends Kohana_Kohana_Exception {
try {
if (Kohana::$config->load('debug')->show_errors) {
return parent::response($e);
} else {
SystemMessage::add(array(
'title'=>'An Error Occured.',
@@ -57,6 +58,7 @@ class Kohana_Exception extends Kohana_Kohana_Exception {
$response = Response::factory();
$response->status(302);
$response->headers('Location',URL::site());
return $response;
}