[Fusionforge-commits] FusionForge branch feature/reactivity updated. 3423f0e88a23775ff10a63920a8e1b257f2112b6

Sylvain Beucler beuc-inria at fusionforge.org
Tue Dec 16 15:21:35 CET 2014


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, feature/reactivity has been updated
       via  3423f0e88a23775ff10a63920a8e1b257f2112b6 (commit)
       via  11106a58bff5e887c24e5a516ffea3a7addc7773 (commit)
       via  a4d2c075828658abccdff6499791337e27407d6f (commit)
       via  69afd64beffc19b3ffd547497e2cdad2cc8ef8ce (commit)
       via  790f094168f936e58b36ee9898e05e33b6314a15 (commit)
       via  feb0f2c7bdb4dace5401f5ab77de4e5c978f3b56 (commit)
       via  d328a4ba108681f5b419be6a5fe3c481727fd9ba (commit)
       via  6ef9227e7717475ef290c52c9c4b42841048b6d6 (commit)
       via  282d9aff2469b628689596202c61929aef364453 (commit)
       via  334d4b6de957da3fafaf4d3c82c56acede57a34c (commit)
       via  b72fdd967f573ee1287a87811b06bae9bd142c53 (commit)
       via  d1f09e9a3ab25f60c2af412b50ad467087220464 (commit)
       via  1b1849ca05657590fda17892066f03b43d8a68f9 (commit)
       via  393bb8ba1af2a26629a177eeb4fcf07c313bb16e (commit)
       via  c910f7425764cd97e4627571c2f2b9314fc48b2d (commit)
       via  04c78afceca28aaf42f292f1e4fe525f576ef810 (commit)
       via  dacf456c60dfb4f3b049a4b01268cf55da1c9c7f (commit)
       via  2f6dc28d1c3658779dbfbe2ad3ccf8f7cf1de29a (commit)
       via  d8468f7d0a1b2f070345ed0bb6a6147b7688b23f (commit)
       via  27c472decb2bed4bbc87511c2262d6ff46beaa3f (commit)
       via  c108fdc20a2e0f078c8f30c8eee52d92dc460ed3 (commit)
       via  31a40fc6ecc413ac4d7c2c74fcac21b4767d457a (commit)
       via  d9dc226373ad5661ad733c2cc75baac7c555765f (commit)
       via  767042d5f7900793e0c7edd91b9f43a6868b68b6 (commit)
       via  46b7878cf07b162d56ba45b5d43cf644dbcb76c9 (commit)
       via  683bc9043d0becd0156e06b895da9f25c2a6cfa5 (commit)
       via  1ae94fa52f0156ac787c9441d395de1d790b6f7c (commit)
       via  086190a38441abe1583d6f72a093036952bd3f8c (commit)
       via  70724eec33477d13e21075df8e93689585240b15 (commit)
       via  5a77d5b1d3a0573e82d8ca37f0c207d906dd093a (commit)
       via  ee051b8230b9db1e511ce94364488de81e767089 (commit)
       via  fdcd9b083ccd66041ba013102bbcee18f61bcfb8 (commit)
       via  346e9d2d3835d1461770c7ae591fd4bd13edd1f5 (commit)
       via  349e53f2d594bd9b4db7658af5cc689cba4aedb2 (commit)
       via  d60c6855056dd507df091c9862f73c5cac1c9e46 (commit)
       via  c5781b5eaa25d47d10f087dcfa434eb1f1a3e64a (commit)
       via  0be7f1f48ee9f498c9f929ceca2f514a1bcd4f57 (commit)
       via  a618c6cd83c8ab1c6fc3b310035f59dc31df3ecf (commit)
      from  7b51ebdfd66b163ac598daa855f48ff52e94dd0a (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 3423f0e88a23775ff10a63920a8e1b257f2112b6
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Tue Dec 16 15:21:11 2014 +0100

    reactivity: plugin support, convert mediawiki

diff --git a/src/bin/light.php b/src/bin/light.php
index 0ce7c23..8c75772 100755
--- a/src/bin/light.php
+++ b/src/bin/light.php
@@ -78,17 +78,27 @@ function usergroups_sync() {
 
 function sysaction_get_script($plugin_id, $sysaction_type_id) {
 		global $cron_arr;
+		global $pm, $plugins;
 		if ($plugin_id == null) {
 				if (isset($cron_arr[$sysaction_type_id]))
-						return forge_get_config('source_path').'/cronjobs/'.$cron_arr[$sysaction_type_id];
-				else
-						return null;
+						return forge_get_config('source_path')
+								.'/cronjobs/'.$cron_arr[$sysaction_type_id];
 		} else {
-				// TODO
-				// $path = forge_get_config('plugins_path')."/$plugin/cronjobs/";
+				if (isset($plugins[$plugin_id])) {
+						$plugin = $pm->GetPluginObject($plugins[$plugin_id]);
+						print_r($plugin->sysaction_types);
+						if (isset($plugin->sysaction_types[$sysaction_type_id]))
+								return forge_get_config('plugins_path')."/".$plugin->GetName()
+										."/cronjobs/".$plugin->sysaction_types[$sysaction_type_id];
+				}
 		}
+		return null;
 }
 
+
+$pm = plugin_manager_get_object();
+$plugins = $pm->GetPlugins();
+
 usergroups_sync();
 while (true) {
 		// Deal with pending requests
diff --git a/src/plugins/mediawiki/common/mediawikiPlugin.class.php b/src/plugins/mediawiki/common/mediawikiPlugin.class.php
index 974e28b..16eee55 100644
--- a/src/plugins/mediawiki/common/mediawikiPlugin.class.php
+++ b/src/plugins/mediawiki/common/mediawikiPlugin.class.php
@@ -32,8 +32,16 @@ forge_define_config_item('master_path', 'mediawiki', '$mediawiki/mwdata_path/mas
 forge_define_config_item('enable_uploads', 'mediawiki', false);
 forge_set_config_item_bool('enable_uploads', 'mediawiki');
 }
+require_once $gfcommon.'include/SysActionsQ.class.php';
+define('SYSACTION_MEDIAWIKI_CREATE_WIKI', 1);
+define('SYSACTION_MEDIAWIKI_CREATE_IMAGEDIR', 2);
 
 class MediaWikiPlugin extends Plugin {
+	public $sysaction_types = array(
+		SYSACTION_MEDIAWIKI_CREATE_WIKI => 'create-wikis.php',
+		SYSACTION_MEDIAWIKI_CREATE_IMAGEDIR => 'create-imagedirs.php'
+	);
+
 	function __construct ($id=0) {
 		$this->Plugin($id) ;
 		$this->name = "mediawiki" ;
@@ -95,32 +103,6 @@ _("This plugin allows each project to embed Mediawiki under a tab.");
 				$params['TOOLTIPS'][] = _('Mediawiki Space');
 			}
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
-		} elseif ($hookname == "groupisactivecheckbox") {
-			//Check if the group is active
-			// this code creates the checkbox in the project edit public info page to activate/deactivate the plugin
-			$group = group_get_object($group_id);
-			echo "<tr>";
-			echo "<td>";
-			echo ' <input type="checkbox" name="use_mediawikiplugin" value="1" ';
-			// checked or unchecked?
-			if ( $group->usesPlugin ( $this->name ) ) {
-				echo "checked";
-			}
-			echo " /><br/>";
-			echo "</td>";
-			echo "<td>";
-			echo "<strong>Use ".$this->text." Plugin</strong>";
-			echo "</td>";
-			echo "</tr>";
-		} elseif ($hookname == "groupisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the project edit public info page
-			$group = group_get_object($group_id);
-			$use_mediawikiplugin = getStringFromRequest('use_mediawikiplugin');
-			if ( $use_mediawikiplugin == 1 ) {
-				$group->setPluginUse ( $this->name );
-			} else {
-				$group->setPluginUse ( $this->name, false );
-			}
 		} elseif ($hookname == "project_public_area") {
 			$project = group_get_object($group_id);
 			if (!$project || !is_object($project)) {
@@ -391,7 +373,19 @@ _("This plugin allows each project to embed Mediawiki under a tab.");
 			}
 		}
 	}
-  }
+
+	function groupisactivecheckboxpost(&$params) {
+			if (!parent::groupisactivecheckboxpost($params))
+					return false;
+			if (getIntFromRequest('use_mediawiki') == 1) {
+				$sysactionsq = new SysActionsQ();
+				$group_id = $params['group'];
+				$sysactionsq->add($this->getID(), SYSACTION_MEDIAWIKI_CREATE_WIKI, $group_id);
+				$sysactionsq->add($this->getID(), SYSACTION_MEDIAWIKI_CREATE_IMAGEDIR, $group_id);
+			}
+			return true;
+	}
+}
 
 // Local Variables:
 // mode: php
