partial #3057
This commit is contained in:
parent
38e580855b
commit
c3f07aed40
@ -26,6 +26,19 @@ class Cockpit_Auth extends Crunchbutton_Auth_Base {
|
|||||||
if ($this->user()->id_admin) {
|
if ($this->user()->id_admin) {
|
||||||
c::admin($this->user());
|
c::admin($this->user());
|
||||||
}
|
}
|
||||||
|
$ghost = $_GET['_ghost'];
|
||||||
|
if (!$ghost) {
|
||||||
|
$ghost = $_COOKIE['_ghost'];
|
||||||
|
}
|
||||||
|
if ($ghost && $ghost != 'ME') {
|
||||||
|
$u = new Admin($ghost);
|
||||||
|
if ($u->id_admin) {
|
||||||
|
$this->user($u);
|
||||||
|
setcookie('_ghost', $u->id_admin, (new DateTime('3000-01-01'))->getTimestamp(), '/');
|
||||||
|
}
|
||||||
|
} elseif ($ghost == 'ME') {
|
||||||
|
setcookie('_ghost', '', (new DateTime('1999-01-01'))->getTimestamp(), '/');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUser($user) {
|
public function setUser($user) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user