[Fusionforge-commits] r9407 - trunk/gforge/plugins/scmgit/common

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Apr 7 16:43:28 CEST 2010


Author: lolando
Date: 2010-04-07 16:43:27 +0200 (Wed, 07 Apr 2010)
New Revision: 9407

Modified:
   trunk/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/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-07 14:43:15 UTC (rev 9406)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-07 14:43:27 UTC (rev 9407)
@@ -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 Fusionforge-commits mailing list