[Fusionforge-commits] FusionForge branch 6.1 updated. v6.1beta1-159-gbbcb86a

Franck Villaume nerville at libremir.placard.fr.eu.org
Sat Feb 17 17:38:34 CET 2018


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.1 has been updated
       via  bbcb86a5bab99b216efdcf82f2ed9bff10a8fe76 (commit)
      from  ccc3d40aae7919467831370ff5524a0e732951d1 (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=bbcb86a5bab99b216efdcf82f2ed9bff10a8fe76

commit bbcb86a5bab99b216efdcf82f2ed9bff10a8fe76
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Feb 17 17:38:13 2018 +0100

    scmhook: support multirepo [#696], fix [#862], fix [#847]

diff --git a/src/plugins/scmhook/common/scmhookPlugin.class.php b/src/plugins/scmhook/common/scmhookPlugin.class.php
index b120806..595d83c 100644
--- a/src/plugins/scmhook/common/scmhookPlugin.class.php
+++ b/src/plugins/scmhook/common/scmhookPlugin.class.php
@@ -4,7 +4,7 @@
  * Copyright 2011, Franck Villaume - Capgemini
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
  * Copyright 2012, Benoit Debaenst - TrivialDev
- * Copyright 2012-2014,2017, Franck Villaume - TrivialDev
+ * Copyright 2012-2014,2017-2018, Franck Villaume - TrivialDev
  * Copyright 2014, Sylvain Beucler - Inria
  * Copyright 2014, Philipp Keidel - EDAG Engineering AG
  *
@@ -44,17 +44,12 @@ project independently.");
 			$this->_addHook('groupisactivecheckbox'); // The "use ..." checkbox in editgroupinfo
 		}
 		$this->_addHook('groupisactivecheckboxpost'); //
-		$this->_addHook('scm_admin_update');
 		$this->_addHook('artifact_extra_detail');
 		$this->_addHook('task_extra_detail');
 	}
 
 	function CallHook($hookname, &$params) {
 		switch ($hookname) {
-			case 'scm_admin_update': {
-				$this->update($params);
-				break;
-			}
 			case 'artifact_extra_detail': {
 				$group_id = $params['group_id'];
 				$group = group_get_object($group_id);
@@ -86,17 +81,6 @@ project independently.");
 		return false;
 	}
 
-	function add($group_id) {
-		if (!$this->exists($group_id)) {
-			$res = db_query_params('INSERT INTO plugin_scmhook (id_group) VALUES ($1)', array($group_id));
-			if (!$res)
-				return false;
-			$systasksq = new SystasksQ();
-			$systasksq->add($this->getID(), 'SCMHOOK_UPDATE', $group_id, user_getid());
-		}
-		return true;
-	}
-
 	function remove($group_id) {
 		if ($this->exists($group_id)) {
 			$res = db_query_params('DELETE FROM plugin_scmhook where id_group = $1', array($group_id));
@@ -110,6 +94,7 @@ project independently.");
 	function update($params) {
 		$group_id = $params['group_id'];
 		$repository_name = $params['repository_name'];
+		$scm_plugin = $params['scm_plugin'];
 
                 $group = group_get_object($group_id);
                 if (!$group->usesPlugin($this->name))
@@ -118,59 +103,77 @@ project independently.");
 		$hooksString = '';
 		$hooks = $this->getAvailableHooks($group_id);
 		$available_hooknames = array();
-		foreach ($hooks as $hook)
-			$available_hooknames[] = $hook->getClassname();
+		foreach ($hooks as $hook) {
+			if ($hook->getLabel() == $scm_plugin) {
+				$available_hooknames[] = $hook->getLabel().'_'.$hook->getClassname();
+			}
+		}
 
 		$enabled_hooknames = array();
-		foreach($params as $key => $value) {
-			if ($value == 'on' && $key == strstr($key, 'scm')) {
-				$hookname = preg_replace('/scm[a-z][a-z]+_/','',$key);
-				if (in_array($hookname, $available_hooknames) !== FALSE) {
-					$enabled_hooknames[] = $hookname;
+		if (isset($params['hooks'])) {
+			foreach($params['hooks'] as $value) {
+				if (in_array($value, $available_hooknames) !== FALSE) {
+					$enabled_hooknames[] = preg_replace('/scm[a-z][a-z]+_/','', $value);
 				}
 			}
 		}
-		$res = db_query_params('UPDATE plugin_scmhook set hooks = $1, need_update = 1 where id_group = $2 and repository_name = $3',
-				       array(implode('|', $enabled_hooknames), $group_id, $repository_name));
+
+		$existingHooksEnabled = $this->getEnabledHooks($group_id);
+		if (isset($existingHooksEnabled[$scm_plugin])) {
+			$res = db_query_params('UPDATE plugin_scmhook SET hooks = $1, need_update = 1 WHERE id_group = $2 AND repository_name = $3 AND scm_plugin = $4',
+					array(implode('|', $enabled_hooknames), $group_id, $repository_name, $scm_plugin));
+		} else {
+			$res = db_query_params('INSERT INTO plugin_scmhook (hooks, need_update, id_group, repository_name, scm_plugin) VALUES ($1, $2, $3, $4, $5)',
+					array(implode('|', $enabled_hooknames), 1, $group_id, $repository_name, $scm_plugin));
+		}
 
 		// Save parameters
 		foreach($hooks as $hook) {
-			$hook_params = $hook->getParams();
-			if (count($hook_params) == 0)
-				continue;
-			if (array_search($hook->getClassname(), $enabled_hooknames) === false)
-				continue;
-			// Build 3 arrays for inconvenient db_query_params()
-			$i = 1;
-			$sql_cols = array_keys($hook_params);
-			$sql_vals = array();
-			$sql_vars = array();
-			foreach($hook_params as $pname => $pconf) {
-				$val = $params["scmsvn_{$hook->getClassname()}_$pname"];
-				// Validation
-				switch($pconf['type']) {
-				case 'emails':
-					$emails = array_map('trim', explode(',', $val));
-					$strict = true;
-					$invalid = array_search(false, array_map('validate_email', $emails), $strict) !== false;
-					if ($invalid)
-						exit_error($hook->getName() . _(": ") . _("invalid e-mails"). ' ' . $val);
-					$val = implode(',', $emails);
+			$table = 'plugin_scmhook_'.$hook->getLabel().'_'.strtolower($hook->getClassname());
+			if (db_check_table_exists($table)) {
+				$hook_params = $hook->getParams();
+				if (count($hook_params) == 0)
+					continue;
+				if (array_search($hook->getClassname(), $enabled_hooknames) === false)
+					continue;
+				// Build 3 arrays for inconvenient db_query_params()
+				$i = 1;
+				$sql_cols = array_keys($hook_params);
+				$sql_vals = array();
+				$sql_vars = array();
+				foreach($hook_params as $pname => $pconf) {
+					$vals = $params['hooks']['options'];
+					foreach ($vals as $val) {
+						// Validation
+						switch($pconf['type']) {
+							case 'emails':
+								if (isset($val['dest'])) {
+									$emails = array_map('trim', explode(',', $val['dest']));
+									$strict = true;
+									$invalid = array_search(false, array_map('validate_email', $emails), $strict) !== false;
+									if ($invalid)
+										exit_error($hook->getName() . _(": ") . _("invalid e-mails"). ' ' . $val['dest']);
+									$val = implode(',', $emails);
+								}
+						}
+						$sql_vals[] = $val;
+						$sql_vars[] = '$'.$i;
+						$i++;
+					}
 				}
-				$sql_vals[] = $val;
+				$sql_cols[] = 'group_id';
+				$sql_vals[] = $group_id;
 				$sql_vars[] = '$'.$i;
-				$i++;
+				$sql_cols[] = 'repository_name';
+				$sql_vals[] = $repository_name;
+				$sql_vars[] = '$'.++$i;
+				db_begin();
+				db_query_params('DELETE FROM '.$table.' WHERE group_id=$1 AND repository_name = $2', array($group_id, $repository_name));
+				db_query_params('INSERT INTO '.$table.' (' . implode(',', $sql_cols)
+						. ') VALUES (' . implode(',', $sql_vars) . ')',
+						$sql_vals);
+				db_commit();
 			}
-			$sql_cols[] = 'group_id';
-			$sql_vals[] = $group_id;
-			$sql_vars[] = '$'.$i;
-			$table = 'plugin_scmhook_scmsvn_'.strtolower($hook->getClassname());
-			db_begin();
-			db_query_params('DELETE FROM '.$table.' WHERE group_id=$1', array($group_id));
-			db_query_params('INSERT INTO '.$table.' (' . implode(',', $sql_cols)
-					. ') VALUES (' . implode(',', $sql_vars) . ')',
-					$sql_vals);
-			db_commit();
 		}
 
 		if (!$res)
@@ -190,6 +193,7 @@ project independently.");
 		$hooksEnabled = $this->getEnabledHooks($group_id);
 		if (count($hooksAvailable)) {
 			echo $HTML->openForm(array('id' => 'scmhook_form', 'action' => '/scm/admin/?group_id='.$group_id, 'method' => 'post'));
+			echo $HTML->html_input('scm_plugin', '', '', 'hidden', $scm);
 			echo '<div id="scmhook">';
 			echo html_e('h2', array(), _('Enable Repository Hooks'));
 			switch ($scm) {
@@ -244,12 +248,12 @@ project independently.");
 
 	function getEnabledHooks($group_id) {
 		$enabledHooks = array();
-		$res = db_query_params('SELECT hooks, repository_name FROM plugin_scmhook WHERE id_group = $1', array($group_id));
+		$res = db_query_params('SELECT hooks, repository_name, scm_plugin FROM plugin_scmhook WHERE id_group = $1', array($group_id));
 		if (!$res)
 			return $enabledHooks;
 
 		while ($arr = db_fetch_array($res)) {
-			$enabledHooks[$arr['repository_name']] = explode('|', $arr['hooks']);
+			$enabledHooks[$arr['scm_plugin']][$arr['repository_name']] = explode('|', $arr['hooks']);
 		}
 		return $enabledHooks;
 	}
@@ -344,18 +348,18 @@ project independently.");
 			echo $HTML->listTableTop($tabletop, '', 'sortable_scmhook_scmgit', 'sortable', $classth, $titleArr);
 			foreach($repositories as $repository) {
 				$cells = array();
-				$cells[][] = $repository;
+				$cells[][] = $repository.html_e('input', array('type' => 'hidden', 'name' => 'repository['.$repository.'][]'));
 				foreach (array('pre-commit', 'pre-revprop-change', 'post-commit') as $hooktype) {
 					$hooks = $hooks_by_type[$hooktype];
 					foreach ($hooks as $hook) {
-						$attr = array('type' => 'checkbox');
+						$attr = array('type' => 'checkbox', 'name' => 'repository['.$repository.'][]', 'value' => $hook->getLabel().'_'.$hook->getClassname());
 						if ((!empty($hook->onlyGlobalAdmin) && !Permission::isGlobalAdmin()) || !$hook->isAvailable()) {
 							$attr = array_merge($attr, array('disabled' => 'disabled'));
 							if (!$hook->isAvailable()) {
 								$attr = array_merge($attr, array('title' => $hook->getDisabledMessage()));
 							}
 						}
-						if (in_array($hook->getName(), $hooksEnabled[$repository])) {
+						if (isset($hooksEnabled['scmsvn'][$repository]) && in_array($hook->getClassname(), $hooksEnabled['scmsvn'][$repository])) {
 							$attr = array_merge($attr, array('checked' => 'checked'));
 						}
 						$content = '';
@@ -367,12 +371,12 @@ project independently.");
 								$val = ($values[$pname] != null) ? $values[$pname] : $pconf['default'];
 								switch($pconf['type']) {
 								case 'emails':
-									$content = html_e('input', array('type' => 'text','title' => $pconf['description'], 'name' => 'scmsvn_{'.$hook->getClassname().'}_'.$pname, 'value' => $val, 'size' => 40));
+									$content = html_e('input', array('type' => 'text','title' => $pconf['description'], 'name' => $hook->getLabel().'_'.$hook->getClassname().'['.$repository.']['.$pname.']', 'value' => $val, 'size' => 40));
 									break;
 								}
 							}
 						}
-						$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hook->getLabel().'_'.$hook->getClassname(), 'value' => $repository)).$content;
+						$cells[][] = html_e('input', $attr).$content;
 					}
 				}
 				echo $HTML->multiTableRow(array(), $cells);
@@ -416,17 +420,31 @@ project independently.");
 				$cells = array();
 				$cells[][] = $repository;
 				foreach ($hooksServePushPullBundle as $hookServePushPullBundle) {
-					$attr = array('type' => 'checkbox');
+					$attr = array('type' => 'checkbox', 'name' => 'repository['.$repository.'][]', 'value' => $hookServePushPullBundle->getLabel().'_'.$hookServePushPullBundle->getClassname());
 					if ((!empty($hookServePushPullBundle->onlyGlobalAdmin) && !Permission::isGlobalAdmin()) || !$hookServePushPullBundle->isAvailable()) {
 						$attr = array_merge($attr, array('disabled' => 'disabled'));
 						if (!$hookServePushPullBundle->isAvailable()) {
 							$attr = array_merge($attr, array('title' => $hookServePushPullBundle->getDisabledMessage()));
 						}
 					}
-					if (isset($hooksEnabled[$repository]) && in_array($hookServePushPullBundle->getName(), $hooksEnabled[$repository])) {
+					if (isset($hooksEnabled['scmhg'][$repository]) && in_array($hookServePushPullBundle->getClassname(), $hooksEnabled['scmhg'][$repository])) {
 						$attr = array_merge($attr, array('checked' => 'checked'));
 					}
-					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookServePushPullBundle->getLabel().'_'.$hookServePushPullBundle->getClassname(), 'value' => $repository));
+					$content = '';
+					$table = 'plugin_scmhook_scmhg_'.strtolower($hookServePushPullBundle->getClassname());
+					if (db_check_table_exists($table)) {
+						$res = db_query_params('SELECT * FROM '.$table.' WHERE group_id = $1 and repository_name = $2', array($group_id, $repository));
+						$values = db_fetch_array($res);
+						foreach ($hookServePushPullBundle->getParams() as $pname => $pconf) {
+							$val = ($values[$pname] != null) ? $values[$pname] : $pconf['default'];
+							switch($pconf['type']) {
+							case 'emails':
+								$content = html_e('input', array('type' => 'text','title' => $pconf['description'], 'name' => $hookServePushPullBundle->getLabel().'_'.$hookServePushPullBundle->getClassname().'['.$repository.']['.$pname.']', 'value' => $val, 'size' => 40));
+								break;
+							}
+						}
+					}
+					$cells[][] = html_e('input', $attr).$content;
 				}
 				echo $HTML->multiTableRow(array(), $cells);
 			}
@@ -476,10 +494,24 @@ project independently.");
 							$attr = array_merge($attr, array('title' => $hookPostReceive->getDisabledMessage()));
 						}
 					}
-					if (in_array($hookPostReceive->getName(), $hooksEnabled[$repository])) {
+					if (isset($hooksEnabled['scmgit'][$repository]) && in_array($hookPostReceive->getClassname(), $hooksEnabled['scmgit'][$repository])) {
 						$attr = array_merge($attr, array('checked' => 'checked'));
 					}
-					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookPostReceive->getLabel().'_'.$hookPostReceive->getClassname(), 'value' => $repository));
+					$content = '';
+					$table = 'plugin_scmhook_scmgit_'.strtolower($hookPostReceive->getClassname());
+					if (db_check_table_exists($table)) {
+						$res = db_query_params('SELECT * FROM '.$table.' WHERE group_id = $1 and repository_name = $2', array($group_id, $repository));
+						$values = db_fetch_array($res);
+						foreach ($hookPostReceive->getParams() as $pname => $pconf) {
+							$val = ($values[$pname] != null) ? $values[$pname] : $pconf['default'];
+							switch($pconf['type']) {
+							case 'emails':
+								$content = html_e('input', array('type' => 'text','title' => $pconf['description'], 'name' => 'scmgit_{'.$hookPostReceive->getClassname().'}_'.$pname.'[]', 'value' => $val, 'size' => 40));
+								break;
+							}
+						}
+					}
+					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookPostReceive->getLabel().'_'.$hookPostReceive->getClassname().'[]', 'value' => $repository)).$content;
 				}
 				echo $HTML->multiTableRow(array(), $cells);
 			}
@@ -529,10 +561,10 @@ project independently.");
 							$attr = array_merge($attr, array('title' => $hookPostCommit->getDisabledMessage()));
 						}
 					}
