[Fusionforge-commits] r8852 - in trunk/gforge/plugins: scmbzr/common scmcpold/common scmcvs/common scmgit/common scmhg/common scmsvn/common

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Feb 23 12:02:12 CET 2010


Author: lolando
Date: 2010-02-23 12:02:11 +0100 (Tue, 23 Feb 2010)
New Revision: 8852

Modified:
   trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php
   trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php
   trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php
   trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
   trunk/gforge/plugins/scmhg/common/HgPlugin.class.php
   trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php
Log:
Display actual loginname for the SCM read/write instructions when it's known

Modified: trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php	2010-02-23 10:25:51 UTC (rev 8851)
+++ trunk/gforge/plugins/scmbzr/common/BzrPlugin.class.php	2010-02-23 11:02:11 UTC (rev 8852)
@@ -90,9 +90,15 @@
 
 	function getInstructionsForRW ($project) {
 		$b = '' ;
-		$b .= _('<p><b>Developer Bazaar Access via SSH</b></p><p>Only project developers can access the Bazaar branches via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-		$b .= '<p><tt>bzr checkout bzr+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . $this->bzr_root .'/'. $project->getUnixName().'/'._('branchname').'</tt></p>' ;
-		
+		if (session_loggedin()) {
+			$u =& user_get_object(user_getid()) ;
+			$d = $u->getUnixName() ;
+			$b .= _('<p><b>Developer Bazaar Access via SSH</b></p><p>Only project developers can access the Bazaar branches via this method. SSH must be installed on your client machine. Enter your site password when prompted.</p>');
+			$b .= '<p><tt>bzr checkout bzr+ssh://'.$d.'@' . $project->getSCMBox() . $this->bzr_root .'/'. $project->getUnixName().'/'._('branchname').'</tt></p>' ;
+		} else {
+			$b .= _('<p><b>Developer Bazaar Access via SSH</b></p><p>Only project developers can access the Bazaar branches 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>bzr checkout bzr+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . $this->bzr_root .'/'. $project->getUnixName().'/'._('branchname').'</tt></p>' ;
+		}
 		return $b ;
 	}
 

Modified: trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php	2010-02-23 10:25:51 UTC (rev 8851)
+++ trunk/gforge/plugins/scmcpold/common/CpoldPlugin.class.php	2010-02-23 11:02:11 UTC (rev 8852)
@@ -70,8 +70,15 @@
 	}
 
 	function getInstructionsForRW ($project) {
-		$b = _('<p><b>Developer CPOLD Access via SSH</b></p><p>Only project developers can access the CPOLD tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-		$b .= '<p><tt>scp -r <i>'._('developername').'</i>@' . $project->getSCMBox() . ':'. $this->cpold_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		if (session_loggedin()) {
+			$u =& user_get_object(user_getid()) ;
+			$d = $u->getUnixName() ;
+			$b = _('<p><b>Developer CPOLD Access via SSH</b></p><p>Only project developers can access the CPOLD tree via this method. SSH must be installed on your client machine. Enter your site password when prompted.</p>');
+			$b .= '<p><tt>scp -r '.$d.'@' . $project->getSCMBox() . ':'. $this->cpold_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		} else {
+			$b = _('<p><b>Developer CPOLD Access via SSH</b></p><p>Only project developers can access the CPOLD 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>scp -r <i>'._('developername').'</i>@' . $project->getSCMBox() . ':'. $this->cpold_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		}
 		return $b ;
 	}
 

Modified: trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php	2010-02-23 10:25:51 UTC (rev 8851)
+++ trunk/gforge/plugins/scmcvs/common/CVSPlugin.class.php	2010-02-23 11:02:11 UTC (rev 8852)
@@ -89,12 +89,21 @@
 
 	function getInstructionsForRW ($project) {
 		$cvsrootend = $project->getSCMBox().':'.$this->cvs_root.'/'.$project->getUnixName();
-		$b = _('<p><b>Developer CVS Access via SSH</b></p><p>Only project developers can access the CVS tree via this method. SSH must be installed on your client machine. Substitute <i>modulename</i> and <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-		$b .= '<p>
+		if (session_loggedin()) {
+			$u =& user_get_object(user_getid()) ;
+			$d = $u->getUnixName() ;
+			$b = _('<p><b>Developer CVS Access via SSH</b></p><p>Only project developers can access the CVS tree via this method. SSH must be installed on your client machine. Substitute <i>modulename</i> with the proper value. Enter your site password when prompted.</p>');
+			$b .= '<p>
 			       <tt>export CVS_RSH=ssh</tt><br/>
+			       <tt>cvs -d :ext:'.$d.'@'.$cvsrootend.' checkout <em>'._('modulename').'</em></tt>
+			       </p>';
+		} else {
+			$b = _('<p><b>Developer CVS Access via SSH</b></p><p>Only project developers can access the CVS tree via this method. SSH must be installed on your client machine. Substitute <i>modulename</i> and <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
+			$b .= '<p>
+			       <tt>export CVS_RSH=ssh</tt><br/>
 			       <tt>cvs -d :ext:<em>'._('developername').'</em>@'.$cvsrootend.' checkout <em>'._('modulename').'</em></tt>
 			       </p>';
-		
+		}
 		return $b ;
 	}
 

Modified: trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-02-23 10:25:51 UTC (rev 8851)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-02-23 11:02:11 UTC (rev 8852)
@@ -83,8 +83,15 @@
 	}
 
 	function getInstructionsForRW ($project) {
-		$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 values. Enter your site password when prompted.</p>');
+		if (session_logged_in()) {
+			$u =& user_get_object(user_getid()) ;
+			$d = $u->getUnixName() ;
+			$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. Enter your site password when prompted.</p>');
+			$b .= '<p><tt>git clone git+ssh://'.$d.'@' . $project->getSCMBox() . $this->git_root .'/'. $project->getUnixName() .'/'. $project->getUnixName() .'.git</tt></p>' ;
+		} 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>' ;
+		}
 		return $b ;
 	}
 

Modified: trunk/gforge/plugins/scmhg/common/HgPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmhg/common/HgPlugin.class.php	2010-02-23 10:25:51 UTC (rev 8851)
+++ trunk/gforge/plugins/scmhg/common/HgPlugin.class.php	2010-02-23 11:02:11 UTC (rev 8852)
@@ -58,8 +58,15 @@
 	}
 
 	function getInstructionsForRW ($project) {
-		$b = _('<p><b>Developer Mercurial Access via SSH</b></p><p>Only project developers can access the Mercurial tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-		$b .= '<p><tt>hg clone hg+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . ':'. $this->hg_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		if (session_logged_in()) {
+			$u =& user_get_object(user_getid()) ;
+			$d = $u->getUnixName() ;
+			$b = _('<p><b>Developer Mercurial Access via SSH</b></p><p>Only project developers can access the Mercurial tree via this method. SSH must be installed on your client machine. Enter your site password when prompted.</p>');
+			$b .= '<p><tt>hg clone hg+ssh://'.$d.'@' . $project->getSCMBox() . ':'. $this->hg_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		} else {
+			$b = _('<p><b>Developer Mercurial Access via SSH</b></p><p>Only project developers can access the Mercurial 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>hg clone hg+ssh://'.$d.'@' . $project->getSCMBox() . ':'. $this->hg_root .'/'. $project->getUnixName().'/ .</tt></p>' ;
+		}
 		return $b ;
 	}
 

Modified: trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php	2010-02-23 10:25:51 UTC (rev 8851)
+++ trunk/gforge/plugins/scmsvn/common/SVNPlugin.class.php	2010-02-23 11:02:11 UTC (rev 8852)
@@ -93,15 +93,27 @@
 
 	function getInstructionsForRW ($project) {
 		$b = '' ;
-		if ($this->use_ssh) {
-			$b .= _('<p><b>Developer Subversion Access via SSH</b></p><p>Only project developers can access the SVN tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-			$b .= '<p><tt>svn checkout svn+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . $this->svn_root .'/'. $project->getUnixName().'</tt></p>' ;
+		if (session_loggedin()) {
+			$u =& user_get_object(user_getid()) ;
+			$d = $u->getUnixName() ;
+			if ($this->use_ssh) {
+				$b .= _('<p><b>Developer Subversion Access via SSH</b></p><p>Only project developers can access the SVN tree via this method. SSH must be installed on your client machine. Enter your site password when prompted.</p>');
+				$b .= '<p><tt>svn checkout svn+ssh://'.$d.'@' . $project->getSCMBox() . $this->svn_root .'/'. $project->getUnixName().'</tt></p>' ;
+			}
+			if ($this->use_dav) {
+				$b .= _('<p><b>Developer Subversion Access via DAV</b></p><p>Only project developers can access the SVN tree via this method. Enter your site password when prompted.</p>');
+				$b .= '<p><tt>svn checkout --username '.$d.' http'.(($this->use_ssl) ? 's' : '').'://'. $project->getSCMBox() . $this->svn_root .'/'.$project->getUnixName().'</tt></p>' ;
+			}
+		} else {
+			if ($this->use_ssh) {
+				$b .= _('<p><b>Developer Subversion Access via SSH</b></p><p>Only project developers can access the SVN tree via this method. SSH must be installed on your client machine. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
+				$b .= '<p><tt>svn checkout svn+ssh://<i>'._('developername').'</i>@' . $project->getSCMBox() . $this->svn_root .'/'. $project->getUnixName().'</tt></p>' ;
+			}
+			if ($this->use_dav) {
+				$b .= _('<p><b>Developer Subversion Access via DAV</b></p><p>Only project developers can access the SVN tree via this method. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
+				$b .= '<p><tt>svn checkout --username <i>'._('developername').'</i> http'.(($this->use_ssl) ? 's' : '').'://'. $project->getSCMBox() . $this->svn_root .'/'.$project->getUnixName().'</tt></p>' ;
+			}
 		}
-		if ($this->use_dav) {
-			$b .= _('<p><b>Developer Subversion Access via DAV</b></p><p>Only project developers can access the SVN tree via this method. Substitute <i>developername</i> with the proper values. Enter your site password when prompted.</p>');
-			$b .= '<p><tt>svn checkout --username <i>'._('developername').'</i> http'.(($this->use_ssl) ? 's' : '').'://'. $project->getSCMBox() . $this->svn_root .'/'.$project->getUnixName().'</tt></p>' ;
-		}
-
 		return $b ;
 	}
 




More information about the Fusionforge-commits mailing list