Skip to content

Commit

Permalink
FIX #1069
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrichblock committed Jan 20, 2018
1 parent 6e5db39 commit 1f42c4f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions switch.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@
$pa = User_Permissions($admin_id);

if (!$pa['user'] and !$pa['gserver'] and !$pa['root']) {
die('No access');
die('No access');
}

if ($reseller_id != 0 and isset($admin_id) and $admin_id != $reseller_id) {
$reseller_id = $admin_id;
if (isset($reseller_id) and $reseller_id != 0 and isset($admin_id) and $admin_id != $reseller_id) {
$reseller_id = $admin_id;
}

if ($ui->id('id', 19, 'get')) {
$referrer = explode('/', str_replace(array('http://','https://'), '', strtolower($ui->escaped('HTTP_REFERER', 'server'))));

$referrer = explode('/', str_replace(array('http://','https://'), '', strtolower($ui->escaped('HTTP_REFERER', 'server'))));
$refstring = explode('?', $referrer[1]);

if (isset($refstring[1])) {
Expand All @@ -70,7 +71,7 @@

$sql = null;

if ($row['accounttype'] == 'u' && $row['resellerid'] == $reseller_id) {
if ($row['accounttype'] == 'u' and $row['resellerid'] == $reseller_id) {

$_SESSION['userid'] = $ui->id('id', 19, 'get');

Expand Down Expand Up @@ -102,5 +103,7 @@

}
}

$sql = null;

redirect('login.php');

0 comments on commit 1f42c4f

Please sign in to comment.