From: hickert Date: Fri, 9 Jun 2006 08:25:01 +0000 (+0000) Subject: Updated get status flag X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ca87dabb9722eaf53fe09924fb074514ab673321;p=gosa.git Updated get status flag git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3744 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_goCupsServer.inc b/plugins/admin/systems/class_goCupsServer.inc index 05375062d..178cac45a 100644 --- a/plugins/admin/systems/class_goCupsServer.inc +++ b/plugins/admin/systems/class_goCupsServer.inc @@ -40,6 +40,7 @@ class goCupsServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Print service"); @@ -172,6 +173,24 @@ class goCupsServer extends plugin{ } + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goFaxServer.inc b/plugins/admin/systems/class_goFaxServer.inc index b5c478375..53e8ad307 100644 --- a/plugins/admin/systems/class_goFaxServer.inc +++ b/plugins/admin/systems/class_goFaxServer.inc @@ -43,6 +43,7 @@ class goFaxServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("FAX database configuration"); @@ -179,7 +180,24 @@ class goFaxServer extends plugin{ } } } - + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goFonServer.inc b/plugins/admin/systems/class_goFonServer.inc index 074d287dd..e8cd4d529 100644 --- a/plugins/admin/systems/class_goFonServer.inc +++ b/plugins/admin/systems/class_goFonServer.inc @@ -46,6 +46,7 @@ class goFonServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Asterisk management"); @@ -190,6 +191,23 @@ class goFonServer extends plugin{ } } + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goGlpiServer.inc b/plugins/admin/systems/class_goGlpiServer.inc index 9129d1411..f73caf538 100644 --- a/plugins/admin/systems/class_goGlpiServer.inc +++ b/plugins/admin/systems/class_goGlpiServer.inc @@ -45,6 +45,7 @@ class goGlpiServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Glpi management"); @@ -181,6 +182,25 @@ class goGlpiServer extends plugin{ } } } + + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_goImapServer.inc b/plugins/admin/systems/class_goImapServer.inc index a7760919f..f934a71be 100644 --- a/plugins/admin/systems/class_goImapServer.inc +++ b/plugins/admin/systems/class_goImapServer.inc @@ -77,6 +77,7 @@ class goImapServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Cyrus service"); @@ -238,6 +239,24 @@ class goImapServer extends plugin{ } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goKrbServer.inc b/plugins/admin/systems/class_goKrbServer.inc index edc089536..953389a10 100644 --- a/plugins/admin/systems/class_goKrbServer.inc +++ b/plugins/admin/systems/class_goKrbServer.inc @@ -43,6 +43,7 @@ class goKrbServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Kerberos kadmin access informations"); @@ -184,7 +185,25 @@ class goKrbServer extends plugin{ } } } - + + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goLdapServer.inc b/plugins/admin/systems/class_goLdapServer.inc index 271dabdf0..64d385f8a 100644 --- a/plugins/admin/systems/class_goLdapServer.inc +++ b/plugins/admin/systems/class_goLdapServer.inc @@ -41,6 +41,7 @@ class goLdapServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("LDAP Service"); @@ -176,6 +177,23 @@ class goLdapServer extends plugin{ } } + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goLogDBServer.inc b/plugins/admin/systems/class_goLogDBServer.inc index aa43f9548..3c8a414f8 100644 --- a/plugins/admin/systems/class_goLogDBServer.inc +++ b/plugins/admin/systems/class_goLogDBServer.inc @@ -43,6 +43,7 @@ class goLogDBServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Logging database"); @@ -180,6 +181,25 @@ class goLogDBServer extends plugin{ } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goMailServer.inc b/plugins/admin/systems/class_goMailServer.inc index 5bb4c8a82..d8e198569 100644 --- a/plugins/admin/systems/class_goMailServer.inc +++ b/plugins/admin/systems/class_goMailServer.inc @@ -476,6 +476,7 @@ class goMailServer extends plugin{ /* Return list entry */ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Postfix")." ["._("configured for")." ".$this->postfixMyhostname."] "; @@ -732,6 +733,25 @@ class goMailServer extends plugin{ } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } + function save_object() { plugin::save_object(); diff --git a/plugins/admin/systems/class_goNtpServer.inc b/plugins/admin/systems/class_goNtpServer.inc index 8cb692ffa..f7a9ea42e 100644 --- a/plugins/admin/systems/class_goNtpServer.inc +++ b/plugins/admin/systems/class_goNtpServer.inc @@ -64,6 +64,7 @@ class goNtpServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("NTP service"); @@ -184,6 +185,26 @@ class goNtpServer extends plugin{ } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } + + function check(){ return array();} function save_object(){;} diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc index fb2d1a5a1..35b9cf512 100644 --- a/plugins/admin/systems/class_goShareServer.inc +++ b/plugins/admin/systems/class_goShareServer.inc @@ -142,6 +142,7 @@ class goShareServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Shares"); @@ -348,6 +349,23 @@ class goShareServer extends plugin{ } } + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_goSyslogServer.inc b/plugins/admin/systems/class_goSyslogServer.inc index 2aa5a33ed..1dec56f6d 100644 --- a/plugins/admin/systems/class_goSyslogServer.inc +++ b/plugins/admin/systems/class_goSyslogServer.inc @@ -40,6 +40,7 @@ class goSyslogServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Syslog service"); @@ -170,6 +171,25 @@ class goSyslogServer extends plugin{ } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_goTerminalServer.inc b/plugins/admin/systems/class_goTerminalServer.inc index 501546fc6..be3a6640c 100644 --- a/plugins/admin/systems/class_goTerminalServer.inc +++ b/plugins/admin/systems/class_goTerminalServer.inc @@ -43,6 +43,7 @@ class goTerminalServer extends plugin{ function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; $fields['Status'] = $this->$flag; $fields['Message'] = _("Terminal service"); @@ -188,6 +189,25 @@ class goTerminalServer extends plugin{ } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/plugins/admin/systems/class_servKolab.inc b/plugins/admin/systems/class_servKolab.inc index a507d486e..bb40188cc 100644 --- a/plugins/admin/systems/class_servKolab.inc +++ b/plugins/admin/systems/class_servKolab.inc @@ -357,6 +357,7 @@ class servkolab extends plugin { function getListEntry() { + $this->updateStatusState(); $flag = $this->StatusFlag; if(empty($flag)){ $fields['Status'] = ""; @@ -397,6 +398,24 @@ class servkolab extends plugin { } } + + /* Get updates for status flag */ + function updateStatusState() + { + if(empty($this->StatusFlag)) return; + + $attrs = array(); + $flag = $this->StatusFlag; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->cn); + $ldap->cat($this->dn,array($flag)); + if($ldap->count()){ + $attrs = $ldap->fetch(); + } + if(isset($attrs[$flag][0])){ + $this->$flag = $attrs[$flag][0]; + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_serverService.inc b/plugins/admin/systems/class_serverService.inc index 7f8754d3b..b0065d6cf 100644 --- a/plugins/admin/systems/class_serverService.inc +++ b/plugins/admin/systems/class_serverService.inc @@ -189,22 +189,8 @@ class ServerService extends plugin $this->divList->execute(); $list = array(); - $ldap = $this->config->get_ldap_link(); - $ldap->cd($this->dn); - $ldap->cat($this->dn); - - if($ldap->count()){ - $attrs = $ldap->fetch(); - }else{ - $attrs = array(); - } - foreach($this->plugins as $name => $obj){ if($obj->is_account){ - $flag = $this->plugins[$name]->StatusFlag; - if(isset($attrs[$flag][0])){ - $this->plugins[$name]->$flag = $attrs[$flag][0]; - } $list[$name] = $this->plugins[$name]->getListEntry(); } }