} $reportPath = acym_getLogPath($filename); if (!file_exists($reportPath)) { echo esc_html(acym_translation('ACYM_EXIST_LOG')); exit; } if (ACYM_CMS === 'wordpress') @ob_get_clean(); $final = acym_fileGetContent($reportPath); echo nl2br(esc_html($final)); exit; } private function loginForOAuth2(bool $isSmtp = true): void { // Step 1: prompt consent window to the user $this->store(); $redirectUrl = ''; acym_trigger('onAcymOauthAuthenticate', [&$redirectUrl, $isSmtp]); if (empty($redirectUrl)) { $this->listing(); return; } acym_redirect($redirectUrl, '', 'message', false); } public function handleOauthAuthentication(): void { // Step 2: get the access and refresh tokens after the user is redirected to the config with a code in the URL $code = acym_getVar('string', 'code'); if (empty($code)) { return; } $isSmtp = acym_getVar('string', 'auth_type', 'smtp') === 'smtp'; acym_trigger('onAcymOauthCredentialsCreation', [$isSmtp, $code]); } }