Code

several fixed, w3c, acl
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Aug 2006 09:37:41 +0000 (09:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Aug 2006 09:37:41 +0000 (09:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4376 594d385d-05f5-0310-b6e9-bd551577e9d8

include/smarty/plugins/block.render.php
plugins/personal/generic/class_user.inc
plugins/personal/generic/main.inc
plugins/personal/posix/class_posixAccount.inc
plugins/personal/posix/main.inc

index 63c8c3444e0e6c5e0df97d3a82abe214b8dbb81d..efca60e7d93bca406e8edbdab64e629333890c75 100755 (executable)
@@ -24,14 +24,21 @@ function smarty_block_render($params, $text, &$smarty)
        if(!(isset($params['mode']) && $params['mode']=='readable')){
 
                /* Disable options && greyout divlists */
-               $from   = array("/name=/i" ,            
-                               "/class=['\"]list1nohighlight['\"]/i",
+
+
+
+               $from   = array("/class=['\"]list1nohighlight['\"]/i",
                                "/class=['\"]list0['\"]/i",
                                "/class=['\"]list1['\"]/i");
-               $to     = array(" disabled name=",      
-                               "class='list1nohighlightdisabled'",
+               $to     = array("class='list1nohighlightdisabled'",
                                "class='list1nohighlightdisabled'",
                                "class='list1nohighlightdisabled'");
+                               
+               if(!preg_match("/ disabled /",$text)){
+                       $from [] = "/name=/i" ;
+                       $to   [] = "disabled name=";
+               }
+
                $text   = preg_replace($from,$to,$text);
 
                /* Replace picture if object is disabled */
index cf5cb5a34485dd2ec13793481e10b7978c974ca3..77269484084914487230ef3fc2d4bf9a11a7a222 100644 (file)
@@ -328,11 +328,10 @@ class user extends plugin
       if ($_FILES['picture_file']['name'] != ""){
         if (!is_uploaded_file($_FILES['picture_file']['tmp_name'])) {
           print_red(_("The specified file has not been uploaded via HTTP POST! Aborted."));
-          exit;
+        }else{
+          /* Activate new picture */
+          $this->set_picture($_FILES['picture_file']['tmp_name']);
         }
-
-        /* Activate new picture */
-        $this->set_picture($_FILES['picture_file']['tmp_name']);
       }
       $this->picture_dialog= FALSE;
       $this->dialog= FALSE;
index 6e199258e99ef3e368179c4c2d5df6e47a82a7bf..8d7f30d97950d414068d30a33f5d3151f6e2bb51 100644 (file)
@@ -164,6 +164,8 @@ if (!$remove_lock){
         $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
                "\"> ".$ui->dn."&nbsp;";
       }
+
+      echo "Check acl here; Only display edit button if we are able to edit at least one attribute.  Line 168";
       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");
index d2fa156ae25cced6be9d6ea4ab611a0c4b2b7949..79a8149f08672b6a2aee022b78af32dc8ce6c2e0 100644 (file)
@@ -446,19 +446,19 @@ class posixAccount extends plugin
 
       $shadowMinACL     =  $this->getacl("shadowMin",$SkipWrite);
       $smarty->assign("shadowmins", sprintf(_("Password can't be changed up to %s days after last change"), 
-                                              "<input name=\"shadowMin\" size=3 maxlength=4 $shadowMinACL value=\"".$this->shadowMin."\">"));
+                                              "<input name=\"shadowMin\" size=3 maxlength=4 value=\"".$this->shadowMin."\">"));
 
       $shadowMaxACL     =  $this->getacl("shadowMax",$SkipWrite);
       $smarty->assign("shadowmaxs", sprintf(_("Password must be changed after %s days"), 
-                                              "<input name=\"shadowMax\" size=3 maxlength=4 $shadowMaxACL value=\"".$this->shadowMax."\">"));
+                                              "<input name=\"shadowMax\" size=3 maxlength=4 value=\"".$this->shadowMax."\">"));
 
       $shadowInactiveACL=  $this->getacl("shadowInactive",$SkipWrite);
       $smarty->assign("shadowinactives", sprintf(_("Disable account after %s days of inactivity after password expiery"), 
-                                              "<input name=\"shadowInactive\" size=3 maxlength=4 $shadowInactiveACL value=\"".$this->shadowInactive."\">"));
+                                              "<input name=\"shadowInactive\" size=3 maxlength=4 value=\"".$this->shadowInactive."\">"));
 
       $shadowWarningACL =  $this->getacl("shadowWarning",$SkipWrite);
       $smarty->assign("shadowwarnings", sprintf(_("Warn user %s days before password expiery"), 
-                                              "<input name=\"shadowWarning\" size=3 maxlength=4 $shadowWarningACL value=\"".$this->shadowWarning."\">"));
+                                              "<input name=\"shadowWarning\" size=3 maxlength=4 value=\"".$this->shadowWarning."\">"));
 
       foreach( array("use_shadowMin", "use_shadowMax",
                      "use_shadowExpire", "use_shadowInactive","use_shadowWarning") as $val){
@@ -641,7 +641,7 @@ class posixAccount extends plugin
 
   function save_object()
   {
-    if ((isset($_POST['posixTab'])) && (isset($_SESSION['edit']))){
+    if (isset($_POST['posixTab'])){
       /* Save values to object */
       plugin::save_object();
 
index 1de7f0286b7b10cc089b4dca18283b5d8ef10104..c1b0c30e1a63cec283b5e951ef78af6ae9acb512 100644 (file)
@@ -24,9 +24,7 @@ $display= "";
 if (!$remove_lock){
 
   /* Reset requested? */
-  if (isset($_POST['edit_cancel']) ||
-      (isset($_GET['reset']) && $_GET['reset'] == 1)){
-
+  if (isset($_POST['edit_cancel']) ||  (isset($_GET['reset']) && $_GET['reset'] == 1)){
     del_lock ($ui->dn);
     sess_del ('edit');
     sess_del ('posixAccount');
@@ -35,6 +33,8 @@ if (!$remove_lock){
   /* Create posixAccount object on demand */
   if (!isset($_SESSION['posixAccount']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
     $_SESSION['posixAccount']= new posixAccount ($config, $ui->dn);
+    $_SESSION['posixAccount']->set_acl_base($ui->dn);
+    $_SESSION['posixAccount']->set_acl_category("users");
   }
   $posixAccount= $_SESSION['posixAccount'];
 
@@ -44,7 +44,7 @@ if (!$remove_lock){
   }
 
   /* Enter edit mode? */
-  if (isset($_POST['edit'])){
+  if ((isset($_POST['edit'])) && (!isset($_SESSION['edit']))){
 
     /* Check locking */
     if (($username= get_lock($ui->dn)) != ""){
@@ -106,7 +106,7 @@ if (!$remove_lock){
       $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
              "\"> ".$ui->dn."&nbsp;";
       
-      echo "FIXME : user -> posix, 109, Only display edit button if there is at least one attribute editable.";
+    $display .= "FIXME : user -> posix, 109, Only display edit button if there is at least one attribute editable.";
         $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png')."\"> ".
                 _("Click the 'Edit' button below to change informations in this dialog");