-					if (in_array($hookPostCommit->getName(), $hooksEnabled[$repository])) {
+					if (isset($hooksEnabled['scmcvs'][$repository]) && in_array($hookPostCommit->getName(), $hooksEnabled['scmcvs'][$repository])) {
 						$attr = array_merge($attr, array('checked' => 'checked'));
 					}
-					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookPostCommit->getLabel().'_'.$hookPostCommit->getClassname(), 'value' => $repository));
+					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookPostCommit->getLabel().'_'.$hookPostCommit->getClassname().'[]', 'value' => $repository));
 				}
 				echo $HTML->multiTableRow(array(), $cells);
 			}
diff --git a/src/plugins/scmhook/library/scmgit/postReceiveEmail.class.php b/src/plugins/scmhook/library/scmgit/postReceiveEmail.class.php
index a7ab27a..e5174c4 100644
--- a/src/plugins/scmhook/library/scmgit/postReceiveEmail.class.php
+++ b/src/plugins/scmhook/library/scmgit/postReceiveEmail.class.php
@@ -2,7 +2,7 @@
 /**
  * scmhook GitPostReceiveEmail Plugin Class
  * Copyright 2013, Benoit Debaenst - TrivialDev
- * Copyright 2016, Franck Villaume - TrivialDev
+ * Copyright 2016,2018, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -30,7 +30,7 @@ class GitPostReceiveEmail extends scmhook {
 	function __construct() {
 		$this->group = $GLOBALS['group'];
 		$this->name = "Post Receive Email";
-		$this->description = _('Commit message log is pushed to commit mailing-list of the project');
+		$this->description = _('Commit message log is pushed to commit mailing-list of the project (which you need to create)');
 		$this->classname = "postReceiveEmail";
 		$this->hooktype = "post-receive";
 		$this->label = "scmgit";
@@ -39,28 +39,17 @@ class GitPostReceiveEmail extends scmhook {
 		$this->command = forge_get_config('plugins_path').'/scmhook/library/'.$this->label.'/hooks/'.$this->unixname.'/post-receive-email <<eoc '."\n".'$PARAMS'."\n".'eoc';
 	}
 
-	function isAvailable() {
-		global $gfcommon;
-		require_once $gfcommon.'mail/MailingList.class.php';
-		require_once $gfcommon.'mail/MailingListFactory.class.php';
-
-		if ($this->group->usesMail()) {
-			$mlFactory = new MailingListFactory($this->group);
-			$mlArray = $mlFactory->getMailingLists();
-			$mlCount = count($mlArray);
-			for ($j = 0; $j < $mlCount; $j++) {
-				$currentList =& $mlArray[$j];
-				if ($currentList->getListEmail() == $this->group->getUnixName().'-commits@'.forge_get_config('lists_host'))
-					return true;
-			}
-			$this->disabledMessage = _('Hook not available due to missing dependency')._(': ')._('Project has no commit mailing-list: ').$this->group->getUnixName().'-commits';
-		} elseif (!$this->group->usesMail()) {
-			$this->disabledMessage = _('Hook not available due to missing dependency')._(': ')._('Project not using mailing-list.');
-		}
-		return false;
-	}
-
 	function getDisabledMessage() {
 		return $this->disabledMessage;
 	}
+
+	function getParams() {
+		return array(
+			'dest' => array(
+				'description' => _('Send commit e-mail notification to'),
+				'type'        => 'emails',
+				'default'     => $this->group->getUnixName().'-commits@'.forge_get_config('lists_host'),
+			)
+		);
+	}
 }
diff --git a/src/plugins/scmhook/library/scmhg/commitEmail.class.php b/src/plugins/scmhook/library/scmhg/commitEmail.class.php
index 63ed059..47d5b25 100644
--- a/src/plugins/scmhook/library/scmhg/commitEmail.class.php
+++ b/src/plugins/scmhook/library/scmhg/commitEmail.class.php
@@ -2,7 +2,7 @@
 /**
  * scmhook commitEmail Plugin Class
  * Copyright 2012, Denise Patzker <denise.patzker at tu-dresden.de>
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012,2018, Franck Villaume - TrivialDev
  *
  * This class provides hook to activate/deactivate Mercurials e-mail
  * notification per repository.
@@ -33,9 +33,9 @@ class HgCommitEmail extends scmhook {
 	function __construct() {
 		$this->group = $GLOBALS['group'];
 		$this->name = "Commit Email";
-		$this->description = _('Every commit pushed sends a notification e-mail to the users of the commit-mailinglist.')
+		$this->description = _('Commit message log is pushed to commit mailing-list of the project (which you need to create)')
 							. "\n"
-							. _('The hook is triggered after \'serve push pull bundle\' on the projects repository.');
+							. _('The hook is triggered after "serve push pull bundle" on the projects repository.');
 		$this->classname = "commitEmail";
 		$this->label = "scmhg";
 		$this->hooktype = "serve-push-pull-bundle";
@@ -44,30 +44,20 @@ class HgCommitEmail extends scmhook {
 		$this->command = 'exit 0';
 	}
 
-	function isAvailable() {
-		global $gfcommon;
-		require_once $gfcommon.'mail/MailingList.class.php';
-		require_once $gfcommon.'mail/MailingListFactory.class.php';
-		if ($this->group->usesMail()) {
-			$mlFactory = new MailingListFactory($this->group);
-			$mlArray = $mlFactory->getMailingLists();
-			$mlCount = count($mlArray);
-			for ($j = 0; $j < $mlCount; $j++) {
-				$currentList =& $mlArray[$j];
-				if ($currentList->getListEmail() == $this->group->getUnixName().'-commits@'.forge_get_config('lists_host'))
-					return true;
-			}
-			$this->disabledMessage = _('Hook not available due to missing dependency: Project has no commit mailing-list: ').$this->group->getUnixName().'-commits';
-		} else {
-			$this->disabledMessage = _('Hook not available due to missing dependency: Project not using mailing-list.');
-		}
-		return false;
-	}
-
 	function getDisabledMessage() {
 		return $this->disabledMessage;
 	}
 
+	function getParams() {
+		return array(
+			'dest' => array(
+				'description' => _('Send commit e-mail notification to'),
+				'type'        => 'emails',
+				'default'     => $this->group->getUnixName().'-commits@'.forge_get_config('lists_host'),
+			)
+		);
+	}
+
 	/**
 	 * This function activates e-mail notification for pushed commits.
 	 * This is done by adding the needed entries to the projects hgrc file.
diff --git a/src/www/scm/admin/index.php b/src/www/scm/admin/index.php
index 94ec672..eec678b 100644
--- a/src/www/scm/admin/index.php
+++ b/src/www/scm/admin/index.php
@@ -142,6 +142,25 @@ if (getStringFromRequest('create_repository') && getStringFromRequest('submit'))
 		// Don't call scm plugin update if their form wasn't displayed
 		// to avoid processing an apparently empty form and reset configuration
 		plugin_hook("scm_admin_update", $hook_params);
+} elseif (getStringFromRequest('scmhook_submit')) {
+	$hook_params = array();
+	$hook_params['group_id'] = $group_id;
+	$repos = getArrayFromRequest('repository', array());
+	foreach ($repos as $repo => $hook_elements) {
+		$hook_params['repository_name'] = $repo;
+		$hook_params['hooks'] = $hook_elements;
+		$hook_params['scm_plugin'] = getStringFromRequest('scm_plugin');
+		$hook_options = array();
+		foreach ($hook_elements as $hook_element) {
+			$hook_params['hooks']['options'] = array();
+			$options = getArrayFromRequest($hook_element, array());
+			if (isset($options[$repo])) {
+				$hook_params['hooks']['options'] = $options[$repo];
+			}
+		}
+		$scmhookPlugin = plugin_get_object('scmhook');
+		$scmhookPlugin->update($hook_params);
+	}
 }
 
 scm_header(array('title'=>_('SCM Repository'),'group'=>$group_id));

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

Summary of changes:
 src/plugins/scmhook/common/scmhookPlugin.class.php | 178 ++++++++++++---------
 .../library/scmgit/postReceiveEmail.class.php      |  35 ++--
 .../scmhook/library/scmhg/commitEmail.class.php    |  36 ++---
 src/www/scm/admin/index.php                        |  19 +++
 4 files changed, 149 insertions(+), 119 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list