Ejemplo n.º 1
0
//Free mem
unset($res);
//Verify that we have permissions to edit
//Start by checking if we own that post
if ($CURUSER->get('id') != $Post['author']) {
    //Since we dont own the post
    //Check if we have the minimum required rank
    if ($CURUSER->getRank()->int() < $config['FORUM']['Min_Rank_Post_Edit']) {
        WCF::SetupNotification('You do not meet the requirements to edit this post.');
        header("Location: " . $config['BaseURL'] . "/forums.php");
        die;
    } else {
        //We have the minimum required rank
        //now check if the authoer is lower rank
        //If the author is not resolved we assume he is lower rank
        if ($userInfo = WCF::getAuthorInfo($Post['author'])) {
            //Get the poster rank
            $userRank = new UserRank($userInfo['rank']);
            //The author has equal or geater rank, we cant delete his post
            if ($CURUSER->getRank()->int() <= $userRank->int()) {
                WCF::SetupNotification('You do not meet the requirements to edit this post.');
                header("Location: " . $config['BaseURL'] . "/forums.php");
                die;
            }
        }
    }
}
//Set the title
$TPL->SetTitle('Edit Reply');
$TPL->SetParameter('topbar', true);
//Print the header
Ejemplo n.º 2
0
            $userRank = new UserRank(0);
            $arr['author_str'] = 'Unknown';
            $arr['author_rank'] = 'Unknown';
            $gallery = new AvatarGallery();
            $Avatar = $gallery->get(0);
            unset($gallery);
        }
        //format the time
        $arr['added'] = date('D M j, Y, h:i A', strtotime($arr['added']));
        //Is staff post
        $staffPost = $CORE->hasFlag((int) $arr['flags'], WCF_FLAGS_STAFF_POST);
        //Is deleted
        $deletedPost = (int) $arr['deleted_by'] > 0 ? true : false;
        //Resolve the deletion author
        if ($deletedPost) {
            $userInfo = WCF::getAuthorInfo($arr['deleted_by']);
            $arr['deleted_by_str'] = $userInfo['displayName'];
            unset($userInfo);
            $arr['deleted_time'] = date('D M j, Y, h:i A', strtotime($arr['deleted_time']));
        }
        echo '
				<!-- Topic Post -->
				<div class="topic_post', $staffPost ? ' admin_post' : '', $deletedPost ? ' deleted_post' : '', '" id="post-', $arr['id'], '">';
        if ($staffPost) {
            echo '<!-- Admin Warcry WoW post -->
						<div class="admin_post_logo_wc"></div>';
        }
        echo '
					<div class="left_side">
					
						<div class="user_avatar">';