[evolvis-commits] r18248: allow deletion of special mailing lists upon group deletion

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Apr 5 23:02:02 CEST 2012


Author: mirabilos
Date: 2012-04-05 23:02:01 +0200 (Thu, 05 Apr 2012)
New Revision: 18248

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php
   trunk/gforge_base/evolvisforge-5.1/src/common/mail/MailingList.class.php
Log:
allow deletion of special mailing lists upon group deletion


Modified: trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php	2012-04-05 21:01:56 UTC (rev 18247)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/include/Group.class.php	2012-04-05 21:02:01 UTC (rev 18248)
@@ -1866,7 +1866,7 @@
 			if (!is_object($i)) {
 				continue;
 			}
-			if (!$i->delete(1,1)) {
+			if (!$i->delete(2, 2)) {
 				$this->setError(_('Could not properly delete the mailing list'));
 				db_rollback();
 				return false;

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/mail/MailingList.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/mail/MailingList.class.php	2012-04-05 21:01:56 UTC (rev 18247)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/mail/MailingList.class.php	2012-04-05 21:02:01 UTC (rev 18248)
@@ -384,7 +384,8 @@
 	function delete($sure,$really_sure) {
 		$mn = $this->getName();
 		$gn = $this->Group->getUnixName();
-		if ($mn == $gn."-commits" || $mn == $gn."-discuss") {
+		if (($mn == $gn."-commits" || $mn == $gn."-discuss") &&
+		    $sure != 2) {
 			$this->setError(_('Sorry, this mailing list is special and must not be deleted.'), ERROR__PERMISSION_DENIED_ERROR);
 			return false;
 		}



More information about the evolvis-commits mailing list