Beispiel #1
0
<?php

require_once '../../includes/auth.php';
$fileInfo = array('title' => 'ADR Lists', 'fileName' => 'adrLists/index.php');
$debug->newFile($fileInfo['fileName']);
$buildPage = new Adrlist_BuildPage();
$buildPage->addIncludes('adrListsMethods.php');
$buildPage->addJs('adrLists.js');
echo $buildPage->output(), '
<div id="buildListsHolder">
	', buildLists(), '
</div>
', $buildPage->buildFooter();
function unlockList()
{
    global $debug, $message, $success, $Dbc, $returnThis;
    try {
        if (empty($_POST['listId'])) {
            throw new Adrlist_CustomException('', '$_POST[\'listId\'] is empty.');
        } elseif (empty($_SESSION['credits'])) {
            throw new Adrlist_CustomException('You don\'t have any credits. Credits can be purchased in <a href="' . LINKMYACCOUNT . '" data-ajax="false">My Account</a>', '$_SESSION[\'credits\'] is empty.');
        }
        $listInfo = getListInfo($_SESSION['userId'], $_POST['listId']);
        if ($listInfo['listRoleId'] < 4) {
            throw new Adrlist_CustomException('Your role does not allow you to unlock this list.', '$listInfo[\'listRoleId\']: ' . $listInfo['listRoleId']);
        }
        $unlockStmt = $Dbc->prepare("UPDATE\n\tlists\nSET\n\tlocked = 0\nWHERE\n\tlistId = ?");
        $unlockStmt->execute(array($_POST['listId']));
        updateListHist($_POST['listId']);
        $locked = reconcileLists($_SESSION['userId']);
        if (MODE == 'unlockList') {
            $success = true;
            $returnThis['locked'] = $locked;
            $returnThis['buildLists'] = buildLists();
        }
    } catch (Adrlist_CustomException $e) {
    } catch (PDOException $e) {
        error(__LINE__, '', '<pre>' . $e . '</pre>');
    }
    if (MODE == 'unlockList') {
        returnData();
    }
}