summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 883f54e)
raw | patch | inline | side by side (parent: 883f54e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Feb 2008 08:11:58 +0000 (08:11 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Feb 2008 08:11:58 +0000 (08:11 +0000) |
-Cache the result of getAvailableZones
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9045 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9045 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc | patch | blob | history |
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc
index ade653d2d5e447ba740c64ca194b70fa8a4a1521..4354c9a1b0361a35fc9d533358f8e637a632de39 100644 (file)
*/
static function getAvailableZones($config)
{
- $ret = array();
-
- /* Search for zones ...
- */
- $ou = preg_replace("/,.*$/","",get_ou("serverou"));
- $deps = array();
- $ldap = $config->get_ldap_link();
- $ldap->cd ($config->current['BASE']);
- $ldap->search("(&(objectClass=organizationalUnit)(".$ou."))",array("dn"));
- while($attrs = $ldap->fetch()){
- $deps[] = $attrs['dn'];
- }
-
- $ForwardZones = array();
- $ReverseZones = array();
- $zones = array();
- foreach($deps as $dep){
- $ldap->cd($dep);
- $ldap->search("(&(objectClass=dNSZone)(sOARecord=*))",array("zoneName"));
-
+ $runtime_cache = session::get("runtime_cache");
+ if(!isset($runtime_cache['DNS']['getAvailableZones'])){
+
+ $ret = array();
+ $ldap = $config->get_ldap_link();
+ $tmp = get_sub_list("(&(objectClass=dNSZone)(sOARecord=*))","",get_ou("serverou"),
+ $config->current['BASE'],array("zoneName"),GL_NO_ACL_CHECK | GL_SUBSEARCH);
- while($at = $ldap->fetch()){
+ foreach($tmp as $at){
if(preg_match("/\.in\-addr\.arpa/",$at['zoneName'][0])){
$ReverseZones[$at['dn']] = $at;
}else{
}
}
}
+ $runtime_cache['DNS']['getAvailableZones'] = $zones;
+ session::set("runtime_cache",$runtime_cache);
}
- return($zones);
+ return($runtime_cache['DNS']['getAvailableZones']);
}
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: