From a83028159c1e39c00224c61a076819a42c377e2f Mon Sep 17 00:00:00 2001 From: stfwi Date: Fri, 17 Jun 2011 23:17:38 +0100 Subject: filemods, info cleanup, permission display bugfix --- HTPasswdSync.module | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) mode change 100755 => 100644 HTPasswdSync.module (limited to 'HTPasswdSync.module') diff --git a/HTPasswdSync.module b/HTPasswdSync.module old mode 100755 new mode 100644 index e563dec..f6fa48e --- 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:') . "
\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;
 }
-- 
cgit v1.2.3