diff options
author | stfwi <cerberos@atwillys.de> | 2011-06-17 23:17:38 +0100 |
---|---|---|
committer | stfwi <cerberos@atwillys.de> | 2011-06-17 23:17:38 +0100 |
commit | a83028159c1e39c00224c61a076819a42c377e2f (patch) | |
tree | 35243c20dc947838364c3e477ef3c00424c3cb01 /HTPasswdSync.module | |
parent | 9b33e3200a1ff714480190474125c097166519ca (diff) | |
download | drupal_htpasswdsync-a83028159c1e39c00224c61a076819a42c377e2f.tar.gz drupal_htpasswdsync-a83028159c1e39c00224c61a076819a42c377e2f.tar.bz2 drupal_htpasswdsync-a83028159c1e39c00224c61a076819a42c377e2f.zip |
filemods, info cleanup, permission display bugfix
Diffstat (limited to 'HTPasswdSync.module')
-rw-r--r--[-rwxr-xr-x] | HTPasswdSync.module | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/HTPasswdSync.module b/HTPasswdSync.module index e563dec..f6fa48e 100755..100644 --- a/HTPasswdSync.module +++ b/HTPasswdSync.module @@ -118,6 +118,7 @@ function _htpasswdsync_crypt($password) { } } + /** * Checks if a file (given by path) exitsts and is writable. Returns false * on success, an error message on error. @@ -183,7 +184,7 @@ function _htpasswdsync_write_htfile(&$data, $file) { $content[] = "$u:$p"; } } - if(file_put_contents($file, implode("\n", $content) . "\n") === false) { + if(@file_put_contents($file, implode("\n", $content) . "\n") === false) { watchdog('HtPasswdSync', "Failed to write $file", WATCHDOG_ERROR); } } @@ -374,7 +375,7 @@ function htpasswdsync_help($path, $arg) { */ function htpasswdsync_permission() { return array( - 'user' => array( + 'administer htpasswdsync' => array( 'title' => t('Administer htpasswd synchronization'), 'restrict access' => true ) @@ -506,10 +507,13 @@ function htpasswdsync_admin() { ); // Small description ... + + $notewhitespaces = _htpasswdsync_names_lowercase() ? " Enter your login name without whitespaces and special characters." : ""; + $txt = t('This is how a simple .htaccess file could look like:') . "<pre>\t[...]\n" . "\tAuthType Basic\n" - . "\tAuthName \"Protected members area. Enter your login name without whitespaces and special characters.\"\n" + . "\tAuthName \"Protected members area.$notewhitespaces\"\n" ; if(_htpasswdsync_passfilename() != '') { @@ -583,11 +587,11 @@ function htpasswdsync_admin_validate($form, &$form_state) { function htpasswdsync_menu() { $items = array(); $items['admin/config/people/htpasswdsync'] = array( - 'title' => 'htasswd file synchronization', + 'title' => 'Htpasswd file synchronization', 'description' => 'Preferences for the HTPasswd Sync module', 'page callback' => 'drupal_get_form', 'page arguments' => array('htpasswdsync_admin'), - 'access arguments' => array('access administration pages'), + 'access arguments' => array('administer htpasswdsync'), ); return $items; } |