Skip to content
Snippets Groups Projects
Commit 42c143c3 authored by Pedro Alves's avatar Pedro Alves
Browse files

Issue #62 by pedro-alves: Adding online statistics button to module settings...

Issue #62 by pedro-alves: Adding online statistics button to module settings Statistics & Log page. Adding social links and online statistics to help page. Fixing missing space in honeypot log text. Setting characters scan as default true but they only get applied if master scan is set to true.
parent 12e1ad96
No related branches found
No related tags found
No related merge requests found
......@@ -15,14 +15,14 @@ extra_honeypot_login: '1'
extra_honeypot_registration: '1'
extra_honeypot_comment: '1'
extra_honeypot_contact: '1'
extra_contact_cyrillic: '0'
extra_contact_asian: '0'
extra_contact_arabic: '0'
extra_contact_spam: '0'
extra_comment_cyrillic: '0'
extra_comment_asian: '0'
extra_comment_arabic: '0'
extra_comment_spam: '0'
extra_contact_cyrillic: '1'
extra_contact_asian: '1'
extra_contact_arabic: '1'
extra_contact_spam: '1'
extra_comment_cyrillic: '1'
extra_comment_asian: '1'
extra_comment_arabic: '1'
extra_comment_spam: '1'
signature_registration: '1'
signature_login: '1'
signature_comment: '1'
......
......@@ -17,7 +17,7 @@ function spammaster_install() {
// Store state values.
$install_values = [
'spammaster.version' => '1.61',
'spammaster.version' => '1.62',
'spammaster.extra_cyrillic_char' => 'д,и,ж,Ч,Б',
'spammaster.extra_asian_char' => '的,是,一,不,了,人,我,在,有,他,这,为,你,出,就,那,要,自,她,于,木,作,工,程,裝,潢,統,包,室,內,設,計,家,谩,膷,艡,铆,茅,眉,ョ,プ,て,い,ン,が,る,ノ,。,ト,ự,ữ,đ,ắ,ủ,ă,ả,ạ,ơ,ố,ộ,ư,부,스,타,빗',
'spammaster.extra_arabic_char' => 'أ,ن,ا,ح,ب,ه,ل,ا,ي,ة,إ,أ,و,هَ,ج',
......@@ -42,14 +42,14 @@ function spammaster_install() {
->set('spammaster.extra_honeypot_registration', '1')
->set('spammaster.extra_honeypot_comment', '1')
->set('spammaster.extra_honeypot_contact', '1')
->set('spammaster.extra_contact_cyrillic', '0')
->set('spammaster.extra_contact_asian', '0')
->set('spammaster.extra_contact_arabic', '0')
->set('spammaster.extra_contact_spam', '0')
->set('spammaster.extra_comment_cyrillic', '0')
->set('spammaster.extra_comment_asian', '0')
->set('spammaster.extra_comment_arabic', '0')
->set('spammaster.extra_comment_spam', '0')
->set('spammaster.extra_contact_cyrillic', '1')
->set('spammaster.extra_contact_asian', '1')
->set('spammaster.extra_contact_arabic', '1')
->set('spammaster.extra_contact_spam', '1')
->set('spammaster.extra_comment_cyrillic', '1')
->set('spammaster.extra_comment_asian', '1')
->set('spammaster.extra_comment_arabic', '1')
->set('spammaster.extra_comment_spam', '1')
->set('spammaster.signature_registration', '1')
->set('spammaster.signature_login', '1')
->set('spammaster.signature_comment', '1')
......
......@@ -14,7 +14,7 @@ use Drupal\Core\Url;
function spammaster_help($process_name, RouteMatchInterface $route_match) {
// Store state version.
\Drupal::state()->set('spammaster.version', '1.61');
\Drupal::state()->set('spammaster.version', '1.62');
// Get state version.
$spammaster_version = \Drupal::state()->get('spammaster.version');
......@@ -31,7 +31,12 @@ function spammaster_help($process_name, RouteMatchInterface $route_match) {
$output_help .= t('<p>Visit <a href="@spammaster_url">Spam Master project at Drupal</a>.</p>', ['@spammaster_url' => 'https://www.drupal.org/project/spammaster']);
$output_help .= t('<p>Visit <a href="@spammaster_url">Spam Master Homepage</a>.</p>', ['@spammaster_url' => 'https://spammaster.techgasp.com/']);
$output_help .= t('<p>Visit <a href="@spammaster_url">Spam Master Documentation</a>.</p>', ['@spammaster_url' => 'https://spammaster.techgasp.com/documentation/']);
$output_help .= t('<p>Visit your website <a href="@spammaster_url">online statistics</a>.</p>', ['@spammaster_url' => 'https://spammaster.techgasp.com/websites-stats/']);
$output_help .= t('<p>Need a Full Year License? <a href="@spammaster_url">Get a full rbl license for peanuts</a>.</p>', ['@spammaster_url' => 'https://www.techgasp.com/downloads/spam-master-license/']);
$output_help .= t('<h3>Social</h3>');
$output_help .= t('<p>Like our <a href="@spammaster_url">Facebook</a> page and get the latest news.</p>', ['@spammaster_url' => 'https://www.facebook.com/TechGasp']);
$output_help .= t('<p>Follow our <a href="@spammaster_url">Twitter</a> page and get the latest news.</p>', ['@spammaster_url' => 'https://twitter.com/techgasp']);
$output_help .= t('<p>Follow our <a href="@spammaster_url">LinkedIn</a> page and get the latest news.</p>', ['@spammaster_url' => 'https://www.linkedin.com/company/techgasp']);
$output_help .= t('<h3>Configuration & Options</h3>');
$output_help .= t('<p>Spam Master settings, options and statistics are available via module administration pages.</p>');
$output_help .= t('<p>Please visit the link below.</p>');
......
......@@ -106,7 +106,7 @@ class SpamMasterBufferForm extends FormBase {
];
}
}
// Get Buffer Size.
// Get buffer size.
$spammaster_buffer_size = $this->connection->select('spammaster_threats', 'u');
$spammaster_buffer_size->fields('u', ['threat']);
$spammaster_buffer_size_result = $spammaster_buffer_size->countQuery()->execute()->fetchField();
......@@ -114,7 +114,7 @@ class SpamMasterBufferForm extends FormBase {
'#markup' => $this->t('<h2>Buffer Size: <b>@buffer_size</b></h2>', ['@buffer_size' => $spammaster_buffer_size_result]),
];
// Spam Buffer Description.
// Spam buffer description.
$form['buffer_header']['header_description'] = [
'#markup' => $this->t('<p>Spam Master Buffer greatly reduces server resources like cpu, memory and bandwidth by doing fast local machine checks. Also prevents major attacks like flooding, DoS , etc. via Spam Master Firewall.</p>'),
];
......
......@@ -133,6 +133,11 @@ class SpamMasterLogForm extends ConfigFormBase {
'#open' => TRUE,
];
// Form description.
$form['statistics_header']['header_description'] = [
'#markup' => $this->t('<p>Click the button below to check your local statistics. In order to access your online statistics you need to login into Spam Master website with the correct email. Trial licenses login with your Administration Email Address found in Configuration -> Basic site settings. Full licenses login with the email used during license purchase, it costs peanuts per year. <a href="@spammaster_url">Visit online statistics</a>.</p>', ['@spammaster_url' => 'https://spammaster.techgasp.com/websites-stats/']),
];
// Create buttons table.
$form['statistics_header']['buttons'] = [
'#type' => 'table',
......@@ -144,7 +149,7 @@ class SpamMasterLogForm extends ConfigFormBase {
'#attributes' => [
'class' => ['button button--primary'],
],
'#value' => $this->t('Visit your Statistics Page'),
'#value' => $this->t('Visit Local Statistics Page'),
'#submit' => ['::spamMasterStatisticsPage'],
];
// Insert addrow firewall button.
......
......@@ -172,7 +172,7 @@ class SpamMasterHoneypotService {
// Web api check. Create data to be posted to verify rbl listings.
$blog_threat_type = 'honeypot';
$blog_threat_content = 'Page: ' . $spammasterpage . 'Field 1: ' . $spammasterextrafield1 . 'Field 2: ' . $spammasterextrafield2;
$blog_threat_content = 'Page: ' . $spammasterpage . ' Field 1: ' . $spammasterextrafield1 . ' Field 2: ' . $spammasterextrafield2;
$spammasteremail = 'drup@' . date('Ymdhis') . '.drup';
$blog_web_address = $this->requestStack->getCurrentRequest()->getHost();
$address_unclean = $blog_web_address;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment