removed old code which isn't not needed anymore.

It's handled by accountContainer now
This commit is contained in:
katagia 2004-09-14 13:09:13 +00:00
parent b6bc73106c
commit 3b47260d69
9 changed files with 16 additions and 91 deletions

View File

@ -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,7 +974,7 @@ class accountContainer {
$return[$attribute] =& $this->module[$module[$i]]->orig[$attribute];
}
}
$return['objectClass'][0] = $objectClassName;
return $return;
}

View File

@ -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

View File

@ -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 <EFBFBD><EFBFBD>])+$';
/** 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 \\.<EFBFBD><EFBFBD>])*$';
/** regular expression for postal address */
var $regex_postalAddress = '^([0-9a-z \\.äöüß-])*$';
var $regex_postalAddress = '^([0-9a-z \\.<EFBFBD><EFBFBD>])*$';
/** 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 \\.<EFBFBD><EFBFBD>])*$';
/** regular expression for employee types */
var $regex_employeeType = '^([0-9a-z \\.äöüß-])*$';
var $regex_employeeType = '^([0-9a-z \\.<EFBFBD><EFBFBD>])*$';
/** list of possible error messages */
var $messages = array();

View File

@ -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; $i<count($module); $i++) {
foreach ($newattributes as $attribute)
if (isset($_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute])) $this->attributes[$attribute] =& $_SESSION[$this->base]->module[$module[$i]]->attributes[$attribute];
}
$this->attributes['objectClass'][0] = 'posixAccount';
$this->createhomedir=false;
}

View File

@ -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;
}

View File

@ -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; $i<count($module); $i++) {
foreach ($newattributes as $attribute)
if (isset($_SESSION[$this->base]->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\\.%<EFBFBD><EFBFBD>\$-])+)+$';
/** 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\\._%<EFBFBD><EFBFBD>])+([/]([a-z0-9\\._%<25><>])+)*((\\.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]|[.]|[-]|[%]|[<EFBFBD>|[<5B>|[<5B>|[<5B>|[]|[<5B>|[<5B>)+)+$', $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]|[.]|[-]|[_]|[%]|[<EFBFBD>|[<5B>|[<5B>|[<5B>|[]|[<5B>|[<5B>)+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[<5B>|[<5B>|[<5B>|[<5B>|[]|[<5B>|[<5B>)*'.
'([/]([a-z]|[0-9]|[.]|[-]|[_]|[%]|[<EFBFBD>|[<5B>|[<5B>|[<5B>|[]|[<5B>|[<5B>)+([a-z]|[0-9]|[.]|[-]|[_]|[%]|[<5B>|[<5B>|[<5B>|[<5B>|[]|[<5B>|[<5B>)*)*(([.][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)))

View File

@ -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; $i<count($module); $i++) {
foreach ($newattributes as $attribute)
if (isset($_SESSION[$this->base]->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 );
}

View File

@ -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; $i<count($module); $i++) {
foreach ($newattributes as $attribute)
if (isset($_SESSION[$this->base]->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\\.%<EFBFBD><EFBFBD>\$-])+)+$';
/** 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\\._%<EFBFBD><EFBFBD>])+([/]([a-z0-9\\._%<25><>])+)*((\\.bat)|(\\.cmd))$';
/** regular expression for allowed workstations */
var $regex_workstations = '^([a-z0-9\\._-])+(,[a-z0-9\\._-])*$';

View File

@ -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; $i<count($module); $i++) {
foreach ($newattributes as $attribute)
if (isset($_SESSION[$this->base]->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