mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 14:13:46 +09:00
- added UM setting;
This commit is contained in:
@@ -187,6 +187,11 @@ if ( ! class_exists( 'um\core\Permalinks' ) ) {
|
||||
wp_die( __( 'This activation link is expired or have already been used.', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
$account_secret_hash_expiry = get_user_meta( $user_id, 'account_secret_hash_expiry', true );
|
||||
if ( ! empty( $account_secret_hash_expiry ) && time() > $account_secret_hash_expiry ) {
|
||||
wp_die( __( 'This activation link is expired.', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
um_fetch_user( $user_id );
|
||||
UM()->user()->approve();
|
||||
um_reset_user();
|
||||
|
||||
@@ -1336,6 +1336,13 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
$this->profile['account_secret_hash'] = UM()->validation()->generate();
|
||||
$this->update_usermeta_info( 'account_secret_hash' );
|
||||
|
||||
$expiry_time = UM()->options()->get( 'activation_link_expiry_time' );
|
||||
if ( ! empty( $expiry_time ) && is_numeric( $expiry_time ) ) {
|
||||
$this->profile['account_secret_hash_expiry'] = time() + $expiry_time;
|
||||
$this->update_usermeta_info( 'account_secret_hash_expiry' );
|
||||
}
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
@@ -1436,6 +1443,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
$this->set_status( 'approved' );
|
||||
$this->delete_meta( 'account_secret_hash' );
|
||||
$this->delete_meta( 'account_secret_hash_expiry' );
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
|
||||
Reference in New Issue
Block a user