[Fusionforge-commits] r13231 - in branches/Branch_5_1/src/plugins/mailman: bin debian/dsf-in etc include packaging/control packaging/install var/lib/mailman/lists

Christian Bayle cbayle at fusionforge.org
Fri Apr 29 14:44:35 CEST 2011


Author: cbayle
Date: 2011-04-29 14:44:35 +0200 (Fri, 29 Apr 2011)
New Revision: 13231

Added:
   branches/Branch_5_1/src/plugins/mailman/etc/mailman.ini
Modified:
   branches/Branch_5_1/src/plugins/mailman/bin/db-delete.pl
   branches/Branch_5_1/src/plugins/mailman/bin/db-upgrade.pl
   branches/Branch_5_1/src/plugins/mailman/bin/install.sh
   branches/Branch_5_1/src/plugins/mailman/debian/dsf-in/plugin-mailman.preinst
   branches/Branch_5_1/src/plugins/mailman/include/MailmanList.class.php
   branches/Branch_5_1/src/plugins/mailman/include/mailmanPlugin.class.php
   branches/Branch_5_1/src/plugins/mailman/packaging/control/222plugin-mailman
   branches/Branch_5_1/src/plugins/mailman/packaging/install/plugin-mailman
   branches/Branch_5_1/src/plugins/mailman/var/lib/mailman/lists/extend.py
Log:
Merge from trunk


Modified: branches/Branch_5_1/src/plugins/mailman/bin/db-delete.pl
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/bin/db-delete.pl	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/bin/db-delete.pl	2011-04-29 12:44:35 UTC (rev 13231)
@@ -17,7 +17,7 @@
     $sys_urlroot $sf_cache_dir $sys_name $sys_themeroot
     $sys_news_group $sys_dbhost $sys_dbname $sys_dbuser $sys_dbpasswd
     $sys_ldap_base_dn $sys_ldap_host $admin_login $admin_password
-    $server_admin $domain_name $newsadmin_groupid $statsadmin_groupid
+    $domain_name $newsadmin_groupid $statsadmin_groupid
     $skill_list/ ;
 use vars qw/$pluginname/ ;
 

Modified: branches/Branch_5_1/src/plugins/mailman/bin/db-upgrade.pl
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/bin/db-upgrade.pl	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/bin/db-upgrade.pl	2011-04-29 12:44:35 UTC (rev 13231)
@@ -17,7 +17,7 @@
     $sys_urlroot $sf_cache_dir $sys_name $sys_themeroot
     $sys_news_group $sys_dbhost $sys_dbname $sys_dbuser $sys_dbpasswd
     $sys_ldap_base_dn $sys_ldap_host $admin_login $admin_password
-    $server_admin $domain_name $newsadmin_groupid $statsadmin_groupid
+    $domain_name $newsadmin_groupid $statsadmin_groupid
     $skill_list/ ;
 use vars qw/$pluginname/ ;
 
@@ -69,33 +69,6 @@
 	$dbh->commit () ;
     }
     
-#    $version = &get_db_version ;
-#    $target = "0.2" ;
-#    if (is_lesser $version, $target) {
-#	debug "Adding local data." ;
-#	
-#	do "/etc/gforge/local.pl" or die "Cannot read /etc/gforge/local.pl" ;
-#	
-#	my $ip_address = qx/host $domain_name | awk '{print \}'/ ;
-#	
-#	@reqlist = (
-#		    "INSERT INTO plugin_".$pluginname."_sample_data (domain, ip_address) VALUES ('$domain_name', '$ip_address')",
-#		    ) ;
-#	
-#	foreach my $s (@reqlist) {
-#	    $query = $s ;
-#	    # debug $query ;
-#	    $sth = $dbh->prepare ($query) ;
-#	    $sth->execute () ;
-#	    $sth->finish () ;
-#	}
-#	@reqlist = () ;
-#	
-#	&update_db_version ($target) ;
-#	debug "Committing." ;
-#	$dbh->commit () ;
-#    }
-
     debug "It seems your database install/upgrade went well and smoothly.  That's cool." ;
     debug "Please enjoy using Debian FusionForge." ;
 

Modified: branches/Branch_5_1/src/plugins/mailman/bin/install.sh
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/bin/install.sh	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/bin/install.sh	2011-04-29 12:44:35 UTC (rev 13231)
@@ -1,6 +1,4 @@
 #! /bin/sh
 PATH=/usr/share/gforge/bin:/usr/share/fusionforge/bin:$PATH
 export PATH
