Files
2024_WEBSITE_fipf/plugins/cipf_plugin/php/profs_handle_states.php
asus ade0be87ce updated plgntls :
- renamed PLGNTLS_class -> Plgntls
- changed method 'add_to_front()' to static method
- moved fetch script as inline script, so the plgntls file is single
- improved the way inline script and styles are added
2024-03-29 21:56:12 +01:00

67 lines
1.1 KiB
PHP

<?php
/*
* it means someone outside wp is accessing the file, in this case kill it.
*/
if (!defined('ABSPATH')) {
die('You can not access this file!');
}
/*
* if field transfert-validation is not checked, do nothing
* else
* first reset the field
* then
* if no transfert was waiting, do nothing
* when transfert is validate :
* - change card to valid
* - update date
*
*/
function handle_transfert_validation_CIPF($user_id) {
Plgntls::debug_infos();
if (false === is_transfert_success_CIPF($user_id)) {
return;
}
reset_acf_transfert_CIPF($user_id);
if (false === is_account_waiting_transfert_CIPF($user_id)) {
return;
}
set_account_valid_CIPF($user_id);
update_card_expiration_CIPF($user_id);
}
/*
* if card expire, makes some changes
*
*/
function handle_card_expire_CIPF($user_id) {
Plgntls::debug_infos();
if (false === card_date_exists_CIPF($user_id)) {
return;
}
if (false === is_card_date_expired_CIPF($user_id)) {
return;
}
if (false === is_account_expired_CIPF($user_id)) {
set_account_expired_CIPF($user_id);
}
if (is_account_waiting_valid_CIPF($user_id)) {
set_account_waiting_invalid_CIPF($user_id);
}
}
?>