if ($targetPage == Router::$PAGE_LOGIN)
{
if ($conf->get('security.open_shaarli')) { header('Location: ?'); exit; } // No need to login for open Shaarli
- $token=''; if (ban_canLogin($conf)) $token=getToken($conf); // Do not waste token generation if not useful.
- $PAGE->assign('token',$token);
if (isset($_GET['username'])) {
$PAGE->assign('username', escape($_GET['username']));
}
}
else // show the change password form.
{
- $PAGE->assign('token',getToken($conf));
$PAGE->renderPage('changepassword');
exit;
}
}
else // Show the configuration form.
{
- $PAGE->assign('token',getToken($conf));
$PAGE->assign('title', $conf->get('general.title'));
$PAGE->assign('redirector', $conf->get('redirector.url'));
list($timezone_form, $timezone_js) = generateTimeZoneForm($conf->get('general.timezone'));
if ($targetPage == Router::$PAGE_CHANGETAG)
{
if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
- $PAGE->assign('token', getToken($conf));
$PAGE->assign('tags', $LINKSDB->allTags());
$PAGE->renderPage('changetag');
exit;
$data = array(
'link' => $link,
'link_is_new' => false,
- 'token' => getToken($conf),
'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
'tags' => $LINKSDB->allTags(),
);
$data = array(
'link' => $link,
'link_is_new' => $link_is_new,
- 'token' => getToken($conf), // XSRF protection.
'http_referer' => (isset($_SERVER['HTTP_REFERER']) ? escape($_SERVER['HTTP_REFERER']) : ''),
'source' => (isset($_GET['source']) ? $_GET['source'] : ''),
'tags' => $LINKSDB->allTags(),
// -------- Show upload/import dialog:
if ($targetPage == Router::$PAGE_IMPORT)
{
- $PAGE->assign('token',getToken($conf));
$PAGE->assign('maxfilesize',getMaxFileSize());
$PAGE->renderPage('import');
exit;
'search_term' => $searchterm,
'search_tags' => $searchtags,
'redirector' => $conf->get('redirector.url'), // Optional redirector URL.
- 'token' => $token,
'links' => $linkDisp,
'tags' => $LINKSDB->allTags(),
);