This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  39e7dd4fa7255434a79edb86895894452bb8c429 (commit)
      from  09859eaaa2ade2a65f6c5e960d8076c474ce10ae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=39e7dd4fa7255434a79edb86895894452bb8c429

commit 39e7dd4fa7255434a79edb86895894452bb8c429
Author: Franck Villaume <[email protected]>
Date:   Mon Jun 5 15:05:15 2017 +0000

    scmgit plugin: support ssh port mapping

diff --git a/src/plugins/scmgit/common/GitPlugin.class.php 
b/src/plugins/scmgit/common/GitPlugin.class.php
index ebc8a3c..bf6be31 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -34,6 +34,7 @@ forge_define_config_item('use_ssh', 'scmgit', false);
 forge_set_config_item_bool('use_ssh', 'scmgit');
 forge_define_config_item('use_ssl', 'scmgit', true);
 forge_set_config_item_bool('use_ssl', 'scmgit');
+forge_define_config_item('ssh_port', 'core', 22);
 
 class GitPlugin extends SCMPlugin {
        function __construct() {
@@ -186,6 +187,10 @@ control over it to the project's administrator.");
                if (!isset($configuration)) {
                        return $HTML->error_msg(_('Error')._(': ')._('No access 
protocol has been allowed for the Git plugin in scmgit.ini: use_ssh and 
use_smarthttp are disabled'));
                }
+               $ssh_port = '';
+               if (forge_get_config('ssh_port') != 22) {
+                       $ssh_port = ':'.forge_get_config('ssh_port');
+               }
                if (session_loggedin()) {
                        $u = user_get_object(user_getid());
                        $d = $u->getUnixName();
@@ -194,7 +199,7 @@ control over it to the project's administrator.");
                                $b .= html_e('p', array(), _('SSH must be 
installed on your client machine.'));
                                $htmlRepo = '';
                                foreach ($repo_list as $repo_name) {
-                                       $htmlRepo .= html_e('tt', array(), 'git 
clone git+ssh://'.$d.'@' . forge_get_config('scm_host') . 
forge_get_config('repos_path', 'scmgit') .'/'. $project->getUnixName() .'/'. 
$repo_name .'.git').html_e('br');
+                                       $htmlRepo .= html_e('tt', array(), 'git 
clone 
git+ssh://'.$d.'@'.forge_get_config('scm_host').$ssh_port.forge_get_config('repos_path',
 'scmgit').'/'.$project->getUnixName().'/'.$repo_name.'.git').html_e('br');
                                }
                                $b .= html_e('p', array(), $htmlRepo);
                                $b .= '</div>';
@@ -221,7 +226,7 @@ control over it to the project's administrator.");
                                        ' '. _('Substitute 
<em>developername</em> with the proper value.'));
                                $htmlRepo = '';
                                foreach ($repo_list as $repo_name) {
-                                       $htmlRepo .= html_e('tt', array(), 'git 
clone git+ssh://'.html_e('i', array(), _('developername'), true, false).'@' . 
forge_get_config('scm_host') . forge_get_config('repos_path', 'scmgit') .'/'. 
$project->getUnixName() .'/'. $repo_name .'.git').html_e('br');
+                                       $htmlRepo .= html_e('tt', array(), 'git 
clone git+ssh://'.html_e('i', array(), _('developername'), true, 
false).'@'.forge_get_config('scm_host').$ssh_port.forge_get_config('repos_path',
 'scmgit').'/'.$project->getUnixName().'/'.$repo_name.'.git').html_e('br');
                                }
                                $b .= html_e('p', array(), $htmlRepo);
                                $b .= '</div>';
@@ -254,7 +259,7 @@ control over it to the project's administrator.");
                                        $b .= html_e('h3', array(), _('Access 
to your personal repository'));
                                        $b .= html_e('p', array(), _('You have 
a personal repository for this project, accessible through the following 
methods. Enter your site password when prompted.'));
                                        if (forge_get_config('use_ssh', 
'scmgit')) {
-                                               $b .= html_e('tt', array(), 
'git clone git+ssh://'.$u->getUnixName().'@' . forge_get_config('scm_host') . 
forge_get_config('repos_path', 'scmgit') .'/'. $project->getUnixName() 
.'/users/'. $u->getUnixName() .'.git').html_e('br');
+                                               $b .= html_e('tt', array(), 
'git clone 
git+ssh://'.$u->getUnixName().'@'.forge_get_config('scm_host').$ssh_port.forge_get_config('repos_path',
 
'scmgit').'/'.$project->getUnixName().'/users/'.$u->getUnixName().'.git').html_e('br');
                                        }
                                        if (forge_get_config('use_smarthttp', 
'scmgit')) {
                                                $b .= html_e('tt', array(), 
'git clone '.$protocol.'://'.$u->getUnixName().'@' . 
forge_get_config('scm_host').'/authscm/'.$u->getUnixName().'/git/'.$project->getUnixName()
 .'/users/'. $u->getUnixName() .'.git').html_e('br');

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/scmgit/common/GitPlugin.class.php | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to