Commit c77d0d5296810af40f2eeebc45b95ae7c419bb5c

Authored by Mark Holtzhausen
1 parent 7c1f0c28

Implemented Licencing check in updated comms.

var/cache/.empty deleted
webservice/clienttools/ajaxhandler.php
@@ -94,8 +94,8 @@ class ajaxHandler{ @@ -94,8 +94,8 @@ class ajaxHandler{
94 94
95 95
96 //TODO: Get rid of this service 96 //TODO: Get rid of this service
97 - $this->loadService('auth');  
98 - $this->authenticator=new auth($this,$this->ret,$this->kt,$this->request,$this->auth); 97 +// $this->loadService('auth');
  98 +// $this->authenticator=new auth($this,$this->ret,$this->kt,$this->request,$this->auth);
99 99
100 100
101 101
@@ -273,6 +273,9 @@ class ajaxHandler{ @@ -273,6 +273,9 @@ class ajaxHandler{
273 273
274 $kt=$this->kt; 274 $kt=$this->kt;
275 275
  276 + /*
  277 + * User Check
  278 + */
276 $o_user=$kt->get_user_object_by_username($user); 279 $o_user=$kt->get_user_object_by_username($user);
277 280
278 if(PEAR::isError($o_user)){ 281 if(PEAR::isError($o_user)){
@@ -281,6 +284,33 @@ class ajaxHandler{ @@ -281,6 +284,33 @@ class ajaxHandler{
281 return false; 284 return false;
282 } 285 }
283 286
  287 + /*
  288 + * BAOBAB Licence Check
  289 + */
  290 + if ($user != 'admin') {
  291 + try{
  292 + if(class_exists('BaobabKeyUtil')){
  293 + if (!BaobabKeyUtil::checkIfLicensed(true)) {
  294 + $this->ret->setResponse(array('authenticated'=> false, 'message'=> 'license_expired'));
  295 + $this->ret->addError('Licence Expired');
  296 + return false;
  297 + }
  298 + }else{
  299 + $this->ret->addError('Licence Utility could not be loaded. Appears to be a Community version.');
  300 + $this->ret->setResponse(array('authenticated'=> false, 'message'=> 'Licence Utility could not be loaded. Appears to be a Community version.'));
  301 + return false;
  302 + }
  303 + }catch(Exception $e){
  304 + $this->ret->addError('could not execute BaobabKeyUtil::checkIfLicensed');
  305 + $this->ret->setResponse(array('authenticated'=> false, 'message'=> 'BaobabKeyUtil::checkIfLicensed error'));
  306 + return;
  307 + }
  308 + }
  309 +
  310 +
  311 + /*
  312 + * Password Check
  313 + */
284 try{ 314 try{
285 $l_pass=$o_user->getPassword(); 315 $l_pass=$o_user->getPassword();
286 $l_passHash=md5($l_pass.$this->auth['token']); 316 $l_passHash=md5($l_pass.$this->auth['token']);