diff --git a/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki b/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
index c8fe4c0..87aaa63 100644
--- a/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
+++ b/src/plugins/mediawiki/etc/cron.d/fusionforge-plugin-mediawiki
@@ -3,9 +3,5 @@
 #
 PATH=@bindir@:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
-# Create new mediawikis four times an hour
-0,15,30,45 * * * * root forge_run_plugin_job mediawiki create-wikis.php
-1,16,31,46 * * * * root forge_run_plugin_job mediawiki create-imagedirs.php
-
 # Create wiki XML dumps every night
 55 1 * * * root forge_run_plugin_job mediawiki dump-wikis.php

commit 11106a58bff5e887c24e5a516ffea3a7addc7773
Merge: 7b51ebd a4d2c07
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Tue Dec 16 11:25:45 2014 +0100

    Merge branch 'master' into feature/reactivity
    
    Conflicts:
    	src/www/scm/admin/index.php

diff --cc src/www/scm/admin/index.php
index e86ded4,099f2be..3d4736b
--- a/src/www/scm/admin/index.php
+++ b/src/www/scm/admin/index.php
@@@ -125,31 -120,28 +125,30 @@@ if (getStringFromRequest('create_reposi
  
  	$scm_changed = false;
  
-     foreach ($scm_plugins as $plugin) {
- 			$myPlugin = plugin_get_object($plugin);
-             if (in_array($myPlugin->name, $scmarray)) {
-                     if (!$group->usesPlugin($myPlugin->name)) {
-                             $group->setPluginUse($myPlugin->name, 1);
-                             if ($myPlugin->getDefaultServer()) {
-                                     $group->setSCMBox($myPlugin->getDefaultServer());
-                             }
-                             $scm_changed = true;
-                     }
- 			} else {
-                     if ($group->usesPlugin($myPlugin->name)) {
-                             $group->setPluginUse($myPlugin->name, 0);
-                             $scm_changed = true;
-                     }
+ 	foreach ($scm_plugins as $plugin) {
+ 		$myPlugin = plugin_get_object($plugin);
+ 		if (in_array($myPlugin->name, $scmarray)) {
+ 			if (!$group->usesPlugin($myPlugin->name)) {
+ 				$group->setPluginUse($myPlugin->name, 1);
+ 				if ($myPlugin->getDefaultServer()) {
+ 					$group->setSCMBox($myPlugin->getDefaultServer());
+ 				}
+ 				$scm_changed = true;
  			}
-     }
+ 		} else {
+ 			if ($group->usesPlugin($myPlugin->name)) {
+ 				$group->setPluginUse($myPlugin->name, 0);
+ 				$scm_changed = true;
+ 			}
+ 		}
+ 	}
  
-         
 -	// Don't call scm plugin update if their form wasn't displayed
 -	// to avoid processing an apparently empty form and reset configuration
 -	if (!$scm_changed)
 -		plugin_hook("scm_admin_update", $hook_params);
 +	if ($scm_changed)
 +			$sysactionsq->add(SYSACTION_CORE, SYSACTION_SCM_REPO, $group_id);
 +	else
 +			// 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);
  }
  
  scm_header(array('title'=>_('SCM Repository'),'group'=>$group_id));

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

Summary of changes:
 autoinstall/common-backports                       |    2 +-
 src/CHANGES                                        |    3 +-
 src/GNUmakefile                                    |    1 +
 src/bin/light.php                                  |   20 +++++--
 src/common/include/Group.class.php                 |    2 +-
 src/common/include/utils.php                       |    1 +
 src/common/mail/Mail.class.php                     |    1 +
 src/common/widget/Widget_Rss.class.php             |   16 ++++--
 src/debian/fusionforge-plugin-mediawiki.triggers   |    4 +-
 .../mediawiki/common/mediawikiPlugin.class.php     |   48 ++++++++---------
 .../etc/cron.d/fusionforge-plugin-mediawiki        |    4 --
 src/plugins/scmsvn/common/SVNPlugin.class.php      |   10 ++--
 src/post-install.d/web/web.sh                      |   13 ++---
 src/www/activity/index.php                         |    2 +-
 src/www/export/rss20_activity.php                  |   13 ++++-
 src/www/scm/admin/index.php                        |   55 ++++++++++----------
 tests/buildbot/config/.gitignore                   |    2 +
 17 files changed, 112 insertions(+), 85 deletions(-)
 create mode 100644 tests/buildbot/config/.gitignore


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list