[Fusionforge-commits] FusionForge branch 6.0 updated. d18019362b5ec5973987d39c2ddf6921f606aeee

Franck Villaume nerville at fusionforge.org
Thu Apr 2 23:40:09 CEST 2015


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, 6.0 has been updated
       via  d18019362b5ec5973987d39c2ddf6921f606aeee (commit)
      from  191d3fc4700d950bd592d2cf4b5af0a21fb1359a (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 -----------------------------------------------------------------
commit d18019362b5ec5973987d39c2ddf6921f606aeee
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Apr 2 23:39:47 2015 +0200

    clean-up

diff --git a/src/bin/fix_default_role.php b/src/bin/fix_default_role.php
index 2a5b559..ec91f36 100755
--- a/src/bin/fix_default_role.php
+++ b/src/bin/fix_default_role.php
@@ -21,7 +21,7 @@
 
 require (dirname(__FILE__).'/../www/env.inc.php');
 require_once $gfcommon.'include/pre.php';
-			 
+
 $res=db_query_params('CREATE FUNCTION upgrade_default_role_to_admin () RETURNS void AS $$
 DECLARE
 	g groups%ROWTYPE ;
@@ -31,7 +31,7 @@ BEGIN
 		UPDATE user_group SET role_id=(
 		       SELECT min(r.role_id)
 		       FROM role r JOIN role_setting rs USING (role_id)
-		       WHERE r.group_id=g.group_id 
+		       WHERE r.group_id=g.group_id
 		       	     AND rs.section_name=\'projectadmin\'
 			     AND rs.value=\'A\'
 		       )
@@ -45,4 +45,3 @@ $$ LANGUAGE plpgsql', array());
 $res=db_query_params('SELECT upgrade_default_role_to_admin()', array());
 
 $res=db_query_params('DROP FUNCTION upgrade_default_role_to_admin()', array());
-?>
diff --git a/src/bin/forge b/src/bin/forge
index d1f0334..205ee55 100755
--- a/src/bin/forge
+++ b/src/bin/forge
@@ -28,7 +28,7 @@ require_once $gfcommon.'include/pre.php';
 class CliActions {
 	function help () {
 		$methods = join('|', get_class_methods($this));
-		echo "Usage: forge.php ($methods) [arguments...]\n" ;
+		echo "Usage: .../forge ($methods) [arguments...]\n" ;
 		exit (1) ;
 	}
 
@@ -39,7 +39,7 @@ class CliActions {
 		$plugin = $pm->GetPluginObject($name);
 		$plugin->install();
 	}
-	
+
 	function pluginDeactivate ($name) {
 		$pm = plugin_manager_get_object();
 		$pm->deactivate($name);
@@ -53,7 +53,7 @@ if (count($argv) == 3) {
 	$action = 'help';
 	$name   = '';
 }
-	
+
 $ctl = new CliActions();
 if (method_exists($ctl, $action)) {
 	$ctl->$action($name);
diff --git a/src/bin/forge_make_admin b/src/bin/forge_make_admin
index 270488b..716acd8 100755
--- a/src/bin/forge_make_admin
+++ b/src/bin/forge_make_admin
@@ -20,7 +20,7 @@
  * with FusionForge; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-        
+
 require (dirname(__FILE__).'/../common/include/env.inc.php');
 require_once $gfcommon.'include/pre.php';
 
@@ -48,7 +48,7 @@ if (count ($argv) == 2) {
 } else {
 	echo "Usage: .../forge_make_admin <username>
 " ;
-        exit (1) ;
+	exit (1) ;
 }
 
 // Local Variables:
diff --git a/src/bin/forge_run_job b/src/bin/forge_run_job
index 2a23b25..d739afc 100755
--- a/src/bin/forge_run_job
+++ b/src/bin/forge_run_job
@@ -25,7 +25,7 @@
 
 // Don't try to connect to the DB, just spawning a cronjob
 putenv('FUSIONFORGE_NO_DB=true');
-        
+
 require (dirname(__FILE__).'/../common/include/env.inc.php');
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'include/cron_utils.php';
@@ -33,7 +33,7 @@ require_once $gfcommon.'include/cron_utils.php';
 if (count ($argv) < 2) {
 	echo "Usage: .../forge_run_job <jobname> [ <parameter> ... ]
 " ;
-        exit (1) ;
+	exit (1) ;
 }
 $self = array_shift($argv);
 
@@ -57,7 +57,7 @@ while ($arg = array_shift($argv)) {
 // Clean-up env
 putenv('FUSIONFORGE_NO_DB');
 putenv('FUSIONFORGE_NO_PLUGINS');
-	
+
 system ("$cmdline\n");
 
 // Local Variables:
diff --git a/src/bin/forge_run_plugin_job b/src/bin/forge_run_plugin_job
index 962c2de..d6d24dc 100755
--- a/src/bin/forge_run_plugin_job
+++ b/src/bin/forge_run_plugin_job
@@ -27,7 +27,7 @@
  * This script runs the plugin-specific cron jobs typically located in
  * @PLUGINS_PATH@/PLUGIN_NAME/cronjobs/
  */
-        
+
 require (dirname(__FILE__).'/../common/include/env.inc.php');
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'include/cron_utils.php';
@@ -35,7 +35,7 @@ require_once $gfcommon.'include/cron_utils.php';
 if (count ($argv) < 3) {
 	echo "Usage: .../forge_run_plugin_job <plugin> <jobname> [ <parameter> ... ]
 " ;
-        exit (1) ;
+	exit (1) ;
 }
 $self = array_shift($argv);
 
@@ -60,7 +60,7 @@ $cmdline = $script;
 while ($arg = array_shift($argv)) {
 	$cmdline .= ' '.escapeshellarg($arg);
 }
-	
+
 system ("$cmdline\n");
 
 // Local Variables:
diff --git a/src/bin/forge_set_password b/src/bin/forge_set_password
index 38a293d..fea6bfd 100755
--- a/src/bin/forge_set_password
+++ b/src/bin/forge_set_password
@@ -20,7 +20,7 @@
  * with FusionForge; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
-        
+
 require (dirname(__FILE__).'/../common/include/env.inc.php');
 require_once $gfcommon.'include/pre.php';
 
@@ -41,12 +41,10 @@ if (count ($argv) == 3) {
 } else {
 	echo "Usage: .../forge_set_password <username> <password>
 " ;
-        exit (1) ;
+	exit (1) ;
 }
 
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>
diff --git a/src/bin/httpd_log_demux.php b/src/bin/httpd_log_demux.php
index e36f775..86d1db4 100755
--- a/src/bin/httpd_log_demux.php
+++ b/src/bin/httpd_log_demux.php
@@ -30,7 +30,7 @@
 if (count($argv) < 3) {
 	echo "Usage: {$argv[0]} dir_template project_pregexp\n";
 	echo "   ex: CustomLog \"||{$argv[0]} /home/logs/%/raw/access.log /([-_a-zA-Z0-9]+)\.yourforge\.tld/\" combined\n";
-        exit(1);
+	exit(1);
 }
 $dir_template   = $argv[1];
 $project_regexp = $argv[2];
@@ -38,21 +38,21 @@ $project_regexp = $argv[2];
 $stdin = fopen('php://stdin', 'r') or die("Can't read standard input.");
 
 while(($line = fgets($stdin)) !== false) {
-  if (!preg_match($project_regexp, $line, $matches)) {
-    error_log("httpd_log_demux: line doesn't match project_pregexp: $line");
-  } else {
-    $project = $matches[1];
-    if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $project)) {  // project name, or domain name if DNS alias
-      error_log("httpd_log_demux: project name is invalid: '$project'");
-    } else {
-      $logfile = str_replace('%', $project, $dir_template);
-      $f = fopen($logfile, 'a');
-      if ($f != null) {
-	fwrite($f, $line);
-	fclose($f);
-      }
-    }
-  }
+	if (!preg_match($project_regexp, $line, $matches)) {
+		error_log("httpd_log_demux: line doesn't match project_pregexp: $line");
+	} else {
+		$project = $matches[1];
+		if (!preg_match('/^[a-z0-9][-a-z0-9_\.]+\z/', $project)) {  // project name, or domain name if DNS alias
+			error_log("httpd_log_demux: project name is invalid: '$project'");
+		} else {
+			$logfile = str_replace('%', $project, $dir_template);
+			$f = fopen($logfile, 'a');
+			if ($f != null) {
+				fwrite($f, $line);
+				fclose($f);
+			}
+		}
+	}
 }
 
 fclose($stdin);
diff --git a/src/bin/inject-files.php b/src/bin/inject-files.php
index c2c7042..42dc702 100755
--- a/src/bin/inject-files.php
+++ b/src/bin/inject-files.php
@@ -51,7 +51,7 @@ db_begin ();
 
 $f = fopen ('files.txt', 'r') ;
 while (! feof ($f)) {
-        $l = trim (fgets ($f, 1024)) ;
+	$l = trim (fgets ($f, 1024)) ;
 	if ($l == "") { continue ; } ;
 	$array = explode (':', $l) ;
 	$projectname = $array[0] ;
@@ -133,5 +133,3 @@ db_commit () ;
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>
diff --git a/src/bin/inject-groups.php b/src/bin/inject-groups.php
index b39cd46..8df58df 100755
--- a/src/bin/inject-groups.php
+++ b/src/bin/inject-groups.php
@@ -34,7 +34,7 @@ db_begin ();
 
 $f = fopen ('groups.txt', 'r') ;
 while (! feof ($f)) {
-        $l = trim (fgets ($f, 1024)) ;
+	$l = trim (fgets ($f, 1024)) ;
 	if ($l == "") { continue ; } ;
 	$array = explode (':', $l) ;
 	$unixname = $array[0] ;
@@ -62,12 +62,11 @@ while (! feof ($f)) {
 	$admin = user_get_object_by_name ('admin') ;
 	session_set_new ($admin->getID ()) ;
 	$r = $g->approve ($admin) ;
-        if (!$r) {
-                print "Error: ". $g->getErrorMessage () . "\n" ;
-                db_rollback () ;
-                exit (1) ;
-        }
-
+	if (!$r) {
+		print "Error: ". $g->getErrorMessage () . "\n" ;
+		db_rollback () ;
+		exit (1) ;
+	}
 }
 fclose ($f);
 
@@ -78,5 +77,3 @@ db_commit () ;
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>
diff --git a/src/bin/inject-users.php b/src/bin/inject-users.php
index 7d269b6..6c4587d 100755
--- a/src/bin/inject-users.php
+++ b/src/bin/inject-users.php
@@ -38,7 +38,7 @@ db_begin ();
 
 $f = fopen ('users.txt', 'r') ;
 while (! feof ($f)) {
-        $l = trim (fgets ($f, 1024)) ;
+	$l = trim (fgets ($f, 1024)) ;
 	if ($l == "") { continue ; } ;
 	$array = explode (':', $l, 5) ;
 	$login = $array[0] ;
@@ -70,5 +70,3 @@ db_commit () ;
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>
diff --git a/src/bin/list-projects-using-plugin.php b/src/bin/list-projects-using-plugin.php
index 7a08dfa..ad19d52 100755
--- a/src/bin/list-projects-using-plugin.php
+++ b/src/bin/list-projects-using-plugin.php
@@ -50,4 +50,3 @@ if (!$plugin) {
 foreach ($plugin->getGroups() as $p) {
 	print $p->getUnixName()."\n";
 }
-?>
diff --git a/src/bin/normalize_roles.php b/src/bin/normalize_roles.php
index 6fc8a39..80a201e 100755
--- a/src/bin/normalize_roles.php
+++ b/src/bin/normalize_roles.php
@@ -42,5 +42,3 @@ for ($i=0; $i<$rows; $i++) {
 
 	$role->normalizeData() ;
 }
-
-?>
diff --git a/src/bin/populate_template_project.php b/src/bin/populate_template_project.php
index 1079c32..a34e9a7 100755
--- a/src/bin/populate_template_project.php
+++ b/src/bin/populate_template_project.php
@@ -38,7 +38,7 @@ function usage($rc=1) {
 	echo "\t.../populate_template_project.php 5\n";
 	echo "\t.../populate_template_project.php new unixname groupname\n";
 	echo "The first syntax populates an existing group, with its ID given.\n";
-	echo "The second syntax creates a new template froup.\n";
+	echo "The second syntax creates a new template group.\n";
 	exit($rc);
 }
 
@@ -228,7 +228,7 @@ if (count($argv) < 2) {
 	}
 	if (!populateProject($project)) {
 		printf("Error: could not populate new group: %s\n",
-		    $project->getErrorMessage());
+			$project->getErrorMessage());
 		exit(1);
 	}
 } elseif (count($argv) == 4 && $argv[1] == "new") {
@@ -240,18 +240,18 @@ if (count($argv) < 2) {
 	    $desc, $desc)) {
 		db_rollback();
 		printf("Error: could not create group: %s\n",
-		    $project->getErrorMessage());
+			$project->getErrorMessage());
 		exit(1);
 	}
 	if (!$project->setAsTemplate(true)) {
 		db_rollback();
 		printf("Error: could not mark group as template: %s\n",
-		    db_error());
+			db_error());
 		exit(1);
 	}
 	if (!populateProject($project)) {
 		printf("Error: could not populate new group: %s\n",
-		    $project->getErrorMessage());
+			$project->getErrorMessage());
 		exit(1);
 	}
 	db_commit();
@@ -260,5 +260,5 @@ if (count($argv) < 2) {
 }
 
 printf("Group #%d %s (%s) populated successfully.\n", $project->getID(),
-    $project->getUnixName(), $project->getPublicName());
+	$project->getUnixName(), $project->getPublicName());
 exit(0);
diff --git a/src/bin/ssh_akc.php b/src/bin/ssh_akc.php
index ec4222e..d404cf1 100755
--- a/src/bin/ssh_akc.php
+++ b/src/bin/ssh_akc.php
@@ -37,8 +37,8 @@ if (count ($argv) <= 1) {
 
 // Filter out hard-coded list ("root") and weird usernames
 if (!account_namevalid($argv[1], true, false)) {
-    file_put_contents('php://stderr', "Invalid username {$argv[1]}\n");
-    exit();
+	file_put_contents('php://stderr', "Invalid username {$argv[1]}\n");
+	exit();
 }
 
 // The DB request
diff --git a/src/bin/sync_unix_groups.php b/src/bin/sync_unix_groups.php
index 4b2104e..208f413 100755
--- a/src/bin/sync_unix_groups.php
+++ b/src/bin/sync_unix_groups.php
@@ -51,5 +51,3 @@ db_commit();
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>

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

Summary of changes:
 src/bin/fix_default_role.php           |    5 ++---
 src/bin/forge                          |    6 +++---
 src/bin/forge_make_admin               |    4 ++--
 src/bin/forge_run_job                  |    6 +++---
 src/bin/forge_run_plugin_job           |    6 +++---
 src/bin/forge_set_password             |    6 ++----
 src/bin/httpd_log_demux.php            |   32 ++++++++++++++++----------------
 src/bin/inject-files.php               |    4 +---
 src/bin/inject-groups.php              |   15 ++++++---------
 src/bin/inject-users.php               |    4 +---
 src/bin/list-projects-using-plugin.php |    1 -
 src/bin/normalize_roles.php            |    2 --
 src/bin/populate_template_project.php  |   12 ++++++------
 src/bin/ssh_akc.php                    |    4 ++--
 src/bin/sync_unix_groups.php           |    2 --
 15 files changed, 47 insertions(+), 62 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list