X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=process.php;h=14686885849f37fdc59d7ad14b0bfa7053eb8860;hb=c00cdfdd3bc8e53750d34c60d13cd2d885c5d4fd;hp=5a056caac795bf851a1546bd8327f4a66edccaf6;hpb=cf3180f6b8c552bbf7214d1ba72fbf1fc90ef861;p=github%2Fwallabag%2Fwallabag.git diff --git a/process.php b/process.php index 5a056caa..14686885 100644 --- a/process.php +++ b/process.php @@ -3,38 +3,14 @@ * poche, a read it later open source system * * @category poche - * @author Nicolas Lœuillet + * @author Nicolas Lœuillet * @copyright 2013 * @license http://www.wtfpl.net/ see COPYING file */ include dirname(__FILE__).'/inc/config.php'; -$db = new db(DB_PATH); -$action = (isset ($_GET['action'])) ? htmlentities($_GET['action']) : ''; -$id = (isset ($_GET['id'])) ? htmlentities($_GET['id']) : ''; -$token = (isset ($_GET['token'])) ? $_GET['token'] : ''; - -if (verif_token($token)) { - switch ($action) - { - case 'toggle_fav' : - $sql_action = "UPDATE entries SET is_fav=~is_fav WHERE id=?"; - $params_action = array($id); - break; - case 'toggle_archive' : - $sql_action = "UPDATE entries SET is_read=~is_read WHERE id=?"; - $params_action = array($id); - break; - default: - break; - } - - # action query - if (isset($sql_action)) - { - $query = $db->getHandle()->prepare($sql_action); - $query->execute($params_action); - } -} -else die('CSRF problem'); \ No newline at end of file +$entries = display_view($view); +$tpl->assign('token', $_SESSION['token_poche']); +$tpl->assign('entries', $entries); +$tpl->draw('entries'); \ No newline at end of file