aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstfwi <cerberos@atwillys.de>2011-06-27 13:02:15 +0100
committerstfwi <cerberos@atwillys.de>2011-06-27 13:02:15 +0100
commit00083c1f9c6bee2207afd4bd38c601bc3a64e959 (patch)
tree5cf717cda1e16d6df2856981a250630be0a59ff4
parentcb77f9e5f444f088c9c9dc49e7110aeaea6db3de (diff)
downloaddrupal_htpasswdsync-00083c1f9c6bee2207afd4bd38c601bc3a64e959.tar.gz
drupal_htpasswdsync-00083c1f9c6bee2207afd4bd38c601bc3a64e959.tar.bz2
drupal_htpasswdsync-00083c1f9c6bee2207afd4bd38c601bc3a64e959.zip
Help text now read from README.txt and exposed in help pages
-rw-r--r--HTPasswdSync.info2
-rw-r--r--HTPasswdSync.module19
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 &lt;space&gt;, :'));
+ if(isset($edit['name'])) {
+ if (ereg('[:[:space:]]', $edit['name'])) {
+ form_set_error('htpasswdsync',
+ t('The username contains an illegal character, like &lt;space&gt;, :'));
+ }
}
- }
}
@@ -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 = '<p>'. t("synchronize password with a htpasswd file") .'</p>';
- break;
- }
- return $output;
+ if($path != 'admin/help#htpasswdsync') return '';
+ return '<pre>' . htmlspecialchars(@file_get_contents(dirname(__FILE__) . '/README.txt'), null, 'UTF-8') . '</pre>';
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy