diff --git a/SourceSFSVN/SourceSFSVN.php b/SourceSFSVN/SourceSFSVN.php index c2d2d2d..e736efe 100644 --- a/SourceSFSVN/SourceSFSVN.php +++ b/SourceSFSVN/SourceSFSVN.php @@ -100,6 +100,17 @@ return; } + $t_svn_username = ''; + $t_svn_password = ''; + $t_sf_project = ''; + $t_branches = ''; + + if ( isset( $p_repo->info['svn_password'] ) ) { + $t_svn_password = $p_repo->info['svn_password']; + } + if ( isset( $p_repo->info['svn_username'] ) ) { + $t_svn_username = $p_repo->info['svn_username']; + } if ( isset( $p_repo->info['sf_project'] ) ) { $t_sf_project = $p_repo->info['sf_project']; } @@ -108,6 +119,14 @@ } ?> > + + + +> + + + +> @@ -123,9 +142,13 @@ return; } + $f_svn_username = gpc_get_string( 'svn_username' ); + $f_svn_password = gpc_get_string( 'svn_password' ); $f_sf_project = gpc_get_string( 'sf_project' ); $f_standard_repo = gpc_get_bool( 'standard_repo', false ); + $p_repo->info['svn_username'] = $f_svn_username; + $p_repo->info['svn_password'] = $f_svn_password; $p_repo->info['sf_project'] = $f_sf_project; $p_repo->info['standard_repo'] = $f_standard_repo; @@ -138,9 +161,11 @@ } if ( preg_match( '/(\d+)/', $p_data, $p_matches ) ) { + $svn = $this->svn_call( $p_repo ); + $t_url = $p_repo->url; $t_revision = $p_matches[1]; - $t_svnlog = explode( "\n", `svn log -v $t_url -r$t_revision` ); + $t_svnlog = explode( "\n", `$svn log -v $t_url -r$t_revision` ); if ( SourceChangeset::exists( $p_repo->id, $t_revision ) ) { echo "Revision $t_revision already committed!\n"; @@ -158,9 +183,10 @@ } $this->check_svn(); + $svn = $this->svn_call( $p_repo ); $t_url = $p_repo->url; - $t_svnlog = explode( "\n", `svn log -v $t_url` ); + $t_svnlog = explode( "\n", `$svn log -v $t_url` ); return $this->process_svn_log( $p_repo, $t_svnlog ); } @@ -171,6 +197,7 @@ } $this->check_svn(); + $svn = $this->svn_call( $p_repo ); $t_changeset_table = plugin_table( 'changeset', 'Source' ); @@ -181,7 +208,7 @@ $t_url = $p_repo->url; $t_rev = $t_db_revision + 1; - $t_svnlog = explode( "\n", `svn log -v -r $t_rev:HEAD --limit 200 $t_url` ); + $t_svnlog = explode( "\n", `$svn log -v -r $t_rev:HEAD --limit 200 $t_url` ); return $this->process_svn_log( $p_repo, $t_svnlog ); } @@ -192,6 +219,22 @@ } } + function svn_call( $p_repo ) { + $t_call = 'svn'; + + $t_username = $p_repo->info['svn_username']; + $t_password = $p_repo->info['svn_password']; + + if ( !is_blank( $t_username ) ) { + $t_call .= ' --username ' . $t_username; + } + if ( !is_blank( $t_password ) ) { + $t_call .= ' --password ' . $t_password; + } + + return $t_call; + } + function process_svn_log( $p_repo, $p_svnlog ) { $t_state = 0; $t_svnline = str_pad( '', 72, '-' ); diff --git a/SourceSFSVN/lang/strings_english.txt b/SourceSFSVN/lang/strings_english.txt index 3ee0811..6642ccb 100644 --- a/SourceSFSVN/lang/strings_english.txt +++ b/SourceSFSVN/lang/strings_english.txt @@ -16,6 +16,8 @@ $s_plugin_SourceSFSVN_description = 'Adds Subversion integration to the Source plugin framework using SourceForge.net.'; $s_plugin_SourceSFSVN_svn = 'SourceForge SVN'; +$s_plugin_SourceSFSVN_svn_username = 'SVN Username'; +$s_plugin_SourceSFSVN_svn_password = 'SVN Password'; $s_plugin_SourceSFSVN_sf_project = 'SourceForge Project'; $s_plugin_SourceSFSVN_standard_repo = 'Standard Repository
(trunk/branches/tags)';