Button for all options in .htaccess file
authorJamie Cameron <jcameron@webmin.com>
Thu, 10 Jan 2008 07:26:47 +0000 (07:26 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 10 Jan 2008 07:26:47 +0000 (07:26 +0000)
htaccess-htpasswd/CHANGELOG
htaccess-htpasswd/edit_dir.cgi
htaccess-htpasswd/lang/en
htaccess-htpasswd/save_dir.cgi

index f00c89a..c74522b 100644 (file)
@@ -19,3 +19,4 @@ Users can be limited to only editing users and groups (and not adding or changin
 ---- Changes since 1.390 ----
 Converted all user interface code to use the new Webmin UI library, for consistency.
 Fixed a bug that prevented a groups file from being added to an existing directory.
+Added a button to link to the Apache module (if accessible) for editing all settings in the .htaccess file.
index baf357e..e2f0875 100755 (executable)
@@ -130,10 +130,17 @@ if ($in{'new'}) {
        print &ui_form_end([ [ undef, $text{'create'} ] ]);
        }
 else {
+       if (&foreign_available("apache")) {
+               %aaccess = &get_module_acl(undef, "apache");
+               if ($aaccess{'global'}) {
+                       @abutton = ( undef, [ 'apache', $text{'dir_apache'} ] );
+                       }
+               }
        print &ui_form_end([ [ undef, $text{'save'} ],
                             [ 'delete', $text{'dir_delete'} ],
                             [ 'remove', $dir->[4] ? $text{'dir_delete2'}
-                                                  : $text{'dir_delete3'} ] ]);
+                                                  : $text{'dir_delete3'} ],
+                            @abutton ]);
        }
 
 &ui_print_footer("", $text{'index_return'});
index c530655..9e5caf1 100644 (file)
@@ -57,6 +57,7 @@ dir_erequire_group=No groups to allow entered
 dir_delete=Un-Protect
 dir_delete2=Un-Protect And Remove Files
 dir_delete3=Un-Protect And Remove File
+dir_apache=Edit Apache Options
 
 edit_title1=Create User
 edit_title2=Edit User
index 40f81a1..5973ad6 100755 (executable)
@@ -24,6 +24,14 @@ else {
        $htaccess = "$dir->[0]/$config{'htaccess'}";
        }
 
+# Check for button that redirects to the Apache module for editing all
+# options in .htaccess file
+if ($in{'apache'}) {
+       &redirect("../apache/htaccess_index.cgi?file=".
+                 &urlize($htaccess));
+       exit;
+       }
+
 &lock_file($htaccess);
 &lock_file($directories_file);