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 --- CHANGELOG.txt | 1 - HTPasswdSync.info | 6 ------ HTPasswdSync.install | 0 HTPasswdSync.module | 14 +++++++++----- LICENSE.txt | 0 README.txt | 1 + 6 files changed, 10 insertions(+), 12 deletions(-) mode change 100755 => 100644 CHANGELOG.txt mode change 100755 => 100644 HTPasswdSync.info mode change 100755 => 100644 HTPasswdSync.install mode change 100755 => 100644 HTPasswdSync.module mode change 100755 => 100644 LICENSE.txt mode change 100755 => 100644 README.txt diff --git a/CHANGELOG.txt b/CHANGELOG.txt old mode 100755 new mode 100644 index fbb5559..b7a5a39 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,2 @@ -$Id: CHANGELOG.txt,v 1.0.0 2011/06/01 00:08:53 stfwi Exp $ v1.0 Initial release for DP7 diff --git a/HTPasswdSync.info b/HTPasswdSync.info old mode 100755 new mode 100644 index d890e3f..8ad669a --- a/HTPasswdSync.info +++ b/HTPasswdSync.info @@ -1,9 +1,3 @@ -; $Id: HTPasswdSync.info, stfwi Exp $ name = HTPasswdSync description = Export user login data into htpasswd and htgroup files. core = 7.x - -version = "7.x-1.0-dev" -core = "7.x" -project = "htpasswdsync" - diff --git a/HTPasswdSync.install b/HTPasswdSync.install old mode 100755 new mode 100644 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;
 }
diff --git a/LICENSE.txt b/LICENSE.txt
old mode 100755
new mode 100644
diff --git a/README.txt b/README.txt
old mode 100755
new mode 100644
index d2af52a..f468a5d
--- a/README.txt
+++ b/README.txt
@@ -73,3 +73,4 @@ None.
 
 Current maintainers:
 * Marc Furrer (m.fu) - http://drupal.org/user/310415
+* Stefan Wilhelm (7.x-xx) - http://drupal.org/user/1344522
-- 
cgit v1.2.3