From 00083c1f9c6bee2207afd4bd38c601bc3a64e959 Mon Sep 17 00:00:00 2001 From: stfwi Date: Mon, 27 Jun 2011 13:02:15 +0100 Subject: Help text now read from README.txt and exposed in help pages --- HTPasswdSync.info | 2 ++ HTPasswdSync.module | 19 +++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/HTPasswdSync.info b/HTPasswdSync.info index 8ad669a..bf24406 100644 --- a/HTPasswdSync.info +++ b/HTPasswdSync.info @@ -1,3 +1,5 @@ name = HTPasswdSync description = Export user login data into htpasswd and htgroup files. core = 7.x +php = 5.0 +configure = admin/config/people/htpasswdsync diff --git a/HTPasswdSync.module b/HTPasswdSync.module index 29a2e35..9777d1e 100644 --- a/HTPasswdSync.module +++ b/HTPasswdSync.module @@ -343,12 +343,12 @@ function _htpasswdsync_delete($account) { * @return none */ function _htpasswdsync_validate($edit, $account) { - if(isset($edit['name'])) { - if (ereg('[:[:space:]]', $edit['name'])) { - form_set_error('htpasswdsync', - t('The username contains an illegal character, like <space>, :')); + if(isset($edit['name'])) { + if (ereg('[:[:space:]]', $edit['name'])) { + form_set_error('htpasswdsync', + t('The username contains an illegal character, like <space>, :')); + } } - } } @@ -359,13 +359,8 @@ function _htpasswdsync_validate($edit, $account) { * @return string */ function htpasswdsync_help($path, $arg) { - $output = ''; //declare your output variable - switch ($path) { - case "admin/help#htpasswdsync": - $output = '

'. t("synchronize password with a htpasswd file") .'

'; - break; - } - return $output; + if($path != 'admin/help#htpasswdsync') return ''; + return '
' . htmlspecialchars(@file_get_contents(dirname(__FILE__) . '/README.txt'), null, 'UTF-8') . '
'; } -- cgit v1.2.3