smaller fixes

This commit is contained in:
Roland Gruber 2008-11-18 19:06:55 +00:00
parent 6e48ecdb47
commit abeb9bc3da
3 changed files with 17 additions and 35 deletions

View File

@ -163,13 +163,6 @@ class ddns extends baseModule {
* 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);
}
else {

View File

@ -120,9 +120,9 @@ class dhcp_settings extends baseModule {
// module dependencies
$return['dependencies'] = array('depends' => array(), 'conflicts' => array());
// managed object classes
$return['objectClasses'] = array();
$return['objectClasses'] = array('top', 'dhcpOptions');
// managed attributes
$return['attributes'] = array('cn','dhcpOtions');
$return['attributes'] = array('cn');
// help Entries
$return['help'] = 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, ...
*/
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')) {
// Standard Things
$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
{
// 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'])) {
$i = 0;
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'];
unset($this->attributestmp['dhcpStatements']);
}
$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);
// Load DHCP Options:
$this->dn = ereg_replace("'", "", $_GET['DN']);
$this->dn = $this->getAccountContainer()->dn_orig;
if (!is_array($attr['dhcpOption'])) {
$attr['dhcpOption'] = array();

View File

@ -198,18 +198,20 @@ class fixed_ip extends baseModule {
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)');
$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]['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]['ip'] = array_pop(explode(" ", $entries[$i]['dhcpstatements'][0]));
}
$sr = @ldap_search($_SESSION['ldap']->server(),'cn='.$_SESSION['account']->getAccountModule('dhcp_settings')->attributes['cn'][0].','.$_SESSION['config']->get_suffix('dhcp'),'(objectClass=dhcpHost)');
if ($sr) {
$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]['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]['ip'] = array_pop(explode(" ", $entries[$i]['dhcpstatements'][0]));
}
}
}
}