-chgrp list /var/lib/mailman/lists/extend.py
-getent group www-data | grep -q list || adduser list www-data
 [ -d /var/lib/mailman/lists/mailman/ ] || /usr/sbin/newlist -q mailman postmaster@`hostname -f` `forge_get_config database_password`

Modified: branches/Branch_5_1/src/plugins/mailman/debian/dsf-in/plugin-mailman.preinst
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/debian/dsf-in/plugin-mailman.preinst	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/debian/dsf-in/plugin-mailman.preinst	2011-04-29 12:44:35 UTC (rev 13231)
@@ -18,13 +18,13 @@
 case "$1" in
     install|upgrade)
 	dpkg-divert --package @PACKAGE at -plugin-mailman \
-		--divert /usr/lib/mailman/Mailman/Archiver/Archiver.py.old \
+		--divert /usr/lib/mailman/Mailman/Archiver/Archiver.py.fusionforge \
 		--rename /usr/lib/mailman/Mailman/Archiver/Archiver.py
 	dpkg-divert --package @PACKAGE at -plugin-mailman \
-		--divert /usr/lib/mailman/Mailman/SecurityManager.py.old \
+		--divert /usr/lib/mailman/Mailman/SecurityManager.py.fusionforge \
 		--rename /usr/lib/mailman/Mailman/SecurityManager.py
 	dpkg-divert --package @PACKAGE at -plugin-mailman \
-		--divert /usr/lib/mailman/Mailman/MailList.py.old \
+		--divert /usr/lib/mailman/Mailman/MailList.py.fusionforge \
 		--rename /usr/lib/mailman/Mailman/MailList.py
     ;;
 

Added: branches/Branch_5_1/src/plugins/mailman/etc/mailman.ini
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/etc/mailman.ini	                        (rev 0)
+++ branches/Branch_5_1/src/plugins/mailman/etc/mailman.ini	2011-04-29 12:44:35 UTC (rev 13231)
@@ -0,0 +1,12 @@
+[mailman]
+
+; Current mailman is to be validate by developers
+; plugin_status is a string.
+; valid means : production ready.
+; Any other strings means it's under work or broken and plugin 
+; is available in installation_environment = development only.
+plugin_status = valid
+dbhost = 
+dbuser = list
+dbpassword =
+database =  gforge

Modified: branches/Branch_5_1/src/plugins/mailman/include/MailmanList.class.php
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/include/MailmanList.class.php	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/include/MailmanList.class.php	2011-04-29 12:44:35 UTC (rev 13231)
@@ -194,8 +194,9 @@
 	function activationRequested()
 	{
 		$systemevent =	SystemEventManager::instance();
-		$result = $systemevent->fetchEvents(0,10,false,array(SystemEvent::STATUS_NEW,SystemEvent::STATUS_RUNNING),array('MAILMAN_LIST_CREATE'),$this->getID());
-		if(count($result)<1) {
+		$result1 = $systemevent->fetchEvents(0,10,false,SystemEvent::STATUS_NEW,'MAILMAN_LIST_CREATE',$this->getID());
+		$result2 = $systemevent->fetchEvents(0,10,false,SystemEvent::STATUS_RUNNING,'MAILMAN_LIST_CREATE',$this->getID());
+		if(count($result1)+count($result2)<1) {
 			return false;
 		}
 		else {

Modified: branches/Branch_5_1/src/plugins/mailman/include/mailmanPlugin.class.php
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/include/mailmanPlugin.class.php	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/include/mailmanPlugin.class.php	2011-04-29 12:44:35 UTC (rev 13231)
@@ -94,6 +94,7 @@
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
 				$params['DIRS'][]='/plugins/mailman/index.php?group_id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we�re calling is the project one
+                $params['ADMIN'][]='';
 			} 
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 		} elseif ($hookname == "groupisactivecheckbox") {
@@ -213,8 +214,9 @@
 				return false;
 			}
 		}
+		// TODO : WTF ? : I think this should probably be gotten rid of -- OlivierBerger
 		elseif ($hookname=='site_admin_option_hook') {
-			echo '<li><a href="'.$this->getPluginPath().'/">Template</a></li>';
+			echo '<li><a href="'.$this->getPluginPath().'/">Template [' . _('Mailman plugin') . ']</a></li>';
 		}
 		
 		

