Files
Auto_Logout_Extended/trait/al_ext_force_trait.php
T
nobu adc35d3e8a AUTO LOGOUT EXTENDED
自動ログアウト除外ユーザ設定を追加
2021-07-02 18:54:27 +09:00

40 lines
905 B
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
if ( ! trait_exists( 'al_ext_force_trait' ) ) {
/**
* 自動ログアウト
* Trait al_ext_force_trait
*/
trait al_ext_force_trait {
/**
* 自動ログアウトの一時Cookie作成
*/
public function set_force_al_ext_cookie() {
//自動ログアウト除外ユーザの判定
if($this->is_exclude_user()){
return;
}
//ログイン+一時Cookieが存在する場合、一時Cookieを更新する
if ( isset( $_COOKIE[ al_ext_config::AL_EXT_TMP_COOKIE ] ) && is_user_logged_in() ) {
$this->create_tmp_cookie();
}
}
/**
* 自動ログアウトのログイン:remembermeを元に一時Cookieを作成
*/
public function my_force_login() {
if ( isset( $_POST['rememberme'] ) ) {
//一時ログインCookieを生成
$this->create_tmp_cookie();
}
}
}
}