[Fusionforge-commits] r10727 - in trunk/src: common/forum www/forum www/forum/admin

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sun Sep 26 19:31:14 CEST 2010


Author: nerville
Date: 2010-09-26 19:31:13 +0200 (Sun, 26 Sep 2010)
New Revision: 10727

Modified:
   trunk/src/common/forum/Forum.class.php
   trunk/src/common/forum/ForumMessage.class.php
   trunk/src/www/forum/admin/ForumAdmin.class.php
   trunk/src/www/forum/admin/index.php
   trunk/src/www/forum/forum.php
Log:
fix commit 9820 : delete forum message

Modified: trunk/src/common/forum/Forum.class.php
===================================================================
--- trunk/src/common/forum/Forum.class.php	2010-09-26 17:08:37 UTC (rev 10726)
+++ trunk/src/common/forum/Forum.class.php	2010-09-26 17:31:13 UTC (rev 10727)
@@ -43,9 +43,9 @@
 		return NULL ;
 	}
 
-	$data =& db_fetch_array($res);
+	$data = db_fetch_array($res);
 	$Group =& group_get_object($data["group_id"]);
-	$f =  new Forum ($Group, $data["group_artifact_id"]);
+	$f =  new Forum ($Group, $forum_id);
 
 	$f->fetchData ($forum_id) ;
 

Modified: trunk/src/common/forum/ForumMessage.class.php
===================================================================
--- trunk/src/common/forum/ForumMessage.class.php	2010-09-26 17:08:37 UTC (rev 10726)
+++ trunk/src/common/forum/ForumMessage.class.php	2010-09-26 17:31:13 UTC (rev 10727)
@@ -560,7 +560,7 @@
 		$msg_id=$this->getID();
 		if (!$msg_id) {
 			$this->setError(_('Invalid Message ID'));
-			return 0;
+			return false;
 		}
 		
 		if (!forge_check_perm ('forum_admin', $this->Forum->Group->getID())) {
@@ -568,8 +568,6 @@
 			return false;
 		}
 		
-		return forge_check_perm ('forum', $this->Forum->getID(), 'moderate') ;
-
 		$result = db_query_params ('SELECT msg_id FROM forum 
 			WHERE is_followup_to=$1
 			AND group_forum_id=$2',
@@ -587,11 +585,11 @@
 			AND group_forum_id=$2',
 					 array ($msg_id,
 						$this->Forum->getID())) ;
+
 		$res = db_query_params ('DELETE FROM forum_attachment where msg_id=$1',
 					array ($msg_id));
 
 		return $count;
-
 	}
 
 	/**

Modified: trunk/src/www/forum/admin/ForumAdmin.class.php
===================================================================
--- trunk/src/www/forum/admin/ForumAdmin.class.php	2010-09-26 17:08:37 UTC (rev 10726)
+++ trunk/src/www/forum/admin/ForumAdmin.class.php	2010-09-26 17:31:13 UTC (rev 10727)
@@ -215,7 +215,7 @@
 			return $feedback;
 		}
 		if ($action == "delete") { //Deleting messages or threads
-			$msg_id = getStringFromRequest('deletemsg');
+			$msg_id = getIntFromRequest('deletemsg');
 			$forum_id = getIntFromRequest('forum_id');
 			$f=new Forum($this->g,$forum_id);
 			if (!$f || !is_object($f)) {

Modified: trunk/src/www/forum/admin/index.php
===================================================================
--- trunk/src/www/forum/admin/index.php	2010-09-26 17:08:37 UTC (rev 10726)
+++ trunk/src/www/forum/admin/index.php	2010-09-26 17:31:13 UTC (rev 10727)
@@ -190,9 +190,9 @@
 } elseif ( getStringFromRequest("deletemsg") ) {
 	// delete message handling
 		
-	$forum_id = getStringFromRequest("forum_id");
-	$thread_id = getStringFromRequest("thread_id");
-	$msg_id = getStringFromRequest("deletemsg");
+	$forum_id = getIntFromRequest("forum_id");
+	$thread_id = getIntFromRequest("thread_id");
+	$msg_id = getIntFromRequest("deletemsg");
 
 	$f = forum_get_object ($forum_id) ;
 
@@ -233,9 +233,9 @@
 	}
 } elseif (getStringFromRequest("editmsg")) {
 	// edit message handling
-	$forum_id = getStringFromRequest("forum_id");
-	$thread_id = getStringFromRequest("thread_id");
-	$msg_id = getStringFromRequest("editmsg");
+	$forum_id = getIntFromRequest("forum_id");
+	$thread_id = getIntFromRequest("thread_id");
+	$msg_id = getIntFromRequest("editmsg");
 
 	$f = forum_get_object ($forum_id) ;
 	$fa = new ForumAdmin($f->Group->getID());

Modified: trunk/src/www/forum/forum.php
===================================================================
--- trunk/src/www/forum/forum.php	2010-09-26 17:08:37 UTC (rev 10726)
+++ trunk/src/www/forum/forum.php	2010-09-26 17:31:13 UTC (rev 10727)
@@ -215,6 +215,7 @@
 		}
 
 		$i=0;
+		$total_rows = 0;
 		while (($i < $rows) && ($total_rows < $max_rows)) {
 
 			$total_rows++;




More information about the Fusionforge-commits mailing list