From c04b6ac8bc55660d3130420e8abdca29feb03ea2 Mon Sep 17 00:00:00 2001
From: hickert
Date: Wed, 9 Aug 2006 11:37:23 +0000
Subject: [PATCH] Added acls for password change
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4445 594d385d-05f5-0310-b6e9-bd551577e9d8
---
plugins/personal/password/class_password.inc | 17 ++++++++++++
plugins/personal/password/main.inc | 11 +++++---
plugins/personal/password/password.tpl | 29 ++++++++++++++++----
3 files changed, 47 insertions(+), 10 deletions(-)
diff --git a/plugins/personal/password/class_password.inc b/plugins/personal/password/class_password.inc
index f53289ada..28215b037 100644
--- a/plugins/personal/password/class_password.inc
+++ b/plugins/personal/password/class_password.inc
@@ -4,6 +4,23 @@ class password
/* Definitions */
var $plHeadline= "Password";
var $plDescription= "This does something";
+
+
+ function plInfo()
+ {
+ return (array(
+ "plDescription" => _("User password"),
+ "plSelfModify" => TRUE,
+ "plDepends" => array("user"),
+ "plPriority" => 10,
+ "plSection" => "personal",
+ "plCategory" => array("users"),
+ "plOptions" => array(),
+
+ "plProvidedAcls" => array())
+ );
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/personal/password/main.inc b/plugins/personal/password/main.inc
index df07d1162..5b9eac615 100644
--- a/plugins/personal/password/main.inc
+++ b/plugins/personal/password/main.inc
@@ -24,6 +24,11 @@ if (!$remove_lock){
$smarty->assign ('headimage', get_template_path('images/password.png'));
$display= "";
+ $password_ACLS = $ui->get_permissions($ui->dn,"users/password");
+ $password_ACLS = "cmdr";
+ $smarty->assign("ChangeACL" , $password_ACLS);
+ $smarty->assign("NotAllowed" , !preg_match("/w/i",$password_ACLS));
+
/* Check for interaction */
if ($_SERVER["REQUEST_METHOD"] == "POST"){
if (isset($_POST['password_finish'])){
@@ -65,9 +70,7 @@ if (!$remove_lock){
}
}
- $ca= get_permissions ($ui->dn, $ui->subtreeACL);
- $ca= get_module_permission($ca, "user", $ui->dn);
- if (chkacl($ca, "password") != ""){
+ if(!preg_match("/w/i",$password_ACLS)){
$message[]= _("You have no permissions to change your password.");
}
@@ -105,7 +108,7 @@ if (!$remove_lock){
$display= $smarty->fetch(get_template_path("password.tpl", TRUE));
}else{
$expired= ldap_expired_account($config, $ui->dn, $ui->username);
-
+
if($expired == 4){
$display= $smarty->fetch(get_template_path("nochange.tpl", TRUE));
}else{
diff --git a/plugins/personal/password/password.tpl b/plugins/personal/password/password.tpl
index ebd11d350..ef813db5e 100644
--- a/plugins/personal/password/password.tpl
+++ b/plugins/personal/password/password.tpl
@@ -7,33 +7,50 @@
+{if $NotAllowed}
+ {t}You have no permissions to change your password.{/t}
+{else}
{t}Changing the password affects your authentification on mail, proxy, samba and unix services.{/t}
+{/if}
+{render acl=$ChangeACL}
+{/render}
+{render acl=$ChangeACL}
+{/render}
--
2.30.2