[Rt-commit] r11764 - rt/branches/3.8-TESTING/html/installation

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Apr 17 05:32:32 EDT 2008


Author: sunnavy
Date: Thu Apr 17 05:32:30 2008
New Revision: 11764

Modified:
   rt/branches/3.8-TESTING/html/installation/autohandler
   rt/branches/3.8-TESTING/html/installation/index.html

Log:
added superuser check

Modified: rt/branches/3.8-TESTING/html/installation/autohandler
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/autohandler	(original)
+++ rt/branches/3.8-TESTING/html/installation/autohandler	Thu Apr 17 05:32:30 2008
@@ -48,7 +48,7 @@
 
 <%init>
 
-if ( $session{InstallConfig} ) {
+if ( $session{InstallConfig} && $session{CurrentUser}->HasRight( Right => 'SuperUser',  Object => $RT::System ) ) {
     $m->call_next;
 }
 else {
@@ -58,7 +58,3 @@
 }
 
 </%init>
-
-<%args>
-$File => undef
-</%args>

Modified: rt/branches/3.8-TESTING/html/installation/index.html
==============================================================================
--- rt/branches/3.8-TESTING/html/installation/index.html	(original)
+++ rt/branches/3.8-TESTING/html/installation/index.html	Thu Apr 17 05:32:30 2008
@@ -52,6 +52,8 @@
 
 <& /Elements/ListActions, actions => \@results &>
 
+% if ( $session{CurrentUser}->HasRight( Right => 'SuperUser',  Object => $RT::System ) && ! $locked ) {
+
 <div class="intro">
 <p>
 RT is an enterprise-grade ticketing system which enables a group of people to intelligently and efficiently manage tasks, issues, and requests submitted by a community of users.
@@ -67,7 +69,6 @@
 <p>
 </div>
 
-% unless ( $locked ) {
 <form method="post">
 <input type="hidden" name="Run" value="1" />
 <& /Elements/Submit, Label => 'Start Config' &>
@@ -78,20 +79,27 @@
 my @results;
 
 my $locked;
-my $file = File::Spec->catfile( $RT::EtcPath, 'RT_SiteConfig.pm' );
-$locked = 1 unless -w $file;
-
-if ( $RT::Installed && ! $Force ) {
-    push @results, "Seems you've already run this wizard";
-}
 
-if ( $locked ) {
-    push @results, "Config file $file is locked";
+if ( $session{CurrentUser}->HasRight( Right => 'SuperUser',  Object =>
+            $RT::System ) ) {
+    my $file = File::Spec->catfile( $RT::EtcPath, 'RT_SiteConfig.pm' );
+    $locked = 1 unless -w $file;
+    
+    if ( $RT::Installed && ! $Force ) {
+        push @results, "Seems you've already run this wizard";
+    }
+    
+    if ( $locked ) {
+        push @results, "Config file $file is locked";
+    }
+    elsif ( $Run ) {
+        $session{InstallConfig} ||= {};
+        RT::Interface::Web::Redirect(RT->Config->Get('WebURL') . 'installation/Step1.html');
+    
+    }
 }
-elsif ( $Run ) {
-    $session{InstallConfig} ||= {};
-    RT::Interface::Web::Redirect(RT->Config->Get('WebURL') . 'installation/Step1.html');
-
+else {
+    push @results, 'Permission Denied';
 }
 
 </%init>


More information about the Rt-commit mailing list