[evolvis-commits] r14845: Fix some bugs in mailman plugin↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Mon Feb 28 04:55:16 CET 2011
Author: mirabilos
Date: 2011-02-28 04:55:16 +0100 (Mon, 28 Feb 2011)
New Revision: 14845
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/www/include/plugins_utils.php
trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/BackendMailmanList.class.php
trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanList.class.php
trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListDao.class.php
trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListFactory.class.php
trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/admin/deletelist.php
trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/mailman_utils.php
Log:
Fix some bugs in mailman plugin
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/plugins_utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/plugins_utils.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/plugins_utils.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/BackendMailmanList.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/BackendMailmanList.class.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/BackendMailmanList.class.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanList.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanList.class.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanList.class.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListDao.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListDao.class.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListDao.class.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListFactory.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListFactory.class.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/include/MailmanListFactory.class.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/admin/deletelist.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/admin/deletelist.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/admin/deletelist.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/mailman_utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/mailman_utils.php 2011-02-28 03:55:11 UTC (rev 14844)
+++ trunk/gforge_base/evolvisforge-5.1/plugins/coclico/mailman/www/mailman_utils.php 2011-02-28 03:55:16 UTC (rev 14845)
@@ -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 evolvis-commits
mailing list