summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f80cf0)
raw | patch | inline | side by side (parent: 6f80cf0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Aug 2007 08:28:45 +0000 (08:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Aug 2007 08:28:45 +0000 (08:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7055 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/users/class_divListUsers.inc | patch | blob | history | |
plugins/admin/users/class_userManagement.inc | patch | blob | history |
diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc
index b1d5d201ee34d74f7f76b6531be681bc1999395e..c796b1869d86943f08549e7d2fa6375e4b177d56 100644 (file)
$this->EnableSaveButton (false);
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 104;
+ $action_col_size = 122;
if($this->parent->snapshotEnabled()){
$action_col_size += 38;
}
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ";
-
/* Multiple options */
$listhead .= " <input class='center' type='image' align='middle' src='images/edittrash.png'
title='"._("Remove selected user")."' alt='"._("Remove user")."' name='remove_multiple_users'> ";
$editlink = "<a href='?plug=".validate($_GET['plug'])."&id=%s&act=edit_entry'>%s</a>";
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 104;
+ $action_col_size = 122;
if($this->parent->snapshotEnabled()){
$action_col_size += 38;
}
// Test Every Entry and generate divlist Array
foreach($list as $key => $val){
-
+
/* Create action icons */
$action= "";
src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
}
+ /* Add deactivate status */
+ $lock_status = "";
+
+ if(isset($val['userPassword'][0]) && preg_match("/^\{[^\}]/",$val['userPassword'][0])){
+ if(preg_match("/^[^\}]*+\}!/",$val['userPassword'][0])){
+ $lock_status = "<input class='center' type='image' src='images/closedlock.png'
+ alt='"._("Deactivated")."' name='toggle_lock_status_%KEY%'>";
+ }else{
+ $lock_status = "<input class='center' type='image' src='images/openlock.png'
+ alt='"._("Active")."' name='toggle_lock_status_%KEY%'>";
+ }
+ }else{
+ $lock_status = "<img src='images/empty.png' alt=' ' class='center'>";
+ }
+
/* Generate edit icon */
$action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
name='user_edit_%KEY%' title='"._("Edit user")."'>";
+ /* Add deactivate status if we are allowed to */
+ if (preg_match("/w/",$acl_all)){
+ $action.= $lock_status;
+ }
+
/* Add Password change icon, if we are able to write users/password */
if(!in_array_ics("gosaUserTemplate",$val['objectClass']) && preg_match("/w/",$ui->get_permissions($val['dn'],"users/password"))) {
$action.= "<input class='center' type='image' src='images/list_password.png' alt='"._("password")."'
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index e9b1904722153f6022453aaa58e232bfa0e7428d..ffc1a34791484fa6377d49dc2ceb9cb1cb01c3d3 100644 (file)
"copy_multiple" => "multiple_copy_users",
"cut_multiple" => "multiple_cut_users",
"copy" => "^copy",
+ "toggle_lock_status" => "toggle_lock_status",
"cut" => "^cut") as $act => $name){
if (preg_match("/".$name.".*/", $key)){
}
}
+
+ /********************
+ Toggle lock status for user
+ ********************/
+
+ if($s_action == "toggle_lock_status" && isset($this->list[$s_entry])){
+
+ /* Get entry check current status */
+ $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;
+ }
+
+ /* 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($locked){
+ show_ldap_error($ldap->get_error(),_("Could not set user status from locked to unlocked."));
+ }else{
+ show_ldap_error($ldap->get_error(),_("Could not set user status from unlocked to locked."));
+ }
+ }
+ }
+
/********************
Delete entry requested, display confirm dialog
if ($SubSearch){
$ListTemp = get_list($filter, "users", $base,
- array("uid", "givenName", "sn", "objectClass"), GL_SUBSEARCH | GL_SIZELIMIT);
+ array("uid", "givenName", "sn", "objectClass","userPassword"), GL_SUBSEARCH | GL_SIZELIMIT);
} else {
$base= get_people_ou().$base;
$ListTemp = get_list($filter, "users", $base,
- array("uid", "givenName", "sn", "objectClass"), GL_SIZELIMIT);
+ array("uid", "givenName", "sn", "objectClass","userPassword"), GL_SIZELIMIT);
}
$SortTemp = array();
$List = array();