permissions now apply properly to repo, however the git client behaves
[gwvp-mini.git] / gwvpmini / gwvpmini_web.php
index 72f95d7..eb1a7c5 100644 (file)
@@ -90,6 +90,11 @@ function gwvpmini_goMainPage($bodyFunction = null)
        
        
        echo "<table width=\"100%\">";
+       
+       echo "<tr width=\"100%\" bgcolor=\"#ddddff\"><td colspan=\"2\" align=\"right\">";
+       gwvpmini_SearchBuilder();
+       echo "</td></tr>";\r
+       
 
        if(isset($_SESSION["message"])) {
                echo "<tr width=\"100%\"><td colspan=\"2\">";
@@ -105,7 +110,7 @@ function gwvpmini_goMainPage($bodyFunction = null)
        
        echo "</tr>";
        
-       echo "<tr><td>";
+       echo "<tr><td colspan=\"2\">";
        if($bodyFunction == null) {
                gwvpmini_BodyBuilder();
        } else {
@@ -197,7 +202,7 @@ function gwvpmini_LoginBuilder()
        if($login === false) {
                gwvpmini_SingleLineLoginForm();
        } else {
-               echo "Hello ".$_SESSION["fullname"]." <a href=\"$BASE_URL/logout\">logout</a>";
+               echo "Hello <a href=\"$BASE_URL/user/".$_SESSION["username"]."\">".$_SESSION["fullname"]."</a> <a href=\"$BASE_URL/logout\">logout</a>";
        }
 }
 
@@ -219,21 +224,59 @@ function gwvpmini_BodyBuilder()
 // builds the tail structure
 function gwvpmini_TailBuilder()
 {
-       echo "<font size=\"-1\"><i>Copyright 2011, PJR - licensed under GPL</i></font>";
+       echo "<br><br><hr><font size=\"-1\"><b><a href=\"http://github.com/takigama/GWVP\">GWVP</a></b> - <i>Copyright 2011, 2012 PJR - <a href=\"http://www.gnu.org/copyleft/gpl.html\">GPL</a></i></font>";
+}
+
+function gwvpmini_emailToUserLink($email)
+{
+       global $BASE_URL;
+       
+       $username = gwvpmini_GetUserNameFromEmail($email);
+       
+       if($username !== false) {
+               return "<a href=\"$BASE_URL/user/$username\">$username</a>";
+       } else {
+               return false;
+       }
 }
 
 function gwvpmini_fourZeroThree()
 {
        error_log("403 called");
-       header("HTTP/1.0 403 Permission Denied");
+       header("HTTP/1.1 403 Permission Denied");
 }
 
 function gwvpmini_fourZeroFour()
 {
        error_log("404 called");
-       header("HTTP/1.0 404 No Such Thing");
+       header("HTTP/1.1 404 No Such Thing");
 }
 
 
+/**\r
+ * Get either a Gravatar URL or complete image tag for a specified email address.\r
+ *\r
+ * @param string $email The email address\r
+ * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]\r
+ * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]\r
+ * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]\r
+ * @param boole $img True to return a complete IMG tag False for just the URL\r
+ * @param array $atts Optional, additional key/value attributes to include in the IMG tag\r
+ * @return String containing either just a URL or a complete image tag\r
+ * @source http://gravatar.com/site/implement/images/php/\r
+ */\r
+function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\r
+       $url = 'http://en.gravatar.com/avatar/';\r
+       $url .= md5( strtolower( trim( $email ) ) );\r
+       $url .= "?s=$s&d=$d&r=$r";\r
+       if ( $img ) {\r
+               $url = '<img src="' . $url . '"';\r
+               foreach ( $atts as $key => $val )\r
+                       $url .= ' ' . $key . '="' . $val . '"';\r
+               $url .= ' />';\r
+       }\r
+       return $url;\r
+}\r
+
 
 ?>
\ No newline at end of file