Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Account Class Reference
+ Inheritance diagram for Account:
+ Collaboration diagram for Account:

Public Member Functions

 setLoginName ($login)
 
 getSubstitute ()
 
 getIncumbents ($returnSystemIds=true)
 
 setSubstitute ($substitute)
 
 setLogin ($login, $unused= '0')
 
 setFid ($fid)
 
 preInsert ()
 
 PostInsert ()
 
 postUpdate ()
 
 preUpdate ()
 
 postDelete ()
 
 CheckLogin ($login, $unused, $whatid)
 
 getAccountName ()
 
 setUsers ($fid, $lname, $fname, $expires, $passdelay, $login, $status, $pwd1, $pwd2, $unused= '', $extmail= '')
 
 updateUser ($fid, $lname, $fname, $expires, $passdelay, $login, $status, $pwd1, $pwd2, $extmail= '', array $roles=array(-1), $substitute=-1)
 
 setGroups ($fid, $gname, $login, array $roles=array(-1))
 
 revert ()
 
 getExpires ()
 
 computepass ($pass, &$passk)
 
 checkpassword ($pass)
 
 checkpass ($pass, $passk)
 
 getMail ($rawmail=true)
 
 PostInit ()
 
 getIncumbentPrivilege (Doc &$doc, $acl)
 
 getGroupsId ()
 
 getRUsersList ($id, $r=array())
 
 getUsersGroupList ($gid, $onlygroup=false)
 
 getUserParents ($accountFilter= '')
 
 getStrictMemberOf ($uid=-1)
 
 updateMemberOf ($updateSubstitute=true)
 
 getMemberOf ($useSystemId=true)
 
 isMember ($uid)
 
 getGroupUserList ($qtype="LIST", $withgroup=false, $limit="all")
 
 getAllMembers ($limit="all", $onlyUsers=true)
 
 getUserToken ($expireDelay=-1, $oneshot=false, $context=array(), $description="", $forceCreate=false)
 
 setAdminHtpasswd ($admin_passwd)
 
 setSupervisorHtpasswd ($admin_passwd)
 
 addRole ($idRole)
 
 setRoles (array $roleIds)
 
 getRoles ($useSystemId=true)
 
 getAllRoles ()
 
 deleteRoles ()
 
- Public Member Functions inherited from DbObj
 __construct ($dbaccess= '', $id= '', $res= '', $dbid=0)
 
 Select ($id)
 
 getValues ()
 
 affectColumn ($fields, $reset=true)
 
 affect ($array, $more=false, $reset=true)
 
 isAffected ()
 
 Complete ()
 
 preInsert ()
 
 postInsert ()
 
 preUpdate ()
 
 postUpdate ()
 
 preDelete ()
 
 postDelete ()
 
 preSelect ($id)
 
 postSelect ($id)
 
 Add ($nopost=false, $nopre=false)
 
 modify ($nopost=false, $sfields="", $nopre=false)
 
 delete ($nopost=false)
 
 Adds (&$tcopy, $nopost=false)
 
 lw ($prop)
 
 CloseConnect ()
 
 Create ($nopost=false)
 
 postInit ()
 
 init_dbid ()
 
 exec_query ($sql, $lvl=0, $prepare=false)
 
 numrows ()
 
 fetch_array ($c, $type=PGSQL_ASSOC)
 
 update ()
 
 setError ($moreerr= '')
 
 autoUpdate ()
 
 savePoint ($point)
 
 lockPoint ($exclusiveLock, $exclusiveLockPrefix= '')
 
 setMasterLock ($useLock)
 
 rollbackPoint ($point)
 
 commitPoint ($point)
 

Static Public Member Functions

static getDisplayName ($uid)
 
static getUidFromFid ($fid)
 
static getFidFromUid ($uid)
 
static getUserList ($qtype="LIST", $start=0, $slice=0, $filteruser= '')
 
static getGroupList ($qtype="LIST")
 
static getRoleList ($qtype="LIST")
 
static getUserAndGroupList ($qtype="LIST")
 
