summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ffbe7e)
raw | patch | inline | side by side (parent: 3ffbe7e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 1 Sep 2011 07:00:11 +0000 (07:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 1 Sep 2011 07:00:11 +0000 (07:00 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20976 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 08b460b2bb33277edb1a0911924b1f05deca6546..62b22757945f9a56d4b57ce058ac409607c5a8b3 100644 (file)
// Update shadow timestamp?
if (isset($attrs["shadowLastChange"][0])){
- $shadow= (int)(date("U") / 86400);
+ $shadow= (int)(date("U") / 86400);
} else {
- $shadow= 0;
+ $shadow= 0;
}
// Write back modified entry
// Create SMB Password
if ($config->get_cfg_value('sambaHashHook', NULL)) {
$attrs= generate_smb_nt_hash($password);
-
- 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;
+ }
}
}
}
if ($hash == "") {
msg_dialog::display(_("Configuration error"), _("Cannot generate samba hash!"), ERROR_DIALOG);
- return ("");
+ return (array());
}
} else {
$tmp= $config->get_cfg_value('sambaHashHook')." ".escapeshellarg($password);
if ($hash == "") {
msg_dialog::display(_("Configuration error"), sprintf(_("Cannot generate samba hash: running '%s' failed, check the 'sambaHashHook'!"),$config->get_cfg_value('sambaHashHook')), ERROR_DIALOG);
- return ("");
+ return (array());
}
}