summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8295dc9)
raw | patch | inline | side by side (parent: 8295dc9)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 26 May 2008 12:28:45 +0000 (12:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 26 May 2008 12:28:45 +0000 (12:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11003 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/users/class_userManagement.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 344404dee86f8a36d05b1e23d9daf9afa12e22f9..7c7e19f76df555c17343f19ba5b29120c30ee45b 100644 (file)
$acl = $this->ui->get_permissions($dn, "users/password");
$cacl= $this->ui->get_permissions($dn, "users/user");
+ /* Are we allowed to create a new user or to set the password attribute? */
if (preg_match('/w/', $acl) || preg_match('/c/', $cacl)){
/* Check input and feed errors into 'message' */
dialog. */
session::set('objectinfo',$this->dn);
return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
-
-
} else {
/* User is not allowed. Show message and cancel. */
msg_dialog::display(_("Password change"),_("You have no permission to change this users password!"),WARNING_DIALOG);
$this->templates[$ldap->getDN()]=
$attrs['uid'][0]." - ".@LDAP::fix($key);
}
- if ($s_action != "templatize_multiple"){
- $this->templates['none']= _("none");
- }
+ if ($s_action != "templatize_multiple"){
+ $this->templates['none']= _("none");
+ }
}
}
}
/* Template readable? */
if (preg_match('/r/', $acl)){
- $template_dn= $_POST['template'];
+ $template_dn= $_POST['template'];
foreach ($this->dns as $dn){
- $acl = $this->ui->get_permissions($_POST['template'], "users/user");
- if (preg_match('/w/', $acl)){
- $usertab= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
- $usertab->adapt_from_template($template_dn, array("sn", "givenName", "uid"));
- $usertab->save();
- unset ($usertab);
- $usertab= NULL;
- } else {
- msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to modify object '%s'!"), $dn), ERROR_DIALOG);
+ $acl = $this->ui->get_permissions($_POST['template'], "users/user");
+ if (preg_match('/w/', $acl)){
+ $usertab= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn);
+ $usertab->adapt_from_template($template_dn, array("sn", "givenName", "uid"));
+ $usertab->save();
+ unset ($usertab);
+ $usertab= NULL;
+ } else {
+ msg_dialog::display(_("Permission error"), sprintf(_("You have no permission to modify object '%s'!"), $dn), ERROR_DIALOG);
}
}
} else {
- msg_dialog::display(_("Permission error"), _("You have no permission to use this template!"), ERROR_DIALOG);
+ msg_dialog::display(_("Permission error"), _("You have no permission to use this template!"), ERROR_DIALOG);
}
}
$val = $this->list[$s_entry];
$pwd = $val['userPassword'][0];
- if(!preg_match("/^\{[^\}]/",$pwd)){
- trigger_error("Can not deactivate user which is using clear password encryption.");
- }else{
- $locked = false;
- if(preg_match("/^[^\}]*+\}!/",$pwd)){
- $locked = true;
- }
+ if (!preg_match("/w/",$this->ui->get_permissions($val['dn'],"users/password"))){
+
+ /* Missing permissions, show message */
+ msg_dialog::display(_("Password change"),_("You have no permission to change the lock status for this user!"),WARNING_DIALOG);
- /* Create ldap array to update status */
- $attrs = array("userPassword" => $pwd);
- if($locked){
- $attrs['userPassword'] = preg_replace("/(^[^\}]+\})!(.*$)/","\\1\\2",$attrs['userPassword']);
+ }else{
+
+ if(!preg_match("/^\{[^\}]/",$pwd)){
+ trigger_error("Can not deactivate user which is using clear password encryption.");
}else{
- $attrs['userPassword'] = preg_replace("/(^[^\}]+\})(.*$)/","\\1!\\2",$attrs['userPassword']);
- }
- /* Write new status back to ldap */
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($val['dn']);
- $ldap->modify($attrs);
- if (!$ldap->success()){
- msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $val['dn'], 0, get_class()));
+ $locked = false;
+ if(preg_match("/^[^\}]*+\}!/",$pwd)){
+ $locked = true;
+ }
+
+ /* Create ldap array to update status */
+ $attrs = array("userPassword" => $pwd);
+ if($locked){
+ $attrs['userPassword'] = preg_replace("/(^[^\}]+\})!(.*$)/","\\1\\2",$attrs['userPassword']);
+ }else{
+ $attrs['userPassword'] = preg_replace("/(^[^\}]+\})(.*$)/","\\1!\\2",$attrs['userPassword']);
+ }
+
+ /* Write new status back to ldap */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($val['dn']);
+ $ldap->modify($attrs);
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $val['dn'], 0, get_class()));
+ }
}
}
}