index c82008207c6566bc392459b96e5880965dca8cc7..d0b5cc71e9bf35ac68c9994fb52877a7892f4571 100644 (file)
define ("DEBUG_SESSION",32);
define ("DEBUG_CONFIG", 64);
define ("DEBUG_ACL", 128);
+define ("DEBUG_SI", 256);
/* Rewrite german 'umlauts' and spanish 'accents'
to get better results */
}
/* Check for global language settings in gosa.conf */
- if (isset ($config) && $config->get_cfg_value('lang') != ""){
- $lang = $config->get_cfg_value('lang');
+ if (isset ($config) && $config->get_cfg_value('language') != ""){
+ $lang = $config->get_cfg_value('language');
if(!preg_match("/utf/i",$lang)){
$lang .= ".UTF-8";
}
/* Sadly we've no proper return values here. Use the error message instead. */
if (!$ldap->success()){
- echo sprintf(_("FATAL: Error when connecting the LDAP. Server said '%s'."), $ldap->get_error());
+ msg_dialog::display(_("Fatal error"),
+ sprintf(_("FATAL: Error when connecting the LDAP. Server said '%s'."), $ldap->get_error()),
+ FATAL_ERROR_DIALOG);
exit();
}
/* Look for entry or realm */
$ldap= $config->get_ldap_link();
if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH, ERROR_DIALOG));
- $smarty= get_smarty();
- $smarty->display(get_template_path('headers.tpl'));
- echo "<body>".session::get('errors')."</body></html>";
+ msg_dialog::display(_("LDAP error"),
+ msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH)."<br><br>".session::get('errors'),
+ FATAL_ERROR_DIALOG);
exit();
}
$ldap->search("(&(objectClass=gosaAccount)(|(uid=$username)(userPassword={$mode}$username)))", array("uid"));
/* Look for entry or realm */
$ldap= $config->get_ldap_link();
if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH, FATAL_ERROR_DIALOG));
- $smarty= get_smarty();
- $smarty->display(get_template_path('headers.tpl'));
- echo "<body>".session::get('errors')."</body></html>";
+ msg_dialog::display(_("LDAP error"),
+ msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH)."<br><br>".session::get('errors'),
+ FATAL_ERROR_DIALOG);
exit();
}
$ldap->search("(&(objectClass=gosaAccount)(uid=$username))", array("uid"));
/* look through the entire ldap */
$ldap = $config->get_ldap_link();
if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error()), FATAL_ERROR_DIALOG);
- $smarty= get_smarty();
- $smarty->display(get_template_path('headers.tpl'));
- echo "<body>".session::get('errors')."</body></html>";
+ msg_dialog::display(_("LDAP error"),
+ msgPool::ldaperror($ldap->get_error(), "", LDAP_AUTH)."<br><br>".session::get('errors'),
+ FATAL_ERROR_DIALOG);
exit();
}
$ldap->cd($config->current['BASE']);
{
global $config;
+ $name= strtolower($name);
+
$map = array(
"ogroupou" => "ou=groups,",
"applicationou" => "ou=apps,",
"mimetypeou" => "ou=mime,");
/* Preset ou... */
- if ($config->get_cfg_value($name) != ""){
+ if ($config->get_cfg_value($name, "_not_set_") != "_not_set_"){
$ou= $config->get_cfg_value($name);
} elseif (isset($map[$name])) {
$ou = $map[$name];
function get_people_ou()
{
- return (get_ou("PEOPLE"));
+ return (get_ou("USERRDN"));
}
function get_groups_ou()
{
- return (get_ou("GROUPS"));
+ return (get_ou("GROUPRDN"));
}
{
global $config;
- return ($config->get_cfg_value("strict") == "true");
+ if (isset($config)){
+ return ($config->get_cfg_value("strict") == "true");
+ }
+ return (TRUE);
}
return ($output[0]);
} else {
msg_dialog::display(_("Warning"), _("'base_hook' is not available. Using default base!"), WARNING_DIALOG);
- return ($config->get_cfg_value("uidbase"));
+ return ($config->get_cfg_value("uidNumberBase"));
}
} else {
msg_dialog::display(_("Warning"), _("'base_hook' is not available. Using default base!"), WARNING_DIALOG);
- return ($config->get_cfg_value("uidbase"));
+ return ($config->get_cfg_value("uidNumberBase"));
}
} else {
msg_dialog::display(_("Warning"), _("'base_hook' is not available. Using default base!"), WARNING_DIALOG);
- return ($config->get_cfg_value("uidbase"));
+ return ($config->get_cfg_value("uidNumberBase"));
}
}
$hash= "";
}
} else {
- $tmp= $config->get_cfg_value('smbhash')." ".escapeshellarg($password);
+ $tmp= $config->get_cfg_value('sambaHashHook')." ".escapeshellarg($password);
@DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $tmp, "Execute");
exec($tmp, $ar);
}
/* Get attribute that we should use as serial number */
- $attr= $config->get_cfg_value("uniq_identifier");
+ $attr= $config->get_cfg_value("modificationDetectionAttribute");
if($attr != ""){
$ldap = $config->get_ldap_link();
$ldap->cat($dn,array($attr));