- Timestamp:
- Jun 24, 2012, 9:18:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GrumPluginClasses/classes/GPCAjax.class.inc.php
r5550 r16012 3 3 /* ----------------------------------------------------------------------------- 4 4 class name : GPCAjax 5 class version : 3. 0.06 plugin version : 3. 0.07 date : 201 0-03-305 class version : 3.1.0 6 plugin version : 3.5.2 7 date : 2012-06-19 8 8 ------------------------------------------------------------------------------ 9 9 author: grum at piwigo.org … … 15 15 | release | date | 16 16 | 3.0.0 | 2010/03/30 | * Update class & function names 17 | | | 18 | 3.1.0 | 2012/06/19 | * Check token request 19 | | | 17 20 | | | 18 21 | | | … … 27 30 ---------------------------------------------------------------------- */ 28 31 29 32 define('GPC_AJAX', 'ajaxfct'); 30 33 31 34 class GPCAjax … … 39 42 exit(strtr($str, $chars)); 40 43 } 44 45 /** 46 * check if there's a valid token in $_REQUEST 47 * if no, the GPC_AJAX call is set to empty value 48 * 49 * @param String $fct: the ajax function field (GPC_AJAX by default) 50 * @param String $token: the token field ('token' by default) to check 51 * @return Boolean: true if ok, otherwise false 52 */ 53 static public function checkToken($fct=GPC_AJAX, $token='token') 54 { 55 if(!isset($_REQUEST[$token])) $_REQUEST[$token]=''; 56 if($fct!='' && !isset($_REQUEST[$fct])) $_REQUEST[$fct]=''; 57 58 if($_REQUEST[$token]==get_pwg_token()) return(true); 59 60 if($fct!='') $_REQUEST[$fct]=''; 61 return(false); 62 } 41 63 } //class 42 64
Note: See TracChangeset
for help on using the changeset viewer.