[Fusionforge-commits] r9500 - in trunk: gforge/www/include plugins/coclico/mailman/include plugins/coclico/mailman/www plugins/coclico/mailman/www/admin

Mélanie Le Bail melanelebail at libremir.placard.fr.eu.org
Thu Apr 15 16:33:10 CEST 2010


Author: melanelebail
Date: 2010-04-15 16:33:10 +0200 (Thu, 15 Apr 2010)
New Revision: 9500

Modified:
   trunk/gforge/www/include/plugins_utils.php
   trunk/plugins/coclico/mailman/include/BackendMailmanList.class.php
   trunk/plugins/coclico/mailman/include/MailmanList.class.php
   trunk/plugins/coclico/mailman/include/MailmanListDao.class.php
   trunk/plugins/coclico/mailman/include/MailmanListFactory.class.php
   trunk/plugins/coclico/mailman/www/admin/deletelist.php
   trunk/plugins/coclico/mailman/www/mailman_utils.php
Log:
Fix some bugs in mailman plugin


Modified: trunk/gforge/www/include/plugins_utils.php
===================================================================
--- trunk/gforge/www/include/plugins_utils.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/gforge/www/include/plugins_utils.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -6,10 +6,10 @@
 
 
  
-$GLOBALS['mailman_bin_dir'] =  $GLOBALS['sys_path_to_mailman'].'/bin';
-$GLOBALS['mailman_list_dir'] = '/var/lib/mailman/lists';
+$GLOBALS['mailman_bin_dir'] =  '/usr/lib/mailman/bin';
+$GLOBALS['mailman_lib_dir'] = '/var/lib/mailman';
 $GLOBALS['forumml_arch'] = '/var/lib/mailman/archives';
-$GLOBALS['forumml_tmp'] = '/var/run/forumml';
+$GLOBALS['forumml_tmp'] = '/var/spool/forumml';
 $GLOBALS['forumml_dir'] = '/var/lib/gforge/forumml';
 $GLOBALS['sys_lf'] = "\n"; 
 global $html;

Modified: trunk/plugins/coclico/mailman/include/BackendMailmanList.class.php
===================================================================
--- trunk/plugins/coclico/mailman/include/BackendMailmanList.class.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/plugins/coclico/mailman/include/BackendMailmanList.class.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -112,14 +112,14 @@
             $list = new MailmanList($row['group_id'],$row['group_list_id']);
             $user=UserManager::instance()->getUserByID($list->getListAdminId());
 	    $list_admin_email= $user->getEmail();
-            $list_dir = $GLOBALS['mailman_list_dir']."/".$list->getName();
+            $list_dir = $GLOBALS['mailman_lib_dir']."/lists/".$list->getName();
 
 	    if($list->isPublic() != 9) {
 		    if ((! is_dir($list_dir))) {
 			    // Create list
 			    system($GLOBALS['mailman_bin_dir']."/newlist -q ".$list->getName()." ".$list_admin_email." ".$list->getPassword()." >/dev/null");
 			    // Then update configuraion
-			    if( $this->updateListConfig($list) !=false ) {
+			    if( is_dir($list_dir) && $this->updateListConfig($list) !=false ) {
 				    $result = $this->_getMailingListDao() -> updateList($list->getID(),$row['group_id'], $list->getDescription(), $list->isPublic(),'3');
 				    if (!$result) {
 					    printf('Unable to update the list status: '.db_error());
@@ -129,6 +129,9 @@
 					    return true;
 				    }
 			    }
+			    else {
+				    return false;
+			    }
 		    }
 		    else {
 			    $result = $this->_getMailingListDao() -> updateList($list->getID(),$row['group_id'], $list->getDescription(), $list->isPublic(),'3');
@@ -137,7 +140,7 @@
 				    return false;
 			    }		
 			    else {
-				   return true;
+				    return true;
 			    }
 		    }
 	    }
@@ -156,12 +159,12 @@
 
 	    if ($row = $dar->getRow()) {
 		    $list=new MailmanList($row['group_id'],$group_list_id);
-		    $list_dir = $GLOBALS['mailman_list_dir']."/".$list->getName();
+		    $list_dir = $GLOBALS['mailman_lib_dir']."/lists/".$list->getName();
 		    if ((is_dir($list_dir))&&($list->isPublic() == 9)) {
 
 			    // Archive first
-			    $list_archive_dir = $GLOBALS['mailman_list_dir']."/../archives/private/".$list->getName(); // Does it work? TODO
-			    $backupfile=$GLOBALS['tmp_dir']."/".$list->getName()."-mailman.tgz";
+			    $list_archive_dir = $GLOBALS['mailman_lib_dir']."/archives/private/".$list->getName(); // Does it work? TODO
+			    $backupfile=$GLOBALS['mailman_lib_dir']."/archives/".$list->getName()."-mailman.tgz";
 			    system("tar cfz $backupfile $list_dir $list_archive_dir");
 			    chmod($backupfile,0600);
 
@@ -180,7 +183,7 @@
      */
     public function listExists($list) {
 	    // Is this the best test?
-	    $list_dir = $GLOBALS['mailman_list_dir']."/".$list->getName();
+	    $list_dir = $GLOBALS['mailman_lib_dir']."/lists/".$list->getName();
 	    if (! is_dir($list_dir)) return false;
 	    return true;
     }

Modified: trunk/plugins/coclico/mailman/include/MailmanList.class.php
===================================================================
--- trunk/plugins/coclico/mailman/include/MailmanList.class.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/plugins/coclico/mailman/include/MailmanList.class.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -331,9 +331,9 @@
 	 */
 	function getArchivesUrl() {
 		if ($this->isPublic()) {
-			$iframe_url = 'http://'.$GLOBALS['sys_lists_host'].'/pipermail/'.$this->getName().'/';
+			$iframe_url = '/pipermail/'.$this->getName().'/';
 		} else {
-			$iframe_url = 'http://'.$GLOBALS['sys_lists_host'].'/mailman/private/'.$this->getName().'/';
+			$iframe_url = '/mailman/private/'.$this->getName().'/';
 		}
 		htmlIframe($iframe_url, array('class' => 'iframe_service'));
 	}
@@ -344,7 +344,7 @@
 	 * @return string url of the info page
 	 */
 	function getExternalInfoUrl() {
-		return 'http://'.$GLOBALS['sys_lists_host'].'/mailman/listinfo/'.$this->getName();
+		return uitl_make_url('/mailman/listinfo/'.$this->getName());
 	}
 	/**
 	 * getOptionsUrl - get the url to manage options for user
@@ -354,7 +354,7 @@
 	function getOptionsUrl() {
 		$current_user=UserManager::instance()->getCurrentUser();
 		$user=$current_user->getEmail();
-		$iframe_url = 'http://'.$GLOBALS['sys_lists_host'].'/mailman/options/'.$this->getName().'/'.$user;
+		$iframe_url = '/mailman/options/'.$this->getName().'/'.$user;
 		htmlIframe($iframe_url, array('class' => 'iframe_service'));
 	}
 	/**

Modified: trunk/plugins/coclico/mailman/include/MailmanListDao.class.php
===================================================================
--- trunk/plugins/coclico/mailman/include/MailmanListDao.class.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/plugins/coclico/mailman/include/MailmanListDao.class.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -150,7 +150,7 @@
 		return $this->retrieve($sql,array($mail));
 
 	}
-	function & updateInfos($mail,$passwd,$name) {
+	function updateInfos($mail,$passwd,$name) {
 		$mail = $this->da->quoteSmart($mail);
 		$passwd = $this->da->quoteSmart($passwd);
 		$name = $this->da->quoteSmart($name);

Modified: trunk/plugins/coclico/mailman/include/MailmanListFactory.class.php
===================================================================
--- trunk/plugins/coclico/mailman/include/MailmanListFactory.class.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/plugins/coclico/mailman/include/MailmanListFactory.class.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -167,7 +167,7 @@
 		if (!$result) {
 			return false;
 		}
-		htmlRedirect('index.php?group_id='.$this->Group->getId());
+		htmlRedirect('/plugins/mailman/index.php?group_id='.$this->Group->getId());
 		return $result;	
 	}
 

Modified: trunk/plugins/coclico/mailman/www/admin/deletelist.php
===================================================================
--- trunk/plugins/coclico/mailman/www/admin/deletelist.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/plugins/coclico/mailman/www/admin/deletelist.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -44,7 +44,7 @@
 	if (!$ml->deleteList($sure,$really_sure)) {
 		exit_error('Error',$ml->getErrorMessage());
 	} else {
-		htmlRedirect('index.php?group_id='.$group_id.'&feedback=DELETED');
+		htmlRedirect('/plugins/mailman/index.php?group_id='.$group_id.'&feedback=DELETED');
 	}
 }
 

Modified: trunk/plugins/coclico/mailman/www/mailman_utils.php
===================================================================
--- trunk/plugins/coclico/mailman/www/mailman_utils.php	2010-04-15 12:40:49 UTC (rev 9499)
+++ trunk/plugins/coclico/mailman/www/mailman_utils.php	2010-04-15 14:33:10 UTC (rev 9500)
@@ -34,7 +34,7 @@
 Thank you for registering your project with %1$s.
 
 -- the %1$s staff
-'), $GLOBALS['sys_name'], $GLOBALS['sys_lists_host'], $list->getName(), $list->getExternalInfoUrl(), 'http://'.$GLOBALS['sys_lists_host'].'/mailman/admin/'.$list->getName(), $list->getPassword());
+'), $GLOBALS['sys_name'], $GLOBALS['sys_lists_host'], $list->getName(), $list->getExternalInfoUrl(), util_make_url('/mailman/admin/'.$list->getName()), $list->getPassword());
        $mailSubject = sprintf(_('%1$s New Mailing List'), $GLOBALS['sys_name']);
 
 




More information about the Fusionforge-commits mailing list