Modified: branches/Branch_5_1/src/plugins/mailman/packaging/control/222plugin-mailman
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/packaging/control/222plugin-mailman	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/packaging/control/222plugin-mailman	2011-04-29 12:44:35 UTC (rev 13231)
@@ -1,6 +1,6 @@
 Package: @PACKAGE at -plugin-mailman
 Architecture: all
-Depends: @OLDPACKAGE at -common, @OLDPACKAGE at -db-postgresql | @OLDPACKAGE at -db, @OLDPACKAGE at -mta-exim4 | @OLDPACKAGE at -mta, apache2 (>= 2.0.52), perl, libdbi-perl, libdbd-pg-perl, debianutils (>= 1.7), debconf (>= 1.0.32) | debconf-2.0, ucf, mailman (>= 2.1.13), python-psycopg2, python-mysqldb, ${misc:Depends}
+Depends: @OLDPACKAGE at -common, @OLDPACKAGE at -db-postgresql | @OLDPACKAGE at -db, @OLDPACKAGE at -mta-exim4 | @OLDPACKAGE at -mta, apache2 (>= 2.0.52), perl, libdbi-perl, libdbd-pg-perl, debianutils (>= 1.7), debconf (>= 1.0.32) | debconf-2.0, ucf, mailman (>= 2.1.13), python-psycopg2, python-mysqldb, python-iniparse, ${misc:Depends}
 Provides: @OLDPACKAGE at -lists
 Conflicts: @OLDPACKAGE at -lists
 Description: collaborative development tool - mailing-lists plugin (using Mailman)

Modified: branches/Branch_5_1/src/plugins/mailman/packaging/install/plugin-mailman
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/packaging/install/plugin-mailman	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/packaging/install/plugin-mailman	2011-04-29 12:44:35 UTC (rev 13231)
@@ -6,5 +6,6 @@
 plugins/mailman/cronjobs/*                usr/share/gforge/cronjobs
 plugins/mailman/etc/plugins/mailman/*     etc/gforge/plugins/mailman/
 plugins/mailman/etc/httpd.d/*             usr/share/gforge/etc/httpd.d/
+plugins/mailman/etc/mailman.ini           etc/gforge/config.ini.d/
 plugins/mailman/usr/lib/mailman/Mailman/* usr/lib/mailman/Mailman/
 plugins/mailman/var/lib/mailman/lists/*   var/lib/mailman/lists/

Modified: branches/Branch_5_1/src/plugins/mailman/var/lib/mailman/lists/extend.py
===================================================================
--- branches/Branch_5_1/src/plugins/mailman/var/lib/mailman/lists/extend.py	2011-04-28 20:22:31 UTC (rev 13230)
+++ branches/Branch_5_1/src/plugins/mailman/var/lib/mailman/lists/extend.py	2011-04-29 12:44:35 UTC (rev 13231)
@@ -1,3 +1,12 @@
+
+#
+# This file is part of the FusionForge mailman plugin, extending
+# mailman to allow the use of its postgresql database for user
+# retrieval
+#
+# Copyright + License : FIXME
+#
+
 from Mailman.PsycopgConnector import PsycopgConnector
 from Mailman.ForgeSecurityManager import ForgeSecurityManager
 import sys
@@ -3,15 +12,16 @@
 
 def extendMemberAdaptor(list):
-    sys.path.append('/etc/gforge')
-    import database 
+    from iniparse import INIConfig
+    cfg = INIConfig(open('/etc/gforge/config.ini.d/mailman.ini'))
     dbparam={}
     #Config to connect to database
-    dbparam['dbhost'] = database.sys_dbhost 
-    dbparam['dbuser']=  database.sys_dbuser
-    dbparam['dbpassword'] = database.sys_dbpasswd 
-    dbparam['database'] =  database.sys_dbname
+    dbparam['dbhost'] = cfg['mailman']['dbhost']
+    dbparam['dbuser']=  cfg['mailman']['dbuser']
+    dbparam['dbpassword'] = cfg['mailman']['dbpassword']
+    dbparam['database'] =  cfg['mailman']['database']
     dbparam['refresh'] = 360
 
-    dbparam['mailman_table']= 'plugin_mailman'#table where mailman stores memeberships info
+    #table where mailman stores memeberships info
+    dbparam['mailman_table']= 'plugin_mailman'
 
     ######################	




More information about the Fusionforge-commits mailing list