Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Authorization fixes

  • Loading branch information...
commit 995a9fb7d3766e352c4e1497d293a3da1f1fa97c 1 parent 93ac895
@lomanf lomanf authored
Showing with 27 additions and 9 deletions.
  1. +9 −0 core/svn.inc.php
  2. +12 −9 core/svndeploy.inc.php
  3. +6 −0 js/svndeploy.js
View
9 core/svn.inc.php
@@ -50,6 +50,15 @@ function svndeploy_svn_info( $dir, &$err = NULL ) {
return $props;
}
+function svndeploy_svn_auth( $dir ) {
+ $command = 'log -q -r BASE ' . $dir;
+ $out = svndeploy_svn_command( $command, $err, TRUE, TRUE );
+ $out = explode( PHP_EOL, $out );
+ $pattern = '/Authentication error/';
+ preg_match_all( $pattern, $err, &$res );
+ return count( $res[ 0 ] ) == 0;
+}
+
function svndeploy_svn_status_list() {
$values = array(
'none' => SVNDEPLOY_STATUS_NONE,
View
21 core/svndeploy.inc.php
@@ -211,8 +211,8 @@ function svndeploy_srv_login() {
$pass = isset( $_POST[ 'pass' ] ) ? $_POST[ 'pass' ] : FALSE;
if ( $user != SVNDEPLOY_SVNDEPLOY_USR || $pass != SVNDEPLOY_SVNDEPLOY_PWD ) {
- if ( isset( $_POST[ 'redirect' ] ) ) {
- header( 'Location: ' . $_POST[ 'redirect' ] . '?error' );
+ if ( isset( $_GET[ 'redirect' ] ) ) {
+ header( 'Location: ' . $_GET[ 'redirect' ] . '?error' );
exit;
} else {
svndeploy_srv_auth_fail();
@@ -252,14 +252,17 @@ function svndeploy_srv_wc_list() {
);
$err;
$info = svndeploy_svn_info( $value, $err );
- $res;
- if ( $err ) {
- $props[ 'err' ] = $err;
- $res = $props;
- } else {
- $res = array_merge( $props, $info );
+ $auth = svndeploy_svn_auth( $value );
+ if ( $auth ) {
+ $res;
+ if ( $err ) {
+ $props[ 'err' ] = $err;
+ $res = $props;
+ } else {
+ $res = array_merge( $props, $info );
+ }
+ $out[] = $res;
}
- $out[] = $res;
}
svndeploy_srv_out( $out );
}
View
6 js/svndeploy.js
@@ -223,6 +223,12 @@ var svndeploy = {
var ihtml = $( '#content ul' ).html();
var ihtml_error = svndeploy.template_get( 'wc-list-error' );
$( '#content ul' ).html( '' );
+ if ( json.data.length == 0 ) {
+ // no working copies available
+ svndeploy.progress_hide();
+ svndeploy.dialog( 'svn: No Working Copies Available!' );
+ return;
+ }
$.each( json.data, function( i, item ) {
if ( !item.err ) {
item.svndeploy_status = svndeploy.SVNSTATUS_NORMAL;

0 comments on commit 995a9fb

Please sign in to comment.
Something went wrong with that request. Please try again.