summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e48418)
raw | patch | inline | side by side (parent: 0e48418)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 May 2010 10:06:06 +0000 (10:06 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 May 2010 10:06:06 +0000 (10:06 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18144 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 817071a44c4a902ab0c4691bc99d15e7beee0a48..76d422f3e8741e7e225f19528338b601200bf527 100644 (file)
}
/* Check for global language settings in gosa.conf */
- if (isset ($config) && $config->get_cfg_value('language') != ""){
- $lang = $config->get_cfg_value('language');
+ if (isset ($config) && $config->get_cfg_value("core",'language') != ""){
+ $lang = $config->get_cfg_value("core",'language');
if(!preg_match("/utf/i",$lang)){
$lang .= ".UTF-8";
}
/* Set theme */
if (isset ($config)){
- $theme= $config->get_cfg_value("theme", "default");
+ $theme= $config->get_cfg_value("core","theme", "default");
} else {
$theme= "default";
}
$config->set_current($name);
$mode= "kerberos";
- if ($config->get_cfg_value("useSaslForKerberos") == "true"){
+ if ($config->get_cfg_value("core","useSaslForKerberos") == "true"){
$mode= "sasl";
}
$ldap->cd($config->current['BASE']);
$allowed_attributes = array("uid","mail");
$verify_attr = array();
- if($config->get_cfg_value("loginAttribute") != ""){
- $tmp = explode(",", $config->get_cfg_value("loginAttribute"));
+ if($config->get_cfg_value("core","loginAttribute") != ""){
+ $tmp = explode(",", $config->get_cfg_value("core","loginAttribute"));
foreach($tmp as $attr){
if(in_array($attr,$allowed_attributes)){
$verify_attr[] = $attr;
/* Check for existing entries in lock area */
$ldap= $config->get_ldap_link();
- $ldap->cd ($config->get_cfg_value("config"));
+ $ldap->cd ($config->get_cfg_value("core","config"));
$ldap->search("(&(objectClass=gosaLockEntry)(gosaUser=$user)(gosaObject=".base64_encode($object)."))",
array("gosaUser"));
if (!$ldap->success()){
if ($ldap->count() == 0){
$attrs= array();
$name= md5($object);
- $ldap->cd("cn=$name,".$config->get_cfg_value("config"));
+ $ldap->cd("cn=$name,".$config->get_cfg_value("core","config"));
$attrs["objectClass"] = "gosaLockEntry";
$attrs["gosaUser"] = $user;
$attrs["gosaObject"] = base64_encode($object);
$attrs["cn"] = "$name";
$ldap->add($attrs);
if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "cn=$name,".$config->get_cfg_value("config"), 0, ERROR_DIALOG));
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "cn=$name,".$config->get_cfg_value("core","config"), 0, ERROR_DIALOG));
return;
}
}
/* Check for existance and remove the entry */
$ldap= $config->get_ldap_link();
- $ldap->cd ($config->get_cfg_value("config"));
+ $ldap->cd ($config->get_cfg_value("core","config"));
$ldap->search ("(&(objectClass=gosaLockEntry)(gosaObject=".base64_encode($object)."))", array("gosaObject"));
$attrs= $ldap->fetch();
if ($ldap->getDN() != "" && $ldap->success()){
/* Get LDAP ressources */
$ldap= $config->get_ldap_link();
- $ldap->cd ($config->get_cfg_value("config"));
+ $ldap->cd ($config->get_cfg_value("core","config"));
/* Remove all objects of this user, drop errors silently in this case. */
$ldap->search("(&(objectClass=gosaLockEntry)(gosaUser=$userdn))", array("gosaUser"));
/* Get LDAP link, check for presence of the lock entry */
$user= "";
$ldap= $config->get_ldap_link();
- $ldap->cd ($config->get_cfg_value("config"));
+ $ldap->cd ($config->get_cfg_value("core","config"));
$ldap->search("(&(objectClass=gosaLockEntry)(gosaObject=".base64_encode($object)."))", array("gosaUser"));
if (!$ldap->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "", LDAP_SEARCH, ERROR_DIALOG));
/* Get LDAP link, check for presence of the lock entry */
$user= "";
$ldap= $config->get_ldap_link();
- $ldap->cd ($config->get_cfg_value("config"));
+ $ldap->cd ($config->get_cfg_value("core","config"));
$ldap->search($filter, array("gosaUser","gosaObject"));
if (!$ldap->success()){
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "", LDAP_SEARCH, ERROR_DIALOG));
"mimetypeRDN" => "ou=mime,");
/* Preset ou... */
- if ($config->get_cfg_value($name, "_not_set_") != "_not_set_"){
- $ou= $config->get_cfg_value($name);
+ if ($config->get_cfg_value("core",$name, "_not_set_") != "_not_set_"){
+ $ou= $config->get_cfg_value("core",$name);
} elseif (isset($map[$name])) {
$ou = $map[$name];
return($ou);
global $config;
if (isset($config)){
- return ($config->get_cfg_value("strictNamingRules") == "true");
+ return ($config->get_cfg_value("core","strictNamingRules") == "true");
}
return (TRUE);
}
{
global $config;
- if ($config->get_cfg_value("baseIdHook") != ""){
+ if ($config->get_cfg_value("core","baseIdHook") != ""){
/* Call hook script - if present */
- $command= $config->get_cfg_value("baseIdHook");
+ $command= $config->get_cfg_value("core","baseIdHook");
if ($command != ""){
$command.= " '".LDAP::fix($dn)."' $attrib";
return ($output[0]);
} else {
msg_dialog::display(_("Warning"), _("'baseIdHook' is not available. Using default base!"), WARNING_DIALOG);
- return ($config->get_cfg_value("uidNumberBase"));
+ return ($config->get_cfg_value("core","uidNumberBase"));
}
} else {
msg_dialog::display(_("Warning"), _("'baseIdHook' is not available. Using default base!"), WARNING_DIALOG);
- return ($config->get_cfg_value("uidNumberBase"));
+ return ($config->get_cfg_value("core","uidNumberBase"));
}
} else {
msg_dialog::display(_("Warning"), _("'baseIdHook' is not available. Using default base!"), WARNING_DIALOG);
- return ($config->get_cfg_value("uidNumberBase"));
+ return ($config->get_cfg_value("core","uidNumberBase"));
}
}
global $config;
# Try to use gosa-si?
- if ($config->get_cfg_value("gosaSupportURI") != ""){
+ if ($config->get_cfg_value("core","gosaSupportURI") != ""){
$res= gosaSupportDaemon::send("gosa_gen_smb_hash", "GOSA", array("password" => $password), TRUE);
if (isset($res['XML']['HASH'])){
$hash= $res['XML']['HASH'];
return ("");
}
} else {
- $tmp= $config->get_cfg_value('sambaHashHook')." ".escapeshellarg($password);
+ $tmp= $config->get_cfg_value("core",'sambaHashHook')." ".escapeshellarg($password);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $tmp, "Execute");
exec($tmp, $ar);
$hash= current($ar);
if ($hash == "") {
- msg_dialog::display(_("Configuration error"), sprintf(_("Generating SAMBA hash by running %s failed: check %s!"), bold($config->get_cfg_value('sambaHashHook'), bold("sambaHashHook"))), ERROR_DIALOG);
+ msg_dialog::display(_("Configuration error"), sprintf(_("Generating SAMBA hash by running %s failed: check %s!"), bold($config->get_cfg_value("core",'sambaHashHook'), bold("sambaHashHook"))), ERROR_DIALOG);
return ("");
}
}
}
/* Get attribute that we should use as serial number */
- $attr= $config->get_cfg_value("modificationDetectionAttribute");
+ $attr= $config->get_cfg_value("core","modificationDetectionAttribute");
if($attr != ""){
$ldap = $config->get_ldap_link();
$ldap->cat($dn,array($attr));
{
global $config;
- switch ($config->get_cfg_value("idAllocationMethod", "traditional")){
+ switch ($config->get_cfg_value("core","idAllocationMethod", "traditional")){
case "pool":
return get_next_id_pool($attrib);
case "traditional":
global $config;
/* Fill informational values */
- $min= $config->get_cfg_value("${attrib}PoolMin", 10000);
- $max= $config->get_cfg_value("${attrib}PoolMax", 40000);
+ $min= $config->get_cfg_value("core","${attrib}PoolMin", 10000);
+ $max= $config->get_cfg_value("core","${attrib}PoolMax", 40000);
/* Sanity check */
if ($min >= $max) {
/* If it does not exist, create one with these defaults */
if ($ldap->count() == 0) {
/* Fill informational values */
- $minUserId= $config->get_cfg_value("uidPoolMin", 10000);
- $minGroupId= $config->get_cfg_value("gidPoolMin", 10000);
+ $minUserId= $config->get_cfg_value("core","uidPoolMin", 10000);
+ $minGroupId= $config->get_cfg_value("core","gidPoolMin", 10000);
/* Add as default */
$attrs= array("objectClass" => array("organizationalUnit", "sambaUnixIdPool"));
/* get the ranges */
$tmp = array('0'=> 1000);
- if (preg_match('/posixAccount/', $oc) && $config->get_cfg_value("uidNumberBase") != ""){
- $tmp= explode('-',$config->get_cfg_value("uidNumberBase"));
- } elseif($config->get_cfg_value("gidNumberBase") != ""){
- $tmp= explode('-',$config->get_cfg_value("gidNumberBase"));
+ if (preg_match('/posixAccount/', $oc) && $config->get_cfg_value("core","uidNumberBase") != ""){
+ $tmp= explode('-',$config->get_cfg_value("core","uidNumberBase"));
+ } elseif($config->get_cfg_value("core","gidNumberBase") != ""){
+ $tmp= explode('-',$config->get_cfg_value("core","gidNumberBase"));
}
/* Set hwm to max if not set - for backward compatibility */
$hwm= pow(2,32);
}
/* Find out next free id near to UID_BASE */
- if ($config->get_cfg_value("baseIdHook") == ""){
+ if ($config->get_cfg_value("core","baseIdHook") == ""){
$base= $lwm;
} else {
/* Call base hook */
// Get theme
if (isset ($config)){
- $theme= $config->get_cfg_value("theme", "default");
+ $theme= $config->get_cfg_value("core","theme", "default");
} else {
# For debuging - avoid that there's no theme set
die("config not set!");