made shadowAccount optional
This commit is contained in:
parent
44daea3763
commit
b71e0e12a5
|
@ -38,6 +38,17 @@ $Id$
|
|||
*/
|
||||
class shadowAccount extends baseModule {
|
||||
|
||||
/**
|
||||
* Creates a new shadowAccount object.
|
||||
*
|
||||
* @param string $scope account type (user, group, host)
|
||||
*/
|
||||
function __construct($scope) {
|
||||
// call parent constructor
|
||||
parent::__construct($scope);
|
||||
$this->autoAddObjectClasses = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function builds up the message array.
|
||||
*/
|
||||
|
@ -223,6 +234,9 @@ class shadowAccount extends baseModule {
|
|||
* <br>"modify" are attributes which have to been modified in LDAP entry
|
||||
*/
|
||||
function save_attributes() {
|
||||
if (!in_array('shadowAccount', $this->attributes['objectClass'])) {
|
||||
return array();
|
||||
}
|
||||
$return = $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
|
||||
// Set shadowLastchange manual.
|
||||
$clearPwd = $this->getAccountContainer()->getAccountModule('posixAccount')->getClearTextPassword();
|
||||
|
@ -242,6 +256,9 @@ class shadowAccount extends baseModule {
|
|||
* @return array list of info/error messages
|
||||
*/
|
||||
function process_attributes() {
|
||||
if (!in_array('shadowAccount', $this->attributes['objectClass'])) {
|
||||
return array();
|
||||
}
|
||||
$errors = array();
|
||||
// Load attributes
|
||||
$this->attributes['shadowMin'][0] = $_POST['shadowMin'];
|
||||
|
@ -262,6 +279,11 @@ class shadowAccount extends baseModule {
|
|||
* @return array meta HTML code
|
||||
*/
|
||||
function display_html_attributes() {
|
||||
if (isset($_POST['form_subpage_shadowAccount_attributes_addObjectClass'])) {
|
||||
$this->attributes['objectClass'][] = 'shadowAccount';
|
||||
}
|
||||
$return = array();
|
||||
if (in_array('shadowAccount', $this->attributes['objectClass'])) {
|
||||
$shWarning = '';
|
||||
if (isset($this->attributes['shadowWarning'][0])) {
|
||||
$shWarning = $this->attributes['shadowWarning'][0];
|
||||
|
@ -302,7 +324,13 @@ class shadowAccount extends baseModule {
|
|||
array('kind' => 'input', 'name' => 'form_subpage_shadowAccount_expire_open', 'type' => 'submit', 'value' => _('Change'))
|
||||
))),
|
||||
array('kind' => 'help', 'value' => 'shadowExpire' ));
|
||||
|
||||
}
|
||||
else {
|
||||
$return[] = array(
|
||||
array('kind' => 'text', 'text' => ' '),
|
||||
array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_shadowAccount_attributes_addObjectClass', 'value' => _('Add Shadow account'))
|
||||
);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue