'check_platform_legal_conditions', 'url' => api_get_path(WEB_CODE_PATH).'auth/inscription.php', ] ); //array_push($login_conditions, array( // 'conditional_function' => 'dc_check_phone_number', // 'url' => api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php' //)); function dc_check_phone_number($user) { $uInfo = api_get_user_info($user['user_id']); if (empty($uInfo['phone'])) { return false; } return true; } /** * Checks if the user accepted or not the legal conditions. * * @param array $user * * @return bool true if user pass, false otherwise */ function check_platform_legal_conditions($user) { if (api_get_setting('allow_terms_conditions') === 'true' && api_get_setting('load_term_conditions_section') === 'login' ) { $termAndConditionStatus = api_check_term_condition($user['user_id']); // @todo not sure why we need the login password and update_term_status if ($termAndConditionStatus === false) { Session::write('term_and_condition', ['user_id' => $user['user_id']]); return false; } else { Session::erase('term_and_condition'); return true; } } else { // No validation user can pass return true; } }