WP_PLUGIN 自動ログアウト拡張

初回コミット
This commit is contained in:
2021-06-29 15:49:09 +09:00
commit 6d4b4c813d
13 changed files with 535 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
<?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() {
//ログイン+一時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();
}
}
}
}