static getUserMemberOf ($uid, $strict=false)
 

Data Fields

const ANONYMOUS_ID = ANONYMOUS_ID
 
const GALL_ID = GALL_ID
 
const GADMIN_ID = GADMIN_ID
 
const ADMIN_ID = 1
 
const USER_TYPE = "U"
 
const GROUP_TYPE = "G"
 
const ROLE_TYPE = "R"
 
 $fields
 
 $id
 
 $lastname
 
 $firstname
 
 $login
 
 $password
 
 $isgroup
 
 $expires
 
 $passdelay
 
 $status
 
 $mail
 
 $fid
 
 $memberof
 
 $accounttype
 
 $substitute
 
 $famid
 
 $password_new
 
 $id_fields
 
 $dbtable = "users"
 
 $order_by = "lastname, accounttype"
 
 $fulltextfields
 
 $sqlcreate
 
- Data Fields inherited from DbObj
 $dbid = - 1
 
 $dbaccess = ''
 
 $fields
 
 $dbtable = ''
 
 $id_fields
 
 $criterias = array()
 
 $sup_fields = array()
 
 $sup_where = array()
 
 $sup_tables = array()
 
 $fulltextfields = array()
 
 $order_by = ""
 
 $isset = false
 
 $msg_err = ''
 
 $err_code = ''
 
 $res = ''
 
 $debug = false
 
 $sqlcreate
 
 $sqlinit
 
 $log
 

Additional Inherited Members

- Static Public Attributes inherited from DbObj
static $savepoint = array()
 
static $lockpoint = array()
 
static $sqlStrict = null
 
- Protected Member Functions inherited from DbObj
 tryCreate ()
 

Detailed Description

Manage User, Group and Role account object

Definition at line 31 of file Class.Account.php.

Member Function Documentation

addRole (   $idRole)

add a role to a user/group

Parameters
string$idRolesystem identicator or reference role (login)
Returns
string error message

Definition at line 1187 of file Class.Account.php.

+ Here is the call graph for this function:

CheckLogin (   $login,
  $unused,
  $whatid 
)
Deprecated:
use SearchAccount class instead
Parameters
string$login
string$unused
int$whatid
Returns
bool

Definition at line 353 of file Class.Account.php.

checkpass (   $pass,
  $passk 
)

Definition at line 620 of file Class.Account.php.

+ Here is the call graph for this function:

checkpassword (   $pass)
Parameters
string$passclear password to test
Returns
bool

Definition at line 614 of file Class.Account.php.

+ Here is the call graph for this function:

computepass (   $pass,
$passk 
)

Definition at line 601 of file Class.Account.php.

deleteRoles ( )

delete all role of a user/group

Returns
string error message

Definition at line 1281 of file Class.Account.php.

+ Here is the call graph for this function:

getAccountName ( )

Same as ::getDisplayName but for current object

Definition at line 395 of file Class.Account.php.

getAllMembers (   $limit = "all",
  $onlyUsers = true 
)

get all users of a group/role direct or indirect

Parameters
int | string$limitmax users returned
bool$onlyUsersset to true to have also sub groups
Returns
array of user properties

Definition at line 1052 of file Class.Account.php.

+ Here is the call graph for this function:

getAllRoles ( )

return direct and indirect role which comes from groups

Parameters
bool$useSystemIdif true return system id else return document ids
Returns
array of users properties

Definition at line 1269 of file Class.Account.php.

+ Here is the call graph for this function:

static getDisplayName (   $uid)
static

return display name of a user

Parameters
int$uiduser identifier
Returns
string|null firstname and lastname or null if not found

Definition at line 373 of file Class.Account.php.

+ Here is the call graph for this function:

getExpires ( )

Definition at line 537 of file Class.Account.php.

static getFidFromUid (   $uid)
static

return user document reference from system user identifier

See Also
getUidFromFid
Parameters
int$fid
Returns
int

Definition at line 421 of file Class.Account.php.

+ Here is the call graph for this function:

static getGroupList (   $qtype = "LIST")
static

get All groups

