Commit 56c7e5d9db933244ac54cbeae9b60885da132626
1 parent
5fec8b8b
Added permanentURL parameter to bypass single token validity
Showing
1 changed file
with
3 additions
and
0 deletions
webservice/clienttools/ajaxhandler.php
| @@ -13,6 +13,7 @@ class ajaxHandler{ | @@ -13,6 +13,7 @@ class ajaxHandler{ | ||
| 13 | public $authenticator=NULL; | 13 | public $authenticator=NULL; |
| 14 | public $noAuthRequireList=array(); | 14 | public $noAuthRequireList=array(); |
| 15 | public $standardServices=array('system'); | 15 | public $standardServices=array('system'); |
| 16 | + public $parameters=array(); | ||
| 16 | 17 | ||
| 17 | protected $errors=array(); | 18 | protected $errors=array(); |
| 18 | 19 | ||
| @@ -70,6 +71,7 @@ class ajaxHandler{ | @@ -70,6 +71,7 @@ class ajaxHandler{ | ||
| 70 | $add_params=array_merge($_GET,$_POST); | 71 | $add_params=array_merge($_GET,$_POST); |
| 71 | unset($add_params['request'],$add_params['datasource']); | 72 | unset($add_params['request'],$add_params['datasource']); |
| 72 | $this->request['parameters']=array_merge($this->request['parameters'],$add_params); | 73 | $this->request['parameters']=array_merge($this->request['parameters'],$add_params); |
| 74 | + $this->parameters=$this->request['parameters']; | ||
| 73 | 75 | ||
| 74 | if(!$this->auth['debug'])$this->ret->includeDebug=false; | 76 | if(!$this->auth['debug'])$this->ret->includeDebug=false; |
| 75 | 77 | ||
| @@ -183,6 +185,7 @@ class ajaxHandler{ | @@ -183,6 +185,7 @@ class ajaxHandler{ | ||
| 183 | 185 | ||
| 184 | //TODO: Alter this to verify whether token was used before or whether it is new | 186 | //TODO: Alter this to verify whether token was used before or whether it is new |
| 185 | protected function checkTokenValidity(){ | 187 | protected function checkTokenValidity(){ |
| 188 | + if($this->parameters['permanentURL'])return true; | ||
| 186 | $token=$this->auth['token']; | 189 | $token=$this->auth['token']; |
| 187 | $tokenList=$_SESSION['JAPI_TOKEN_STORE']?$_SESSION['JAPI_TOKEN_STORE']:array(); | 190 | $tokenList=$_SESSION['JAPI_TOKEN_STORE']?$_SESSION['JAPI_TOKEN_STORE']:array(); |
| 188 | $valid=!in_array($token,$tokenList); | 191 | $valid=!in_array($token,$tokenList); |