/** * Removes all logs from the db if any exist and the user has the proper permissions * * @throws HttpException */ public function actionDeleteLogs() { $this->requireAdmin(); $this->requirePostRequest(); $confirmation = craft()->request->getPost('confirmation', false); if ($confirmation) { $deleted = spamGuard()->deleteLogs(); if ($deleted) { craft()->userSession->setNotice(Craft::t('All logs were deleted successfully.')); } else { craft()->userSession->setError(Craft::t('Unable to delete all logs.')); } } else { craft()->userSession->setError(Craft::t('Please check the box to confirm this action.')); } $this->redirectToPostedUrl(); }
/** * @return string */ public function getSettingsHtml() { craft()->templates->includeCssResource('spamguard/css/spamguard.css'); return craft()->templates->render('spamguard/_settings', spamGuard()->getTemplateVariables()); }