[geeklog-cvs] geeklog-2/lib/A_and_A/common AAConstants.php,NONE,1.1 AAException.class.php,NONE,1.1 AAGroup.class.php,NONE,1.1 AAPrivilege.class.php,NONE,1.1
tony at geeklog.net
tony at geeklog.net
Sat Jan 11 01:09:25 EST 2003
Update of /usr/cvs/geeklog/geeklog-2/lib/A_and_A/common
In directory internal.geeklog.net:/tmp/cvs-serv370/common
Added Files:
AAConstants.php AAException.class.php AAGroup.class.php
AAPrivilege.class.php
Log Message:
Initial load into Geeklog
--- NEW FILE: AAConstants.php ---
<?php
/**
* Constants used by both the A&A Client and Server
*
* This file contains two types of constants: result codes and XML Tags
* The result codes are the list of possible exceptions the server may
* generate. The XML Tags identify the tag used to construct XML and
* prevent us from hardcoding tags
*
* @author Tony Bibbs <tony at tonybibbs.com>
* @package net.geeklog.enterprise.aa.common
*
*/
/**
* This identifies the privilege that gives a user full
* access to this A&A system. Give this privilege
* sparingly!
* @const AA_ADMIN_PRIV
*/
define('AA_ADMIN_PRIV', 'AA_ADMIN_PRIV');
/**
* Denotes a successful action
* @const SUCCESSFUL_RETURN
*/
define('SUCCESSFUL_RETURN',0);
/**
* Denotes the user account is locked
* @const ACCOUNT_LOCKED_EXCEPTION
*/
define('ACCOUNT_LOCKED_EXCEPTION',2);
/**
* Dentoes the admin account used is locked
* @const ADMIN_ACCOUNT_LOCKED_EXCEPTION
*/
define('ADMIN_ACCOUNT_LOCKED_EXCEPTION',7);
/**
* Denotes the account used doesn't have sufficent rights
* @const ADMIN_PERMISSION_EXCEPTION
*/
define('ADMIN_PERMISSION_EXCEPTION',6);
/**
* Denotes a problem with changing the user's password
* @const CHANGE_PASSWORD_EXCEPTION
*/
define('CHANGE_PASSWORD_EXCEPTION',3);
/**
* Denotes the user's password has expired
* @const PASSWORD_EXPIRED_EXCEPTION
*/
define('PASSWORD_EXPIRED_EXCEPTION',9);
/**
* Denotes not enough data was passed to the server
* @const INSUFFICIENT_DATA_EXCEPTION
*/
define('INSUFFICIENT_DATA_EXCEPTION',4);
/**
* Denotes user didn't have the needed privilege
* @const INVALID_PRIVILEGE_EXCEPTION
*/
define('INVALID_PRIVILEGE_EXCEPTION',8);
/**
* Denotes the user account doesn't exists
* @const INVALID_USER_EXCEPTION
*/
define('INVALID_USER_EXCEPTION',1);
/**
* New password was rejected
* @const INVALID_NEW_PASSWORD_EXCEPTION
*/
define('INVALID_NEW_PASSWORD_EXCEPTION',5);
/**
* Some sort of unexpected error occured
* @const UNEXPECTED_FATAL_EXCEPTION
*/
define('UNEXPECTED_FATAL_EXCEPTION',100);
// XML tags used
/**
* A&A Service tag, root of all XML generated
* @const AA_SERVICE_TAG
*/
define('AA_SERVICE_TAG','AAService');
/**
* Application ID tag
* @const APPLICATION_ID_TAG
*/
define('APPLICATION_ID_TAG','AppId');
/**
* User ID tag
* @const USER_ID_TAG
*/
define('USER_ID_TAG', 'UserId');
/**
* Username tag
* @const USER_NAME_TAG
*/
define('USER_NAME_TAG', 'UserName');
/**
* Employee ID tag
* @const EMPLOYEE_ID_TAG
*/
define('EMPLOYEE_ID_TAG', 'EmpId');
/**
* Passwor tag
* @const PASSWORD_TAG
*/
define('PASSWORD_TAG', 'Password');
/**
* Old password tag
* @const OLD_PASSWORD_TAG
*/
define('OLD_PASSWORD_TAG', 'OldPassword');
/**
* New password tag
* @const NEW_PASSWORD_TAG
*/
define('NEW_PASSWORD_TAG', 'NewPassword');
/**
* Admin User ID Tag
* @const ADMIN_USER_ID_TAG
*/
define('ADMIN_USER_ID_TAG', 'AdminUserId');
/**
* Admin Username Tag
* @const ADMIN_USER_NAME_TAG
*/
define('ADMIN_USER_NAME_TAG', 'AdminUserName');
/**
* Admin Password Tag
* @const ADMIN_PASSWORD_TAG
*/
define('ADMIN_PASSWORD_TAG', 'AdminPassword');
/**
* Privilege List Tag
* @const PRIVILEGE_LIST_TAG
*/
define('PRIVILEGE_LIST_TAG', 'PrivilegeList');
/**
* Privilege Tag
* @const PRIVILEGE_TAG
*/
define('PRIVILEGE_TAG', 'Privilege');
/**
* Group List Tag
* @const GROUP_LIST_TAG
*/
define('GROUP_LIST_TAG', 'GroupList');
/**
* Group Tag
* @const GROUP_TAG
*/
define('GROUP_TAG', 'Group');
/**
* Result Tag
* @const RESULT_TAG
*/
define('RESULT_TAG', 'Result');
?>
--- NEW FILE: AAException.class.php ---
<?php
/**
* Exception class which can be passed around in both the client
* and the server code
*
* @access public
* @author Tony Bibbs <tony at tonybibbs.com>
* @package net.geeklog.enterprise.aa.common
*
*/
class AAException {
/**
* Holds exception ID
* @var integer
* @access public
*/
var $exception;
/**
* Holds error message
* @var string
* @access public
*/
var $message = '';
/**
* Constructor
*
* @access public
* @param integer $exception Exception number (constant)
*
*/
function AAException($exception)
{
$this->exception = $exception;
}
/**
* Sets the error message to go with the exception
*
* @access public
* @param string $message Message
*
*/
function setMessage($message)
{
$this->message = $message;
}
}
?>
--- NEW FILE: AAGroup.class.php ---
<?php
/**
* Generic group class used to pass group data between
* the A&A Server and A&A client(s)
*
* @author Tony Bibbs <tony at tonybibbs.com>
* @package net.geeklog.enterprise.aa.client
*
*/
class AAGroup {
/**
* @access private
*/
var $_groupId = '';
/**
* @access private
*/
var $_groupLogicalName = '';
/**
* @access private
*/
var $_groupDisplayName = '';
/**
* @access private
*/
var $_groupDesc = '';
/**
* @access private
*/
var $_privileges = '';
/**
* Sets the group ID
*
* @access public
* @param integer $id ID for group
*
*/
function setGroupId($id)
{
$this->_groupId = $id;
}
/**
* Retrieves the group ID
*
* @access public
* @return integer ID for group
*
*/
function getGroupId()
{
return $this->_groupId;
}
/**
* Sets the group ID
*
* @access public
* @param string $name ID for group
*
*/
function setGroupLogicalName($name)
{
$this->_groupLogicalName = $name;
}
/**
* Retrieves the group's logical name (used mainly in code)
*
* @access public
* @return string logical name for group
*
*/
function getGroupLogicalName()
{
return $this->_groupLogicalName;
}
/**
* Sets the group ID
*
* @access public
* @param string $name ID for group
*
*/
function setGroupDisplayName($name)
{
$this->_groupDisplayName = $name;
}
/**
* Retrieves the group's Display name (used mainly in code)
*
* @access public
* @return string Display name for group
*
*/
function getGroupDisplayName()
{
return $this->_groupDisplayName;
}
/**
* Sets the group description
*
* @access public
* @param string $desc Description for group
*
*/
function setGroupDesc($desc)
{
$this->_groupDesc = $desc;
}
/**
* Retrieves the group code
*
* @access public
* @return string Description for group
*
*/
function getGroupDesc()
{
return $this->_groupDesc;
}
function setGroupPrivileges($privArray)
{
$this->_privileges = $privArray;
}
function getGroupPrivileges()
{
return $this->_privileges;
}
}
?>
--- NEW FILE: AAPrivilege.class.php ---
<?php
/**
* Generic privilege class used to pass user privileges between
* the A&A Server and A&A client(s)
*
* @author Tony Bibbs <tony at tonybibbs.com>
* @package net.geeklog.enterprise.aa.client
*
*/
class AAPrivilege {
/**
* @access private
*/
var $_privilegeCode = '';
/**
* @access private
*/
var $_privilegeDesc = '';
/**
* Sets the privilege code
*
* @access public
* @param string $code Code for privilege
*
*/
function setPrivilegeCode($code)
{
$this->_privilegeCode = $code;
}
/**
* Retrieves the privilege code
*
* @access public
* @return string Code for privilege
*
*/
function getPrivilegeCode()
{
return $this->_privilegeCode;
}
/**
* Sets the privilege description
*
* @access public
* @param string $desc Description for privilege
*
*/
function setPrivilegeDesc($desc)
{
$this->_privilegeDesc = $desc;
}
/**
* Retrieves the privilege code
*
* @access public
* @return string Description for privilege
*
*/
function getPrivilegeDesc()
{
return $this->_privilegeDesc;
}
}
?>
More information about the geeklog-cvs
mailing list