[geeklog-cvs] A_and_A/server/commands authenticate.class.php,1.4,1.5 changepassword.class.php,1.1.1.1,1.2 changepasswordbyadmin.class.php,1.1.1.1,1.2 getusergroups.class.php,1.1,1.2 getuserprivileges.class.php,1.1.1.1,1.2 listappprivileges.class.php,1.2,1.3 resetpassword.class.php,1.1.1.1,1.2 setuserprivileges.class.php,1.2,1.3

tony at geeklog.net tony at geeklog.net
Fri Jan 10 00:56:39 EST 2003


Update of /usr/cvs/geeklog/A_and_A/server/commands
In directory internal.geeklog.net:/tmp/cvs-serv11905

Modified Files:
	authenticate.class.php changepassword.class.php 
	changepasswordbyadmin.class.php getusergroups.class.php 
	getuserprivileges.class.php listappprivileges.class.php 
	resetpassword.class.php setuserprivileges.class.php 
Log Message:
Tons of fixes.  Mostly working again

Index: authenticate.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/authenticate.class.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** authenticate.class.php	27 Nov 2002 00:28:36 -0000	1.4
--- authenticate.class.php	10 Jan 2003 05:56:37 -0000	1.5
***************
*** 19,23 ****
      {
          $user = new AAServiceUser();
!         $user = &$user->authenticate($this->getParam(APPLICATION_ID_TAG), $this->getParam(USER_ID_TAG), $this->getParam(PASSWORD_TAG));
          if (get_class($user) == 'aaexception') {
              return $this->getExceptionResponse($user, $this->getParam(APPLICATION_ID_TAG), 'Authenticate');
--- 19,23 ----
      {
          $user = new AAServiceUser();
!         $user = &$user->authenticate($this->getParam(APPLICATION_ID_TAG), $this->getParam(USER_NAME_TAG), $this->getParam(PASSWORD_TAG));
          if (get_class($user) == 'aaexception') {
              return $this->getExceptionResponse($user, $this->getParam(APPLICATION_ID_TAG), 'Authenticate');

Index: changepassword.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/changepassword.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** changepassword.class.php	25 Oct 2002 22:06:42 -0000	1.1.1.1
--- changepassword.class.php	10 Jan 2003 05:56:37 -0000	1.2
***************
*** 30,34 ****
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserId($this->getParam(USER_ID_TAG));
          $user->setPassword($this->getParam(OLD_PASSWORD_TAG));
          $newPassword = $this->getParam(NEW_PASSWORD_TAG);
--- 30,34 ----
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(USER_NAME_TAG));
          $user->setPassword($this->getParam(OLD_PASSWORD_TAG));
          $newPassword = $this->getParam(NEW_PASSWORD_TAG);

Index: changepasswordbyadmin.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/changepasswordbyadmin.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** changepasswordbyadmin.class.php	25 Oct 2002 22:06:42 -0000	1.1.1.1
--- changepasswordbyadmin.class.php	10 Jan 2003 05:56:37 -0000	1.2
***************
*** 30,39 ****
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserId($this->getParam(ADMIN_USER_ID_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userId = $this->getParam(USER_ID_TAG);
          $newPassword = $this->getParam(NEW_PASSWORD_TAG);
  
!         $retval = $user->changePasswordByAdmin($userId, $newPassword);
          if ($retval) {
              // Some sort of error occurred
--- 30,39 ----
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(ADMIN_USER_NAME_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userName = $this->getParam(USER_NAME_TAG);
          $newPassword = $this->getParam(NEW_PASSWORD_TAG);
  
!         $retval = $user->changePasswordByAdmin($userName, $newPassword);
          if ($retval) {
              // Some sort of error occurred

Index: getusergroups.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/getusergroups.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** getusergroups.class.php	20 Nov 2002 03:47:54 -0000	1.1
--- getusergroups.class.php	10 Jan 2003 05:56:37 -0000	1.2
***************
*** 20,27 ****
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserId($this->getParam(ADMIN_USER_ID_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userId = $this->getParam(USER_ID_TAG);
!         $groupArray = $user->getUserGroups($userId);
          $responseXML = $this->getXML($groupArray, $user->getAppId());
          return $responseXML;
--- 20,27 ----
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(ADMIN_USER_NAME_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userName = $this->getParam(USER_NAME_TAG);
!         $groupArray = $user->getUserGroups($userName);
          $responseXML = $this->getXML($groupArray, $user->getAppId());
          return $responseXML;

Index: getuserprivileges.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/getuserprivileges.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** getuserprivileges.class.php	25 Oct 2002 22:06:42 -0000	1.1.1.1
--- getuserprivileges.class.php	10 Jan 2003 05:56:37 -0000	1.2
***************
*** 20,27 ****
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserId($this->getParam(ADMIN_USER_ID_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userId = $this->getParam(USER_ID_TAG);
!         $privArray = $user->getUserPrivileges($userId);
          $responseXML = $this->getXML($privArray, $user->getAppId());
          return $responseXML;
--- 20,27 ----
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(ADMIN_USER_NAME_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userName = $this->getParam(USER_NAME_TAG);
!         $privArray = $user->getUserPrivileges($userName);
          $responseXML = $this->getXML($privArray, $user->getAppId());
          return $responseXML;

Index: listappprivileges.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/listappprivileges.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** listappprivileges.class.php	27 Nov 2002 19:14:56 -0000	1.2
--- listappprivileges.class.php	10 Jan 2003 05:56:37 -0000	1.3
***************
*** 20,24 ****
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(ADMIN_USER_ID_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
          $privArray = $user->listAppPrivileges();
--- 20,24 ----
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(ADMIN_USER_NAME_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
          $privArray = $user->listAppPrivileges();

Index: resetpassword.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/resetpassword.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** resetpassword.class.php	25 Oct 2002 22:06:42 -0000	1.1.1.1
--- resetpassword.class.php	10 Jan 2003 05:56:37 -0000	1.2
***************
*** 29,46 ****
      {
          $user = new AAServiceUser();
!         $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserId($this->getParam(ADMIN_USER_ID_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userId = $this->getParam(USER_ID_TAG);
  
!         $retval = $user->resetPassword($userId);
!         if ($retval) {
              // Some sort of error occurred
!             $responseXML =  $this->getExceptionResponse($retval, $user->getAppId(), 'ResetPassword');
              trigger_error($responseXML);
          } else {
!             $responseXML = $this->getXML($this->getParam(APPLICATION_ID_TAG));
          }
          return $responseXML; 
      }
  }
--- 29,60 ----
      {
          $user = new AAServiceUser();
!         $user->setUserName($this->getParam(ADMIN_USER_NAME_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $userName = $this->getParam(USER_NAME_TAG);
  
!         $newPassword = $user->resetPassword($userName);
!         if (get_class($newPassword) == 'aaexception') {
              // Some sort of error occurred
!             $responseXML =  $this->getExceptionResponse($newPassword, $user->getAppId(), 'ResetPassword');
              trigger_error($responseXML);
          } else {
!             $responseXML = $this->getXML($this->getParam(APPLICATION_ID_TAG), $newPassword);
          }
          return $responseXML; 
+     }
+     
+     function getXML($appId, $newPassword)
+     {
+         $tree = new XML_Tree;
+         $root = &$tree->addRoot(AA_SERVICE_TAG);
+         $message = '';
+ 
+         $retval = 0;
+ 
+         $tmpNode = &$root->addChild(RESULT_TAG, $message, array('method'=>'ResetPassword','appId'=>$this->getParam('AppId'),'value'=>$retval));
+         $tmpNode = &$root->addChild(NEW_PASSWORD_TAG, $newPassword, '');
+         
+         return $tree->get();
      }
  }

Index: setuserprivileges.class.php
===================================================================
RCS file: /usr/cvs/geeklog/A_and_A/server/commands/setuserprivileges.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** setuserprivileges.class.php	26 Oct 2002 18:33:44 -0000	1.2
--- setuserprivileges.class.php	10 Jan 2003 05:56:37 -0000	1.3
***************
*** 20,31 ****
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserId($this->getParam(ADMIN_USER_ID_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userId = $this->getParam(USER_ID_TAG);
  
          // Get all the privileges, from XML into array
          $privileges = $this->getParam(PRIVILEGE_LIST_TAG);
  
!         $retval = $user->setUserPrivileges($userId, $privileges);
  
          if ($retval) {
--- 20,31 ----
          $user = new AAServiceUser();
          $user->setAppId($this->getParam(APPLICATION_ID_TAG));
!         $user->setUserName($this->getParam(ADMIN_USER_NAME_TAG));
          $user->setPassword($this->getParam(ADMIN_PASSWORD_TAG));
!         $userName = $this->getParam(USER_NAME_TAG);
  
          // Get all the privileges, from XML into array
          $privileges = $this->getParam(PRIVILEGE_LIST_TAG);
  
!         $retval = $user->setUserPrivileges($userName, $privileges);
  
          if ($retval) {





More information about the geeklog-cvs mailing list