smaller fixes
This commit is contained in:
parent
6e48ecdb47
commit
abeb9bc3da
|
@ -163,13 +163,6 @@ class ddns extends baseModule {
|
||||||
* Save main settings
|
* Save main settings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!isset($this->getAccountContainer()->dn_already_edit)) {
|
|
||||||
$a = explode(",", $this->getAccountContainer()->dn);
|
|
||||||
unset($a[0]);
|
|
||||||
$this->getAccountContainer()->dn = implode(",", $a);
|
|
||||||
$this->getAccountContainer()->dn_already_edit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$return = $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
|
$return = $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -120,9 +120,9 @@ class dhcp_settings extends baseModule {
|
||||||
// module dependencies
|
// module dependencies
|
||||||
$return['dependencies'] = array('depends' => array(), 'conflicts' => array());
|
$return['dependencies'] = array('depends' => array(), 'conflicts' => array());
|
||||||
// managed object classes
|
// managed object classes
|
||||||
$return['objectClasses'] = array();
|
$return['objectClasses'] = array('top', 'dhcpOptions');
|
||||||
// managed attributes
|
// managed attributes
|
||||||
$return['attributes'] = array('cn','dhcpOtions');
|
$return['attributes'] = array('cn');
|
||||||
// help Entries
|
// help Entries
|
||||||
$return['help'] = array(
|
$return['help'] = array(
|
||||||
'domainname' => array(
|
'domainname' => array(
|
||||||
|
@ -250,10 +250,6 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
* lamdaemon are lamdaemon commands to modify homedir, quotas, ...
|
* lamdaemon are lamdaemon commands to modify homedir, quotas, ...
|
||||||
*/
|
*/
|
||||||
public function save_attributes() {
|
public function save_attributes() {
|
||||||
// Get easy attributes
|
|
||||||
$this->attributes['objectClass'][0] = "top";
|
|
||||||
$this->attributes['objectClass'][1] = "dhcpOptions";
|
|
||||||
|
|
||||||
if ($_SESSION['account']->getAccountModule('dhcp_settings')->dn!=$_SESSION['config']->get_suffix('dhcp')) {
|
if ($_SESSION['account']->getAccountModule('dhcp_settings')->dn!=$_SESSION['config']->get_suffix('dhcp')) {
|
||||||
// Standard Things
|
// Standard Things
|
||||||
$this->attributes['objectClass'][2] = "dhcpSubnet";
|
$this->attributes['objectClass'][2] = "dhcpSubnet";
|
||||||
|
@ -283,14 +279,6 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Basicsettings...
|
// Basicsettings...
|
||||||
|
|
||||||
if (!isset($this->getAccountContainer()->dn_already_edit)) {
|
|
||||||
$a = explode(",", $this->getAccountContainer()->dn);
|
|
||||||
unset($a[0]);
|
|
||||||
//$this->getAccountContainer()->dn = implode(",", $a);
|
|
||||||
$this->getAccountContainer()->dn_already_edit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array($this->attributes['dhcpOption'])) {
|
if (is_array($this->attributes['dhcpOption'])) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($this->attributes['dhcpOption'] AS $key=>$value) {
|
foreach($this->attributes['dhcpOption'] AS $key=>$value) {
|
||||||
|
@ -311,7 +299,6 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
$this->attributes['dhcpStatements'] = $this->attributestmp['dhcpStatements'];
|
$this->attributes['dhcpStatements'] = $this->attributestmp['dhcpStatements'];
|
||||||
unset($this->attributestmp['dhcpStatements']);
|
unset($this->attributestmp['dhcpStatements']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
|
$return = $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -329,7 +316,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
|
||||||
|
|
||||||
parent::load_attributes($attr);
|
parent::load_attributes($attr);
|
||||||
// Load DHCP Options:
|
// Load DHCP Options:
|
||||||
$this->dn = ereg_replace("'", "", $_GET['DN']);
|
$this->dn = $this->getAccountContainer()->dn_orig;
|
||||||
|
|
||||||
if (!is_array($attr['dhcpOption'])) {
|
if (!is_array($attr['dhcpOption'])) {
|
||||||
$attr['dhcpOption'] = array();
|
$attr['dhcpOption'] = array();
|
||||||
|
|
|
@ -198,18 +198,20 @@ class fixed_ip extends baseModule {
|
||||||
|
|
||||||
if ($_SESSION['account']->getAccountModule('dhcp_settings')->dn!=$_SESSION['config']->get_suffix('dhcp')) {
|
if ($_SESSION['account']->getAccountModule('dhcp_settings')->dn!=$_SESSION['config']->get_suffix('dhcp')) {
|
||||||
|
|
||||||
$sr = ldap_search($_SESSION['ldap']->server(),'cn='.$_SESSION['account']->getAccountModule('dhcp_settings')->attributes['cn'][0].','.$_SESSION['config']->get_suffix('dhcp'),'(objectClass=dhcpHost)');
|
$sr = @ldap_search($_SESSION['ldap']->server(),'cn='.$_SESSION['account']->getAccountModule('dhcp_settings')->attributes['cn'][0].','.$_SESSION['config']->get_suffix('dhcp'),'(objectClass=dhcpHost)');
|
||||||
$entries = ldap_get_entries($_SESSION['ldap']->server(), $sr);
|
if ($sr) {
|
||||||
for ($i=0; $i < $entries["count"]; $i++)
|
$entries = ldap_get_entries($_SESSION['ldap']->server(), $sr);
|
||||||
{
|
for ($i=0; $i < $entries["count"]; $i++)
|
||||||
$this->fixed_ip[$i]['cn'] = $entries[$i]['cn'][0];
|
{
|
||||||
$this->fixed_ip[$i]['mac'] = array_pop(explode(" ", $entries[$i]['dhcphwaddress'][0]));
|
$this->fixed_ip[$i]['cn'] = $entries[$i]['cn'][0];
|
||||||
$this->fixed_ip[$i]['ip'] = array_pop(explode(" ", $entries[$i]['dhcpstatements'][0]));
|
$this->fixed_ip[$i]['mac'] = array_pop(explode(" ", $entries[$i]['dhcphwaddress'][0]));
|
||||||
|
$this->fixed_ip[$i]['ip'] = array_pop(explode(" ", $entries[$i]['dhcpstatements'][0]));
|
||||||
$this->orig_ips[$i]['cn'] = $entries[$i]['cn'][0];
|
|
||||||
$this->orig_ips[$i]['mac'] = array_pop(explode(" ", $entries[$i]['dhcphwaddress'][0]));
|
$this->orig_ips[$i]['cn'] = $entries[$i]['cn'][0];
|
||||||
$this->orig_ips[$i]['ip'] = array_pop(explode(" ", $entries[$i]['dhcpstatements'][0]));
|
$this->orig_ips[$i]['mac'] = array_pop(explode(" ", $entries[$i]['dhcphwaddress'][0]));
|
||||||
}
|
$this->orig_ips[$i]['ip'] = array_pop(explode(" ", $entries[$i]['dhcpstatements'][0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue