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.module | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'HTPasswdSync.module') 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