Single session Admin can be set in the misc settings
This commit is contained in:
parent
5f6b14ab7e
commit
f0da633808
@ -149,7 +149,14 @@ class Admin
|
||||
|
||||
public static function validateToken($aid, $cookieToken)
|
||||
{
|
||||
global $config;
|
||||
$query = ORM::for_table('tbl_users')->select('login_token')->findOne($aid);
|
||||
if($config['single_session'] != 'yes'){
|
||||
return true; // For multi-session, any token is valid
|
||||
}
|
||||
if(empty($query)){
|
||||
return true;
|
||||
}
|
||||
return $query->login_token === sha1($cookieToken);
|
||||
}
|
||||
}
|
||||
|
@ -849,5 +849,8 @@
|
||||
"Ask_Telegram_Community": "Ask Telegram Community",
|
||||
"Transaction_History_List": "Transaction History List",
|
||||
"Login_as_Customer": "Login as Customer",
|
||||
"info": "info"
|
||||
"info": "info",
|
||||
"Registration_code": "Registration code",
|
||||
"Admin_can_only_have_single_session_login__it_will_logout_another_session": "Admin can only have single session login, it will logout another session",
|
||||
"Single_session_Admin": "Single session Admin"
|
||||
}
|
@ -36,6 +36,21 @@
|
||||
minutes')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Single session Admin')}</label>
|
||||
<div class="col-md-6">
|
||||
<select name="single_session" id="single_session" class="form-control">
|
||||
<option value="no">
|
||||
{Lang::T('No')}</option>
|
||||
<option value="yes" {if $_c['single_session']=='yes' }selected="selected" {/if}>
|
||||
{Lang::T('Yes')}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
{Lang::T('Admin can only have single session login, it will logout another session')}
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('New Version Notification')}</label>
|
||||
<div class="col-md-6">
|
||||
|
Loading…
x
Reference in New Issue
Block a user