← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2015: Added Java and OS information for superusers in about page

 

------------------------------------------------------------
revno: 2015
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Sat 2010-06-19 19:11:55 +0200
message:
  Added Java and OS information for superusers in about page
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm	2010-05-05 09:17:27 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/about.vm	2010-06-19 17:11:55 +0000
@@ -11,7 +11,14 @@
   <dt>$i18n.getString( "database_type" ):</dt><dd>$!info.type</dd>
   <dt>$i18n.getString( "database_name" ):</dt><dd>$!info.name</dd>
   <dt>$i18n.getString( "database_user" ):</dt><dd>$!info.user</dd>
+  #if ( $currentUserIsSuper )
   <dt>$i18n.getString( "java_opts" ):</dt><dd>$!javaOpts</dd>
+  <dt>$i18n.getString( "java_version" ):</dt><dd>$systemProperties.get( "java.version" )</dd>
+  <dt>$i18n.getString( "java_vendor" ):</dt><dd>$systemProperties.get( "java.vendor" )</dd>
+  <dt>$i18n.getString( "os_name" ):</dt><dd>$systemProperties.get( "os.name" )</dd>
+  <dt>$i18n.getString( "os_architecture" ):</dt><dd>$systemProperties.get( "os.arch" )</dd>
+  <dt>$i18n.getString( "os_version" ):</dt><dd>$systemProperties.get( "os.version" )</dd>
+  #end
 </dl>
 <br/>
 <div><input type="button" value="$i18n.getString( 'back' )" onclick="window.location.href='$!backUrl'" style="width:140px"/></div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java	2010-05-18 13:42:38 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/about/action/AboutAction.java	2010-06-19 17:11:55 +0000
@@ -41,6 +41,7 @@
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.system.database.DatabaseInfo;
 import org.hisp.dhis.system.database.DatabaseInfoProvider;
+import org.hisp.dhis.user.CurrentUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import org.apache.struts2.ServletActionContext;
@@ -65,6 +66,13 @@
     @Autowired
     private DatabaseInfoProvider databaseInfoProvider;
     
+    private CurrentUserService currentUserService;
+    
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -143,6 +151,20 @@
     {
         this.backUrl = backUrl;
     }
+    
+    private Properties systemProperties;
+    
+    public Properties getSystemProperties()
+    {
+        return systemProperties;
+    }
+
+    private boolean currentUserIsSuper;
+
+    public boolean getCurrentUserIsSuper()
+    {
+        return currentUserIsSuper;
+    }
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -218,6 +240,10 @@
             javaOpts = i18n.getString( "unknown" );
         }
         
+        systemProperties = System.getProperties();
+        
+        currentUserIsSuper = currentUserService.currentUserIsSuper();
+
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2010-06-06 13:49:53 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2010-06-19 17:11:55 +0000
@@ -557,7 +557,9 @@
 
 	<!-- About -->
 
-	<bean id="org.hisp.dhis.about.action.AboutAction" class="org.hisp.dhis.about.action.AboutAction" scope="prototype"/>
+	<bean id="org.hisp.dhis.about.action.AboutAction" class="org.hisp.dhis.about.action.AboutAction" scope="prototype">
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService"/>
+	</bean>
 
 	<bean id="org.hisp.dhis.about.action.HelpAction" class="org.hisp.dhis.about.action.HelpAction"
 		scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-06-09 04:47:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-06-19 17:11:55 +0000
@@ -224,6 +224,12 @@
 user_account = User account
 unknown = Unknown
 java_opts = Java Opts
+java_version = Java version
+java_vendor = Java vendor
+os_name = OS name
+os_architecture = OS architecture
+os_version = OS version
+os_bit_addressing = OS bit addressing
 
 #-- Change Log------------------------------------------------------------------#