Some updates to invoice

This commit is contained in:
Deon George
2013-06-11 14:30:13 +10:00
parent 114ac8eb38
commit 25a47cac3a
6 changed files with 273 additions and 316 deletions

View File

@@ -44,10 +44,13 @@ class Auth_OSB extends Auth_ORM {
if ($mmto->loaded()) {
// Check that the token is for this URI
$mo = ORM::factory('Module',array('name'=>Request::current()->controller()));
$mmo = ORM::factory('Module_Method',array(
'module_id'=>$mo->id,
'name'=>strtolower(Request::current()->directory() ? sprintf('%s:%s',Request::current()->directory(),Request::current()->action()) : Request::current()->action())
));
$mmo = $mo->module_method
->where_open()
->where('name','=',strtolower(Request::current()->directory() ? sprintf('%s:%s',Request::current()->directory(),Request::current()->action()) : Request::current()->action()))
// @todo No longer required after all method names have been colon delimited
->or_where('name','=',strtolower(Request::current()->directory() ? sprintf('%s_%s',Request::current()->directory(),Request::current()->action()) : Request::current()->action()))
->where_close()
->find();
// Ignore the token if this is not the right method.
if ($mmo->id == $mmto->method_id) {