PHPDoc coments added; refactored some things by using the meta array;
This commit is contained in:
parent
dc328d7d5d
commit
28184982b9
|
@ -308,6 +308,34 @@ class baseModule {
|
|||
return $messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array with all fields available for this account type on the PDF
|
||||
* output. This method may be overwritten by subclasses or it may be used
|
||||
* by using entries in the $this->meta['PDF_fields'] array of the specific sub-
|
||||
* class.
|
||||
*
|
||||
* @param string $scope account type
|
||||
* @return array list of available fields for PDF output
|
||||
*/
|
||||
function get_pdfFields($scope = 'user') {
|
||||
return ((isset($this>meta['PDF_fields'])) ? $this->meta['PDF_fields'] : array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a hastable with all entries that may be printed out in the PDF. The
|
||||
* syntax of the hashtable is specified by the module specification and the
|
||||
* corresponding DTD. This method must be overwritten in case that there
|
||||
* are non static things to be returned. The $this->meta['PDF_entries'] array
|
||||
* may be used when there is only static content.
|
||||
*
|
||||
* @param string $scope account type
|
||||
* @return array hastable of entries for the PDF. Each entry is an array where
|
||||
* each entry is treated as a new line in the PDF.
|
||||
*/
|
||||
function get_pdf_entries($scope = 'user') {
|
||||
return ((isset($this->meta['PDF_entries'])) ? $this->meta['PDF_entries'] : array());
|
||||
}
|
||||
|
||||
// TODO implement missing interface
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,8 @@ class account extends baseModule {
|
|||
$return["alias"] = _('Account');
|
||||
// module dependencies
|
||||
$return['dependencies'] = array('depends' => array(), 'conflicts' => array('inetOrgPerson'));
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array('description');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -196,10 +198,10 @@ class account extends baseModule {
|
|||
return 0;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'description');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array('account_description' => array('<block><key>' . _('Description') . '</key><value>' . $this->attributes['description'][0] . '</value></block>'));
|
||||
}
|
||||
|
|
|
@ -87,6 +87,21 @@ class inetOrgPerson extends baseModule {
|
|||
'error_message' => $this->messages['title']);
|
||||
$return['profile_checks']['inetOrgPerson_employeeType'] = array('type' => 'regex_i',
|
||||
'regex' => $this->regex_employeeType, 'error_message' => $this->messages['employeeType']);
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'description',
|
||||
'host',
|
||||
'title',
|
||||
'givenName',
|
||||
'sn',
|
||||
'employeeType',
|
||||
'street',
|
||||
'postalCode',
|
||||
'postalAddress',
|
||||
'telephoneNumber',
|
||||
'mobileTelephoneNumber',
|
||||
'facimilieTelefonNumber',
|
||||
'mail');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -363,22 +378,10 @@ class inetOrgPerson extends baseModule {
|
|||
return 0;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type = "user") {
|
||||
return array( 'description',
|
||||
'host',
|
||||
'title',
|
||||
'givenName',
|
||||
'sn',
|
||||
'employeeType',
|
||||
'street',
|
||||
'postalCode',
|
||||
'postalAddress',
|
||||
'telephoneNumber',
|
||||
'mobileTelephoneNumber',
|
||||
'facimilieTelefonNumber',
|
||||
'mail');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array( 'inetOrgPerson_description' => array('<block><key>' . _('Description') . '</key><value>' . $this->attributes['description'][0] . '</value></block>'),
|
||||
'inetOrgPerson_host' => array('<block><key>' . _('Unix workstations') . '</key><value>' . $this->attributes['host'][0] . '</value></block>'),
|
||||
|
|
|
@ -138,6 +138,17 @@ class posixAccount extends baseModule {
|
|||
'posixAccount_pwdHash' => _("Password hash type"),
|
||||
)
|
||||
);
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'uid',
|
||||
'uidNumber',
|
||||
'gidNumber',
|
||||
'gecos',
|
||||
'primaryGroup',
|
||||
'additionalGroups',
|
||||
'homeDirectory',
|
||||
'userPassword',
|
||||
'loginShell');
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -769,18 +780,10 @@ class posixAccount extends baseModule {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'uid',
|
||||
'uidNumber',
|
||||
'gidNumber',
|
||||
'gecos',
|
||||
'primaryGroup',
|
||||
'additionalGroups',
|
||||
'homeDirectory',
|
||||
'userPassword',
|
||||
'loginShell');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array( 'posixAccount_uid' => array('<block><key>' . _('Username') . '</key><value>' . $this->attributes['uid'][0] . '</value></block>'),
|
||||
'posixAccount_uidNumber' => array('<block><key>' . _('UID number') . '</key><value>' . $this->attributes['uidNumber'][0] . '</value></block>'),
|
||||
|
|
|
@ -121,6 +121,11 @@ class posixGroup extends baseModule {
|
|||
'required' => true, 'required_message' => $this->messages['maxGID'], 'error_message' => $this->messages['maxGID']);
|
||||
$return['config_checks']['group']['cmpGID'] = array('type' => 'int_greater', 'cmp_name1' => 'posixGroup_maxGID',
|
||||
'cmp_name2' => 'posixGroup_minGID', 'error_message' => $this->messages['cmpGID']);
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'cn',
|
||||
'gidNumber',
|
||||
'memberUid',
|
||||
'description');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -631,13 +636,10 @@ class posixGroup extends baseModule {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'cn',
|
||||
'gidNumber',
|
||||
'memberUid',
|
||||
'description');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "group") {
|
||||
return array( 'posixGroup_cn' => array('<block><key>' . _('Groupname') . '</key><value>' . $this->attributes['cn'][0] . '</value></block>'),
|
||||
'posixGroup_gidNumber' => array('<block><key>' . _('GID number') . '</key><value>' . $this->attributes['gidNumber'][0] . '</value></block>'),
|
||||
|
|
|
@ -57,6 +57,8 @@ class quota extends baseModule {
|
|||
// module dependencies
|
||||
$return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array());
|
||||
}
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'quotas');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -371,10 +373,10 @@ class quota extends baseModule {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'quotas');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array( 'quota_quotas' => array('<block><key>' . _('User quota') . '</key><td width="20%"><b>' . _('Mountpoint') . '</b></td><td width="20%"><b>' . _('Soft block') . '</b></td><td width="20%"><b>' . _('Soft inode') . '</b></td><td width="20%"><b>' . _('Hard block') . '</b></td><td width="20%"><b>' . _('Hard inode') . '</b></td></block>'));
|
||||
}
|
||||
|
|
|
@ -165,6 +165,16 @@ class sambaAccount extends baseModule {
|
|||
'error_message' => $this->messages['workstations']);
|
||||
$return['profile_checks']['sambaAccount_domain'] = array('type' => 'regex_i', 'regex' => $this->regex_domain,
|
||||
'error_message' => $this->messages['domain']);
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'displayName',
|
||||
'uid',
|
||||
'smbHome',
|
||||
'homeDrive',
|
||||
'scriptPath',
|
||||
'profilePath',
|
||||
'userWorkstations',
|
||||
'domain',
|
||||
'description');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -711,18 +721,10 @@ class sambaAccount extends baseModule {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'displayName',
|
||||
'uid',
|
||||
'smbHome',
|
||||
'homeDrive',
|
||||
'scriptPath',
|
||||
'profilePath',
|
||||
'userWorkstations',
|
||||
'domain',
|
||||
'description');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array( 'sambaAccount_displayName' => array('<block><key>' . _('Display name') . '</key><value' . $this->attributes['displayName'][0] . '</value></block>'),
|
||||
'sambaAccount_uid' => array('<block><key>' . _('Username') . '</key><value>' . $this->attributes['uid'][0] . '</value></block>'),
|
||||
|
|
|
@ -67,6 +67,12 @@ class sambaGroupMapping extends baseModule {
|
|||
$return["alias"] = _('Samba 3');
|
||||
// module dependencies
|
||||
$return['dependencies'] = array('depends' => array('posixGroup'), 'conflicts' => array());
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'gidNumber',
|
||||
'sambaSID',
|
||||
'displayName',
|
||||
'sambaGroupType',
|
||||
'description');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -320,14 +326,10 @@ class sambaGroupMapping extends baseModule {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'gidNumber',
|
||||
'sambaSID',
|
||||
'displayName',
|
||||
'sambaGroupType',
|
||||
'description');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "User") {
|
||||
return array( 'sambaGroupMapping_gidNumber' => array('<block><key>' . _('GID number') . '</key><value>' . $this->attributes['gidNumber'][0] . '</value></block>'),
|
||||
'sambaGroupMapping_sambaSID' => array('<block><key>' . _('Windows group') . '</key><value>' . $this->attributes['sambaSID'][0] . '</value></block>'),
|
||||
|
|
|
@ -97,6 +97,17 @@ class sambaSamAccount extends baseModule {
|
|||
'error_message' => $this->messages['logonScript']);
|
||||
$return['profile_checks']['sambaSamAccount_userWorkstations'] = array('type' => 'regex_i', 'regex' => $this->regex_workstations,
|
||||
'error_message' => $this->messages['workstations']);
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'displayName',
|
||||
'uid',
|
||||
'sambaHomePath',
|
||||
'sambaHomeDrive',
|
||||
'sambaLogonScript',
|
||||
'sambaProfilePath',
|
||||
'sambaUserWorkstations',
|
||||
'sambaDomainName',
|
||||
'description',
|
||||
'sambaPrimaryGroupSID');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -744,19 +755,10 @@ class sambaSamAccount extends baseModule {
|
|||
return $return;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'displayName',
|
||||
'uid',
|
||||
'sambaHomePath',
|
||||
'sambaHomeDrive',
|
||||
'sambaLogonScript',
|
||||
'sambaProfilePath',
|
||||
'sambaUserWorkstations',
|
||||
'sambaDomainName',
|
||||
'description',
|
||||
'sambaPrimaryGroupSID');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array( 'sambaSamAccount_displayName' => array('<block><key>' . _('Display name') . '</key><value' . $this->attributes['displayName'][0] . '</value></block>'),
|
||||
'sambaSamAccount_uid' => array('<block><key>' . _('Username') . '</key><value>' . $this->attributes['uid'][0] . '</value></block>'),
|
||||
|
|
|
@ -135,6 +135,13 @@ class shadowAccount extends baseModule {
|
|||
'error_message' => $this->messages['inactive']);
|
||||
$return['profile_checks']['shadowAccount_shadowWarning'] = array('type' => 'regex', 'regex' => $this->regex_number,
|
||||
'error_message' => $this->messages['shadowWarning']);
|
||||
// available PDF fields
|
||||
$return['PDF_fields'] = array( 'shadowLastChange',
|
||||
'shadowWarning',
|
||||
'shadowInactive',
|
||||
'shadowExpire',
|
||||
'shadowFlag',
|
||||
'description');
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -328,15 +335,10 @@ class shadowAccount extends baseModule {
|
|||
return 0;
|
||||
}
|
||||
|
||||
function get_pdfFields($account_type="user") {
|
||||
return array( 'shadowLastChange',
|
||||
'shadowWarning',
|
||||
'shadowInactive',
|
||||
'shadowExpire',
|
||||
'shadowFlag',
|
||||
'description');
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-PHPDoc)
|
||||
* @see baseModule#get_pdfEntries
|
||||
*/
|
||||
function get_pdfEntries($account_type = "user") {
|
||||
return array( 'shadowAccount_shadowLastChange' => array('<block><key>' . _('Last shadow password change') . '</key><value>' . $this->attributes['shadowLastChange'][0] . '</value></block>'),
|
||||
'shadowAccount_shadowWarning' => array('<block><key>' . _('Password warn') . '</key><value>' . $this->attributes['shadowWarn'][0] . '</value><block>'),
|
||||
|
|
Loading…
Reference in New Issue