mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
first check if parameter 'action' is set, return false if preRun fails
This commit is contained in:
parent
5378d6e7d9
commit
014bcc009d
|
@ -61,12 +61,14 @@ class SeedDMS_Controller_Common {
|
||||||
*/
|
*/
|
||||||
public function __invoke($get=array()) {
|
public function __invoke($get=array()) {
|
||||||
$action = null;
|
$action = null;
|
||||||
$request = $this->getParam('request');
|
if(!$action = $this->getParam('action')) {
|
||||||
if($request) {
|
$request = $this->getParam('request');
|
||||||
if($request->isMethod('get'))
|
if($request) {
|
||||||
$action = $request->query->get('action');
|
if($request->isMethod('get'))
|
||||||
elseif($request->isMethod('post'))
|
$action = $request->query->get('action');
|
||||||
$action = $request->request->get('action');
|
elseif($request->isMethod('post'))
|
||||||
|
$action = $request->request->get('action');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!$this->callHook('preRun', get_class($this), $action ? $action : 'run')) {
|
if(!$this->callHook('preRun', get_class($this), $action ? $action : 'run')) {
|
||||||
if($action) {
|
if($action) {
|
||||||
|
@ -78,6 +80,8 @@ class SeedDMS_Controller_Common {
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return $this->run();
|
return $this->run();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
$this->callHook('postRun', get_class($this), $action ? $action : 'run');
|
$this->callHook('postRun', get_class($this), $action ? $action : 'run');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user