summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2dacb5c)
raw | patch | inline | side by side (parent: 2dacb5c)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 8 Mar 2008 15:59:37 +0000 (15:59 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 8 Mar 2008 15:59:37 +0000 (15:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9466 594d385d-05f5-0310-b6e9-bd551577e9d8
21 files changed:
index 1391d03a787a0320f96e523fec6050a8964f28e8..1aecdc429627157be30554415fc6ecb8b1a40631 100644 (file)
/* Do we need to show error messages? */
if (count ($message) != 0){
/* Show error message and continue editing */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
} else {
/* Passed quality check, just try to change the password now */
}
if ($output != ""){
$message[]= _("External password changer reported a problem: ".$output);
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
} else {
if ($method != ""){
change_password ($ui->dn, $_POST['new_password'], 0, $method);
index d833d5f52f3d8f9e5b956cee2eeb0b06dcefda31..64f2ab711194ff9e6eeefeae187b454273295b64 100644 (file)
new log("modify","acls/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving ACLs with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+ }
/* Refresh users ACLs */
$ui= get_userinfo();
index af6fec7a36d80fa98a1613ad391b14f8929a605a..742315ad3e6142a55b81185b95e16d48da369d2d 100644 (file)
$this->cd($cdn);
$this->add($na);
- show_ldap_error($this->get_error(), sprintf(_("Creating subtree '%s' failed."),$cdn));
- if (!preg_match('/success/i', $this->error)){
+ if (!$this->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($this->get_error(), $cdn, LDAP_ADD, get_class()));
return FALSE;
}
}
$ret = $this->modify($data);
}
}
- show_ldap_error($this->get_error(), sprintf(_("Ldap import with dn '%s' failed."),$dn));
+
+ if (!$this->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($this->get_error(), $dn, "", get_class()));
+ }
+
return($ret);
}
index d6bc4f7a6aa7cc3f35bdccb11d2873826120f8a9..5fb06268f92e79e1656e947e41c96c3dfc34ed9f 100644 (file)
public static function displayChecks($messages)
{
/* Assemble the message array to a plain string */
- foreach ($message as $error){
+ foreach ($messages as $error){
msg_dialog::display(_("Error"), $error, ERROR_DIALOG);
}
}
index 2e10d7215e84e4a0291045348bb438b59a0bbc38..72f0f26ae13850171bf272b7ebddbe59b8765148 100644 (file)
$ldap_to = new LDAP($user,$password, $server);
$ldap_to -> cd($snapldapbase);
- show_ldap_error($ldap->get_error(), sprintf(_("Saving object snapshot with dn '%s' failed."),$snapldapbase));
+
+ if (!$ldap_to->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
+ }
+
}
/* check if the dn exists */
$ldap_to->create_missing_trees($new_base);
$ldap_to->cd($new_dn);
$ldap_to->add($target);
-
- show_ldap_error($ldap->get_error(), sprintf(_("Saving object snapshot with dn '%s' failed."),$new_base));
- show_ldap_error($ldap_to->get_error(), sprintf(_("Saving object snapshot with dn '%s' failed."),$new_base));
+ if (!$ldap_to->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $new_dn, LDAP_ADD, get_class()));
+ }
+
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $new_base, "", get_class()));
+ }
+
}
}
$ldap_to = new LDAP($user,$password, $server);
$ldap_to -> cd ($snapldapbase);
- show_ldap_error($ldap->get_error(), sprintf(_("Method get available snapshots with dn '%s' failed."),$this->dn));
+ if (!$ldap_to->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
+ }
}else{
$ldap_to = $ldap;
}
$snapldapbase = $cfg['SNAPSHOT_BASE'];
$ldap_to = new LDAP($user,$password, $server);
$ldap_to->cd ($snapldapbase);
- show_ldap_error($ldap_to->get_error(), sprintf(_("Method get deleted snapshots with dn '%s' failed."),$this->dn));
+ if (!$ldap_to->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
+ }
}else{
$ldap_to = $ldap;
}
$snapldapbase = $cfg['SNAPSHOT_BASE'];
$ldap_to = new LDAP($user,$password, $server);
$ldap_to->cd ($snapldapbase);
- show_ldap_error($ldap->get_error(), sprintf(_("Restore snapshot with dn '%s' failed."),$snapldapbase));
+ if (!$ldap_to->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap_to->get_error(), $snapldapbase, "", get_class()));
+ }
}else{
$ldap_to = $ldap;
}
/* Import the given data */
$ldap->import_complete_ldif($data,$err,false,false);
- show_ldap_error($ldap->get_error(), sprintf(_("Restore snapshot with dn '%s' failed."),$dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, "", get_class()));
+ }
}
index 81f387e13681ddfe0d314fdfb074b69064d1b192..3a2968ae71732ecc2d99b6464e1d755a70896537 100644 (file)
function strict_uid_mode()
{
+ global $config;
+
return !(isset($config->current['STRICT']) && preg_match('/^(no|false)$/i', $config->current['STRICT']));
}
index 4fa85ce41c677209242014e723958112cf5ee3c0..4c2d40d5d1c4f978b0640e377c4327b94f40974f 100644 (file)
public static function is_uid($uid)
{
- global $config;
-
if ($uid == ""){
return (TRUE);
}
diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc
index b6f97d368aa7efa0d07140a2a7208ab7ec4e3c9e..198817bc4ff59a7b6fe628748794eeea27b3b3df 100644 (file)
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc
index 0fca34925c8b7ef1c331c1cb69c41bb4ce464c3c..e8297b74f382cf2f0742c3cb23130b71b44e4c62 100644 (file)
new log("create","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving ACLs with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, "", get_class()));
+ }
/* Refresh users ACLs */
$ui= get_userinfo();
$ldap->rmDir($this->dn);
new log("remove","aclroles/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of aclRole with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, "", get_class()));
+ }
/* Optionally execute a command after we're done */
$this->handle_post_events("remove");
$og= new ogroup($this->config, $ldap->getDN());
unset($og->member[$this->dn]);
$og->save ();
- show_ldap_error($ldap->get_error(), sprintf(_("Removing aclRole from objectgroup '%s' failed"), $og->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $og->dn, "", get_class()));
+ }
}
}
diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc
index e647139ef54ec62d09c452e10000440a9f2651c2..fc808e028976954813300647351b1fe8ef177690 100644 (file)
$ldap->cd ($this->dn);
$ldap->recursive_remove();
new log("remove","department/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of department with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+ }
/* Optionally execute a command after we're done */
$this->handle_post_events('remove');
$this->handle_post_events('add');
new log("create","department/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of department with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+ }
/* The parameter forces only to set must_be_tagged, and don't touch any objects
This will be done later */
$nattrs['objectClass'][]= "gosaAdministrativeUnitTag";
$ldap->cd($dn);
$ldap->modify($nattrs);
- show_ldap_error($ldap->get_error(), sprintf(_("Handle object tagging with dn '%s' failed."),$dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class()));
+ }
} else {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, "Not tagging ($tag) $dn - seems to have moved away", "Tagging");
}
}
$ldap->cd($dn);
$ldap->modify($nattrs);
- show_ldap_error($ldap->get_error(), sprintf(_("Handle object tagging with dn '%s' failed."),$dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class()));
+ }
} else {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, "Not removing tag ($tag) $dn - seems to have moved away", "Tagging");
}
diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc
index 74d15307829705fb95f19e42409b7a2303b8ae1a..1d040e2688bbede3441f04b34278b618bd27b7f5 100644 (file)
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc
index b4d2ae7cc2a34b02e296494486b88cad33d48095..ed6f1a28ae8ca43ab53b8fb375a4c45698943962 100644 (file)
$ldap= $this->config->get_ldap_link();
$ldap->rmdir($this->dn);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of groups/generic with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+ }
new log("remove","groups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
$ret= 0;
- if ( show_ldap_error($ldap->get_error(), sprintf(_("Removing of groups/generic with dn '%s' failed."),$this->dn))){
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
$ret= 1;
}
diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc
index 23b264a97615d9e27426df25e57282685fcd1e26..a75569115e80a60fdd9c2a0bd947c63098aada60 100644 (file)
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc
index c51a95d28f51edf3308fd0946a84a9b93785f705..92460840c6beb9578d5f557f3ca33c8c3bb58bc0 100644 (file)
$this->handle_post_events($mode);
$ret= 0;
- if (show_ldap_error($ldap->get_error(), sprintf(_("Saving of object group/generic with dn '%s' failed."),$this->dn))){
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
$ret= 1;
}
$ldap= $this->config->get_ldap_link();
$ldap->rmdir($this->dn);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of object group/generic with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+ }
new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 67d092a38a52cf687d9bc7bbba7510ca7127d489..413cd2eee7bb3af42b4823a47ec13226b9fe4cf6 100644 (file)
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 1dfb05833399b542d4187b3d5a2039d1de2209bd..f38de95074ac876a07c72ec72f875ac62945fdc7 100644 (file)
if (count($message) != 0){
/* Show error message and continue editing */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
return($smarty->fetch(get_template_path('password.tpl', TRUE)));
}
$ldap = $this->config->get_ldap_link();
$ldap->cd($val['dn']);
$ldap->modify($attrs);
- if($locked){
- show_ldap_error($ldap->get_error(),_("Could not set user status from locked to unlocked."));
- }else{
- show_ldap_error($ldap->get_error(),_("Could not set user status from unlocked to locked."));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $val['dn'], 0, get_class()));
}
}
}
} else {
/* Ok. There seem to be errors regarding to the tab data,
show message and continue as usual. */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
/* Show error message / continue editing */
if (count($message) > 0){
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
foreach(array("sn", "givenName", "uid", "template") as $attr){
if(isset($_POST[$attr])){
/* Show error message / continue editing */
if (count($message) > 0){
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
} else {
$attributes= array('sn' => $this->sn, 'givenName' => $this->givenName);
if (isset($this->config->current['IDGEN']) &&
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index c7dd82b708399d2235ff7d1b9288bd6c4da5bc25..ab72dfd592b0de60d4e20c3ed9f7649d745ea229 100644 (file)
/* Remove user */
$ldap= $this->config->get_ldap_link();
$ldap->rmdir ($this->dn);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/generic account with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+ }
new log("remove","users/".get_class($this),$this->dn,$this->attributes,$ldap->get_error());
$ldap->cd ($this->dn);
$ldap->$mode ($this->attrs);
- if (show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/generic account with dn '%s' failed."),$this->dn))){
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
return (1);
}
diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc
index fbfcb823eceb2e05cf042264703bb5cf5dcc383b..f1afbfa12f7923b26e8c373804e31aad38373965 100644 (file)
if (count($message) != 0){
/* Show error message and continue editing */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
$display.= $smarty->fetch(get_template_path('password.tpl', TRUE));
return ($display);
}
} else {
/* Errors found, show message */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index 995a66a63a4d706015b5a31d73485bae9b42b0cf..c50bf1f8e7a0222e5a9d8eae6d13fc6edaa9af1a 100644 (file)
new log("remove","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/posix account with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+ }
/* Delete group only if cn is uid and there are no other
members inside */
new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
}
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/posix account with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+ }
/* Remove lock needed for unique id generation */
del_lock ("uidnumber");
index 243644bc78b772a1c61ebb3f603246e3372b2ef8..73396471ee6ebc1e2f7a156e7144e7d86c14a9ed 100644 (file)
session::un_set ('posixAccount');
} else {
/* Errors found, show message */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc
index 20d563b5f9a1b90b81cc8f53df2a9058f8f9676d..cef6eefed2d100a5b2300f8f08400545443c2d79 100644 (file)
msg_dialog::display(_("LDAP error"), sprintf(_("Copy '%s' to '%s' failed:")."<br><br><i>%s</i>", LDAP::fix($source), LDAP::fix($destination), $ldap->get_error()), ERROR_DIALOG);
}else{
$res = $ldap->rmDir($source);
- show_ldap_error($ldap->get_error(),_("Problem copying DNs"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $source, LDAP_DEL, get_class()));
+ }
/* Object is copied, so update its references */
foreach($ogs_to_fix as $dn => $data){