lib/modules/pykotaUser.inc

Properties

Description

Manages PyKota user accounts.

Classes

pykotaUser

Properties

 
 
modules  
No 
No 

Description

Manages PyKota user accounts.
It implements the complete module interface and uses meta-data provided by the account modules for its functions.

Location and naming of modules
All LAM modules are placed in lib/modules/ and are named ".inc". E.g. if you create a new module and its class name is "qmail" then the filename would be "qmail.inc". The class name of a module must contain only a-z, A-Z, 0-9, -, and _.

You can avoid to override many functions by using {@link get_metaData()}.

All module classes should extend the baseModule class.

Methods

__construct, build_uploadAccounts, checkSelfServiceSettings, display_html_attributes, display_html_jobs, display_html_payments, getCurrentUserName, getJobs, getSelfServiceOptions, get_metaData, get_pdfEntries, isStructural, loadUserNameCache, load_Messages, load_profile, manageDescription, manageMail, manageUid, module_complete, process_attributes, process_jobs, process_payments, pykotaUserNameExists, save_attributes, uidExists,

__construct( string   $scope, ) : n/a

Description

Creates a new pykotaUser object.

Arguments

Name Type Description Default
$scope string

account type (user, group, host)

Return value

Type Description
n/a n/a

build_uploadAccounts( array   $rawAccounts, array   $ids, array   $partialAccounts, array   $selectedModules, ) : array

Description

In this function the LDAP account is built up.

Arguments

Name Type Description Default
$rawAccounts array

list of hash arrays (name => value) from user input

$ids array

list of IDs for column position (e.g. "posixAccount_uid" => 5)

$partialAccounts array

list of hash arrays (name => value) which are later added to LDAP

$selectedModules array

list of selected account modules

Return value

Type Description
array list of error messages if any

checkSelfServiceSettings( array   $options, \selfServiceProfile   $profile, ) : array

Description

Checks if the self service settings are valid.
Calling this method does not require the existence of an enclosing {@link accountContainer}.

If the input data is invalid the return value is an array that contains arrays to build StatusMessages (message type, message head, message text). If no errors occured the function returns an empty array.

Arguments

Name Type Description Default
$options array

hash array (option name => value) that contains the input. The option values are all arrays containing one or more elements.

$profile \selfServiceProfile

self service profile

Return value

Type Description
array error messages

display_html_attributes( ) : \htmlElement

Description

Returns the HTML meta data for the main account page.

Return value

Type Description
\htmlElement HTML meta data

display_html_jobs( ) : \htmlElement

Description

Returns the HTML meta data for the jobs page.

Return value

Type Description
\htmlElement HTML meta data

display_html_payments( ) : \htmlElement

Description

Returns the HTML meta data for the payments page.

Return value

Type Description
\htmlElement HTML meta data

getCurrentUserName( ) : String

Description

Returns the current user name (uid) of this account.

Return value

Type Description
String user name

getJobs( String   $user, String   $suffix, ) : n/a

Description

Returns a list of jobs for the given user reverse-sorted by date.
The number of jobs is limited to 100.

Arguments

Name Type Description Default
$user String

user name

$suffix String

LDAP suffix for job objects

Return value

Type Description
n/a n/a

getSelfServiceOptions( array   $fields, array   $attributes, boolean   $passwordChangeOnly, array   $readOnlyFields, ) : array

Description

Returns the meta HTML code for each input field.
format: array( => array(), ...) It is not possible to display help links.

Arguments

Name Type Description Default
$fields array

list of active fields

$attributes array

attributes of LDAP account

$passwordChangeOnly boolean

indicates that the user is only allowed to change his password and no LDAP content is readable

$readOnlyFields array

list of read-only fields

Return value

Type Description
array list of meta HTML elements (field name => htmlTableRow)

get_metaData( ) : array

Description

Returns meta data that is interpreted by parent class

Return value

Type Description
array array with meta data

Tags

Name Description
see

get_pdfEntries( ) : n/a

Description

Returns a list of PDF entries

Return value

Type Description
n/a n/a

isStructural( ) : boolean

Description

Returns if this module also manages the structural object class pykotaObject.
This is overridden by a submodule that must provide the structural object class.

Return value

Type Description
boolean structural usage

loadUserNameCache( ) : n/a

Description

Loads the list of user names into the cache.

Return value

Type Description
n/a n/a

load_Messages( ) : n/a

Description

This function fills the $messages variable with output messages from this module.

Return value

Type Description
n/a n/a

load_profile( array   $profile, ) : n/a

Description

Loads the values of an account profile into internal variables.

Arguments

Name Type Description Default
$profile array

hash array with profile values (identifier => value)

Return value

Type Description
n/a n/a

manageDescription( ) : boolean

Description

Returns if the description attribute should be managed.

Return value

Type Description
boolean manage description attribute

manageMail( ) : boolean

Description

Returns if the mail attribute should be managed.

Return value

Type Description
boolean manage mail attribute

manageUid( ) : boolean

Description

Returns if the uid attribute should be managed.

Return value

Type Description
boolean manage uid attribute

module_complete( ) : boolean

Description

This function is used to check if all settings for this module have been made.
Calling this method requires the existence of an enclosing {@link accountContainer}.

This function tells LAM if it can create/modify the LDAP account. If your module needs any additional input then set this to false. The user will be notified that your module needs more input.
This method's return value defaults to true.

Return value

Type Description
boolean true, if settings are complete

process_attributes( ) : array

Description

Processes user input of the primary module page.
It checks if all input values are correct and updates the associated LDAP attributes.

Return value

Type Description
array list of info/error messages

process_jobs( ) : array

Description

Processes user input of the jobs module page.
It checks if all input values are correct and updates the associated LDAP attributes.

Return value

Type Description
array list of info/error messages

process_payments( ) : array

Description

Processes user input of the payments module page.
It checks if all input values are correct and updates the associated LDAP attributes.

Return value

Type Description
array list of info/error messages

pykotaUserNameExists( String   $pykotaUserName, ) : boolean

Description

Returns if the given pykotaUserName already exists.

Arguments

Name Type Description Default
$pykotaUserName String

pykotaUserName attribute value

Return value

Type Description
boolean pykotaUserName exists

save_attributes( ) : array

Description

Returns a list of modifications which have to be made to the LDAP account.

Return value

Type Description
array list of modifications <br>This function returns an array with 3 entries: <br>array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... ) <br>DN is the DN to change. It may be possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid) <br>"add" are attributes which have to be added to LDAP entry <br>"remove" are attributes which have to be removed from LDAP entry <br>"modify" are attributes which have to been modified in LDAP entry <br>"info" are values with informational value (e.g. to be used later by pre/postModify actions)

uidExists( String   $uid, ) : boolean

Description

Returns if the given uid already exists.

Arguments

Name Type Description Default
$uid String

uid attribute value

Return value

Type Description
boolean uid exists

Properties

$limitOptions, $pykotaUserNameCache, $uidCache,

  private  $limitOptions =

list of limit options label => value


  private  $pykotaUserNameCache = null

cache for pykotaUserName attribute


  private  $uidCache = null

cache for uid attribute


Documentation was generated by phpDocumentor 2.1.0 .

Namespaces

  • global

    Packages