summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9035a2f)
raw | patch | inline | side by side (parent: 9035a2f)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 8 Mar 2008 10:48:06 +0000 (10:48 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 8 Mar 2008 10:48:06 +0000 (10:48 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9454 594d385d-05f5-0310-b6e9-bd551577e9d8
index f27171e8dce7e3654c52d96e21a86f002b15e8e0..81f387e13681ddfe0d314fdfb074b69064d1b192 100644 (file)
}
+function show_ldap_error($message, $addon= "")
+{
+ if (!preg_match("/Success/i", $message)){
+ if ($addon == ""){
+ msg_dialog::display(_("LDAP error:"), $message, ERROR_DIALOG);
+ } else {
+ if(!preg_match("/No such object/i",$message)){
+ msg_dialog::display(_("LDAP error"), sprintf(_("Plugin '%s':%s"),"<i>".$addon."</i>", "<br><br>$message"),ERROR_DIALOG);
+ }
+ }
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+
/* Removes a given objectClass from the attrs entry */
function remove_objectClass($classes, &$attrs)
{
index ea90b398477475a83d262f147da9508ed5eaf8d2..39cbe7a8c905e37c556acffee74405e58f62c719 100644 (file)
}
}
+ public static function noValidExtension($name)
+ {
+ return sprintf(_("This account has no valid %s extensions!", $name));
+ }
+
+ public static function featuresEnabled($name, $depends= "")
+ {
+ if ($depends == ""){
+ return sprintf(_("This account has %s settings enabled. You can disable them by clicking below."), $name);
+ } else {
+ if (is_array($depends)){
+ return sprintf(_("This account has %s settings enabled. To disable them, you'll need to remove the %s settings first!"), $depends);
+ } else {
+ $deps= "";
+ foreach ($depends as $dep){
+ $deps.= "$dep / ";
+ }
+ $deps= preg_replace("/ \/ $/", "", $deps);
+ return sprintf(_("This account has %s settings enabled. To disable them, you'll need to remove the %s settings first!"), $deps);
+ }
+ }
+ }
+
+
+ public static function featuresDisabled($name, $depends= "")
+ {
+ if ($depends == ""){
+ return sprintf(_("This account has %s settings disabled. You can enable them by clicking below."), $name);
+ } else {
+ if (is_array($depends)){
+ return sprintf(_("This account has %s settings disabled. To enable them, you'll need to add the %s settings first!"), $depends);
+ } else {
+ $deps= "";
+ foreach ($depends as $dep){
+ $deps.= "$dep / ";
+ }
+ $deps= preg_replace("/ \/ $/", "", $deps);
+ return sprintf(_("This account has %s features settings. To disable them, you'll need to add the %s settings first!"), $deps);
+ }
+ }
+ }
+
+
+ public static function addFeaturesButton($name)
+ {
+ return sprintf(_("Add %s settings"), $name);
+ }
+
+
+ public static function removeFeaturesButton($name)
+ {
+ return sprintf(_("Remove %s settings"), $name);
+ }
+
}
diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc
index afdb5dfaa2da5af6207d9244cfc2a4ce9abcf04a..c7dd82b708399d2235ff7d1b9288bd6c4da5bc25 100644 (file)
/* Do we represent a valid gosaAccount? */
if (!$this->is_account){
$str = "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
- _("This account has no valid GOsa extensions.")."</b>";
+ msgPool::noValidExtension("GOsa")."</b>";
return($str);
}
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index 26ba41e8bbe66f64955db6a30e386a042755e935..ef07f0db1ce235c5665980e3e0e75f7516260680 100644 (file)
/* Do we represent a valid posixAccount? */
if (!$this->is_account && $this->parent === NULL ){
$display= "<img alt=\"\" src=\"images/stop.png\" align=\"middle\"> <b>".
- _("This account has no unix extensions.")."</b>";
+ msgPool::noValidExtension(_("POSIX"))."</b>";
$display.= back_to_main();
return ($display);
}
in the moment, because I need to rely on unique
uidNumbers. There'll be a better solution later
on. */
- $display= $this->show_disable_header(_("Remove posix account"),
- _("This account has unix features enabled. To disable them, you'll need to remove the samba / environment account first."), TRUE);
+ $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("POSIX")), msgPool::featuresEnabled(_("POSIX"), array(_("Samba"), _("Environment"))), TRUE);
} else {
- $display= $this->show_disable_header(_("Remove posix account"),
- _("This account has posix features enabled. You can disable them by clicking below."));
+ $display= $this->show_disable_header(msgPool::removeFeaturesButton(_("POSIX")), msgPool::featuresEnabled(_("POSIX")));
}
} else {
- $display= $this->show_enable_header(_("Create posix account"),
- _("This account has posix features disabled. You can enable them by clicking below."));
+ $display= $this->show_enable_header(msgPool::addFeaturesButton(_("POSIX")), msgPool::featuresDisabled(_("POSIX")));
return($display);
}
}
index 4aedfd346381a4bb6e9a09ce9f8a82aee7682c31..abe69ad36fa44379a067bfa2287dd68e3b3859e5 100644 (file)
/* Page header*/
$display= print_header(get_template_path('images/posix.png'),
- _("Unix settings"), $info).$display;
+ _("POSIX settings"), $info).$display;
}