tp_auth_factory = &$tp_auth_factory; } /** * Executes either a service authentication or invalidation depending on the request * * @return array */ public function run() { $errors = 0; try { $message = $this->action(); } catch ( Exception $e ) { $message = $this->error_message(); $errors = 1; } return array( 'errors' => $errors, 'message' => $message, 'reload' => $errors ? 0 : 1 ); } /** * @return string the success message for the action */ protected abstract function action(); /** * @return string the error message for the action */ protected abstract function error_message(); }