Parameters
string$qtypereturn type LIST|TABLE|ITEM
Returns
array

Definition at line 779 of file Class.Account.php.

+ Here is the call graph for this function:

getGroupsId ( )

get All ascendant group ids of the user object

Definition at line 816 of file Class.Account.php.

+ Here is the call graph for this function:

getGroupUserList (   $qtype = "LIST",
  $withgroup = false,
  $limit = "all" 
)

only use with group or role if it is a group : get all direct user member of a group if it is a role : het user which has role directly

Parameters
string$qtypeLIST|TABLE|ITEM
bool$withgroupset to true to return sub group also
int | string$limitmax users returned
Returns
array of user properties

Definition at line 1038 of file Class.Account.php.

getIncumbentPrivilege ( Doc $doc,
  $acl 
)

get the first incumbent which has $acl privilege

Parameters
Doc$docdocument to verify
string$acldocument acl name
Returns
string incumbent's name which has privilege

Definition at line 744 of file Class.Account.php.

+ Here is the call graph for this function:

getIncumbents (   $returnSystemIds = true)

return incumbent ids account list (accounts which has this account as substitute)

Parameters
bool$returnSystemIdsset to true to return system account id, false to return document user id
Returns
int[]

Definition at line 163 of file Class.Account.php.

+ Here is the call graph for this function:

getMail (   $rawmail = true)

return mail adress

Parameters
bool$rawmailset to false to have long mail with firstname and lastname
Returns
string mail address empty if no mail

Definition at line 649 of file Class.Account.php.

+ Here is the call graph for this function:

getMemberOf (   $useSystemId = true)

return id of group/role id

Parameters
bool$useSystemIdset to false to return document id instead of system id
Returns
array

Definition at line 970 of file Class.Account.php.

+ Here is the call graph for this function:

static getRoleList (   $qtype = "LIST")
static

get All Roles

Parameters
string$qtypereturn type LIST|TABLE|ITEM
Returns
array

Definition at line 792 of file Class.Account.php.

+ Here is the call graph for this function:

getRoles (   $useSystemId = true)

return direct role ids (not role which can comes from parent groups)

Parameters
bool$useSystemIdif true return system id else return document ids
Returns
array

Definition at line 1257 of file Class.Account.php.

+ Here is the call graph for this function:

getRUsersList (   $id,
  $r = array() 
)

for group :: get All user & groups ids in all descendant(recursive);

Parameters
int$idgroup identifier
Returns
array of account array

Definition at line 828 of file Class.Account.php.

getStrictMemberOf (   $uid = - 1)

get memberof for user without substitutes

Parameters
int$uidif not set it is the current account object else use another account identifier
Returns
array
Exceptions
Dcp\Exception

Definition at line 918 of file Class.Account.php.

+ Here is the call graph for this function:

getSubstitute ( )

return substitute account return null if no susbtitute

Returns
Account|null

Definition at line 149 of file Class.Account.php.

+ Here is the call graph for this function:

static getUidFromFid (   $fid)
static

return system user identifier from user document reference

See Also
getFidFromUid
Parameters
int$fid
Returns
int

Definition at line 406 of file Class.Account.php.

+ Here is the call graph for this function:

static getUserAndGroupList (   $qtype = "LIST")
static

get All users & groups (except role)

Parameters
string$qtypereturn type LIST|TABLE|ITEM
Returns
array

Definition at line 805 of file Class.Account.php.

+ Here is the call graph for this function:

static getUserList (   $qtype = "LIST",
  $start = 0,
  $slice = 0,
  $filteruser = '' 
)
static

get All Users (not group not role)

Parameters
string$qtypereturn type LIST|TABLE|ITEM
int$start
int$slice
string$filteruserkeyword to filter user on login or lastname
Returns
array

Definition at line 766 of file Class.Account.php.

+ Here is the call graph for this function:

static getUserMemberOf (   $uid,
  $strict = false 
)
static

return list of account (group/role) member for a user return null if user not exists

Parameters
int$uiduser identifier
Returns
array|null

