diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 0c347626..b0f68e41 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -892,6 +892,8 @@ class accountContainer { } // Return error if objectClass isn't found if ($line==-1) trigger_error (sprintf(_("ObjectClass %s required but not defined in ldap."), $objectClass), E_USER_WARNING); + // get casesensitive objectClass name + $objectClassName = substr($_SESSION['ldap']->objectClasses[$line], 6+strpos($_SESSION['ldap']->objectClasses[$line], "NAME '"), strlen($objectClass) ); if (strpos($_SESSION['ldap']->objectClasses[$line], 'MUST (')) { $string_withtail = substr($_SESSION['ldap']->objectClasses[$line], strpos($_SESSION['ldap']->objectClasses[$line], 'MUST (')+6); // Now we have a string with all must-attributes @@ -972,8 +974,8 @@ class accountContainer { $return[$attribute] =& $this->module[$module[$i]]->orig[$attribute]; } } - - return $return; + $return['objectClass'][0] = $objectClassName; + return $return; } /* This function return ldap attributes which are uses by $objectClass diff --git a/lam/lib/modules/account.inc b/lam/lib/modules/account.inc index 6c1db6bf..6b39316c 100644 --- a/lam/lib/modules/account.inc +++ b/lam/lib/modules/account.inc @@ -63,11 +63,6 @@ class account extends baseModule { function init($base) { // call parent init parent::init($base); - // load attribtues which are used in account objectClass - $this->orig = $_SESSION[$this->base]->get_module_attributes('account'); - $this->attributes = $_SESSION[$this->base]->get_module_attributes('account'); - // Add objectClass to attributes - $this->attributes['objectClass'][0] = 'account'; } // Variables diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 10369ad8..27d0fd34 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -126,15 +126,6 @@ class inetOrgPerson extends baseModule { function init($base) { // call parent init parent::init($base); - // load attribtues which are used in inetOrgPerson objectClass - // unset attributes which are "must" but not in this module - // cn will be set to uid in module posixAccount - // Therefore module posixAccount is required an cn will be removed from main index in account_container - // Create copy of attributes - $this->orig = $_SESSION[$this->base]->get_module_attributes('inetOrgPerson'); - $this->attributes = $_SESSION[$this->base]->get_module_attributes('inetOrgPerson'); - // Add objectClass to attributes - $this->attributes['objectClass'][0] = 'inetOrgPerson'; } // Variables @@ -149,21 +140,21 @@ class inetOrgPerson extends baseModule { /** regular expression for host name */ var $regex_host = '^([a-z0-9\\.-])+(([,])+([ ])*([a-z0-9\\.-])+)*$'; /** regular expression for first/last name */ - var $regex_name = '^([a-z äöüß-])+$'; + var $regex_name = '^([a-z ��])+$'; /** regular expression for telephone numbers */ var $regex_telephoneNumber = '^(\+)*([0-9]|[ ]|[.]|[(]|[)]|[/]|[-])*$'; /** regular expression for e-mail */ var $regex_email = '^(([0-9a-z\\._-])+[@]([0-9a-z-])+([.]([0-9a-z-])+)*)*$'; /** regular expression for street names */ - var $regex_street = '^([0-9a-z \\.äöüß-])*$'; + var $regex_street = '^([0-9a-z \\.��])*$'; /** regular expression for postal address */ - var $regex_postalAddress = '^([0-9a-z \\.äöüß-])*$'; + var $regex_postalAddress = '^([0-9a-z \\.��])*$'; /** regular expression for postal codes */ var $regex_postalCode = '^([0-9a-z])*$'; /** regular expression for job titles */ - var $regex_title = '^([0-9a-z \\.äöüß-])*$'; + var $regex_title = '^([0-9a-z \\.��])*$'; /** regular expression for employee types */ - var $regex_employeeType = '^([0-9a-z \\.äöüß-])*$'; + var $regex_employeeType = '^([0-9a-z \\.��])*$'; /** list of possible error messages */ var $messages = array(); diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index e5401702..5f388892 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -170,21 +170,9 @@ class posixAccount extends baseModule { function init($base) { // call parent init parent::init($base); - // Add Array with all attributes and type - $this->orig = $_SESSION[$this->base]->get_module_attributes('posixAccount'); - $this->attributes = $_SESSION[$this->base]->get_module_attributes('posixAccount'); - $groups = $_SESSION['cache']->findgroups(); // list of all groupnames if (count($groups)==0) trigger_error(_('No groups found in ldap.'), E_USER_WARNING); - // Make references to attributes which already esists in ldap - $newattributes = array_keys($this->attributes); - $module = array_keys($_SESSION[$this->base]->module); - for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; - } - $this->attributes['objectClass'][0] = 'posixAccount'; $this->createhomedir=false; } diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index 587fada0..96ce1918 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -163,8 +163,6 @@ class posixGroup extends baseModule { function init($base) { // call parent init parent::init($base); - $this->attributes =& $_SESSION[$this->base]->get_module_attributes('posixGroup'); - $this->orig =& $_SESSION[$this->base]->get_module_attributes('posixGroup', true); $this->changegids=false; } diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index 9064fd2f..c351069f 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -182,18 +182,6 @@ class sambaAccount extends baseModule { function init($base) { // call parent init parent::init($base); - // Add Array with all attributes and type - $this->attributes = $_SESSION[$this->base]->get_module_attributes('sambaAccount'); - $_SESSION[$this->base]->add_attributes ('sambaAccount'); - // Make references to attributes which already esists in ldap - $newattributes = array_keys($this->attributes); - $module = array_keys($_SESSION[$this->base]->module); - for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; - } - $this->orig = $this->attributes ; - $this->attributes['objectClass'][0] = 'sambaAccount'; $this->useunixpwd=false; // List of well known rids $this->rids = array ( _('Domain Admins') => 512, _('Domain Users') => 513, _('Domain Guests') => 514, _('Domain Computers') => 515, _('Domain Controllers') => 516, @@ -213,11 +201,11 @@ class sambaAccount extends baseModule { var $rids; /** regular expression for home directory */ - var $regex_homedir = '^[\][\]([a-z0-9\\.%-])+([\]([a-z0-9\\.%äöüß\\$-])+)+$'; + var $regex_homedir = '^[\][\]([a-z0-9\\.%-])+([\]([a-z0-9\\.%��\$-])+)+$'; /** regular expression for profile path */ var $regex_profilePath = '^([\][\]([a-zA-Z0-9\\.%-])+([\]([a-z0-9\\.%-])+)+)|([/][a-z]([a-z0-9\\._%-])*([/][a-z]([a-z0-9\\._%-])*)*)$'; /** regular expression for logon script */ - var $regex_logonScript = '^([/])*([a-z0-9\\._%äöüß-])+([/]([a-z0-9\\._%äöüß-])+)*((\\.bat)|(\\.cmd))$'; + var $regex_logonScript = '^([/])*([a-z0-9\\._%��])+([/]([a-z0-9\\._%��])+)*((\\.bat)|(\\.cmd))$'; /** regular expression for allowed workstations */ var $regex_workstations = '^([a-z0-9\\._-])+(,[a-z0-9\\._-])*$'; /** regular expression for domain name */ @@ -464,10 +452,10 @@ class sambaAccount extends baseModule { $scriptPath = str_replace('$group', 'group', $scriptPath); $profilePath = str_replace('$user', 'user', $this->attributes['profilePath'][0]); $profilePath = str_replace('$group', 'group', $profilePath); - if ( (!$smbHome=='') && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+)+$', $smbHome))) + if ( (!$smbHome=='') && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%]|[�|[�|[�|[�|[]|[�|[�)+)+$', $smbHome))) $errors['smbHome'][] = array('ERROR', _('Home path'), _('Home path is invalid.')); - if ( (!$scriptPath=='') && (!ereg('^([/])*([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*'. - '([/]([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[ä]|[Ä]|[ö]|[Ö]|[ü]|[Ü]|[ß])*)*(([.][b][a][t])|([.][c][m][d]))$', $scriptPath))) + if ( (!$scriptPath=='') && (!ereg('^([/])*([a-z]|[0-9]|[.]|[-]|[_]|[%]|[�|[�|[�|[�|[]|[�|[�)+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[�|[�|[�|[�|[]|[�|[�)*'. + '([/]([a-z]|[0-9]|[.]|[-]|[_]|[%]|[�|[�|[�|[�|[]|[�|[�)+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[�|[�|[�|[�|[]|[�|[�)*)*(([.][b][a][t])|([.][c][m][d]))$', $scriptPath))) $errors['scriptPath'][] = array('ERROR', _('Script path'), _('Script path is invalid!')); if ( (!$profilePath=='') && (!ereg('^[/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*([/][a-z]([a-z]|[0-9]|[.]|[-]|[_]|[%])*)*$', $profilePath)) && (!ereg('^[\][\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+([\]([a-z]|[A-Z]|[0-9]|[.]|[-]|[%])+)+$', $profilePath))) diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index f376caa8..f656bd22 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -109,19 +109,6 @@ class sambaGroupMapping extends baseModule { function init($base) { // call parent init parent::init($base); - // Add Array with all attributes and type - $this->attributes = $_SESSION[$this->base]->get_module_attributes('sambaGroupMapping'); - $_SESSION[$this->base]->add_attributes ('sambaGroupMapping'); - $this->alias = _('sambaGroupMapping'); - // Make references to attributes which already esists in ldap - $newattributes = array_keys($this->attributes); - $module = array_keys($_SESSION[$this->base]->module); - // fixme *** do we have to unset module posixAccuont itself - for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; - } - $this->orig = $this->attributes ; $this->rids = array ( _('Domain Admins') => 512, _('Domain Users') => 513, _('Domain Guests') => 514, _('Domain Computers') => 515, _('Domain Controllers') => 516, _('Domain Certificate Admins') => 517, _('Domain Schema Admins') => 518, _('Domain Enterprise Admins') => 519, _('Domain Policy Admins') => 520 ); } diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 6ad2361a..dfa4d752 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -115,18 +115,6 @@ class sambaSamAccount extends baseModule { function init($base) { // call parent init parent::init($base); - // Add Array with all attributes and type - $this->attributes = $_SESSION[$this->base]->get_module_attributes('sambaSamAccount'); - $_SESSION[$this->base]->add_attributes ('sambaSamAccount'); - // Make references to attributes which already esists in ldap - $newattributes = array_keys($this->attributes); - $module = array_keys($_SESSION[$this->base]->module); - for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; - } - $this->orig = $this->attributes ; - $this->attributes['objectClass'][0] = 'sambaSamAccount'; $this->useunixpwd=false; // List of well known rids $this->rids = array ( _('Domain Admins') => 512, _('Domain Users') => 513, _('Domain Guests') => 514, _('Domain Computers') => 515, _('Domain Controllers') => 516, @@ -147,11 +135,11 @@ class sambaSamAccount extends baseModule { /** regular expression for home directory */ - var $regex_homedir = '^[\][\]([a-z0-9\\.%-])+([\]([a-z0-9\\.%äöüß\\$-])+)+$'; + var $regex_homedir = '^[\][\]([a-z0-9\\.%-])+([\]([a-z0-9\\.%��\$-])+)+$'; /** regular expression for profile path */ var $regex_profilePath = '^([\][\]([a-zA-Z0-9\\.%-])+([\]([a-z0-9\\.%-])+)+)|([/][a-z]([a-z0-9\\._%-])*([/][a-z]([a-z0-9\\._%-])*)*)$'; /** regular expression for logon script */ - var $regex_logonScript = '^([/])*([a-z0-9\\._%äöüß-])+([/]([a-z0-9\\._%äöüß-])+)*((\\.bat)|(\\.cmd))$'; + var $regex_logonScript = '^([/])*([a-z0-9\\._%��])+([/]([a-z0-9\\._%��])+)*((\\.bat)|(\\.cmd))$'; /** regular expression for allowed workstations */ var $regex_workstations = '^([a-z0-9\\._-])+(,[a-z0-9\\._-])*$'; diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index a6346f17..e528346f 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -156,18 +156,6 @@ class shadowAccount extends baseModule { function init($base) { // call parent init parent::init($base); - // Add Array with all attributes and type - $this->attributes = $_SESSION[$this->base]->get_module_attributes('shadowAccount'); - $_SESSION[$this->base]->add_attributes ('shadowAccount'); - // Make references to attributes which already esists in ldap - $newattributes = array_keys($this->attributes); - $module = array_keys($_SESSION[$this->base]->module); - for ($i=0; $ibase]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute]; - } - $this->orig = $this->attributes ; - $this->attributes['objectClass'][0] = 'shadowAccount'; } // Variables