public function make_response($response) { require_once APP_DIR . "plugins/csrf.php"; $csrf_obj = new csrf(); $csrf_obj->clear_values(); $token_id = $csrf_obj->get_token_id(); $token = $csrf_obj->get_token(); $response["token_id"] = $token_id; $response["token"] = $token; echo json_encode($response); }
<?php define('IN_GB', TRUE); session_start(); include "includes/gb.class.php"; include "includes/config.php"; include "language/{$default_language}"; include "includes/rain.tpl.class.php"; include "includes/csrf.class.php"; raintpl::configure("base_url", null); raintpl::configure("tpl_dir", "themes/{$theme}/"); raintpl::configure("cache_dir", "cache/"); // Generate Token Id and Valid $csrf = new csrf(); $token_id = $csrf->get_token_id(); $token_value = $csrf->get_token($token_id); //initialize a Rain TPL object $tpl = new RainTPL(); $tpl->assign("theme", $theme); $tpl->assign("title", $title); $tpl->assign("headingtitletxt", $headingtitletxt); $tpl->assign("addentrytxt", $addentrytxt); $tpl->assign("viewguestbooktxt", $viewguestbooktxt); $tpl->assign("newpostfirsttxt", $newpostfirsttxt); $tpl->assign("newpostlasttxt", $newpostlasttxt); $tpl->assign("searchlabeltxt", $searchlabeltxt); $tpl->assign("searchbuttontxt", $searchbuttontxt); $tpl->assign("yournametxt", $yournametxt); $tpl->assign("youremailtxt", $youremailtxt); $tpl->assign("yourMessagetxt", $yourMessagetxt); $tpl->assign("yourCountrytxt", $yourCountrytxt);