substituted base->ldap/config with 'ldap'/'config'
This commit is contained in:
		
							parent
							
								
									32e319da6a
								
							
						
					
					
						commit
						7e9befcd6f
					
				|  | @ -223,7 +223,7 @@ class main extends baseModule { | ||||||
| 		if (count($table)!=0) $return[] = array ( 0 => array ( 'kind' => 'table', 'value' => $table ) ); | 		if (count($table)!=0) $return[] = array ( 0 => array ( 'kind' => 'table', 'value' => $table ) ); | ||||||
| 		// loop through all suffixes
 | 		// loop through all suffixes
 | ||||||
| 		$rootsuffix = call_user_func(array($_SESSION['config'], 'get_' . ucfirst($_SESSION[$this->base]->type) . 'Suffix')); | 		$rootsuffix = call_user_func(array($_SESSION['config'], 'get_' . ucfirst($_SESSION[$this->base]->type) . 'Suffix')); | ||||||
| 		foreach ($_SESSION[$_SESSION[$this->base]->ldap]->search_units($rootsuffix) as $suffix) { | 		foreach ($_SESSION['ldap']->search_units($rootsuffix) as $suffix) { | ||||||
| 			if ($_SESSION[$this->base]->dn) { | 			if ($_SESSION[$this->base]->dn) { | ||||||
| 				if ($_SESSION[$this->base]->dn == $suffix) $option_selected = $suffix; | 				if ($_SESSION[$this->base]->dn == $suffix) $option_selected = $suffix; | ||||||
| 				else $suffixes[] = $suffix; | 				else $suffixes[] = $suffix; | ||||||
|  |  | ||||||
|  | @ -223,13 +223,13 @@ class posixAccount extends baseModule { | ||||||
| 	function userPassword($newpassword=false) { | 	function userPassword($newpassword=false) { | ||||||
| 		if (is_string($newpassword)) { | 		if (is_string($newpassword)) { | ||||||
| 			// Write new password
 | 			// Write new password
 | ||||||
| 			$this->attributes['userPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); | 			$this->attributes['userPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); | ||||||
| 			return 0; | 			return 0; | ||||||
| 			} | 			} | ||||||
| 		else { | 		else { | ||||||
| 			if ($this->attributes['userPassword'][0]!='') { | 			if ($this->attributes['userPassword'][0]!='') { | ||||||
| 				// Read existing password if set
 | 				// Read existing password if set
 | ||||||
| 				return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['userPassword'][0])); | 				return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['userPassword'][0])); | ||||||
| 				} | 				} | ||||||
| 			else return ''; | 			else return ''; | ||||||
| 			} | 			} | ||||||
|  | @ -364,7 +364,7 @@ class posixAccount extends baseModule { | ||||||
| 			// Add new memberships
 | 			// Add new memberships
 | ||||||
| 			if (is_array($this->groups)) | 			if (is_array($this->groups)) | ||||||
| 				foreach ($this->groups as $group) { | 				foreach ($this->groups as $group) { | ||||||
| 					$dn = $_SESSION[$_SESSION[$this->base]->ldap]->in_cache ($group, 'cn', 'group'); | 					$dn = $_SESSION['ldap']->in_cache ($group, 'cn', 'group'); | ||||||
| 					$return[$dn]['add']['memberUid'][0] = $this->attributes['uid'][0]; | 					$return[$dn]['add']['memberUid'][0] = $this->attributes['uid'][0]; | ||||||
| 					} | 					} | ||||||
| 			} | 			} | ||||||
|  | @ -664,7 +664,7 @@ class posixAccount extends baseModule { | ||||||
| 				1 => array ( 'kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]), | 				1 => array ( 'kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]), | ||||||
| 				2 => array ('kind' => 'help', 'value' => 'homeDirectory')); | 				2 => array ('kind' => 'help', 'value' => 'homeDirectory')); | ||||||
| 			if (!$profile) { | 			if (!$profile) { | ||||||
| 				if ($this->orig['homeDirectory']=='' && isset($_SESSION[$_SESSION[$this->base]->config]->scriptPath)) { | 				if ($this->orig['homeDirectory']=='' && isset($_SESSION['config']->scriptPath)) { | ||||||
| 					$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Create home directory') ), | 					$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Create home directory') ), | ||||||
| 						1 => array ( 'kind' => 'input', 'name' => 'createhomedir', 'type' => 'checkbox', 'checked' => $this->createhomedir), | 						1 => array ( 'kind' => 'input', 'name' => 'createhomedir', 'type' => 'checkbox', 'checked' => $this->createhomedir), | ||||||
| 						2 => array ('kind' => 'help', 'value' => 'createhomedir')); | 						2 => array ('kind' => 'help', 'value' => 'createhomedir')); | ||||||
|  | @ -694,7 +694,7 @@ class posixAccount extends baseModule { | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 	function display_html_delete($post) { | 	function display_html_delete($post) { | ||||||
| 		if ($_SESSION[$this->base]->type=='user' && isset($_SESSION[$_SESSION[$this->base]->config]->scriptPath)) { | 		if ($_SESSION[$this->base]->type=='user' && isset($_SESSION['config']->scriptPath)) { | ||||||
| 			$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Delete home directory') ), | 			$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Delete home directory') ), | ||||||
| 				1 => array ( 'kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'), | 				1 => array ( 'kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'), | ||||||
| 				2 => array ('kind' => 'help', 'value' => 'deletehomedir')); | 				2 => array ('kind' => 'help', 'value' => 'deletehomedir')); | ||||||
|  |  | ||||||
|  | @ -222,13 +222,13 @@ class posixGroup extends baseModule { | ||||||
| 	function userPassword($newpassword=false) { | 	function userPassword($newpassword=false) { | ||||||
| 		if (is_string($newpassword)) { | 		if (is_string($newpassword)) { | ||||||
| 			// Write new password
 | 			// Write new password
 | ||||||
| 			$this->attributes['userPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); | 			$this->attributes['userPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); | ||||||
| 			return 0; | 			return 0; | ||||||
| 			} | 			} | ||||||
| 		else { | 		else { | ||||||
| 			if ($this->attributes['userPassword'][0]!='') { | 			if ($this->attributes['userPassword'][0]!='') { | ||||||
| 				// Read existing password if set
 | 				// Read existing password if set
 | ||||||
| 				return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['userPassword'][0])); | 				return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['userPassword'][0])); | ||||||
| 				} | 				} | ||||||
| 			else return ''; | 			else return ''; | ||||||
| 			} | 			} | ||||||
|  | @ -358,8 +358,8 @@ class posixGroup extends baseModule { | ||||||
| 		if ($this->changegids) { | 		if ($this->changegids) { | ||||||
| 			// get gidNumber
 | 			// get gidNumber
 | ||||||
| 			$line=-1; | 			$line=-1; | ||||||
| 			for ($i=0; $i<count($_SESSION[$this->ldap]->objectClasses) || $i==-1; $i++) { | 			for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $i==-1; $i++) { | ||||||
| 				if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'posixAccount'")) $line = $i; | 				if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'posixAccount'")) $line = $i; | ||||||
| 				} | 				} | ||||||
| 			if ($line!=-1) { | 			if ($line!=-1) { | ||||||
| 				$result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('gidNumber', 'posixAccount', '*'); | 				$result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('gidNumber', 'posixAccount', '*'); | ||||||
|  | @ -369,8 +369,8 @@ class posixGroup extends baseModule { | ||||||
| 				} | 				} | ||||||
| 			// change primaryGroupID
 | 			// change primaryGroupID
 | ||||||
| 			$line=-1; | 			$line=-1; | ||||||
| 			for ($i=0; $i<count($_SESSION[$this->ldap]->objectClasses) || $i==-1; $i++) { | 			for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $i==-1; $i++) { | ||||||
| 				if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'sambaAccount'")) $line = $i; | 				if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'sambaAccount'")) $line = $i; | ||||||
| 				} | 				} | ||||||
| 			if ($line!=-1) { | 			if ($line!=-1) { | ||||||
| 				$result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('primaryGroupID', 'sambaAccount', '*'); | 				$result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('primaryGroupID', 'sambaAccount', '*'); | ||||||
|  | @ -381,15 +381,15 @@ class posixGroup extends baseModule { | ||||||
| 				} | 				} | ||||||
| 			// change sambaPrimaryGroupSID
 | 			// change sambaPrimaryGroupSID
 | ||||||
| 			$line=-1; | 			$line=-1; | ||||||
| 			for ($i=0; $i<count($_SESSION[$this->ldap]->objectClasses) || $i==-1; $i++) { | 			for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $i==-1; $i++) { | ||||||
| 				if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'sambaSamAccount'")) $line = $i; | 				if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'sambaSamAccount'")) $line = $i; | ||||||
| 				} | 				} | ||||||
| 			if ($line!=-1) { | 			if ($line!=-1) { | ||||||
| 				$result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('sambaPrimaryGroupSID', 'sambaSamAccount', '*'); | 				$result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('sambaPrimaryGroupSID', 'sambaSamAccount', '*'); | ||||||
| 				$DNs = array_keys($result); | 				$DNs = array_keys($result); | ||||||
| 				for ($i=0; $i<count($DNs); $i++) { | 				for ($i=0; $i<count($DNs); $i++) { | ||||||
| 					// Get Domain SID from name
 | 					// Get Domain SID from name
 | ||||||
| 					$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 					$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 					// Get Domain-SID from group SID
 | 					// Get Domain-SID from group SID
 | ||||||
| 					$domainSID = substr($result[$DNs[$i]], 0, strrpos($result[$DNs[$i]], "-")); | 					$domainSID = substr($result[$DNs[$i]], 0, strrpos($result[$DNs[$i]], "-")); | ||||||
| 					for ($i=0; $i<count($sambaDomains); $i++ ) | 					for ($i=0; $i<count($sambaDomains); $i++ ) | ||||||
|  |  | ||||||
|  | @ -105,7 +105,7 @@ class quota extends baseModule { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	function module_ready() { | 	function module_ready() { | ||||||
| 		if (!isset($_SESSION[$_SESSION[$this->base]->config]->scriptPath)) return $false; | 		if (!isset($_SESSION['config']->scriptPath)) return $false; | ||||||
| 		if ($_SESSION[$this->base]->type=='user' && $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0]=='') return false; | 		if ($_SESSION[$this->base]->type=='user' && $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0]=='') return false; | ||||||
| 		if ($_SESSION[$this->base]->type=='group' && $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0]=='') return false; | 		if ($_SESSION[$this->base]->type=='group' && $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0]=='') return false; | ||||||
| 		return true; | 		return true; | ||||||
|  |  | ||||||
|  | @ -236,14 +236,14 @@ class sambaAccount extends baseModule { | ||||||
| 	function lmPassword($newpassword=false) { | 	function lmPassword($newpassword=false) { | ||||||
| 		if (is_string($newpassword)) { | 		if (is_string($newpassword)) { | ||||||
| 			// Write new password
 | 			// Write new password
 | ||||||
| 			$this->attributes['lmPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); | 			$this->attributes['lmPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); | ||||||
| 			return 0; | 			return 0; | ||||||
| 			} | 			} | ||||||
| 		else { | 		else { | ||||||
| 			if ($this->useunixpwd) return $_SESSION[$this->base]->module['posixAccount']->userPassword(); | 			if ($this->useunixpwd) return $_SESSION[$this->base]->module['posixAccount']->userPassword(); | ||||||
| 			if ($this->attributes['lmPassword'][0]!='') { | 			if ($this->attributes['lmPassword'][0]!='') { | ||||||
| 				// Read existing password if set
 | 				// Read existing password if set
 | ||||||
| 				return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['lmPassword'][0])); | 				return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['lmPassword'][0])); | ||||||
| 				} | 				} | ||||||
| 			else return ''; | 			else return ''; | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|  | @ -207,7 +207,7 @@ class sambaGroupMapping extends baseModule { | ||||||
| 	*/ | 	*/ | ||||||
| 	function save_attributes() { | 	function save_attributes() { | ||||||
| 		// Get Domain SID from name
 | 		// Get Domain SID from name
 | ||||||
| 		$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 		$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 		// Get Domain-SID from group SID
 | 		// Get Domain-SID from group SID
 | ||||||
| 		$domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); | 		$domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); | ||||||
| 		for ($i=0; $i<count($sambaDomains); $i++ ) | 		for ($i=0; $i<count($sambaDomains); $i++ ) | ||||||
|  | @ -240,7 +240,7 @@ class sambaGroupMapping extends baseModule { | ||||||
| 
 | 
 | ||||||
| 		if (!$profile) { | 		if (!$profile) { | ||||||
| 			// Get Domain SID from name
 | 			// Get Domain SID from name
 | ||||||
| 			$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 			$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 			for ($i=0; $i<count($sambaDomains); $i++ ) | 			for ($i=0; $i<count($sambaDomains); $i++ ) | ||||||
| 				if ($post['sambaDomainName'] == $sambaDomains[$i]->name) { | 				if ($post['sambaDomainName'] == $sambaDomains[$i]->name) { | ||||||
| 					$SID = $sambaDomains[$i]->SID; | 					$SID = $sambaDomains[$i]->SID; | ||||||
|  | @ -277,7 +277,7 @@ class sambaGroupMapping extends baseModule { | ||||||
| 	*/ | 	*/ | ||||||
| 	function display_html_attributes($post, $profile=false) { | 	function display_html_attributes($post, $profile=false) { | ||||||
| 		// Get Domain SID from name
 | 		// Get Domain SID from name
 | ||||||
| 		$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 		$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 		// Get Domain-SID from group SID
 | 		// Get Domain-SID from group SID
 | ||||||
| 		$domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); | 		$domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); | ||||||
| 		for ($i=0; $i<count($sambaDomains); $i++ ) { | 		for ($i=0; $i<count($sambaDomains); $i++ ) { | ||||||
|  |  | ||||||
|  | @ -168,14 +168,14 @@ class sambaSamAccount extends baseModule { | ||||||
| 	function sambaLMPassword($newpassword=false) { | 	function sambaLMPassword($newpassword=false) { | ||||||
| 		if (is_string($newpassword)) { | 		if (is_string($newpassword)) { | ||||||
| 			// Write new password
 | 			// Write new password
 | ||||||
| 			$this->attributes['sambaLMPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); | 			$this->attributes['sambaLMPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); | ||||||
| 			return 0; | 			return 0; | ||||||
| 			} | 			} | ||||||
| 		else { | 		else { | ||||||
| 			if ($this->useunixpwd) return $_SESSION[$this->base]->module['posixAccount']->userPassword(); | 			if ($this->useunixpwd) return $_SESSION[$this->base]->module['posixAccount']->userPassword(); | ||||||
| 			if ($this->attributes['sambaLMPassword'][0]!='') { | 			if ($this->attributes['sambaLMPassword'][0]!='') { | ||||||
| 				// Read existing password if set
 | 				// Read existing password if set
 | ||||||
| 				return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['sambaLMPassword'][0])); | 				return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['sambaLMPassword'][0])); | ||||||
| 				} | 				} | ||||||
| 			else return ''; | 			else return ''; | ||||||
| 			} | 			} | ||||||
|  | @ -268,7 +268,7 @@ class sambaSamAccount extends baseModule { | ||||||
| 		* it's psssible uidNumber has changed | 		* it's psssible uidNumber has changed | ||||||
| 		*/ | 		*/ | ||||||
| 		// Get Domain SID from name
 | 		// Get Domain SID from name
 | ||||||
| 		$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 		$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 		for ($i=0; $i<count($sambaDomains); $i++ ) | 		for ($i=0; $i<count($sambaDomains); $i++ ) | ||||||
| 			if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) { | 			if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) { | ||||||
| 				$SID = $sambaDomains[$i]->SID; | 				$SID = $sambaDomains[$i]->SID; | ||||||
|  | @ -315,7 +315,7 @@ class sambaSamAccount extends baseModule { | ||||||
| 		// Load attributes
 | 		// Load attributes
 | ||||||
| 		$this->attributes['sambaDomainName'][0] = $post['sambaDomainName']; | 		$this->attributes['sambaDomainName'][0] = $post['sambaDomainName']; | ||||||
| 		// Get Domain SID from name
 | 		// Get Domain SID from name
 | ||||||
| 		$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 		$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 		for ($i=0; $i<count($sambaDomains); $i++ ) | 		for ($i=0; $i<count($sambaDomains); $i++ ) | ||||||
| 			if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) { | 			if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) { | ||||||
| 				$SID = $sambaDomains[$i]->SID; | 				$SID = $sambaDomains[$i]->SID; | ||||||
|  | @ -485,7 +485,7 @@ class sambaSamAccount extends baseModule { | ||||||
| 	*/ | 	*/ | ||||||
| 	function display_html_attributes($post, $profile=false) { | 	function display_html_attributes($post, $profile=false) { | ||||||
| 		// Get Domain SID from name
 | 		// Get Domain SID from name
 | ||||||
| 		$sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); | 		$sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); | ||||||
| 		for ($i=0; $i<count($sambaDomains); $i++ ) { | 		for ($i=0; $i<count($sambaDomains); $i++ ) { | ||||||
| 			$sambaDomainNames[] = $sambaDomains[$i]->name; | 			$sambaDomainNames[] = $sambaDomains[$i]->name; | ||||||
| 			if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) | 			if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue