some subclassing support

This commit is contained in:
Roland Gruber 2007-06-24 17:54:23 +00:00
parent d22422bff2
commit 3f232311df
1 changed files with 14 additions and 14 deletions

View File

@ -31,8 +31,7 @@ $Id$
*/ */
/** /**
* This class contains all account LDAP attributes * This module manages LDAP attributes of the object class inetOrgPerson (e.g. name and address).
* and funtioncs required to deal with inetOrgPerson.
* *
* @package modules * @package modules
*/ */
@ -582,10 +581,11 @@ class inetOrgPerson extends baseModule {
return $errors; return $errors;
} }
/* This function will create the html-page /**
* to show a page with all attributes. * Returns the HTML meta data for the main account page.
* It will output a complete html-table *
*/ * @return array HTML meta data
*/
function display_html_attributes() { function display_html_attributes() {
$modules = $_SESSION['config']->get_AccountModules($this->get_scope()); $modules = $_SESSION['config']->get_AccountModules($this->get_scope());
if (!in_array('posixAccount', $modules)) { if (!in_array('posixAccount', $modules)) {
@ -646,7 +646,7 @@ class inetOrgPerson extends baseModule {
else { else {
$return[] = array( $return[] = array(
array('kind' => 'text', 'text' => _('Password') ), array('kind' => 'text', 'text' => _('Password') ),
array('kind' => 'input', 'name' => 'form_subpage_inetOrgPerson_password_open', 'type' => 'submit', 'value' => _('Change password'))); array('kind' => 'input', 'name' => 'form_subpage_' . get_class($this) . '_password_open', 'type' => 'submit', 'value' => _('Change password')));
} }
$return[] = array(array('kind' => 'text', 'td' => array('colspan' => 3))); $return[] = array(array('kind' => 'text', 'td' => array('colspan' => 3)));
@ -789,7 +789,7 @@ class inetOrgPerson extends baseModule {
$photo = array(array( $photo = array(array(
array('kind' => 'image', 'alt' => _('Photo'), 'path' => $photoFile, 'td' => array('align' => 'center')))); array('kind' => 'image', 'alt' => _('Photo'), 'path' => $photoFile, 'td' => array('align' => 'center'))));
if ($noPhoto) { if ($noPhoto) {
$photo[] = array(array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_inetOrgPerson_photo_open', 'value' => _('Add photo'))); $photo[] = array(array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_' . get_class($this) . '_photo_open', 'value' => _('Add photo')));
} }
else { else {
$photo[] = array(array('kind' => 'input', 'type' => 'submit', 'name' => 'delPhoto', 'value' => _('Delete photo'))); $photo[] = array(array('kind' => 'input', 'type' => 'submit', 'name' => 'delPhoto', 'value' => _('Delete photo')));
@ -805,7 +805,7 @@ class inetOrgPerson extends baseModule {
* Sets a new password. * Sets a new password.
*/ */
function process_password() { function process_password() {
if ($_POST['form_subpage_inetOrgPerson_attributes_back']) return array(); if ($_POST['form_subpage_' . get_class($this) . '_attributes_back']) return array();
$messages = array(); $messages = array();
if ($_POST['userPassword'] != $_POST['userPassword2']) { if ($_POST['userPassword'] != $_POST['userPassword2']) {
$messages[] = $this->messages['userPassword'][0]; $messages[] = $this->messages['userPassword'][0];
@ -837,8 +837,8 @@ class inetOrgPerson extends baseModule {
$return[] = array( $return[] = array(
0 => array('kind' => 'table', 'value' => array( 0 => array('kind' => 'table', 'value' => array(
0 => array( 0 => array(
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Ok'), 'name' => 'form_subpage_inetOrgPerson_attributes_submit'), 0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Ok'), 'name' => 'form_subpage_' . get_class($this) . '_attributes_submit'),
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Cancel'), 'name' => 'form_subpage_inetOrgPerson_attributes_back'), 1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Cancel'), 'name' => 'form_subpage_' . get_class($this) . '_attributes_back'),
2 => array('kind' => 'text'))))); 2 => array('kind' => 'text')))));
return $return; return $return;
} }
@ -847,7 +847,7 @@ class inetOrgPerson extends baseModule {
* Sets a new photo. * Sets a new photo.
*/ */
function process_photo() { function process_photo() {
if ($_POST['form_subpage_inetOrgPerson_attributes_back']) return array(); if ($_POST['form_subpage_' . get_class($this) . '_attributes_back']) return array();
$messages = array(); $messages = array();
if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) { if ($_FILES['photoFile'] && ($_FILES['photoFile']['size'] > 0)) {
$handle = fopen($_FILES['photoFile']['tmp_name'], "r"); $handle = fopen($_FILES['photoFile']['tmp_name'], "r");
@ -874,8 +874,8 @@ class inetOrgPerson extends baseModule {
$return[] = array( $return[] = array(
0 => array('kind' => 'table', 'value' => array( 0 => array('kind' => 'table', 'value' => array(
0 => array( 0 => array(
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Add photo'), 'name' => 'form_subpage_inetOrgPerson_attributes_submit'), 0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Add photo'), 'name' => 'form_subpage_' . get_class($this) . '_attributes_submit'),
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_inetOrgPerson_attributes_back'), 1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_' . get_class($this) . '_attributes_back'),
2 => array('kind' => 'text'))))); 2 => array('kind' => 'text')))));
return $return; return $return;
} }