mango r161 - in trunk: . lib www



Author: ovitters
Date: Sat May 31 19:45:06 2008
New Revision: 161
URL: http://svn.gnome.org/viewvc/mango?rev=161&view=rev

Log:
	* lib/user.php: Rework the which_shell and which_homedir functions.
	They're still a bit stupid, but at least it is consistently stupid.
	* www/index.php: Set page title to 'Main page' when user is logged in.
	* www/page.xsl: Update copyright year.



Modified:
   trunk/ChangeLog
   trunk/lib/user.php
   trunk/www/index.php
   trunk/www/page.xsl

Modified: trunk/lib/user.php
==============================================================================
--- trunk/lib/user.php	(original)
+++ trunk/lib/user.php	Sat May 31 19:45:06 2008
@@ -428,21 +428,36 @@
         
         return $watermark + 1;
     }
-    
-    function which_shell() {
+
+    function _has_shell() {
         if(in_array("ftpadmin", $this->groups))
-            return "/bin/bash";
+            return true;
         if(in_array("gnomecvs", $this->groups))
-            return "/bin/bash";
-        return "/sbin/nologin";
+            return true;
+        if(in_array("gnomeweb", $this->groups))
+            return true;
+        if(in_array("bugzilla", $this->groups))
+            return true;
+
+        return false;
     }
-    
+
+    function which_shell() {
+        if (!$this->_has_shell())
+            return "/sbin/nologin";
+
+        # TODO:
+        #  should reuse existing shell, if any
+        return "/bin/bash";
+    }
+
     function which_homedir() {
-        if(in_array("ftpadmin", $this->groups))
-            return "/home/users/".$this->uid;
-        return "/";
+        if (!$this->_has_shell())
+            return "/";
+
+        return "/home/users/".$this->uid;
     }
-    
+
     function add_to_node(&$dom, &$formnode) {
         $node = $formnode->appendChild($dom->createElement("uid"));
         $node->appendChild($dom->createTextNode($this->uid));

Modified: trunk/www/index.php
==============================================================================
--- trunk/www/index.php	(original)
+++ trunk/www/index.php	Sat May 31 19:45:06 2008
@@ -17,6 +17,8 @@
 $is_maintainer = false; 
 $is_coordinator = false;
 if (isset($_SESSION['user']) && is_a ($_SESSION['user'], 'User')) { 
+    $rootnode->setAttribute("title", "Main page");
+
     $vouchers = array();
     $modules = $_SESSION['user']->user_modules();
     $entry_count = $modules['count'];

Modified: trunk/www/page.xsl
==============================================================================
--- trunk/www/page.xsl	(original)
+++ trunk/www/page.xsl	Sat May 31 19:45:06 2008
@@ -86,7 +86,7 @@
 
     <div id="copyright">
      <p>
-      Copyright &#169; 2003-2007, <a href="http://www.gnome.org/";>The GNOME Project</a><br />
+      Copyright &#169; 2003-2008, <a href="http://www.gnome.org/";>The GNOME Project</a><br />
       GNOME and the foot logo are trademarks of the GNOME Foundation.<br />
       <a href="http://validator.w3.org/check/referer";>Optimized</a> for <a href="http://www.w3.org/";>standards</a>. Hosted by <a href="http://redhat.com/";>Red Hat</a>.
       </p>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]