function login_after($args) { $resource_id = $this->rcmail->config->get('protectimus_resource_id'); if (!empty($resource_id) && (!$this->rcmail->config->get('protectimus_allow_users_to_modify_authentication_enabled_state') || $this->rcmail->config->get('protectimus_allow_users_to_modify_authentication_enabled_state') && $this->rcmail->config->get('protectimus_authentication_enabled', $this->rcmail->config->get('protectimus_authentication_enabled_by_default_for_user')) == true)) { try { $api = new ProtectimusApi($this->rcmail->config->get('protectimus_api_username'), $this->rcmail->config->get('protectimus_api_key'), $this->rcmail->config->get('protectimus_api_url')); $response = $api->prepareAuthentication($resource_id, null, null, $this->rcmail->user->data['username']); if (isset($response->response->challenge)) { $_SESSION[self::PROTECTIMUS_CHALLENGE] = $response->response->challenge; } } catch (Exception $e) { } $_SESSION[self::PROTECTIMUS_OTP_CHECK] = true; $args['_task'] = null; $args['action'] = 'plugin.protectimus_otp_authentication'; return $args; } }