From: cajus Date: Fri, 25 Apr 2008 10:28:46 +0000 (+0000) Subject: Added offline switch X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3ae3edcbb2462eb22db89a430b2e476a45662951;p=gosa.git Added offline switch git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10686 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/client/events/corefunctions.pm b/gosa-si/client/events/corefunctions.pm index 50ad0af09..62f744f07 100644 --- a/gosa-si/client/events/corefunctions.pm +++ b/gosa-si/client/events/corefunctions.pm @@ -21,12 +21,13 @@ use Fcntl; use GOSA::GosaSupportDaemon; use File::Basename; -my ($ldap_enabled, $ldap_config, $pam_config, $nss_config, $fai_logpath); +my ($ldap_enabled, $offline_enabled, $ldap_config, $pam_config, $nss_config, $fai_logpath); my %cfg_defaults = ( "client" => { "ldap" => [\$ldap_enabled, 1], + "offline-ldap" => [\$offline_enabled, 0], "ldap-config" => [\$ldap_config, "/etc/ldap/ldap.conf"], "pam-config" => [\$pam_config, "/etc/pam_ldap.conf"], "nss-config" => [\$nss_config, "/etc/libnss-ldap.conf"], @@ -304,6 +305,24 @@ sub new_ldap_config { close(file1); daemon_log("wrote $cfg_name", 5); + # Write offline config + if ($offline_enabled){ + $cfg_name= "/etc/ldap/ldap-offline.conf"; + + # Get first LDAP server + open(file1, "> $cfg_name"); + print file1 "LDAP_BASE=\"$ldap_base\"\n"; + print file1 "LDAP_SERVER=\"127.0.0.1\"\n"; + print file1 "LDAP_URIS=\"ldap://127.0.0.1\"\n"; + print file1 "ADMIN_BASE=\"$admin_base\"\n"; + print file1 "DEPARTMENT=\"$department\"\n"; + print file1 "RELEASE=\"$release\"\n"; + print file1 "UNIT_TAG=\"".(defined $unit_tag ? "$unit_tag" : "")."\"\n"; + print file1 "UNIT_TAG_FILTER=\"".(defined $unit_tag ? "(gosaUnitTag=$unit_tag)" : "")."\"\n"; + close(file1); + daemon_log("wrote $cfg_name", 5); + } + return; }