Commit 964ad4b3bc3686bd7e2d602f22482e66cd373e92
1 parent
8223b21b
Updated debug information
Updates Logout Functionality
Showing
4 changed files
with
22 additions
and
6 deletions
webservice/clienttools/ajaxhandler.php
| ... | ... | @@ -38,10 +38,8 @@ class ajaxHandler{ |
| 38 | 38 | $this->ret=new jsonResponseObject(); |
| 39 | 39 | } |
| 40 | 40 | $this->ret->location='ajaxhandler'; |
| 41 | - $this->log("[__construct]ENTERING PREPARATIONS"); | |
| 42 | 41 | |
| 43 | 42 | $this->remoteIp = (getenv(HTTP_X_FORWARDED_FOR)) ? getenv(HTTP_X_FORWARDED_FOR) : getenv(REMOTE_ADDR); |
| 44 | - $this->log("[__construct]Remote IP determined as: {$this->remoteIp}"); | |
| 45 | 43 | |
| 46 | 44 | $noAuthRequests=is_array($noAuthRequests)?$noAuthRequests:split(',',(string)$noAuthRequests); |
| 47 | 45 | $this->registerNoAuthRequest($noAuthRequests); |
| ... | ... | @@ -50,9 +48,7 @@ class ajaxHandler{ |
| 50 | 48 | $this->digestToken=isset($_GET['msgAuth'])?$_GET['msgAuth']:(isset($_POST['msgAuth'])?$_POST['msgAuth']:''); |
| 51 | 49 | $this->log("[__construct]DigestToken Found: {$this->digestToken}"); |
| 52 | 50 | |
| 53 | - $this->ret->addDebug('Raw Request',$this->rawRequestObject); | |
| 54 | - $this->ret->addDebug('DigestToken Received',$this->digestToken); | |
| 55 | - $this->ret->addDebug('Remote IP',$this->remoteIp); | |
| 51 | + | |
| 56 | 52 | |
| 57 | 53 | |
| 58 | 54 | |
| ... | ... | @@ -61,6 +57,13 @@ class ajaxHandler{ |
| 61 | 57 | $this->req=new jsonWrapper($this->rawRequestObject); |
| 62 | 58 | $this->auth=$this->structArray('user,pass,passhash,appType,session,token,version',$this->req->jsonArray['auth']); |
| 63 | 59 | $this->request=$this->structArray('service,function,parameters',$this->req->jsonArray['request']); |
| 60 | + | |
| 61 | + Clienttools_Syslog::logInfo('--','--','REQUESTING: '.$this->request['service'].'::'.$this->request['function'],$this->request); | |
| 62 | + | |
| 63 | + | |
| 64 | + $this->ret->addDebug('Raw Request',$this->rawRequestObject); | |
| 65 | + $this->ret->addDebug('DigestToken Received',$this->digestToken); | |
| 66 | + $this->ret->addDebug('Remote IP',$this->remoteIp); | |
| 64 | 67 | |
| 65 | 68 | //Add additional parameters |
| 66 | 69 | $add_params=array_merge($_GET,$_POST); |
| ... | ... | @@ -75,7 +78,7 @@ class ajaxHandler{ |
| 75 | 78 | $this->ret->setDebug('Server Versions',$this->getServerVersions()); |
| 76 | 79 | |
| 77 | 80 | $this->ret->addDebug('Session From Server: ',$this->auth); |
| 78 | - if($this->auth['session'])session_id($this->auth['session']); | |
| 81 | +// if($this->auth['session'])session_id($this->auth['session']); | |
| 79 | 82 | $this->session=session_id(); |
| 80 | 83 | $this->ret->addDebug('Session in PHP: ',$this->session); |
| 81 | 84 | $this->log("[__construct]Session Restarted as: {$this->session}"); | ... | ... |
webservice/clienttools/clienttools_syslog.php
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * ClientTools System Logging Static Class | |
| 4 | + * | |
| 5 | + * For more information about use: http://ktwiki.kt-cpt.internal/Logging | |
| 6 | + * @author Mark Holtzhausen | |
| 7 | + * | |
| 8 | + */ | |
| 2 | 9 | class Clienttools_Syslog{ |
| 3 | 10 | /** The default folder in which to put the log files **/ |
| 4 | 11 | private static $logFolder='../../var/log/'; | ... | ... |
webservice/clienttools/comms.php
| ... | ... | @@ -61,6 +61,9 @@ include_once('serviceHelper.php'); |
| 61 | 61 | include_once('client_service.php'); |
| 62 | 62 | include_once('clienttools_syslog.php'); |
| 63 | 63 | |
| 64 | + | |
| 65 | +Clienttools_Syslog::logTrace('--','--','======================================================================== TRANSACTION START'); | |
| 66 | + | |
| 64 | 67 | //Instantiate base classes |
| 65 | 68 | $KT = new KTAPI(); |
| 66 | 69 | $RET=new jsonResponseObject(); | ... | ... |
webservice/clienttools/services/0.9/auth.php
| ... | ... | @@ -142,7 +142,10 @@ class auth extends client_service { |
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | + $newSessId=md5(session_id()); | |
| 145 | 146 | $session->logout(); |
| 147 | + session_id($newSessId); | |
| 148 | + $this->Response->setStatus('session_id',$newSessId); | |
| 146 | 149 | $this->setResponse(array('logout'=>true)); |
| 147 | 150 | return true; |
| 148 | 151 | } | ... | ... |