Definition at line 991 of file Class.Account.php.

getUserParents (   $accountFilter = '')

return all group (recursive) /role of user

Parameters
string$accountFilterG|R to indicate if want only group or only role
Returns
array of users characteristics

Definition at line 898 of file Class.Account.php.

+ Here is the call graph for this function:

getUsersGroupList (   $gid,
  $onlygroup = false 
)

for group :: get All direct user & groups ids

Parameters
int$idgroup identifier
bool$onlygroupset to true if you want only child groups

Definition at line 854 of file Class.Account.php.

getUserToken (   $expireDelay = - 1,
  $oneshot = false,
  $context = array(),
  $description = "",
  $forceCreate = false 
)

Get user token for open access

Parameters
bool | int$expireDelayset expiration delay in seconds (-1 if nether expire)
bool$oneshotset to true to use one token is consumed/deleted when used
array$contextget http var restriction
string$descriptiontext description information
bool$forceCreateset to true to always return a new token
Returns
string
Exceptions
\Dcp\Exception

Definition at line 1076 of file Class.Account.php.

+ Here is the call graph for this function:

isMember (   $uid)

verify if user is member of group (recursive)

Returns
bool

Definition at line 1013 of file Class.Account.php.

+ Here is the call graph for this function:

postDelete ( )

Definition at line 328 of file Class.Account.php.

+ Here is the call graph for this function:

PostInit ( )

Definition at line 684 of file Class.Account.php.

PostInsert ( )

Definition at line 295 of file Class.Account.php.

postUpdate ( )

Definition at line 308 of file Class.Account.php.

preInsert ( )

Definition at line 249 of file Class.Account.php.

+ Here is the call graph for this function:

preUpdate ( )

Definition at line 313 of file Class.Account.php.

+ Here is the call graph for this function:

revert ( )

revert values from database

Definition at line 529 of file Class.Account.php.

+ Here is the call graph for this function:

setAdminHtpasswd (   $admin_passwd)

Set password for the admin account in the `admin' subdir

Deprecated:
use Account::setSupervisorHtpasswd instead
See Also
Account::setSupervisorHtpasswd
Parameters
string$admin_passwdthe password
Returns
string error message, emptuy string if no error

Definition at line 1136 of file Class.Account.php.

+ Here is the call graph for this function:

setFid (   $fid)

affect account from its document id

Parameters
int$fid
Returns
bool true if ok

Definition at line 236 of file Class.Account.php.

setGroups (   $fid,
  $gname,
  $login,
array  $roles = array(-1    ) 
)

update user from FREEDOM IGROUP document

Parameters
int$fiddocument id
string$gnamegroup name
string$loginlogin
array$rolessystem role ids

Definition at line 504 of file Class.Account.php.

+ Here is the call graph for this function:

setLogin (   $login,
  $unused = '0' 
)

affect account from its login

Parameters
string$loginlogin
Deprecated:
use setLoginName instead
Returns
bool true if ok

Definition at line 226 of file Class.Account.php.

+ Here is the call graph for this function:

setLoginName (   $login)

affect account from login name

Parameters
string$loginlogin
Returns
bool true if ok

Definition at line 130 of file Class.Account.php.

+ Here is the call graph for this function:

setRoles ( array  $roleIds)

set role set to a user/group

Parameters
array$roleIdssystem identicators or reference roles (login)
Returns
string error message

Definition at line 1213 of file Class.Account.php.

+ Here is the call graph for this function:

setSubstitute (   $substitute)

set substitute to this user this user become the incumbent of $substitute

Parameters
string$substitutelogin or user system id
Returns
string error message (empty if not)

Definition at line 178 of file Class.Account.php.

+ Here is the call graph for this function:

setSupervisorHtpasswd (   $admin_passwd)

Set password for the admin account in the `admin' subdir

Parameters
string$admin_passwdthe password
Returns
string error message, emptuy string if no error

Definition at line 1146 of file Class.Account.php.

setUsers (   $fid,
  $lname,
  $fname,
  $expires,
  $passdelay,
  $login,
  $status,
  $pwd1,
  $pwd2,
  $unused = '',
  $extmail = '' 
)

