Commit 7140f879 authored by jonnybradley's avatar jonnybradley

[FIX] $cookietab being reset if page loaded by AJAX - now checks first

(but i suspect most of this cookie code could go now we're using Smarty {tabset}?)
parent 2150dc3f
......@@ -682,7 +682,7 @@ if (isset($_REQUEST['graph'])) {
$galleries = $imagegallib->list_visible_galleries(0, -1, 'name_asc', $user, '');
$smarty->assign('galleries', $galleries['data']);
}
$cookietab = 1;
if (!isset($cookietab)) { $cookietab = '1'; }
setcookie('tab', $cookietab);
$smarty->assign('cookietab', $cookietab);
if (isset($_REQUEST['time'])) $smarty->assign('time', $_REQUEST['time']);
......
......@@ -140,7 +140,7 @@ if ($_REQUEST["calendarId"]) {
if (!empty($_REQUEST['show']) && $_REQUEST['show'] == 'mod') {
$cookietab = '2';
} else {
$cookietab = 1;
if (!isset($cookietab)) { $cookietab = '1'; }
}
}
if ($prefs['feature_groupalert'] == 'y') {
......
......@@ -47,7 +47,7 @@ if (!empty($_REQUEST['duplicate']) && !empty($_REQUEST['name']) && !empty($_REQU
if (!empty($_REQUEST['show']) && $_REQUEST['show'] == 'mod') {
$cookietab = '2';
} else {
$cookietab = '1';
if (!isset($cookietab)) { $cookietab = '1'; }
}
if (isset($_REQUEST["remove"])) {
$area = 'deltracker';
......
......@@ -11,7 +11,7 @@ if ($tiki_p_admin != 'y') {
$smarty->display("error.tpl");
die;
}
$cookietab = "1";
if (!isset($cookietab)) { $cookietab = '1'; }
list($trackers, $ag_utracker, $ag_ufield, $ag_gtracker, $ag_gfield, $ag_rufields) = array(
array() ,
0,
......@@ -249,7 +249,7 @@ if (!empty($_REQUEST["group"])) {
foreach($allgroups as $rr) {
$inc["$rr"] = "n";
}
$cookietab = "1";
if (!isset($cookietab)) { $cookietab = '1'; }
$_REQUEST["group"] = 0;
}
if (isset($_REQUEST['add'])) {
......
......@@ -142,7 +142,7 @@ $auto_query_args = array(
'initial',
'filterGroup'
);
$cookietab = "1";
if (!isset($cookietab)) { $cookietab = '1'; }
if (isset($_REQUEST['batch']) && is_uploaded_file($_FILES['csvlist']['tmp_name'])) {
check_ticket('admin-users');
batchImportUsers();
......@@ -549,7 +549,7 @@ if (isset($_REQUEST["user"]) and $_REQUEST["user"]) {
$userinfo['registrationDate'] = '';
$userinfo['age'] = '';
$userinfo['currentLogin'] = '';
$cookietab = "1";
if (!isset($cookietab)) { $cookietab = '1'; }
$_REQUEST["user"] = 0;
}
if (isset($_REQUEST['add'])) {
......
......@@ -32,7 +32,7 @@ $iCalAdvParamsUrl = 'tiki-calendar_params_ical.php';
$bufid = array();
$bufdata = array();
$modifiable = array();
$cookietab = 1;
if (!isset($cookietab)) { $cookietab = '1'; }
$rawcals = $calendarlib->list_calendars();
$viewOneCal = $tiki_p_view_calendar;
$modifTab = 0;
......
......@@ -20,7 +20,7 @@ if ($tiki_p_view != 'y') {
$smarty->display("error.tpl");
die;
}
$cookietab = 1;
if (!isset($cookietab)) { $cookietab = '1'; }
if (!isset($_REQUEST['printpages']) && !isset($_REQUEST['printstructures'])) {
$printpages = array();
$printstructures = array();
......
......@@ -56,7 +56,7 @@ if (!empty($_REQUEST['show']) && $_REQUEST['show'] == 'view') {
} elseif (empty($_REQUEST['cookietab'])) {
if ($tracker_info['writerCanModify'] == 'y' && $user) $cookietab = '1';
elseif (!($tiki_p_view_trackers == 'y' || $tiki_p_admin == 'y' || $tiki_p_admin_trackers == 'y') && $tiki_p_create_tracker_items == 'y') $cookietab = "2";
else $cookietab = "1";
else if (!isset($cookietab)) { $cookietab = '1'; }
} else {
$cookietab = $_REQUEST['cookietab'];
}
......
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