Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -93,14 +93,14 @@ class spam extends Controller
|
||||
/* Work out output */
|
||||
$methodFunction = '_manage' . IPS::mb_ucfirst( $this->activeTab );
|
||||
$activeTabContents = $this->$methodFunction();
|
||||
|
||||
|
||||
/* If this is an AJAX request, just return it */
|
||||
if( Request::i()->isAjax() )
|
||||
{
|
||||
Output::i()->output = $activeTabContents;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Build tab list */
|
||||
$tabs = array();
|
||||
$tabs['captcha'] = 'spamprevention_captcha';
|
||||
@@ -136,7 +136,7 @@ class spam extends Controller
|
||||
'link' => Url::internal( 'app=core&module=moderation&controller=spam&do=whitelist' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'membertools_delete' ) )
|
||||
{
|
||||
Output::i()->sidebar['actions']['delete_guest_content'] = array(
|
||||
@@ -146,7 +146,7 @@ class spam extends Controller
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => Member::loggedIn()->language()->addToStack('member_delete_guest_content') )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* Display */
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('menu__core_moderation_spam');
|
||||
Output::i()->output = Theme::i()->getTemplate( 'global' )->tabs( $tabs, $this->activeTab, $activeTabContents, Url::internal( "app=core&module=moderation&controller=spam" ) );
|
||||
@@ -220,7 +220,7 @@ class spam extends Controller
|
||||
$form->add( new CheckboxSet( 'spm_option', explode( ',', Settings::i()->spm_option ), FALSE, array(
|
||||
'options' => array( 'disable' => 'spm_option_disable', 'unapprove' => 'spm_option_unapprove', 'delete' => 'spm_option_delete', 'ban' => 'spm_option_ban' ),
|
||||
) ) );
|
||||
|
||||
|
||||
/* Save values */
|
||||
if ( $form->values() )
|
||||
{
|
||||
@@ -239,7 +239,7 @@ class spam extends Controller
|
||||
protected function _manageService() : string
|
||||
{
|
||||
$licenseData = IPS::licenseKey();
|
||||
|
||||
|
||||
/* Build Form */
|
||||
$actions = array( 1 => 'spam_service_act_1', 5 => 'spam_service_act_5', 2 => 'spam_service_act_2', 3 => 'spam_service_act_3', 4 => 'spam_service_act_4' );
|
||||
$days = json_decode( Settings::i()->spam_service_days, TRUE );
|
||||
@@ -253,14 +253,12 @@ class spam extends Controller
|
||||
$disabled = TRUE;
|
||||
if( !Settings::i()->ipb_reg_number )
|
||||
{
|
||||
Member::loggedIn()->language()->words['spam_service_enabled_desc'] = Member::loggedIn()->language()->addToStack( 'spam_service_nokey', FALSE, array( 'sprintf' => array( Url::internal( 'app=core&module=settings&controller=licensekey' ) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Member::loggedIn()->language()->words['spam_service_enabled_desc'] = Member::loggedIn()->language()->addToStack( 'spam_service_noservice' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$form->add( new YesNo( 'spam_service_enabled', Settings::i()->spam_service_enabled, FALSE, array( 'disabled' => $disabled, 'togglesOn' => array( 'spam_service_send_to_ips', 'spam_service_action_0', 'spam_service_action_1', 'spam_service_action_2', 'spam_service_action_3', 'spam_service_action_4', 'spam_service_disposable' ) ) ) );
|
||||
$form->add( new YesNo( 'spam_service_send_to_ips', Settings::i()->spam_service_send_to_ips, FALSE, array( 'disabled' => $disabled ), NULL, NULL, NULL, 'spam_service_send_to_ips' ) );
|
||||
$form->add( new Select( 'spam_service_action_1', Settings::i()->spam_service_action_1, FALSE, array( 'disabled' => $disabled, 'options' => $actions, 'toggles' => array( '5' => array( 'spam_service_action_1_num' ) ) ), NULL, NULL, NULL, 'spam_service_action_1' ) );
|
||||
@@ -289,7 +287,7 @@ class spam extends Controller
|
||||
|
||||
unset( $values['spam_service_' . $num . '_num' ] );
|
||||
}
|
||||
|
||||
|
||||
$values['spam_service_days'] = json_encode( $values['spam_service_days'] );
|
||||
|
||||
$form->saveAsSettings( $values );
|
||||
@@ -324,7 +322,7 @@ class spam extends Controller
|
||||
$table->sortBy = $table->sortBy ?: 'qa_question';
|
||||
$table->quickSearch = array( 'word_custom', 'qa_question' );
|
||||
$table->sortDirection = $table->sortDirection ?: 'asc';
|
||||
|
||||
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'core', 'moderation', 'qanda_add' ) )
|
||||
{
|
||||
$table->rootButtons = array(
|
||||
@@ -339,7 +337,7 @@ class spam extends Controller
|
||||
$table->rowButtons = function( $row )
|
||||
{
|
||||
$return = array();
|
||||
|
||||
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'core', 'moderation', 'qanda_edit' ) )
|
||||
{
|
||||
$return['edit'] = array(
|
||||
@@ -348,7 +346,7 @@ class spam extends Controller
|
||||
'link' => Url::internal( 'app=core&module=moderation&controller=spam&do=question&id=' ) . $row['qa_id'],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ( Member::loggedIn()->hasAcpRestriction( 'core', 'moderation', 'qanda_delete' ) )
|
||||
{
|
||||
$return['delete'] = array(
|
||||
@@ -358,7 +356,7 @@ class spam extends Controller
|
||||
'data' => array( 'delete' => '' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
};
|
||||
|
||||
@@ -402,7 +400,7 @@ class spam extends Controller
|
||||
$save = array(
|
||||
'qa_answers' => json_encode( $values['qa_answers'] ),
|
||||
);
|
||||
|
||||
|
||||
if ( $id )
|
||||
{
|
||||
Db::i()->update( 'core_question_and_answer', $save, array( 'qa_id=?', $question['qa_id'] ) );
|
||||
@@ -414,7 +412,7 @@ class spam extends Controller
|
||||
$id = Db::i()->insert( 'core_question_and_answer', $save );
|
||||
Session::i()->log( 'acplogs__question_added' );
|
||||
}
|
||||
|
||||
|
||||
Lang::saveCustom( 'core', "core_question_and_answer_{$id}", $values['qa_question'] );
|
||||
|
||||
Output::i()->redirect( Url::internal( 'app=core&module=moderation&controller=spam&tab=qanda' ), 'saved' );
|
||||
@@ -441,13 +439,13 @@ class spam extends Controller
|
||||
|
||||
Db::i()->delete( 'core_question_and_answer', array( 'qa_id=?', $id ) );
|
||||
Session::i()->log( 'acplogs__question_deleted' );
|
||||
|
||||
|
||||
Lang::deleteCustom( 'core', "core_question_and_answer_{$id}" );
|
||||
|
||||
/* And redirect */
|
||||
Output::i()->redirect( Url::internal( "app=core&module=moderation&controller=spam&tab=qanda" ) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Spam Service Log
|
||||
*
|
||||
@@ -456,18 +454,18 @@ class spam extends Controller
|
||||
protected function serviceLogs() : void
|
||||
{
|
||||
Dispatcher::i()->checkAcpPermission( 'spam_service_log' );
|
||||
|
||||
|
||||
/* Create the table */
|
||||
$table = new TableDb( 'core_spam_service_log', Url::internal( 'app=core&module=moderation&controller=spam&do=serviceLogs' ) );
|
||||
|
||||
|
||||
$table->langPrefix = 'spamlogs_';
|
||||
|
||||
|
||||
/* Columns we need */
|
||||
$table->include = array( 'log_date', 'log_code', 'email_address', 'ip_address' );
|
||||
|
||||
|
||||
$table->sortBy = $table->sortBy ?: 'log_date';
|
||||
$table->sortDirection = $table->sortDirection ?: 'DESC';
|
||||
|
||||
|
||||
/* Search */
|
||||
$table->advancedSearch = array(
|
||||
'email_address' => SEARCH_CONTAINS_TEXT,
|
||||
@@ -476,7 +474,7 @@ class spam extends Controller
|
||||
);
|
||||
|
||||
$table->quickSearch = 'email_address';
|
||||
|
||||
|
||||
/* Custom parsers */
|
||||
$table->parsers = array(
|
||||
'log_date' => function( $val )
|
||||
@@ -484,7 +482,7 @@ class spam extends Controller
|
||||
return DateTime::ts( $val )->localeDate();
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
/* Add a button for settings */
|
||||
Output::i()->sidebar['actions'] = array(
|
||||
'settings' => array(
|
||||
@@ -494,12 +492,12 @@ class spam extends Controller
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => Member::loggedIn()->language()->addToStack('prunesettings') )
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
/* Display */
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('spamlogs');
|
||||
Output::i()->output = (string) $table;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prune Settings
|
||||
*
|
||||
@@ -508,18 +506,18 @@ class spam extends Controller
|
||||
protected function serviceLogSettings() : void
|
||||
{
|
||||
Dispatcher::i()->checkAcpPermission( 'spam_service_log' );
|
||||
|
||||
|
||||
$form = new Form;
|
||||
|
||||
|
||||
$form->add( new Interval( 'prune_log_spam', Settings::i()->prune_log_spam, FALSE, array( 'valueAs' => Interval::DAYS, 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, Member::loggedIn()->language()->addToStack('after'), NULL, 'prune_log_spam' ) );
|
||||
|
||||
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$form->saveAsSettings();
|
||||
Session::i()->log( 'acplog__spamlog_settings' );
|
||||
Output::i()->redirect( Url::internal( 'app=core&module=moderation&controller=spam&do=serviceLogs' ), 'saved' );
|
||||
}
|
||||
|
||||
|
||||
Output::i()->title = Member::loggedIn()->language()->addToStack('spamlogssettings');
|
||||
Output::i()->output = Theme::i()->getTemplate('global')->block( 'spamlogssettings', $form, FALSE );
|
||||
}
|
||||
@@ -732,11 +730,9 @@ class spam extends Controller
|
||||
{
|
||||
if( !Settings::i()->ipb_reg_number )
|
||||
{
|
||||
Member::loggedIn()->language()->words['spam_service_enabled_desc'] = Member::loggedIn()->language()->addToStack( 'spam_service_nokey', FALSE, array( 'sprintf' => array( Url::internal( 'app=core&module=settings&controller=licensekey' ) ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Member::loggedIn()->language()->words['spam_service_enabled_desc'] = Member::loggedIn()->language()->addToStack( 'spam_service_noservice' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user