switching user references to link-to-user references
authorPaul J R <me@pjr.cc>
Wed, 19 Sep 2012 02:06:14 +0000 (12:06 +1000)
committerPaul J R <me@pjr.cc>
Wed, 19 Sep 2012 02:06:14 +0000 (12:06 +1000)
gwvpmini/gwvpmini_admin.php
gwvpmini/gwvpmini_db.php
gwvpmini/gwvpmini_view.php
gwvpmini/gwvpmini_web.php
www/index.php

index 55eae57..e289d45 100644 (file)
@@ -51,8 +51,11 @@ function gwvpmini_AdminMainPageBody()
                $em = $val["email"];
                $fn = $val["fullname"];
                $ds = $val["desc"];
-               echo "<tr><td>$un</td><td>$em</td><td>$fn</td><td>$ds</td><td><a href=\"$BASE_URL/admin/removeuser&id=$id\">Remove</a> <a href=\"$BASE_URL/admin/disableuser&id=$id\">Disable</a></td></tr>";
+               $unlval = "<a href=\"$BASE_URL/user/$un\">$un</a>";
+               echo "<tr><td>$unlval</td><td>$em</td><td>$fn</td><td>$ds</td><td><a href=\"$BASE_URL/admin/removeuser&id=$id\">Remove</a> <a href=\"$BASE_URL/admin/disableuser&id=$id\">Disable</a></td></tr>";
        }
+       
+       
        echo "</table>";
        echo "</td><td>";
        echo "<h3>Create User</h3>";
index f87751c..cf3e0fd 100644 (file)
@@ -240,6 +240,36 @@ function gwvpmini_GetRepoId($reponame)
        
        return $retval;
 }
+
+function gwvpmini_GetRepoDescFromName($reponame)\r
+{\r
+\r
+       /*\r
+        *      $reposql = '\r
+       CREATE TABLE "repos" (\r
+                       "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT,\r
+                       "repos_name" TEXT,\r
+                       "repos_description" TEXT,\r
+                       "repos_owner" INTEGER\r
+       )';\r
+\r
+       */\r
+\r
+       $conn = gwvpmini_ConnectDB();\r
+\r
+       $sql = "select repos_description from repos where repos_name='$reponame'";
+       error_log("desc for name sql: $sql");\r
+\r
+       $res = $conn->query($sql);\r
+\r
+       $retval = -1;\r
+       if(!$res) return -1;\r
+       foreach($res as $row) {\r
+               $retval = $row[0];\r
+       }\r
+\r
+       return $retval;\r
+}
 \r
 function gwvpmini_GetRepoOwnerDetailsFromName($reponame)\r
 {\r
index 70ce34d..007261e 100644 (file)
@@ -51,14 +51,16 @@ function gwvpmini_RepoViewPageBody()
        $sname = $_SERVER["SERVER_NAME"];
        
        $owner = gwvpmini_GetRepoOwnerDetailsFromName($repo_view_call);
+       $desc = gwvpmini_GetRepoDescFromName($repo_view_call);
        
        $owner_name = $owner["username"];
        
        error_log("STUFF:".print_r($owner,true));
+       $cloneurl = "git clone $proto$sname$BASE_URL/git/$repo_view_call.git";
+       echo "<textarea rows=1 cols=".strlen($cloneurl).">$cloneurl</textarea><br>";\r
        
-       echo "<br><h2>".get_gravatar($owner["email"], 30, 'mm', 'g', true)."$repo_view_call - $owner_name</h2>";
-       echo "<b>Desc</b><br>";
-       echo "<textarea rows=1 cols=100>git clone $proto$sname$BASE_URL/git/$repo_view_call.git</textarea><br>";
+       echo "<h2>".get_gravatar($owner["email"], 30, 'mm', 'g', true)."$repo_view_call - $owner_name</h2>";
+       echo "<b>$desc</b><br>";
        //echo "command: git log --git-dir=$repo_base/$repo_view_call.git --pretty=format:\"%H\" -10";
        $rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%H\" -10", "r");
        $commitids = array();
index 54b34a4..8c2a5c1 100644 (file)
@@ -202,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>";
        }
 }
 
index 61e77b2..264e4e8 100644 (file)
@@ -30,10 +30,10 @@ if(!gwvpmini_DBExists($db_name)) {
 gwvpmini_goWeb();
 
 
-echo "<pre>";
+/*echo "<pre>";
 print_r($_SERVER);
 print_r($_REQUEST);
 print_r($_SESSION);
-echo "</pre>";
+echo "</pre>";*/
 
 ?>
\ No newline at end of file