summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a87960)
raw | patch | inline | side by side (parent: 0a87960)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Sep 2010 10:03:27 +0000 (10:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Sep 2010 10:03:27 +0000 (10:03 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19580 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/FAQ b/gosa-core/FAQ
index 8148c169d4dfa1a00285ed29e05f993ee30f9747..e6d8591cea4b44e9877de7b044f9b0b1cc841ff0 100644 (file)
--- a/gosa-core/FAQ
+++ b/gosa-core/FAQ
@@ -117,9 +117,12 @@ A: You can place the keywords "passwordMinLength" and "passwordMinDiffer" in the
Q: I've to update passwords on external windows PDCs. Can I add a command to let
synchronize these for me?
-A: There's the possibility to add a password hook in gosa.conf's main section using
- the keyword "passwordHook". The specified command will be executed with
- three parameters: /path/to/your/script username oldpassword newpassword
+A: There's the possibility to add a hooks in gosa.conf's plugin tags using
+ the "premodify/postmodify" keywords. The specified command will be executed with
+ these additional parameters: %current_password %new_password %userPassword
+
+ For further information about pre- and post hooks search for the premodify
+ and postmodify statements.
So you can call i.e. smbpasswd to handle your password change on the PDC.
index adb659993bbe943796ab906ae58ab1ac5962650b..928f25c3016f02417cdf06b383b05b6cfa48986c 100644 (file)
to have at least n different characters.
.PP
-.B passwordHook
-.I path
-.PP
-The
-.I passwordHook
-can specify an external script to handle password settings at some other
-location besides the LDAP. It will be called this way:
-
-.nf
-/path/to/your/script "username" "oldpassword" "newpassword"
-.fi
-
.B passwordProposalHook
.I command
.PP
index 10ff4be06026e4300636a59b8bb9c306b3552164..a048c006514a408255cfc6513ed8aaee1c32e44b 100644 (file)
if (count($message) != 0) {
/* Show error message and continue editing */
msg_dialog::displayChecks($message);
+ } elseif(!change_password($ui->dn, $_POST['new_password'], FALSE, $method,get_post('current_password'),$msg)){
+ msg_dialog::displayChecks(array($msg));
} else {
-
- /* Passed quality check, just try to change the password now */
- $output= "";
- if ($config->get_cfg_value("core","passwordHook") != "") {
-
- $cmd = $config->get_cfg_value("core","passwordHook");
- $cmd = preg_replace("/%current_password/",escapeshellarg(get_post('current_password')), $cmd);
- $cmd = preg_replace("/%new_password/",escapeshellarg(get_post('new_password')), $cmd);
- $cmd = preg_replace("/%uid/",escapeshellarg($ui->username), $cmd);
- $cmd = preg_replace("/%dn/",escapeshellarg($ui->dn), $cmd);
- exec($cmd, $resarr);
- if (count($resarr) > 0) {
- $output= join('\n', $resarr);
- }
- }
- if ($output != "") {
- $message[]= sprintf(
- _("External password changer reported a problem: %s"),
- $output
- );
- msg_dialog::displayChecks($message);
- } else {
- if(!change_password($ui->dn, $_POST['new_password'], FALSE, $method,get_post('current_password'),$msg)){
- msg_dialog::displayChecks(array($msg));
- }else{
- gosa_log("User/password has been changed");
- $smarty->assign("changed", true);
- }
- }
+ gosa_log("User/password has been changed");
+ $smarty->assign("changed", true);
}
-
-
}
/* Parameter fill up */
index 6f9df0b45fcf17070a033a4d538a7f4ec65cf0b5..0b96b077e7459fda323ddb2edc33da3e2b06e3d2 100644 (file)
"group" => "password",
"mandatory" => FALSE),
- array(
- "name" => "passwordHook",
- "type" => "command",
- "default" => "",
- "description" =>
- _("The 'passwordHook' can specify an external script to handle password settings at some other location besides the LDAP.")." ".sprintf(_("It will be called this way: %s"),"/path/to/your/script \"username\" \"oldpassword\" \"newpassword\""),
- "check" => "gosaProperty::isCommand",
- "migrate" => "",
- "group" => "password",
- "mandatory" => FALSE),
-
array(
"name" => "passwordProposalHook",
"type" => "command",
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 0e97d648a2e46e4c2892aef0437d0a64ff58d0f5..b8462732be880c299621ac01760ab9ff3d9cfa24 100644 (file)
}
}
- // Check password via check hook
- if ($this->config->get_cfg_value("core","passwordHook") != ""){
- $ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- $ldap->cat($this->dn,array('uid'));
- $attrs = $ldap->fetch();
- $cmd = $this->config->get_cfg_value("core","passwordHook");
- $cmd = preg_replace("/%current_password/",'',$cmd);
- $cmd = preg_replace("/%new_password/",escapeshellarg($new_password), $cmd);
- $cmd = preg_replace("/%uid/",escapeshellarg($attrs['uid'][0]), $cmd);
- $cmd = preg_replace("/%dn/",escapeshellarg($attrs['dn']), $cmd);
- exec($cmd,$resarr);
- $message = array_merge($message, $resarr);
- }
-
// Display errors
if (count($message) != 0){
msg_dialog::displayChecks($message);
diff --git a/gosa-core/plugins/personal/password/class_password.inc b/gosa-core/plugins/personal/password/class_password.inc
index db7fff07edead850e008b729e65728b9a21576ff..a436e941f263ba89df9ddfc37e9e9a613ce7e292 100644 (file)
$attrs['current_password'] = escapeshellarg($current_password);
$attrs['new_password'] = escapeshellarg($new_password);
- // Depricated but execute for backward compability
- $check_hook = $this->config->get_cfg_value("core","passwordHook") != "";
- $cmd = $this->config->get_cfg_value("core","passwordHook");
- if(!empty($cmd)){
- $cmd = preg_replace("/%current_password/",escapeshellarg($current_password), $cmd);
- $cmd = preg_replace("/%new_password/",escapeshellarg($new_password), $cmd);
- $cmd = preg_replace("/%uid/",escapeshellarg($ui->username), $cmd);
- $cmd = preg_replace("/%dn/",escapeshellarg($ui->dn), $cmd);
- if($check_hook){
- exec($cmd,$resarr);
- $check_hook_output = "";
- if(count($resarr) > 0) {
- $check_hook_output= join('\n', $resarr);
- $message[] = sprintf(_("Password hook reported a problem: %s. Password change canceled!"),
- $check_hook_output);
- }
- }
- }
-
// Perform GOsa password policy checks
if(empty($current_password)){
$message[] = _("You need to specify your current password in order to proceed.");