Version 4.0.13.1

This commit is contained in:
Neo committed 2025-12-19 04:57:54 -08:00
1 parent f9e857d255
commit c6a86f0d9b
7517 files changed
+597400 -668041

No files matched your search

@@ -0,0 +1,197 @@
<?php
/**
* @brief ban
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 12 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ban
*/
class _ban extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'ban_manage' );
parent::execute();
}
/**
* Manage
*
* @return void
*/
protected function manage()
{
$table = new \IPS\Helpers\Table\Db( 'core_banfilters', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ban' ) );
$table->filters = array(
'ban_filter_ip' => 'ban_type=\'ip\'',
'ban_filter_email' => 'ban_type=\'email\'',
'ban_filter_name' => 'ban_type=\'name\''
);
$table->include = array( 'ban_type', 'ban_content', 'ban_reason', 'ban_date' );
$table->mainColumn = 'ban_content';
$table->sortBy = $table->sortBy ?: 'ban_date';
$table->sortDirection = $table->sortDirection ?: 'asc';
$table->quickSearch = 'ban_content';
$table->advancedSearch = array(
'ban_reason' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
'ban_date' => \IPS\Helpers\Table\SEARCH_DATE_RANGE
);
/* Custom parsers */
$table->parsers = array(
'ban_date' => function( $val, $row )
{
return \IPS\DateTime::ts( $val )->localeDate();
},
'ban_type' => function( $val, $row )
{
switch( $val )
{
default:
case 'ip':
return \IPS\Member::loggedIn()->language()->addToStack('ban_filter_ip_select');
break;
case 'email':
return \IPS\Member::loggedIn()->language()->addToStack('ban_filter_email_select');
break;
case 'name':
return \IPS\Member::loggedIn()->language()->addToStack('ban_filter_name_select');
break;
}
}
);
/* Row buttons */
$table->rowButtons = function( $row )
{
$return = array();
$return['edit'] = array(
'icon' => 'pencil',
'title' => 'edit',
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('edit') ),
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ban&do=form&id=' ) . $row['ban_id'],
);
$return['delete'] = array(
'icon' => 'times-circle',
'title' => 'delete',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ban&do=delete&id=' ) . $row['ban_id'],
'data' => array( 'delete' => '' ),
);
return $return;
};
/* Specify the buttons */
$table->rootButtons = array(
'add' => array(
'icon' => 'plus',
'title' => 'ban_filter_add',
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('ban_filter_add') ),
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ban&do=form' )
)
);
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__core_membersettings_ban');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'menu__core_membersettings_ban', (string) $table );
}
/**
* Add/Edit Rank
*/
public function form()
{
$current = NULL;
if ( \IPS\Request::i()->id )
{
$current = \IPS\Db::i()->select( '*', 'core_banfilters', array( 'ban_id=?', \IPS\Request::i()->id ) )->first();
}
/* Build form */
$form = new \IPS\Helpers\Form();
$form->add( new \IPS\Helpers\Form\Select( 'ban_type', $current['ban_type'], TRUE, array( 'options' => array(
'ip' => 'ban_filter_ip_select',
'email' => 'ban_filter_email_select',
'name' => 'ban_filter_name_select'
) ) ) );
$form->add( new \IPS\Helpers\Form\Text( 'ban_content', $current['ban_content'], TRUE ) );
$form->add( new \IPS\Helpers\Form\Text( 'ban_reason', $current['ban_reason'] ) );
/* Handle submissions */
if ( $values = $form->values() )
{
$save = array(
'ban_type' => $values['ban_type'],
'ban_content' => $values['ban_content'],
'ban_reason' => $values['ban_reason'],
'ban_date' => time()
);
if ( $current )
{
unset( $save['ban_date'] );
\IPS\Db::i()->update( 'core_banfilters', $save, array( 'ban_id=?', $current['ban_id'] ) );
\IPS\Session::i()->log( 'acplog__ban_edited', array( 'ban_filter_' . $save['ban_type'] . '_select' => TRUE, $save['ban_content'] => FALSE ) );
}
else
{
\IPS\Db::i()->insert( 'core_banfilters', $save );
\IPS\Session::i()->log( 'acplog__ban_created', array( 'ban_filter_' . $save['ban_type'] . '_select' => TRUE, $save['ban_content'] => FALSE ) );
}
unset( \IPS\Data\Store::i()->bannedIpAddresses );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ban' ), 'saved' );
}
/* Display */
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( $current ? $current['ban_content'] : 'add', $form, FALSE );
}
/**
* Delete
*
* @return void
*/
public function delete()
{
try
{
$current = \IPS\Db::i()->select( '*', 'core_banfilters', array( 'ban_id=?', \IPS\Request::i()->id ) )->first();
\IPS\Session::i()->log( 'acplog__ban_deleted', array( 'ban_filter_' . $current['ban_type'] . '_select' => TRUE, $current['ban_content'] => FALSE ) );
\IPS\Db::i()->delete( 'core_banfilters', array( 'ban_id=?', \IPS\Request::i()->id ) );
unset( \IPS\Data\Store::i()->bannedIpAddresses );
}
catch ( \UnderflowException $e ) { }
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ban' ) );
}
}
Whitespace-only changes.
@@ -0,0 +1,179 @@
<?php
/**
* @brief Notification Settings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 23 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Notification Settings
*/
class _notifications extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'notifications_manage' );
parent::execute();
}
/**
* Manage
*
* @return void
*/
protected function manage()
{
/* Init Matrix */
$matrix = new \IPS\Helpers\Form\Matrix;
$matrix->manageable = FALSE;
$matrix->langPrefix = 'notificationsettings_';
$matrix->classes = array( 'cMemberNotifications' );
/* Populate columns */
$matrix->columns = array(
'label' => function( $key, $value, $data )
{
if ( mb_substr( $key, 0, -7 ) === 'new_likes' )
{
if ( \IPS\Settings::i()->reputation_point_types === 'like' )
{
return 'notifications__new_likes_like';
}
else
{
return 'notifications__new_likes_rep';
}
}
return $value;
},
'default' => function( $key, $value, $data )
{
return new \IPS\Helpers\Form\CheckboxSet( $key, $value, FALSE, array( 'options' => array( 'email' => 'member_notifications_email', 'inline' => 'member_notifications_inline' ), 'multiple' => TRUE ) );
},
'disabled' => function( $key, $value, $data )
{
return new \IPS\Helpers\Form\CheckboxSet( $key, $value, FALSE, array( 'options' => array( 'email' => 'member_notifications_email', 'inline' => 'member_notifications_inline' ), 'multiple' => TRUE ) );
},
'editable' => function( $key, $value, $data )
{
return new \IPS\Helpers\Form\YesNo( $key, $value );
},
);
/* Populate rows */
$current = iterator_to_array( \IPS\Db::i()->select( '*', 'core_notification_defaults' )->setKeyField( 'notification_key' ) );
foreach( \IPS\Application::allExtensions( 'core', 'Notifications', FALSE ) as $group => $class )
{
$configuration = $class->getConfiguration( NULL );
if ( !empty( $configuration ) )
{
$lang = "notifications__{$group}";
$header = \IPS\Member::loggedIn()->language()->addToStack( $lang );
$matrix->rows[] = $header;
foreach ( $configuration as $key => $data )
{
$matrix->rows[ $key ] = array(
'label' => "notifications__{$key}",
'default' => isset( $current[ $key ] ) ? explode( ',', $current[ $key ]['default'] ) : $data['default'],
'disabled' => isset( $current[ $key ] ) ? explode( ',', $current[ $key ]['disabled'] ) : $data['disabled'],
'editable' => isset( $current[ $key ] ) ? $current[ $key ]['editable'] : TRUE,
);
}
}
}
/* Handle submissions */
if ( $values = $matrix->values() )
{
\IPS\Db::i()->delete( 'core_notification_defaults' );
$inserts = array();
foreach ( $values as $k => $data )
{
$inserts[] = array(
'notification_key' => $k,
'default' => implode( ',', $data['default'] ),
'disabled' => implode( ',', $data['disabled'] ),
'editable' => $data['editable']
);
}
if( count( $inserts ) )
{
\IPS\Db::i()->insert( 'core_notification_defaults', $inserts );
}
\IPS\Session::i()->log( 'acplog__notifications_edited' );
}
/* Add a button for settings */
\IPS\Output::i()->sidebar['actions'] = array(
'settings' => array(
'title' => 'notificationsettings',
'icon' => 'cog',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=notifications&do=settings' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('notificationsettings') )
),
);
/* Display */
\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'members/notifications.css', 'core', 'admin' ) );
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('notifications');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'notifications', $matrix );
}
/**
* Profile Settings
*
* @return void
*/
protected function settings()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'profiles_manage' );
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\Number( 'subs_autoprune', \IPS\Settings::i()->subs_autoprune, FALSE, array(), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), \IPS\Member::loggedIn()->language()->addToStack('days') ) );
$form->add( new \IPS\Helpers\Form\Select( 'autoforum_sub_groups', \IPS\Settings::i()->autoforum_sub_groups ? explode( ",", \IPS\Settings::i()->autoforum_sub_groups ) : array(), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ) ) );
$form->add( new \IPS\Helpers\Form\Select( 'auto_track_method', \IPS\Settings::i()->auto_track_method, FALSE, array( 'options' => array(
0 => 'select_disabled',
'immediate' => 'follow_type_immediate',
'daily' => 'follow_type_daily',
'weekly' => 'follow_type_weekly',
) ) ) );
$form->add( new \IPS\Helpers\Form\Number( 'prune_notifications', \IPS\Settings::i()->prune_notifications, FALSE, array(), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), \IPS\Member::loggedIn()->language()->addToStack('months') ) );
if ( $values = $form->values() )
{
$values['autoforum_sub_groups'] = implode( ",", $values['autoforum_sub_groups'] );
$form->saveAsSettings();
\IPS\Session::i()->log( 'acplog__notification_settings' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=notifications' ), 'saved' );
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('notificationsettings');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('global')->block( 'notificationsettings', $form, FALSE );
}
}
@@ -0,0 +1,104 @@
<?php
/**
* @brief Profile Fields and Settings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 09 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Profile Fields and Settings
*/
class _profiles extends \IPS\Node\Controller
{
/**
* Node Class
*/
protected $nodeClass = '\IPS\core\ProfileFields\Group';
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'profilefields_manage' );
parent::execute();
}
/**
* Manage
*
* @return void
*/
protected function manage()
{
/* Init */
$activeTab = \IPS\Request::i()->tab ?: 'fields';
$activeTabContents = '';
$tabs = array( 'fields' => 'profile_fields' );
/* Add a tab for settings */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'profiles_manage' ) )
{
$tabs['settings'] = 'profile_settings';
}
/* Get contents */
if ( $activeTab == 'fields' )
{
parent::manage();
$activeTabContents = \IPS\Output::i()->output;
}
else
{
\IPS\Dispatcher::i()->checkAcpPermission( 'profiles_manage' );
$form = new \IPS\Helpers\Form;
$form->addHeader( 'photos' );
$form->add( new \IPS\Helpers\Form\YesNo( 'allow_gravatars', \IPS\Settings::i()->allow_gravatars ) );
$form->addHeader( 'usernames' );
$form->add( new \IPS\Helpers\Form\Number( 'max_user_name_length', \IPS\Settings::i()->max_user_name_length, FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('characters') ) );
$form->add( new \IPS\Helpers\Form\Text( 'username_characters', \IPS\Settings::i()->username_characters, FALSE, array( 'max' => 255 ) ) );
$form->addHeader( 'signatures' );
$form->add( new \IPS\Helpers\Form\YesNo( 'signatures_enabled', \IPS\Settings::i()->signatures_enabled ) );
$form->addHeader( 'statuses_profile_comments' );
$form->add( new \IPS\Helpers\Form\YesNo( 'profile_comments', \IPS\Settings::i()->profile_comments, FALSE, array( 'togglesOn' => array( 'profile_comment_approval' ) ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'profile_comment_approval', \IPS\Settings::i()->profile_comment_approval, FALSE, array(), NULL, NULL, NULL, 'profile_comment_approval' ) );
if ( $values = $form->values() )
{
$form->saveAsSettings();
\IPS\Session::i()->log( 'acplog__profile_settings' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=profiles&tab=settings' ), 'saved' );
}
$activeTabContents = (string) $form;
}
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('module__core_profile');
if( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->output = $activeTabContents;
}
else
{
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $activeTab, $activeTabContents, \IPS\Http\Url::internal( "app=core&module=membersettings&controller=profiles" ) );
}
}
}
@@ -0,0 +1,258 @@
<?php
/**
* @brief ranks
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 10 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* ranks
*/
class _ranks extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'ranks_manage' );
parent::execute();
}
/**
* Manage
*
* @return void
*/
protected function manage()
{
/* Create the table */
$table = new \IPS\Helpers\Table\Db( 'core_member_ranks', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ) );
/* Columns */
$table->joins = array(
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'core_member_rank_', core_member_ranks.id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
);
$table->include = array( 'word_custom', 'posts', 'pips' );
$table->langPrefix = 'member_ranks_';
$table->mainColumn = 'title';
$table->noSort = array( 'pips' );
$table->parsers = array(
'pips' => function( $val, $row )
{
if ( $row['use_icon'] and $row['icon'] )
{
return "<img src='" . \IPS\File::get( 'core_Theme', $row['icon'] )->url . "' alt=''>";
}
else
{
return str_repeat("<span class='ipsPip'></span>", intval($val) );
}
}
);
$table->sortBy = $table->sortBy ?: 'posts';
$table->sortDirection = $table->sortDirection ?: 'asc';
/* Root Buttons */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'ranks_manage' ) )
{
$table->rootButtons = array(
'add' => array(
'icon' => 'plus',
'title' => 'member_ranks_add',
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_add') ),
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=form' ),
)
);
}
/* Row buttons */
$table->rowButtons = function( $row )
{
$return = array();
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'ranks_manage' ) )
{
$return['edit'] = array(
'icon' => 'pencil',
'title' => 'edit',
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('edit') ),
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=form&id=' ) . $row['id'],
);
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'ranks_manage' ) )
{
$return['delete'] = array(
'icon' => 'times-circle',
'title' => 'delete',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=delete&id=' ) . $row['id'],
'data' => array( 'delete' => '' ),
);
}
return $return;
};
/* The incredibly complex search code */
$table->quickSearch = 'word_custom';
/* Show a message about the setting to allow members to set their own */
switch ( \IPS\Settings::i()->post_titlechange )
{
case -1:
$message = \IPS\Member::loggedIn()->language()->addToStack('rankown_none');
break;
case 0:
$message = \IPS\Member::loggedIn()->language()->addToStack('rankown_always');
break;
default:
$message = \IPS\Member::loggedIn()->language()->addToStack( 'rankown_limit', FALSE, array( 'pluralize' => array( \IPS\Settings::i()->post_titlechange ) ) );
break;
}
$message .= ' <a href="' . \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks&do=settings' ) . '" data-ipsDialog data-ipsDialog-title="' . \IPS\Member::loggedIn()->language()->addToStack('change') . '">' . \IPS\Member::loggedIn()->language()->addToStack('change') . '</a>';
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->message( $message, 'information', NULL, FALSE );
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('ranks');
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global' )->block( 'ranks', (string) $table );
}
/**
* Add/Edit Rank
*/
public function form()
{
$current = NULL;
if ( \IPS\Request::i()->id )
{
$current = \IPS\Db::i()->select( '*', 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) )->first();
}
/* Build form */
$form = new \IPS\Helpers\Form();
$form->add( new \IPS\Helpers\Form\Translatable( 'member_ranks_word_custom', NULL, TRUE, array( 'app' => 'core', 'key' => ( $current ? "core_member_rank_{$current['id']}" : NULL ) ) ) );
$form->add( new \IPS\Helpers\Form\Number( 'member_ranks_posts', $current ? $current['posts'] : 0, TRUE, array( 'min' => 0 ) ) );
$form->add( new \IPS\Helpers\Form\Radio( 'member_use_icon', $current['use_icon'], FALSE, array(
'parse' => 'raw',
'options' => array( 0 => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_pip_number', FALSE, array( 'htmlsprintf' => array( "<span class='ipsPip'></span>" ) ) ), 1 => \IPS\Member::loggedIn()->language()->addToStack('member_ranks_pip_icon') ),
'toggles' => array( 0 => array('member_ranks_pips'), 1 => array('member_ranks_icon') )
) ) );
/* Pip Icon */
$pip = NULL;
if ( $current['icon'] )
{
$pip = \IPS\File::get( 'core_Theme', $current['icon'] );
}
$form->add( new \IPS\Helpers\Form\Number( 'member_ranks_num_pips' , $current ? $current['pips'] : 0, FALSE, array( 'min' => 0 ), NULL, NULL, NULL, 'member_ranks_pips' ) );
$form->add( new \IPS\Helpers\Form\Upload( 'member_ranks_icon', $pip, FALSE, array( 'image' => array( 'maxWidth' => 140, 'maxHeight' => 140 ), 'storageExtension' => 'core_Theme' ), NULL, NULL, NULL, 'member_ranks_icon' ) );
if ( $values = $form->values() )
{
$save = array(
'posts' => intval( $values['member_ranks_posts'] ),
'pips' => intval( $values['member_ranks_num_pips'] ),
'use_icon' => intval( $values['member_use_icon'] ),
'icon' => '',
);
if ( $values['member_ranks_icon'] instanceof \IPS\File )
{
$save['icon'] = (string) $values['member_ranks_icon'];
}
if ( $current )
{
\IPS\Db::i()->update( 'core_member_ranks', $save, array( 'id=?', $current['id'] ) );
$id = $current['id'];
\IPS\Session::i()->log( 'acplogs__rank_edited', array( $save['posts'] => FALSE ) );
}
else
{
$id = \IPS\Db::i()->insert( 'core_member_ranks', $save );
\IPS\Session::i()->log( 'acplogs__rank_created', array( $save['posts'] => FALSE ) );
}
\IPS\Lang::saveCustom( 'core', "core_member_rank_{$id}", $values['member_ranks_word_custom'] );
unset( \IPS\Data\Store::i()->ranks );
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ), 'saved' );
}
/* Display */
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( $current ? "core_member_rank_{$current['id']}" : 'add', $form, FALSE );
}
/**
* Delete
*
* @return void
*/
public function delete()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'ranks_manage' );
try
{
$current = \IPS\Db::i()->select( '*', 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) )->first();
\IPS\Session::i()->log( 'acplogs__rank_deleted', array( $current['posts'] => FALSE ) );
\IPS\Db::i()->delete( 'core_member_ranks', array( 'id=?', \IPS\Request::i()->id ) );
\IPS\Lang::deleteCustom( 'core', 'core_member_rank_' . \IPS\Request::i()->id );
}
catch ( \UnderflowException $e ) { }
unset( \IPS\Data\Store::i()->ranks );
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ) );
}
/**
* Settings
*
* @return void
*/
public function settings()
{
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\Number( 'post_titlechange', \IPS\Settings::i()->post_titlechange, FALSE, array( 'unlimited' => -1, 'unlimitedLang' => 'never_allow' ) ) );
if ( $form->values() )
{
$form->saveAsSettings();
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=ranks' ), 'saved' );
}
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'ranks', $form, FALSE );
}
}
@@ -0,0 +1,73 @@
<?php
/**
* @brief Registration
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 18 Jul 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Registration
*/
class _registration extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'registration_manage' );
parent::execute();
}
/**
* General Member Settings
*
* @return void
*/
protected function manage()
{
$form = new \IPS\Helpers\Form;
$form->addHeader('registration');
$form->add( new \IPS\Helpers\Form\YesNo( 'allow_reg', \IPS\Settings::i()->allow_reg, FALSE, array( 'togglesOn' => array( 'new_reg_notify', 'reg_auth_type', 'form_header_coppa', 'use_coppa' ) ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'new_reg_notify', \IPS\Settings::i()->new_reg_notify, FALSE, array(), NULL, NULL, NULL, 'new_reg_notify' ) );
$form->add( new \IPS\Helpers\Form\Radio( 'reg_auth_type', \IPS\Settings::i()->reg_auth_type, TRUE, array(
'options' => array( 'user' => 'reg_auth_type_user', 'admin' => 'reg_auth_type_admin', 'admin_user' => 'reg_auth_type_admin_user', 'none' => 'reg_auth_type_none' ),
'toggles' => array( 'user' => array( 'validate_day_prune' ), 'admin_user' => array( 'validate_day_prune' ) )
), NULL, NULL, NULL, 'reg_auth_type' ) );
$form->add( new \IPS\Helpers\Form\Number( 'validate_day_prune', \IPS\Settings::i()->validate_day_prune, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), \IPS\Member::loggedIn()->language()->addToStack('days'), 'validate_day_prune' ) );
$form->addHeader('coppa');
$form->add( new \IPS\Helpers\Form\YesNo( 'use_coppa', \IPS\Settings::i()->use_coppa, FALSE, array( 'togglesOn' => array( 'coppa_fax', 'coppa_address' ) ), NULL, NULL, NULL, 'use_coppa' ) );
$form->add( new \IPS\Helpers\Form\Tel( 'coppa_fax', \IPS\Settings::i()->coppa_fax, FALSE, array(), NULL, NULL, NULL, 'coppa_fax' ) );
$form->add( new \IPS\Helpers\Form\Address( 'coppa_address', \IPS\GeoLocation::buildFromJson( \IPS\Settings::i()->coppa_address ), FALSE, array(), NULL, NULL, NULL, 'coppa_address' ) );
if ( $form->values() )
{
$form->saveAsSettings();
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Session::i()->log( 'acplogs__general_settings' );
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('membersettings_registration_title');
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global' )->block( 'membersettings_registration_title', $form );
}
}
@@ -0,0 +1,292 @@
<?php
/**
* @brief Reputation
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* reputation
*/
class _reputation extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'reps_manage' );
return parent::execute();
}
/**
* Manage
*
* @return void
*/
protected function manage()
{
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('reputation');
/* Init */
$activeTab = \IPS\Request::i()->tab ?: NULL;
$activeTabContents = '';
$tabs = array();
/* Settings */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'reps_settings' ) )
{
$tabs['settings'] = 'reputation_settings';
}
/* Levels */
if ( \IPS\Settings::i()->reputation_enabled and \IPS\Settings::i()->reputation_show_profile )
{
$tabs['levels'] = 'reputation_levels';
}
/* Make sure we have a tab */
if ( empty( $tabs ) )
{
\IPS\Output::i()->error( 'no_module_permission', '1C225/1', 403, '' );
}
elseif ( !$activeTab or !array_key_exists( $activeTab, $tabs ) )
{
$_tabs = array_keys( $tabs );
$activeTab = array_shift( $_tabs );
}
/* Do it */
if ( $activeTab === 'settings' )
{
\IPS\Dispatcher::i()->checkAcpPermission( 'reps_settings' );
/* Fake names for the "like" preview */
$names = array();
foreach ( range( 1, 3 ) as $i )
{
try
{
$member = \IPS\Member::constructFromData( \IPS\Db::i()->select( '*', 'core_members', empty( $names ) ? array() : 'member_id NOT IN(' . implode( ',', array_keys( $names ) ) . ')', 'RAND()', 1 )->first() );
$names[ $member->member_id ] = '<a>' . htmlentities( $member->name, \IPS\HTMLENTITIES, 'UTF-8', FALSE ) . '</a>';
}
catch ( \Exception $e )
{
break;
}
}
if ( count( $names ) == 3 )
{
$names[] = \IPS\Member::loggedIn()->language()->addToStack( 'like_blurb_others', FALSE, array( 'pluralize' => array( 2 ) ) );
}
if ( empty( $names ) )
{
$blurb = '';
}
else
{
$blurb = \IPS\Member::loggedIn()->language()->addToStack( 'like_blurb', FALSE, array( 'htmlsprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $names ) ), 'pluralize' => array( count( $names ) ) ) );
}
/* Build Form */
$form = new \IPS\Helpers\Form();
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_enabled', \IPS\Settings::i()->reputation_enabled, FALSE, array( 'togglesOn' => array( 'reputation_point_types', 'reputation_protected_groups', 'reputation_can_self_vote', 'reputation_highlight', 'reputation_show_profile' ) ) ) );
$form->add( new \IPS\Helpers\Form\Radio( 'reputation_point_types', \IPS\Settings::i()->reputation_point_types, FALSE, array(
'options' => array(
'like' => \IPS\Theme::i()->getTemplate( 'settings' )->reputationLike( $blurb ),
'both' => \IPS\Theme::i()->getTemplate( 'settings' )->reputationNormal( TRUE, TRUE ),
'positive' => \IPS\Theme::i()->getTemplate( 'settings' )->reputationNormal( TRUE, FALSE ),
'negative' => \IPS\Theme::i()->getTemplate( 'settings' )->reputationNormal( FALSE, TRUE ),
),
'toggles' => array(
'both' => array( 'reputation_show_content' ),
'positive' => array( 'reputation_show_content' ),
'negative' => array( 'reputation_show_content' )
),
'parse' => 'raw'
), NULL, NULL, NULL, 'reputation_point_types' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_show_content', \IPS\Settings::i()->reputation_show_content, FALSE, array(), NULL, NULL, NULL, 'reputation_show_content' ) );
$form->add( new \IPS\Helpers\Form\Select( 'reputation_protected_groups', explode( ',', \IPS\Settings::i()->reputation_protected_groups ), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ), NULL, NULL, NULL, 'reputation_protected_groups' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_can_self_vote', \IPS\Settings::i()->reputation_can_self_vote, FALSE, array(), NULL, NULL, NULL, 'reputation_can_self_vote' ) );
$form->add( new \IPS\Helpers\Form\Number( 'reputation_highlight', \IPS\Settings::i()->reputation_highlight, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('reputation_highlight_prefix'), \IPS\Member::loggedIn()->language()->addToStack('reputation_highlight_suffix'), 'reputation_highlight' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'reputation_show_profile', \IPS\Settings::i()->reputation_show_profile, FALSE, array(), NULL, NULL, NULL, 'reputation_show_profile' ) );
/* Save */
if ( $form->saveAsSettings() )
{
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Session::i()->log( 'acplogs__rep_settings' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&tab=settings' ), 'saved' );
}
/* Display */
$activeTabContents = (string) $form;
}
else
{
/* Create the table */
$table = new \IPS\Helpers\Table\Db( 'core_reputation_levels', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation' ) );
$table->langPrefix = 'rep_';
/* Columns */
$table->joins = array(
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'core_reputation_level_', core_reputation_levels.level_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
);
$table->include = array( 'word_custom', 'level_image', 'level_points' );
$table->mainColumn = 'word_custom';
$table->quickSearch = 'word_custom';
/* Sorting */
$table->noSort = array( 'level_image' );
$table->sortBy = $table->sortBy ?: 'level_points';
$table->sortDirection = $table->sortDirection ?: 'asc';
/* Parsers */
$table->parsers = array(
'level_image' => function( $val )
{
if ( $val )
{
return "<img src='" . \IPS\File::get( "core_Theme", $val )->url . "' alt=''>";
}
return '';
}
);
/* Buttons */
$table->rootButtons = array(
'add' => array(
'title' => 'add',
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&do=form' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('add') )
),
);
$table->rowButtons = function( $row )
{
return array(
'edit' => array(
'title' => 'edit',
'icon' => 'pencil',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&do=form&id=' ) . $row['level_id'],
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('edit') )
),
'delete' => array(
'title' => 'delete',
'icon' => 'times-circle',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&do=delete&id=' ) . $row['level_id'],
'data' => array( 'delete' => '' )
),
);
};
/* Display */
$activeTabContents = \IPS\Theme::i()->getTemplate( 'forms' )->blurb( 'reputation_levels_blurb', TRUE, TRUE ) . (string) $table;
}
/* Display */
if( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->output = $activeTabContents;
}
else
{
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $activeTab, $activeTabContents, \IPS\Http\Url::internal( "app=core&module=membersettings&controller=reputation" ) );
}
}
/**
* Add/Edit
*
* @return void
*/
public function form()
{
$current = NULL;
if ( \IPS\Request::i()->id )
{
$current = \IPS\Db::i()->select( '*', 'core_reputation_levels', array( 'level_id=?', \IPS\Request::i()->id ) )->first();
}
$form = new \IPS\Helpers\Form();
$form->add( new \IPS\Helpers\Form\Translatable( 'rep_level_title', NULL, TRUE, array( 'app' => 'core', 'key' => ( $current ? "core_reputation_level_{$current['level_id']}" : NULL ) ) ) );
$form->add( new \IPS\Helpers\Form\Upload( 'rep_level_image', ( $current and $current['level_image'] ) ? \IPS\File::get( 'core_Theme', $current['level_image'] ) : NULL, FALSE, array( 'storageExtension' => 'core_Theme' ) ) );
$form->add( new \IPS\Helpers\Form\Number( 'rep_level_points', $current ? $current['level_points'] : 0, TRUE, array( 'min' => NULL ) ) );
if ( $values = $form->values() )
{
$save = array(
'level_image' => $values['rep_level_image'] ? str_replace( \IPS\ROOT_PATH . '/uploads/', '', $values['rep_level_image'] ) : '',
'level_points' => $values['rep_level_points'],
);
if ( $current )
{
\IPS\Db::i()->update( 'core_reputation_levels', $save, array( 'level_id=?', $current['level_id'] ) );
$id = $current['level_id'];
\IPS\Session::i()->log( 'acplogs__rep_edited', array( $save['level_points'] => FALSE ) );
}
else
{
$id = \IPS\Db::i()->insert( 'core_reputation_levels', $save );
\IPS\Session::i()->log( 'acplogs__rep_edited', array( $save['level_points'] => FALSE ) );
}
unset( \IPS\Data\Store::i()->reputationLevels );
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Lang::saveCustom( 'core', "core_reputation_level_{$id}", $values['rep_level_title'] );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&tab=levels' ), 'saved' );
}
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( $current ? "core_reputation_level_{$current['level_id']}" : 'add', $form, FALSE );
}
/**
* Delete
*
* @return void
*/
public function delete()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'reps_delete' );
try
{
$current = \IPS\Db::i()->select( '*', 'core_reputation_levels', array( 'level_id=?', \IPS\Request::i()->id ) )->first();
\IPS\Session::i()->log( 'acplogs__rep_deleted', array( $current['level_points'] => FALSE ) );
\IPS\Db::i()->delete( 'core_reputation_levels', array( 'level_id=?', \IPS\Request::i()->id ) );
unset( \IPS\Data\Store::i()->reputationLevels );
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Lang::deleteCustom( 'core', 'core_reputation_level_' . \IPS\Request::i()->id );
}
catch ( \UnderflowExceptiobn $e ) { }
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=reputation&tab=levels' ) );
}
}
@@ -0,0 +1,419 @@
<?php
/**
* @brief Spam Prevention Settings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 18 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Spam Prevention Settings
*/
class _spam extends \IPS\Dispatcher\Controller
{
/**
* Execute
*
* @return void
*/
public function execute()
{
/* Get tab content */
$this->activeTab = \IPS\Request::i()->tab ?: 'captcha';
\IPS\Dispatcher::i()->checkAcpPermission( 'spam_manage' );
parent::execute();
}
/**
* Manage Settings
*
* @return void
*/
protected function manage()
{
/* Work out output */
$activeTabContents = call_user_func( array( $this, '_manage'.ucfirst( $this->activeTab ) ) );
/* If this is an AJAX request, just return it */
if( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->output = $activeTabContents;
return;
}
/* Build tab list */
$tabs = array();
$tabs['captcha'] = 'spamprevention_captcha';
$tabs['flagging'] = 'spamprevention_flagging';
$tabs['service'] = 'enhancements__core_SpamMonitoring';
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'qanda_manage' ) )
{
$tabs['qanda'] = 'qanda_settings';
}
/* Add a button for logs */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'settings', 'spam_service_log' ) )
{
\IPS\Output::i()->sidebar['actions']['errorLog'] = array(
'title' => 'spamlogs',
'icon' => 'exclamation-triangle',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&do=serviceLogs' ),
);
}
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('menu__core_membersettings_spam');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $this->activeTab, $activeTabContents, \IPS\Http\Url::internal( "app=core&module=membersettings&controller=spam" ) );
}
/**
* Show CAPTCHA settings
*
* @return string HTML to display
*/
protected function _manageCaptcha()
{
/* Build Form */
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\Radio( 'bot_antispam_type', \IPS\Settings::i()->bot_antispam_type, TRUE, array(
'options' => array( 'none' => 'captcha_type_none', 'recaptcha2' => 'captcha_type_recaptcha2', 'recaptcha' => 'captcha_type_recaptcha', 'keycaptcha' => 'captcha_type_keycaptcha' ),
'toggles' => array(
'none' => array( 'bot_antispam_type_warning' ),
'recaptcha2' => array( 'guest_captcha', 'recaptcha2_public_key', 'recaptcha2_private_key', 'recaptcha2_theme' ),
'recaptcha' => array( 'guest_captcha', 'recaptcha_public_key', 'recaptcha_private_key', 'recaptcha_theme' ),
'keycaptcha' => array( 'guest_captcha', 'keycaptcha_privatekey' )
),
), NULL, NULL, NULL, 'bot_antispam_type' ) );
$form->add( new \IPS\Helpers\Form\Text( 'recaptcha2_public_key', \IPS\Settings::i()->recaptcha2_public_key, FALSE, array(), NULL, NULL, NULL, 'recaptcha2_public_key' ) );
$form->add( new \IPS\Helpers\Form\Text( 'recaptcha2_private_key', \IPS\Settings::i()->recaptcha2_private_key, FALSE, array(), NULL, NULL, NULL, 'recaptcha2_private_key' ) );
$form->add( new \IPS\Helpers\Form\Radio( 'recaptcha2_theme', \IPS\Settings::i()->recaptcha2_theme, FALSE, array( 'options' => array(
'light' => "<img src='" . \IPS\Theme::i()->resource( 'recaptcha2/light.png', 'core' ) . "' alt='light'>",
'dark' => "<img src='" . \IPS\Theme::i()->resource( 'recaptcha2/dark.png', 'core' ) . "' alt='dark'>",
), 'parse' => 'raw' ), NULL, NULL, NULL, 'recaptcha2_theme' ) );
$form->add( new \IPS\Helpers\Form\Text( 'recaptcha_public_key', \IPS\Settings::i()->recaptcha_public_key, FALSE, array(), NULL, NULL, NULL, 'recaptcha_public_key' ) );
$form->add( new \IPS\Helpers\Form\Text( 'recaptcha_private_key', \IPS\Settings::i()->recaptcha_private_key, FALSE, array(), NULL, NULL, NULL, 'recaptcha_private_key' ) );
$form->add( new \IPS\Helpers\Form\Radio( 'recaptcha_theme', \IPS\Settings::i()->recaptcha_theme, FALSE, array( 'options' => array(
'clean' => "<img src='" . \IPS\Theme::i()->resource( 'recaptcha/clean.png', 'core' ) . "' alt='clean'>",
'red' => "<img src='" . \IPS\Theme::i()->resource( 'recaptcha/red.png', 'core' ) . "' alt='clean'>",
'white' => "<img src='" . \IPS\Theme::i()->resource( 'recaptcha/white.png', 'core' ) . "' alt='clean'>",
'blackglass' => "<img src='" . \IPS\Theme::i()->resource( 'recaptcha/blackglass.png', 'core' ) . "' alt='clean'>",
), 'parse' => 'raw' ), NULL, NULL, NULL, 'recaptcha_theme' ) );
$form->add( new \IPS\Helpers\Form\Text( 'keycaptcha_privatekey', \IPS\Settings::i()->keycaptcha_privatekey, FALSE, array(), NULL, NULL, NULL, 'keycaptcha_privatekey' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'guest_captcha', \IPS\Settings::i()->guest_captcha, FALSE, array(), NULL, NULL, \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'membertools_delete' ) ? ( "<a href='" . \IPS\Http\Url::internal( 'app=core&module=members&controller=members&do=deleteGuestContent' ) . "' data-ipsDialog data-ipsDialog-title='" . \IPS\Member::loggedIn()->language()->addToStack('member_delete_guest_content'). "'>" . \IPS\Member::loggedIn()->language()->addToStack('member_delete_guest_content') . "</a>" ) : '', 'guest_captcha' ) );
/* Save values */
if ( $form->values() )
{
$form->saveAsSettings();
/* Clear guest page caches */
\IPS\Data\Cache::i()->clearAll();
\IPS\Session::i()->log( 'acplogs__spamprev_settings' );
}
return $form;
}
/**
* Show spammer flagging settings
*
* @return string HTML to display
*/
protected function _manageFlagging()
{
/* Build Form */
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\CheckboxSet( 'spm_option', explode( ',', \IPS\Settings::i()->spm_option ), FALSE, array(
'options' => array( 'disable' => 'spm_option_disable', 'unapprove' => 'spm_option_unapprove', 'delete' => 'spm_option_delete', 'ban' => 'spm_option_ban' ),
) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'spm_notify', \IPS\Settings::i()->spm_notify ) );
/* Save values */
if ( $form->values() )
{
$form->saveAsSettings();
\IPS\Session::i()->log( 'acplogs__spamprev_settings' );
}
return $form;
}
/**
* Show IPS Spam Service settings
*
* @return string HTML to display
*/
protected function _manageService()
{
$licenseData = \IPS\IPS::licenseKey();
/* Build Form */
$actions = array( 1 => 'spam_service_act_1', 2 => 'spam_service_act_2', 3 => 'spam_service_act_3', 4 => 'spam_service_act_4' );
$form = new \IPS\Helpers\Form;
$form->addHeader( 'enhancements__core_SpamMonitoring' );
$disabled = FALSE;
if( !$licenseData or !$licenseData['products']['spam'] or strtotime( $licenseData['expires'] ) < time() )
{
$disabled = TRUE;
if( !\IPS\Settings::i()->ipb_reg_number )
{
\IPS\Member::loggedIn()->language()->words['spam_service_enabled_desc'] = \IPS\Member::loggedIn()->language()->addToStack( 'spam_service_nokey', FALSE, array( 'sprintf' => array( \IPS\Http\Url::internal( 'app=core&module=settings&controller=licensekey', null ) ) ) );
}
else
{
\IPS\Member::loggedIn()->language()->words['spam_service_enabled_desc'] = \IPS\Member::loggedIn()->language()->addToStack( 'spam_service_noservice' );
}
}
$form->add( new \IPS\Helpers\Form\YesNo( 'spam_service_enabled', \IPS\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' ) ) ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'spam_service_send_to_ips', \IPS\Settings::i()->spam_service_send_to_ips, FALSE, array( 'disabled' => $disabled ), NULL, NULL, NULL, 'spam_service_send_to_ips' ) );
$form->add( new \IPS\Helpers\Form\Select( 'spam_service_action_1', \IPS\Settings::i()->spam_service_action_1, FALSE, array( 'disabled' => $disabled, 'options' => $actions ), NULL, NULL, NULL, 'spam_service_action_1' ) );
$form->add( new \IPS\Helpers\Form\Select( 'spam_service_action_2', \IPS\Settings::i()->spam_service_action_2, FALSE, array( 'disabled' => $disabled, 'options' => $actions ), NULL, NULL, NULL, 'spam_service_action_2' ) );
$form->add( new \IPS\Helpers\Form\Select( 'spam_service_action_3', \IPS\Settings::i()->spam_service_action_3, FALSE, array( 'disabled' => $disabled, 'options' => $actions ), NULL, NULL, NULL, 'spam_service_action_3' ) );
$form->add( new \IPS\Helpers\Form\Select( 'spam_service_action_4', \IPS\Settings::i()->spam_service_action_4, FALSE, array( 'disabled' => $disabled, 'options' => $actions ), NULL, NULL, NULL, 'spam_service_action_4' ) );
$form->add( new \IPS\Helpers\Form\Select( 'spam_service_action_0', \IPS\Settings::i()->spam_service_action_0, FALSE, array( 'disabled' => $disabled, 'options' => $actions ), NULL, NULL, NULL, 'spam_service_action_0' ) );
if ( $form->values() )
{
$form->saveAsSettings();
\IPS\Session::i()->log( 'acplog__enhancements_edited', array( 'enhancements__core_SpamMonitoring' => TRUE ) );
}
return $form;
}
/**
* Show question and answer challenge settings
*
* @return string HTML to display
*/
protected function _manageQanda()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'qanda_manage' );
/* Create the table */
$table = new \IPS\Helpers\Table\Db( 'core_question_and_answer', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&tab=qanda' ) );
$table->include = array( 'qa_question' );
$table->joins = array(
array( 'select' => 'w.word_custom', 'from' => array( 'core_sys_lang_words', 'w' ), 'where' => "w.word_key=CONCAT( 'core_question_and_answer_', core_question_and_answer.qa_id ) AND w.lang_id=" . \IPS\Member::loggedIn()->language()->id )
);
$table->parsers = array(
'qa_question' => function( $val, $row )
{
return ( $row['word_custom'] ? $row['word_custom'] : $row['qa_question'] );
}
);
$table->mainColumn = 'qa_question';
$table->sortBy = $table->sortBy ?: 'qa_question';
$table->quickSearch = array( 'word_custom', 'qa_question' );
$table->sortDirection = $table->sortDirection ?: 'asc';
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'qanda_add' ) )
{
$table->rootButtons = array(
'add' => array(
'icon' => 'plus',
'title' => 'qanda_add_question',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&do=question' ),
)
);
}
$table->rowButtons = function( $row )
{
$return = array();
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'qanda_edit' ) )
{
$return['edit'] = array(
'icon' => 'pencil',
'title' => 'edit',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&do=question&id=' ) . $row['qa_id'],
);
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'qanda_delete' ) )
{
$return['delete'] = array(
'icon' => 'times-circle',
'title' => 'delete',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&do=delete&id=' ) . $row['qa_id'],
'data' => array( 'delete' => '' ),
);
}
return $return;
};
return (string) $table;
}
/**
* Add/Edit Form
*
* @return void
*/
protected function question()
{
/* Init */
$id = 0;
$question = array();
/* Start the form */
$form = new \IPS\Helpers\Form;
/* Load question */
try
{
$id = intval( \IPS\Request::i()->id );
$form->hiddenValues['id'] = $id;
$question = \IPS\Db::i()->select( '*', 'core_question_and_answer', array( 'qa_id=?', $id ) )->first();
\IPS\Dispatcher::i()->checkAcpPermission( 'qanda_edit' );
}
catch ( \UnderflowException $e )
{
\IPS\Dispatcher::i()->checkAcpPermission( 'qanda_add' );
}
$form->add( new \IPS\Helpers\Form\Translatable( 'qa_question', NULL, TRUE, array( 'app' => 'core', 'key' => ( $id ? "core_question_and_answer_{$id}" : NULL ) ) ) );
$form->add( new \IPS\Helpers\Form\Stack( 'qa_answers', $id ? json_decode( $question['qa_answers'], TRUE ) : array(), TRUE ) );
/* Handle submissions */
if ( $values = $form->values() )
{
$save = array(
'qa_answers' => json_encode( $values['qa_answers'] ),
);
if ( $id )
{
\IPS\Db::i()->update( 'core_question_and_answer', $save, array( 'qa_id=?', $question['qa_id'] ) );
\IPS\Session::i()->log( 'acplogs__question_edited' );
}
else
{
$id = \IPS\Db::i()->insert( 'core_question_and_answer', $save );
\IPS\Session::i()->log( 'acplogs__question_added' );
}
\IPS\Lang::saveCustom( 'core', "core_question_and_answer_{$id}", $values['qa_question'] );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&tab=qanda' ), 'saved' );
}
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('qanda_settings');
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Output::i()->title );
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( \IPS\Output::i()->title, $form );
}
/**
* Delete
*
* @return void
*/
protected function delete()
{
$id = intval( \IPS\Request::i()->id );
\IPS\Dispatcher::i()->checkAcpPermission( 'qanda_delete' );
\IPS\Db::i()->delete( 'core_question_and_answer', array( 'qa_id=?', $id ) );
\IPS\Session::i()->log( 'acplogs__question_deleted' );
\IPS\Lang::deleteCustom( 'core', "core_question_and_answer_{$id}" );
/* And redirect */
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=core&module=membersettings&controller=spam&tab=qanda" ) );
}
/**
* Spam Service Log
*
* @return void
*/
protected function serviceLogs()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'spam_service_log' );
/* Create the table */
$table = new \IPS\Helpers\Table\Db( 'core_spam_service_log', \IPS\Http\Url::internal( 'app=core&module=membersettings&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' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
'ip_address' => \IPS\Helpers\Table\SEARCH_CONTAINS_TEXT,
'log_code' => \IPS\Helpers\Table\SEARCH_NUMERIC,
);
/* Custom parsers */
$table->parsers = array(
'log_date' => function( $val, $row )
{
return \IPS\DateTime::ts( $val )->localeDate();
},
);
/* Add a button for settings */
\IPS\Output::i()->sidebar['actions'] = array(
'settings' => array(
'title' => 'prunesettings',
'icon' => 'cog',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&do=serviceLogSettings' ),
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('prunesettings') )
),
);
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('spamlogs');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->block( 'spamlogs', $table );
}
/**
* Prune Settings
*
* @return void
*/
protected function serviceLogSettings()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'spam_service_log' );
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\Number( 'prune_log_spam', \IPS\Settings::i()->prune_log_spam, FALSE, array( 'unlimited' => 0, 'unlimitedLang' => 'never' ), NULL, \IPS\Member::loggedIn()->language()->addToStack('after'), \IPS\Member::loggedIn()->language()->addToStack('days'), 'prune_log_spam' ) );
if ( $values = $form->values() )
{
$form->saveAsSettings();
\IPS\Session::i()->log( 'acplog__spamlog_settings' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=spam&do=serviceLogs' ), 'saved' );
}
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('spamlogssettings');
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate('global')->block( 'spamlogssettings', $form, FALSE );
}
}
@@ -0,0 +1,271 @@
<?php
/**
* @brief Warnings
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 23 Apr 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\modules\admin\membersettings;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Warnings
*/
class _warnings extends \IPS\Node\Controller
{
/**
* Node Class
*/
protected $nodeClass = '\IPS\core\Warnings\Reason';
/**
* Execute
*
* @return void
*/
public function execute()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'warn_settings' );
parent::execute();
}
/**
* Manage
*
* @return void
*/
public function manage()
{
/* Init */
$activeTab = \IPS\Request::i()->tab ?: NULL;
$activeTabContents = '';
$tabs = array();
/* Reasons */
if ( \IPS\Settings::i()->warn_on and \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'reasons_view' ) )
{
$tabs['reasons'] = 'warn_reasons';
if ( $activeTab == 'reasons' )
{
parent::manage();
$activeTabContents = \IPS\Output::i()->output;
}
}
/* Actions */
if ( \IPS\Settings::i()->warn_on and \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'actions_view' ) )
{
$tabs['actions'] = 'warn_actions';
if ( $activeTab == 'actions' )
{
/* Init */
$table = new \IPS\Helpers\Table\Db( 'core_members_warn_actions', \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings' ) );
$table->include = array( 'wa_points', 'wa_mq', 'wa_rpa', 'wa_suspend' );
$table->sortBy = $table->sortBy ?: 'wa_points';
$table->sortDirection = $table->sortDirection ?: 'asc';
/* Row buttons */
$table->rowButtons = function( $row )
{
$return = array();
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'actions_edit' ) )
{
$return['edit'] = array(
'icon' => 'pencil',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings&do=actionForm&id=' ) . $row['wa_id'],
'title' => 'edit',
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('add') )
);
}
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'actions_delete' ) )
{
$return['delete'] = array(
'icon' => 'times-circle',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings&do=actionDelete&id=' ) . $row['wa_id'],
'title' => 'delete',
'data' => array( 'delete' => '' )
);
}
return $return;
};
/* Parsers */
$table->parsers = array(
'wa_mq' => function( $val, $row )
{
return $val ? ( ( $val == -1 ) ? \IPS\Member::loggedIn()->language()->addToStack('indefinitely') : ( \IPS\Member::loggedIn()->language()->addToStack('for') . ' ' . $val . ' ' . ( $row['wa_mq_unit'] == 'd' ? \IPS\Member::loggedIn()->language()->addToStack('days') : \IPS\Member::loggedIn()->language()->addToStack('hours') ) ) ) : '-';
},
'wa_rpa' => function( $val, $row )
{
return $val ? ( ( $val == -1 ) ? \IPS\Member::loggedIn()->language()->addToStack('indefinitely') : ( \IPS\Member::loggedIn()->language()->addToStack('for') . ' ' . $val . ' ' . ( $row['wa_rpa_unit'] == 'd' ? \IPS\Member::loggedIn()->language()->addToStack('days') : \IPS\Member::loggedIn()->language()->addToStack('hours') ) ) ) : '-';
},
'wa_suspend' => function( $val, $row )
{
return $val ? ( ( $val == -1 ) ? \IPS\Member::loggedIn()->language()->addToStack('indefinitely') : ( \IPS\Member::loggedIn()->language()->addToStack('for') . ' ' . $val . ' ' . ( $row['wa_suspend_unit'] == 'd' ? \IPS\Member::loggedIn()->language()->addToStack('days') : \IPS\Member::loggedIn()->language()->addToStack('hours') ) ) ) : '-';
}
);
/* Add button */
if ( \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'membersettings', 'actions_add' ) )
{
$table->rootButtons = array(
'add' => array(
'icon' => 'plus',
'link' => \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings&do=actionForm' ),
'title' => 'add',
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('add') )
)
);
}
/* Display */
$activeTabContents = (string) $table;
}
}
/* Settings */
$tabs['settings'] = 'settings';
if ( $activeTab == 'settings' )
{
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\YesNo( 'warn_on', \IPS\Settings::i()->warn_on, FALSE, array( 'togglesOn' => array(
'warn_protected',
'warn_show_own',
'warnings_acknowledge'
) ) ) );
$form->add( new \IPS\Helpers\Form\Select( 'warn_protected', explode( ',', \IPS\Settings::i()->warn_protected ), FALSE, array( 'options' => \IPS\Member\Group::groups( TRUE, FALSE ), 'parse' => 'normal', 'multiple' => TRUE ), NULL, NULL, NULL, 'warn_protected' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'warn_show_own', \IPS\Settings::i()->warn_show_own, FALSE, array(), NULL, NULL, NULL, 'warn_show_own' ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'warnings_acknowledge', \IPS\Settings::i()->warnings_acknowledge, FALSE, array(), NULL, NULL, NULL, 'warnings_acknowledge' ) );
if ( $values = $form->values() )
{
$form->saveAsSettings();
\IPS\Session::i()->log( 'acplog__warn_settings' );
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings&tab=settings' ), 'saved' );
}
$activeTabContents = (string) $form;
}
/* Add the blurb in */
if ( $activeTab != 'settings' )
{
$activeTabContents = \IPS\Theme::i()->getTemplate( 'forms' )->blurb( 'warn_' . $activeTab . '_blurb', TRUE, TRUE ) . $activeTabContents;
}
/* Display */
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('warnings');
if( \IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->output = $activeTabContents;
}
else
{
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->tabs( $tabs, $activeTab, $activeTabContents, \IPS\Http\Url::internal( "app=core&module=membersettings&controller=warnings" ) );
}
}
/**
* Warn Action Form
*
* @return void
*/
protected function actionForm()
{
$current = NULL;
if ( \IPS\Request::i()->id )
{
$current = \IPS\Db::i()->select( '*', 'core_members_warn_actions', array( 'wa_id=?', \IPS\Request::i()->id ) )->first();
\IPS\Dispatcher::i()->checkAcpPermission( 'actions_edit' );
}
if ( !$current )
{
\IPS\Dispatcher::i()->checkAcpPermission( 'actions_add' );
}
$form = new \IPS\Helpers\Form;
$form->add( new \IPS\Helpers\Form\Number( 'wa_points', ( $current ? $current['wa_points'] : 0 ), TRUE ) );
foreach ( array( 'mq', 'rpa', 'suspend' ) as $k )
{
$form->add( new \IPS\Helpers\Form\Custom( 'wa_' . $k, ( $current ? array( $current[ 'wa_' . $k ], $current[ 'wa_' . $k . '_unit' ] ) : 0 ), FALSE, array(
'getHtml' => function( $element )
{
return \IPS\Theme::i()->getTemplate( 'members' )->warningTime( $element->name, $element->value, TRUE );
},
'formatValue'=> function( $element )
{
if ( isset( $element->value[3] ) )
{
$element->value[0] = -1;
$element->value[1] = 'h';
unset( $element->value[3] );
}
return $element->value;
}
) ) );
}
$form->add( new \IPS\Helpers\Form\YesNo( 'wa_override', ( $current ? $current['wa_override'] : FALSE ) ) );
if ( $values = $form->values() )
{
$save = array( 'wa_points' => $values['wa_points'], 'wa_override' => $values['wa_override'] );
foreach ( array( 'mq', 'rpa', 'suspend' ) as $k )
{
$save[ 'wa_' . $k ] = intval( $values[ 'wa_' . $k ][0] );
$save[ 'wa_' . $k . '_unit' ] = $values[ 'wa_' . $k ][1];
}
if ( $current )
{
\IPS\Db::i()->update( 'core_members_warn_actions', $save, array( 'wa_id=?', $current['wa_id'] ) );
\IPS\Session::i()->log( 'acplog__wa_edited', array( $save['wa_points'] => FALSE ) );
}
else
{
\IPS\Db::i()->insert( 'core_members_warn_actions', $save );
\IPS\Session::i()->log( 'acplog__wa_created', array( $save['wa_points'] => FALSE ) );
}
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings&tab=actions' ), 'saved' );
}
\IPS\Output::i()->output .= \IPS\Theme::i()->getTemplate( 'global' )->block( 'warn_action', $form, FALSE );
}
/**
* Delete Warn Action
*
* @return void
*/
protected function actionDelete()
{
\IPS\Dispatcher::i()->checkAcpPermission( 'actions_delete' );
try
{
$current = \IPS\Db::i()->select( '*', 'core_members_warn_actions', array( 'wa_id=?', \IPS\Request::i()->id ) )->first();
\IPS\Session::i()->log( 'acplog__wa_deleted', array( $current['wa_points'] => FALSE ) );
\IPS\Db::i()->delete( 'core_members_warn_actions', array( 'wa_id=?', \IPS\Request::i()->id ) );
}
catch ( \UnderflowException $e ) { }
\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=membersettings&controller=warnings&tab=actions' ), 'saved' );
}
}