Code

Added branches container for old stuff
[gosa.git] / gosa-core / plugins / personal / generic / main.inc
index aeec45657a8c667767e17e8c67ac02e23ebce896..0ab96b0debdec1d25068019169992f21b7f8eb0a 100644 (file)
@@ -1,24 +1,25 @@
 <?php
 /*
-   This code is part of GOsa (https://gosa.gonicus.de)
-   Copyright (C) 2003  Cajus Pollmeier
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-
 /* Preset display */
 $display  = "";
 $lock_msg = "";
@@ -82,7 +83,7 @@ if (!$remove_lock){
 
         /* Empty password is not permitted by default. */
         if ($_POST['new_password'] == ""){
-          $message[]= _("The password you've entered as 'New password' is empty.");
+          $message[]= msgPool::required(_("New password"));
         }
       }
 
@@ -90,7 +91,7 @@ if (!$remove_lock){
       if (count($message) != 0){
 
         /* Show error message and continue editing */
-        show_errors ($message);
+        msg_dialog::displayChecks($message);
         $display.= $smarty->fetch(get_template_path('password.tpl', TRUE));
         return ($display);
       }
@@ -100,7 +101,7 @@ if (!$remove_lock){
     } else {
 
       /* Missing permissions, show message */
-      print_red (_("You are not allowed to set your password!"));
+      msg_dialog::display(_("Error"), _("You have no permission to set your password!"), ERROR_DIALOG);
     }
 
     del_lock ($ui->dn);
@@ -132,7 +133,7 @@ if (!$remove_lock){
 
     } else {
       /* Errors found, show message */
-      show_errors ($message);
+      msg_dialog::displayChecks($message);
     }
   }
 
@@ -156,30 +157,30 @@ if (!$remove_lock){
 
     /* Are we in edit mode? */
     if (session::is_set('edit')){
-      $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+      $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
       $display.= "&nbsp;";
-      $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+      $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
 
-      $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png').
+      $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png').
              "\"> ".$ui->dn."&nbsp;";
     } else {
       /* 'viewid' may be set by i.e. the phonelist plugin. This
          means that we want to go back... */
       if (isset ($viewid)){
-        $str= _("Back");
+        $str= msgPool::backButton();
         $fn = "back";
       } else {
-        $str= _("Edit");
+        $str= msgPool::editButton();
         $fn = "edit";
-        $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
+        $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/unlocked.png').
                "\"> ".$ui->dn."&nbsp;";
       }
 
       /* Only display edit button if there is at least one attribute editable */
-      if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/user"))){
+      if(preg_match("/r/",$ui->get_permissions($ui->dn,"users/user"))){
         if ($fn == "edit"){
-          $info.= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
-            _("Click the 'Edit' button below to change informations in this dialog");
+          $info.= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/on.png')."\"> ".
+            msgPool::clickEditToChange();
           $display.= "<input type=submit name=\"$fn\" value=\"$str\">\n";
         }
       }
@@ -190,7 +191,7 @@ if (!$remove_lock){
   }
 
   /* Page header*/
-  $display= print_header(get_template_path('images/personal.png'),
+  $display= print_header(get_template_path('plugins/generic/images/plugin.png'),
                          _("Generic user information"), $info).$display;
 
 }