mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16533] Add set_login_key() event
PHPBB3-16533
This commit is contained in:
parent
5a33a141af
commit
946da08304
1 changed files with 24 additions and 1 deletions
|
@ -1457,7 +1457,7 @@ class session
|
|||
*/
|
||||
function set_login_key($user_id = false, $key = false, $user_ip = false)
|
||||
{
|
||||
global $db;
|
||||
global $db, $phpbb_dispatcher;
|
||||
|
||||
$user_id = ($user_id === false) ? $this->data['user_id'] : $user_id;
|
||||
$user_ip = ($user_ip === false) ? $this->ip : $user_ip;
|
||||
|
@ -1489,6 +1489,29 @@ class session
|
|||
{
|
||||
$sql = 'INSERT INTO ' . SESSIONS_KEYS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Event to adjust autologin keys process
|
||||
*
|
||||
* @event core.set_login_key
|
||||
* @var string|false key Current autologin key if exists, false otherwise
|
||||
* @var string key_id New autologin key
|
||||
* @var string sql SQL query to update/insert autologin key
|
||||
* @var array sql_ary Aray with autologin key data
|
||||
* @var int user_id Current user's ID
|
||||
* @var string user_ip Current user's IP address
|
||||
* @since 3.3.2-RC1
|
||||
*/
|
||||
$vars = [
|
||||
'key',
|
||||
'key_id',
|
||||
'sql',
|
||||
'sql_ary',
|
||||
'user_id',
|
||||
'user_ip',
|
||||
];
|
||||
extract($phpbb_dispatcher->trigger_event('core.set_login_key', compact($vars)));
|
||||
|
||||
$db->sql_query($sql);
|
||||
|
||||
$this->cookie_data['k'] = $key_id;
|
||||
|
|
Loading…
Add table
Reference in a new issue