Ejemplo n.º 1
0
 * @package articles
 * @subpackage functions
 */
/**
 * Initialization
 */
require_once '../kernel/setup_inc.php';
require_once ARTICLES_PKG_PATH . 'BitArticle.php';
include_once ARTICLES_PKG_PATH . 'article_filter_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('articles');
// Now check permissions to access this page
$gBitSystem->verifyPermission('p_articles_read');
// get services set up
$gContent = new BitArticle();
$gContent->invokeServices('content_list_function', $_REQUEST);
// nuke articles if requested
if (!empty($_REQUEST['action'])) {
    if ($_REQUEST['action'] == 'remove' && !empty($_REQUEST['remove_article_id'])) {
        $tmpArt = new BitArticle($_REQUEST['remove_article_id']);
        $tmpArt->load();
        // depending on what the status of the article is, we need to check different permissions
        if ($tmpArt->mInfo['status_id'] == ARTICLE_STATUS_PENDING) {
            $gBitSystem->verifyPermission('p_articles_remove_submission');
        } else {
            $gBitSystem->verifyPermission('p_articles_remove');
        }
        if (isset($_REQUEST["confirm"])) {
            if ($tmpArt->expunge()) {
                bit_redirect(ARTICLES_PKG_URL . 'list.php?status_id=' . (!empty($_REQUEST['status_id']) ? $_REQUEST['status_id'] : ''));
            } else {