summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9970204)
raw | patch | inline | side by side (parent: 9970204)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 1 Sep 2011 06:58:28 +0000 (06:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 1 Sep 2011 06:58:28 +0000 (06:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20975 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 57f61321e2cfecfa8407fafae34ed56c54e14f6b..3c1ac16f23e1fec73b9dad764aa77f70f307c07a 100644 (file)
@@ -2907,9 +2907,14 @@ function change_password ($dn, $password, $mode=FALSE, $hash= "", $old_password
$attrs= array();
if (!$mode && !empty($tmp)){
$attrs= generate_smb_nt_hash($password);
- $shadow = (isset($attrs["shadowLastChange"][0]))?(int)(date("U") / 86400):0;
- if ($shadow != 0){
- $attrs['shadowLastChange']= $shadow;
+ if(!count($attrs) || !is_array($attrs)){
+ msg_dialog::display(tr("Error"),tr("Cannot generate SAMBA hash!"),ERROR_DIALOG);
+ return(FALSE);
+ }else{
+ $shadow = (isset($attrs["shadowLastChange"][0]))?(int)(date("U") / 86400):0;
+ if ($shadow != 0){
+ $attrs['shadowLastChange']= $shadow;
+ }
}
}
$hash = $rpc->mksmbhash($password);
if(!$rpc->success()){
msg_dialog::display(_("Error"),msgPool::rpcError($rpc->get_error()),ERROR_DIALOG);
- return("");
+ return(array());
}
}elseif ($config->get_cfg_value("core","gosaSupportURI") != ""){
if ($hash == "") {
msg_dialog::display(_("Configuration error"), sprintf(_("Generating SAMBA hash by running %s failed: check %s!"), bold($config->get_cfg_value("core",'sambaHashHook'), bold("sambaHashHook"))), ERROR_DIALOG);
- return ("");
+ return(array());
}
}