Commit 3e991ffe authored by Richard Mansfield's avatar Richard Mansfield

Add sesskey in sendjsonrequest

parent f7efa3db
......@@ -175,4 +175,7 @@ if (!get_config('installed')
redirect('/admin/');
}
if (defined('JSON')) {
}
?>
......@@ -140,6 +140,7 @@ function sendjsonrequest(script, data, successcallback, errorcallback) {
var req = getXMLHttpRequest();
req.open('POST', script);
req.setRequestHeader('Content-type','application/x-www-form-urlencoded');
data.sesskey = config.sesskey;
var d = sendXMLHttpRequest(req,queryString(data));
d.addCallbacks(function (result) {
var data = evalJSONRequest(result);
......
......@@ -204,6 +204,7 @@ EOF;
$smarty->assign('THEMEURL', get_config('themeurl'));
$smarty->assign('STYLESHEETLIST', array_reverse(theme_get_url('style/style.css', null, true)));
$smarty->assign('WWWROOT', $wwwroot);
$smarty->assign('SESSKEY', $USER->get('sesskey'));
$smarty->assign('THEMELIST', json_encode($theme_list));
if (defined('TITLE')) {
......
......@@ -5,6 +5,7 @@
<script type="text/javascript">
var config = {literal}{{/literal}
'theme': {$THEMELIST},
'sesskey' : '{$SESSKEY}',
'wwwroot': '{$WWWROOT}'
{literal}}{/literal};
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment