mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 08:10:12 +01:00
gui: demo mode fix
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
1192fc3218
commit
08fbbe46c7
@ -84,6 +84,10 @@ class ModelUserPrefs extends Model {
|
|||||||
public function toggle_ga($username = '', $ga_enabled = '') {
|
public function toggle_ga($username = '', $ga_enabled = '') {
|
||||||
if($username == "" || $ga_enabled < 0 || $ga_enabled > 1) { return 0; }
|
if($username == "" || $ga_enabled < 0 || $ga_enabled > 1) { return 0; }
|
||||||
|
|
||||||
|
// In demo mode you can't enable Google AUthenticator since other users
|
||||||
|
// would NOT be able to login without the GA secret
|
||||||
|
if(DEMO_MODE && in_array($username, ['admin@local', 'auditor@local'])) { return 1; }
|
||||||
|
|
||||||
$query = $this->db->query("UPDATE " . TABLE_USER_SETTINGS . " SET ga_enabled=? WHERE username=?", array($ga_enabled, $username));
|
$query = $this->db->query("UPDATE " . TABLE_USER_SETTINGS . " SET ga_enabled=? WHERE username=?", array($ga_enabled, $username));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user