Prevent Adminposts
TriTop Offline
Member
***
Posts: 53
Joined: Apr 2008
Post: #3
RE: Prevent Adminposts
Thanks for fast reply ZiNgA BuRgA! Your impulse ensuing I searched in moderate.php for input actions. Found:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
	// Actually delete the posts in inline moderation
	case "do_multideleteposts":

		// Verify incoming POST request
		verify_post_check($mybb->input['my_post_key']);
		
		$postlist = explode("|", $mybb->input['posts']);
		if(!is_moderator_by_pids($postlist, "candeleteposts"))
		{
			error_no_permission();
		}



By the way, $mybb->input['posts'] read pid. Yes

This code I use now:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$plugins->add_hook('moderation_start', 'adminposteditlock_moderation');


function adminposteditlock_moderation()
{
global $db, $mybb;

if($mybb->input['action'] == "do_multideleteposts") {

		$pid = intval($mybb->input['posts']);
        $query = $db->simple_select("posts", "*", "pid='$pid'");
        $post = $db->fetch_array($query);
        $uid = $post['uid'];
        $user = get_user($uid);
        if($pid = $user['uid'] == 1)
        {
        error("This post was made by an Admin. Editing or deletion is not allowed.", "ERROR!");
        }
}
}


It works! However plugin not yet functional. It will take much more time to make it ready. Anyway, this point Job done! Yipi

12-16-2010 01:59 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Prevent Adminposts - TriTop - 12-15-2010, 04:47 AM
RE: Prevent Adminposts - ZiNgA BuRgA - 12-15-2010, 08:16 AM
RE: Prevent Adminposts - TriTop - 12-16-2010 01:59 AM

 Standard Tools
Forum Jump: