Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-e committed Jan 4, 2016
1 parent 44e3e22 commit 040fa87
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 101 deletions.
10 changes: 5 additions & 5 deletions content/content.banned_ips.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct() {
parent::__construct(); parent::__construct();


$this->_cols = array( $this->_cols = array(
'IP' => __('IP Address'), 'IP' => __('IP Address'),
'RawIP' => __('Raw IP value'), 'RawIP' => __('Raw IP value'),
'Username' => __('Username'), 'Username' => __('Username'),
'FailedCount' => __('Failed Count'), 'FailedCount' => __('Failed Count'),
Expand All @@ -36,11 +36,11 @@ public function __construct() {
/** /**
* Builds the content view * Builds the content view
*/ */
public function __viewIndex() { public function __viewIndex() {
// Get data // Get data
$this->_data = ABF::instance()->getFailures('IP ASC'); $this->_data = ABF::instance()->getFailures('IP ASC');
$this->_hasData = is_array($this->_data) && count($this->_data) > 0; $this->_hasData = is_array($this->_data) && count($this->_data) > 0;

// Build the page // Build the page
$title = __('Banned IPs'); $title = __('Banned IPs');


Expand Down
10 changes: 5 additions & 5 deletions content/content.colored_lists.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function __viewIndex() {


// insert form // insert form
$insertLine = $this->buildInsertForm(); $insertLine = $this->buildInsertForm();

// append actions // append actions
$insertLine->appendChild( $insertLine->appendChild(
ViewFactory::buildActions($this->_hasData) ViewFactory::buildActions($this->_hasData)
Expand Down Expand Up @@ -185,19 +185,19 @@ public function __actionApply() {
public function __actionInsert() { public function __actionInsert() {
if (is_array($_POST['insert']) && isset($_POST['insert']['ip'])) { if (is_array($_POST['insert']) && isset($_POST['insert']['ip'])) {
$ip = $_POST['insert']['ip']; $ip = $_POST['insert']['ip'];

// protection for not entering the users ip // protection for not entering the users ip
// since ip='' will become his ip // since ip='' will become his ip
if (ABF::instance()->isIPValid($ip)) { if (ABF::instance()->isIPValid($ip)) {

// temporary fix for getting the author // temporary fix for getting the author
$author = null; $author = null;
if (is_callable(array('Symphony', 'Author'))) { if (is_callable(array('Symphony', 'Author'))) {
$author = Symphony::Author(); $author = Symphony::Author();
} else { } else {
$author = Administration::instance()->Author; $author = Administration::instance()->Author;
} }

try { try {
$author = $author->getFullName(); $author = $author->getFullName();
$ret = ABF::instance()->registerToList( $ret = ABF::instance()->registerToList(
Expand Down
12 changes: 6 additions & 6 deletions content/content.login.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private function __sendEmail() {


$author = Symphony::Database()->fetchRow(0, "SELECT `id`, `email`, `first_name` FROM `tbl_authors` WHERE `email` = '".MySQL::cleanValue($_POST['email'])."'"); $author = Symphony::Database()->fetchRow(0, "SELECT `id`, `email`, `first_name` FROM `tbl_authors` WHERE `email` = '".MySQL::cleanValue($_POST['email'])."'");
$failure = ABF::instance()->getFailureByIp(); $failure = ABF::instance()->getFailureByIp();

$emailSettings = ABF::instance()->getEmailSettings(); $emailSettings = ABF::instance()->getEmailSettings();


if (is_array($author) && isset($author['email']) && if (is_array($author) && isset($author['email']) &&
Expand All @@ -149,16 +149,16 @@ private function __sendEmail() {
try { try {
// use default values // use default values
$email = Email::create(); $email = Email::create();

// if no default values are set // if no default values are set
if (!is_array($emailSettings) || empty($emailSettings['from_address'])) { if (!is_array($emailSettings) || empty($emailSettings['from_address'])) {
$email->setFrom($author['email'], Symphony::Configuration()->get('sitename','general')); $email->setFrom($author['email'], Symphony::Configuration()->get('sitename','general'));
} }
// use default settings, as this should help with SPF and DKIM // use default settings, as this should help with SPF and DKIM
else { else {
$email->setFrom($emailSettings['from_address'], $emailSettings['from_name']); $email->setFrom($emailSettings['from_address'], $emailSettings['from_name']);
} }

$email->recipients = $author['email']; $email->recipients = $author['email'];
$email->subject = __('Unban IP link'); $email->subject = __('Unban IP link');
$email->text_plain = $email->text_plain =
Expand All @@ -172,7 +172,7 @@ private function __sendEmail() {


} catch (Exception $e) { } catch (Exception $e) {
//var_dump($e); //var_dump($e);

// do nothing // do nothing
$this->_email_sent = false; $this->_email_sent = false;
} }
Expand All @@ -182,4 +182,4 @@ private function __sendEmail() {
private function __unban($hash) { private function __unban($hash) {
ABF::instance()->unregisterFailure($hash); ABF::instance()->unregisterFailure($hash);
} }
} }
4 changes: 2 additions & 2 deletions extension.driver.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function addCustomPreferenceFieldsets($context) {
$wrapper->appendChild(ViewFactory::generateField(ABF::SETTING_GL_DURATION, 'Gray list duration <em>in days</em>', $this->hasErrors(), $this->errors)); $wrapper->appendChild(ViewFactory::generateField(ABF::SETTING_GL_DURATION, 'Gray list duration <em>in days</em>', $this->hasErrors(), $this->errors));


$out_wrapper->appendChild($wrapper); $out_wrapper->appendChild($wrapper);

// create a new wrapper // create a new wrapper
$wrapper = new XMLElement('div'); $wrapper = new XMLElement('div');
$wrapper->setAttribute('class', 'two columns'); $wrapper->setAttribute('class', 'two columns');
Expand Down Expand Up @@ -349,4 +349,4 @@ public function save(&$context){
ABF::instance()->removeExpiredEntries(); ABF::instance()->removeExpiredEntries();
} }
} }
} }
Loading

0 comments on commit 040fa87

Please sign in to comment.