update user from IUSER document

Deprecated:
replace by updateUser
Parameters
int$fiddocument id
string$loginlogin

Definition at line 435 of file Class.Account.php.

+ Here is the call graph for this function:

updateMemberOf (   $updateSubstitute = true)

update memberof fields with all group/role of user

Parameters
bool$updateSubstitutealso update substitute by default
Returns
array of memberof identificators
Exceptions
Dcp\Exception

Definition at line 938 of file Class.Account.php.

+ Here is the call graph for this function:

updateUser (   $fid,
  $lname,
  $fname,
  $expires,
  $passdelay,
  $login,
  $status,
  $pwd1,
  $pwd2,
  $extmail = '',
array  $roles = array(-1    ),
  $substitute = - 1 
)

update user from IUSER document

Parameters
int$fiddocument id
string$lnamelast name
string$fnamefirst name
string$expiresexpiration date
int$passdelaypassword delay
string$loginlogin
string$status'A' (Activate) , 'D' (Desactivated)
string$pwd1password one
string$pwd2password two
string$extmailmail address
array$roles
int$substitutesystem substitute id
Returns
string error message

Definition at line 455 of file Class.Account.php.

+ Here is the call graph for this function:

Field Documentation

$accounttype

Definition at line 78 of file Class.Account.php.

$dbtable = "users"

Definition at line 96 of file Class.Account.php.

Definition at line 69 of file Class.Account.php.

$famid

Definition at line 87 of file Class.Account.php.

$fid

Definition at line 73 of file Class.Account.php.

$fields
Initial value:
= array(
"id",
"lastname",
"firstname",
"login",
"password",
"substitute",
"isgroup",
"accounttype",
"memberof",
"expires",
"passdelay",
"status",
"mail",
"fid"
)

Definition at line 42 of file Class.Account.php.

$firstname

Definition at line 61 of file Class.Account.php.

$fulltextfields
Initial value:
= array(
"login",
"lastname",
"firstname"
)

Definition at line 100 of file Class.Account.php.

$id

Definition at line 59 of file Class.Account.php.

$id_fields
Initial value:
= array(
"id"
)

Definition at line 92 of file Class.Account.php.

$isgroup

Definition at line 68 of file Class.Account.php.

$lastname

Definition at line 60 of file Class.Account.php.

$login

Definition at line 62 of file Class.Account.php.

$mail

Definition at line 72 of file Class.Account.php.

$memberof

Definition at line 74 of file Class.Account.php.

$order_by = "lastname, accounttype"

Definition at line 98 of file Class.Account.php.

$passdelay

Definition at line 70 of file Class.Account.php.

$password

Definition at line 63 of file Class.Account.php.

Definition at line 91 of file Class.Account.php.

$sqlcreate
Initial value:
= "
create table users ( id int not null,
primary key (id),
lastname text,
firstname text,
login text not null,
password text not null,
isgroup char,
substitute int,
accounttype char,
memberof int[],
expires int,
passdelay int,
status char,
mail text,
fid int);
create index users_idx2 on users(lastname);
CREATE UNIQUE INDEX users_login on users (login);
create sequence seq_id_users start 10;"

Definition at line 106 of file Class.Account.php.

$status

Definition at line 71 of file Class.Account.php.

$substitute

Definition at line 82 of file Class.Account.php.

const ADMIN_ID = 1

Definition at line 36 of file Class.Account.php.

const ANONYMOUS_ID = ANONYMOUS_ID

Definition at line 33 of file Class.Account.php.

const GADMIN_ID = GADMIN_ID

Definition at line 35 of file Class.Account.php.

const GALL_ID = GALL_ID

Definition at line 34 of file Class.Account.php.

const GROUP_TYPE = "G"

Definition at line 39 of file Class.Account.php.

const ROLE_TYPE = "R"

Definition at line 40 of file Class.Account.php.

const USER_TYPE = "U"

Definition at line 38 of file Class.Account.php.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen