diff --git a/codepot/etc/Makefile.am b/codepot/etc/Makefile.am index 12e9e21a..9503fa79 100644 --- a/codepot/etc/Makefile.am +++ b/codepot/etc/Makefile.am @@ -1,7 +1,7 @@ cfgdir=$(CFGDIR) cfg_DATA = codepot.ini codepot.sql codepot.a2ldap -cfg_SCRIPTS = start-commit pre-commit post-commit +cfg_SCRIPTS = start-commit pre-commit post-commit pre-revprop-change post-revprop-change EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS) diff --git a/codepot/etc/post-revprop-change b/codepot/etc/post-revprop-change new file mode 100755 index 00000000..791bcdeb --- /dev/null +++ b/codepot/etc/post-revprop-change @@ -0,0 +1,13 @@ +#!/bin/sh + +REPOBASE="`basename "${1}"`" +REV="${2}" +USER="${3}" +PROPNAME="${4}" +ACTION="${5}" + +# [STDIN] PROPVAL ** the old property value is passed via STDIN. + +# does not care if logging has failed. +wget -q -O- "%API%/logRevpropChange/svn/${REPOBASE}/${REV}" 2>/dev/null +exit 0 diff --git a/codepot/etc/pre-revprop-change b/codepot/etc/pre-revprop-change new file mode 100755 index 00000000..e59c0f38 --- /dev/null +++ b/codepot/etc/pre-revprop-change @@ -0,0 +1,24 @@ +#!/bin/sh + +REPOBASE="`basename "${1}"`" +USER="${2}" +USER="${3}" +PROPNAME="${4}" +ACTION="${5}" + +# [STDIN] PROPVAL ** the new property value is passed via STDIN. + +ans="`wget -q -O- "%API%/projectHasMember/${REPOBASE}/${USER}" 2>/dev/null`" +[ "${ans}" = "YES" ] && exit 0 + +[ "${ans}" = "NO" ] && { + echo "-------------------------------------------------------------" >&2 + echo " ${USER} is not a member of ${REPOBASE}" >&2 + echo "-------------------------------------------------------------" >&2 + exit 1 +} + +echo "---------------------------------------------------------------------" >&2 +echo " Failed to check membership of ${REPOBASE} for ${USER}" >&2 +echo "---------------------------------------------------------------------" >&2 +exit 1 diff --git a/codepot/src/codepot/controllers/api.php b/codepot/src/codepot/controllers/api.php index bd500bdf..da92dd0f 100644 --- a/codepot/src/codepot/controllers/api.php +++ b/codepot/src/codepot/controllers/api.php @@ -53,5 +53,16 @@ class API extends Controller $this->email->send (); */ } + + function logCodeRevpropChange ($type, $repo, $rev, $propname) + { + $this->check_access (); + + if (!isset($repo) || !isset($rev) || !isset($propname)) return; + + $this->load->model ('LogModel', 'logs'); + // TODO: + //$this->logs->writeCodeRevpropChange ($type, $repo, $rev, ''); + } } diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index 68ff0503..ec5b222d 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -202,8 +202,11 @@ if (array_key_exists('properties', $file) && count($file['properties']) > 0) { print '
  • '; print htmlspecialchars($pn); - print ' - '; - print htmlspecialchars($pv); + if ($pv != '') + { + print ' - '; + print htmlspecialchars($pv); + } print '
  • '; } print ''; diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index 2598fe62..c0877a73 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -54,8 +54,11 @@ $this->load->view ( { print '
  • '; print htmlspecialchars ($pk); - print ' - '; - print htmlspecialchars ($pv); + if ($pv != '') + { + print ' - '; + print htmlspecialchars ($pv); + } print '
  • '; } print ''; @@ -133,7 +136,7 @@ $this->load->view ( $xpar = $this->converter->AsciiTohex ($headpath); if ($revision > 0 && $revision < $next_revision) { - print anchor ("code/file/{$project->id}", $this->lang->line('Head revision')); + print anchor ("code/file/{$project->id}/{$xpar}", $this->lang->line('Head revision')); print ' | '; } print anchor ("code/history/{$project->id}/{$xpar}", $this->lang->line('History'));