From 7f1ce5d46e0e230d378690cc876e2507d27164a9 Mon Sep 17 00:00:00 2001 From: stfwi Date: Sun, 5 Feb 2012 11:28:05 +0000 Subject: Fix [#1428874] using patch #1 by dchronos --- HTPasswdSync.module | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/HTPasswdSync.module b/HTPasswdSync.module index e61334b..ac287da 100644 --- a/HTPasswdSync.module +++ b/HTPasswdSync.module @@ -135,13 +135,13 @@ function _htpasswdsync_check_file($path) { return t("File '!file' does not exists and the parent directory does not exist neither. Please check the path you entered or create the file manually.", array('!file' => $path)); } else if(!is_writable(dirname($path))) { return t("File '!file' does not exists and the parent directory is not writable. Please create the file manually.", array('!file' => $path)); - } else if(file_put_contents($path, '') === false || !is_file($path) || !is_writable($path) || !is_readable($path)) { + } else if(file_put_contents($path, '') === false || !is_file($path) || !is_writable($path) || !is_readable($path)) { return t("File '!file' does not exists, and it could no be created properly. Please create the file manually.", array('!file' => $path)); } return false; } else if(!is_readable($path)) { return t("File '!file' exists but is not readable for the server. Use chmod command to change this.", array('!file' => $path)); - } else if(!is_writable($path)) { + } else if(!is_writable($path)) { return t("File '!file' exists but is not writable for the server. Use chmod command to change this.", array('!file' => $path)); } else { return t("File '!file' (dead branch check): Please inform the maintainer that there is a bug in function _htpasswdsync_check_file().", array('!file' => $path)); @@ -403,6 +403,12 @@ function htpasswdsync_field_attach_submit($entity_type, $entity, $form, &$form_s } } +/** + * Run the _htpasswdsync_update function when a user is create; + */ +function htpasswdsync_user_insert(){ + _htpasswdsync_updatepasswd(); +} /** * Role delete hook @@ -589,7 +595,7 @@ function htpasswdsync_admin_form_validate($form, &$form_state) { form_set_error('htpasswdsync_htpasswd', 'The htgroup file and the htpasswd file have to be different files.'); $error = true; } - + $file = $form_state['values']['htpasswdsync_htpasswd']; if(!empty($file)) { if($msg = _htpasswdsync_check_file($file)) { -- cgit v1.2.3