From 46652e983128f119b1f1eaa90cb9ffedb3ecc6bc Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 3 Aug 2006 09:37:41 +0000 Subject: [PATCH] several fixed, w3c, acl git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4376 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/smarty/plugins/block.render.php | 15 +++++++++++---- plugins/personal/generic/class_user.inc | 7 +++---- plugins/personal/generic/main.inc | 2 ++ plugins/personal/posix/class_posixAccount.inc | 10 +++++----- plugins/personal/posix/main.inc | 10 +++++----- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/include/smarty/plugins/block.render.php b/include/smarty/plugins/block.render.php index 63c8c3444..efca60e7d 100755 --- a/include/smarty/plugins/block.render.php +++ b/include/smarty/plugins/block.render.php @@ -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 */ diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index cf5cb5a34..772694840 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -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; diff --git a/plugins/personal/generic/main.inc b/plugins/personal/generic/main.inc index 6e199258e..8d7f30d97 100644 --- a/plugins/personal/generic/main.inc +++ b/plugins/personal/generic/main.inc @@ -164,6 +164,8 @@ if (!$remove_lock){ $info= "\"\" ".$ui->dn." "; } + + echo "Check acl here; Only display edit button if we are able to edit at least one attribute. Line 168"; if ($fn == "edit"){ $info.= "\"\" ". _("Click the 'Edit' button below to change informations in this dialog"); diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index d2fa156ae..79a8149f0 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -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"), - "shadowMin."\">")); + "shadowMin."\">")); $shadowMaxACL = $this->getacl("shadowMax",$SkipWrite); $smarty->assign("shadowmaxs", sprintf(_("Password must be changed after %s days"), - "shadowMax."\">")); + "shadowMax."\">")); $shadowInactiveACL= $this->getacl("shadowInactive",$SkipWrite); $smarty->assign("shadowinactives", sprintf(_("Disable account after %s days of inactivity after password expiery"), - "shadowInactive."\">")); + "shadowInactive."\">")); $shadowWarningACL = $this->getacl("shadowWarning",$SkipWrite); $smarty->assign("shadowwarnings", sprintf(_("Warn user %s days before password expiery"), - "shadowWarning."\">")); + "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(); diff --git a/plugins/personal/posix/main.inc b/plugins/personal/posix/main.inc index 1de7f0286..c1b0c30e1 100644 --- a/plugins/personal/posix/main.inc +++ b/plugins/personal/posix/main.inc @@ -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= "\"\" ".$ui->dn." "; - 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.= "\"\" ". _("Click the 'Edit' button below to change informations in this dialog"); -- 2.30.2