Permalink
Browse files

Whitespace

  • Loading branch information...
michael-e committed Jan 4, 2016
1 parent 44e3e22 commit 040fa87eb7e1b89365aeb0c8060f031b6b399c74
@@ -23,7 +23,7 @@ public function __construct() {
parent::__construct();
$this->_cols = array(
'IP' => __('IP Address'),
'IP' => __('IP Address'),
'RawIP' => __('Raw IP value'),
'Username' => __('Username'),
'FailedCount' => __('Failed Count'),
@@ -36,11 +36,11 @@ public function __construct() {
/**
* Builds the content view
*/
public function __viewIndex() {
// Get data
public function __viewIndex() {
// Get data
$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
$title = __('Banned IPs');
@@ -95,7 +95,7 @@ public function __viewIndex() {
// insert form
$insertLine = $this->buildInsertForm();
// append actions
$insertLine->appendChild(
ViewFactory::buildActions($this->_hasData)
@@ -185,19 +185,19 @@ public function __actionApply() {
public function __actionInsert() {
if (is_array($_POST['insert']) && isset($_POST['insert']['ip'])) {
$ip = $_POST['insert']['ip'];
// protection for not entering the users ip
// since ip='' will become his ip
if (ABF::instance()->isIPValid($ip)) {
if (ABF::instance()->isIPValid($ip)) {
// temporary fix for getting the author
$author = null;
if (is_callable(array('Symphony', 'Author'))) {
$author = Symphony::Author();
} else {
$author = Administration::instance()->Author;
}
try {
$author = $author->getFullName();
$ret = ABF::instance()->registerToList(
View
@@ -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'])."'");
$failure = ABF::instance()->getFailureByIp();
$emailSettings = ABF::instance()->getEmailSettings();
if (is_array($author) && isset($author['email']) &&
@@ -149,16 +149,16 @@ private function __sendEmail() {
try {
// use default values
$email = Email::create();
// if no default values are set
if (!is_array($emailSettings) || empty($emailSettings['from_address'])) {
$email->setFrom($author['email'], Symphony::Configuration()->get('sitename','general'));
}
// use default settings, as this should help with SPF and DKIM
else {
else {
$email->setFrom($emailSettings['from_address'], $emailSettings['from_name']);
}
$email->recipients = $author['email'];
$email->subject = __('Unban IP link');
$email->text_plain =
@@ -172,7 +172,7 @@ private function __sendEmail() {
} catch (Exception $e) {
//var_dump($e);
// do nothing
$this->_email_sent = false;
}
@@ -182,4 +182,4 @@ private function __sendEmail() {
private function __unban($hash) {
ABF::instance()->unregisterFailure($hash);
}
}
}
View
@@ -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));
$out_wrapper->appendChild($wrapper);
// create a new wrapper
$wrapper = new XMLElement('div');
$wrapper->setAttribute('class', 'two columns');
@@ -349,4 +349,4 @@ public function save(&$context){
ABF::instance()->removeExpiredEntries();
}
}
}
}
Oops, something went wrong.

0 comments on commit 040fa87

Please sign in to comment.