[evolvis-commits] r14766: Display RW link to user' s private repo when corresponding user is logged in

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Feb 28 04:50:59 CET 2011


Author: mirabilos
Date: 2011-02-28 04:50:59 +0100 (Mon, 28 Feb 2011)
New Revision: 14766

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmgit/common/GitPlugin.class.php
Log:
Display RW link to user's private repo when corresponding user is logged in

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmgit/common/GitPlugin.class.php	2011-02-28 03:50:57 UTC (rev 14765)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmgit/common/GitPlugin.class.php	2011-02-28 03:50:59 UTC (rev 14766)
@@ -111,7 +111,21 @@
 		} else {
 			$b = _('<p><b>Developer GIT Access via SSH</b></p><p>Only project developers can access the GIT tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper value. Enter your site password when prompted.</p>');
 		$b .= '<p><tt>git clone git+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . $this->git_root .'/'. $project->getUnixName() .'/'. $project->getUnixName() .'.git</tt></p>' ;
+
+		if (session_logged_in()) {
+                        $u =& user_get_object(user_getid()) ;
+			if ($u->getUnixStatus() == 'A') {
+				$result = db_query_params ('SELECT * FROM plugin_scmgit_personal_repos p WHERE p.group_id=$1 AND p.user_id=$2',
+							   array ($project->getID(),
+								  $u->getID())) ;
+				if ($result && db_numrows ($result) > 0) {
+					$b .= _('<p><b>Access to your private repository</b></p><p>You have a private repository for this project, accessible through SSH with the following method. Enter your site password when prompted.</p>');
+					$b .= '<p><tt>git clone git+ssh://'.$u->getUnixName().'@' . $project->getSCMBox() . $this->git_root .'/'. $project->getUnixName() .'/users/'. $u->getUnixName() .'.git</tt></p>' ;
+				} else {
+				}
+			}
 		}
+
 		return $b ;
 	}
 



More information about the evolvis-commits mailing list