Version 3.3.4

This commit is contained in:
Neo committed 2025-12-19 00:35:52 -08:00
1 parent 78706903a2
commit fb6b5baabc
2206 files changed
+409828 -382984

No files matched your search

@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'ajax' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,277 +1,277 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Member property updater (AJAX)
* Last Updated: $Date: 2011-06-09 18:03:22 -0400 (Thu, 09 Jun 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://hatynka.in
* @version $Revision: 9021 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class admin_members_ajax_editform extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
switch( $this->request['do'] )
{
default:
case 'show':
$this->show();
break;
case 'remove_photo':
$this->remove_photo();
break;
}
}
/**
* Remove user's photo
*
* @return @e void [Outputs to screen]
*/
protected function remove_photo()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load( $member_id );
if ( ! $member['member_id'] )
{
$this->returnJsonError( $this->lang->words['m_noid'] );
exit();
}
//-----------------------------------------
// Allowed to upload pics for administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_photo_admin', 'members', 'members' ) )
{
$this->returnJsonError( $this->lang->words['m_editadmin'] );
exit();
}
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
$photos = new $classToLoad( $this->registry );
$photos->remove( $member_id );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf($this->lang->words['m_imgremlog'], $member_id ) );
$member = IPSMember::load( $member_id );
$member = IPSMember::buildDisplayData( $member, 0 );
//-----------------------------------------
// Return
//-----------------------------------------
$this->returnJsonArray( array(
'success' => 1,
'pp_main_photo' => $member['pp_main_photo'],
'pp_main_width' => $member['pp_main_width'],
'pp_main_height' => $member['pp_main_height']
) );
}
/**
* Show the form
*
* @return @e void [Outputs to screen]
*/
protected function show()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = trim( IPSText::alphanumericalClean( $this->request['name'] ) );
$member_id = intval( $this->request['member_id'] );
$output = '';
//-----------------------------------------
// Load language and skin
//-----------------------------------------
$html = $this->registry->output->loadTemplate('cp_skin_member_form');
$this->lang->loadLanguageFile( array( 'admin_member' ) );
//-----------------------------------------
// Get member data
//-----------------------------------------
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
//-----------------------------------------
// Got a member?
//-----------------------------------------
if ( ! $member['member_id'] )
{
$this->returnJsonError( $this->lang->words['m_noid'] );
}
//-----------------------------------------
// Return the form
//-----------------------------------------
if ( method_exists( $html, $name ) )
{
$output = $html->$name( $member );
}
else
{
$save_to = '';
$div_id = '';
$form_field = '';
$text = '';
$description = '';
$method = '';
switch( $name )
{
case 'inline_ban_member':
if( !$this->registry->getClass('class_permissions')->checkPermission( 'member_ban', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_noban']);
}
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_ban_admin', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_noban']);
}
//-----------------------------------------
// INIT
//-----------------------------------------
$ban_filters = array( 'email' => array(), 'name' => array(), 'ip' => array() );
$email_banned = false;
$ip_banned = array();
$name_banned = false;
//-----------------------------------------
// Grab existing ban filters
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$ban_filters[ $r['ban_type'] ][] = $r['ban_content'];
}
//-----------------------------------------
// Check name and email address
//-----------------------------------------
if( in_array( $member['email'], $ban_filters['email'] ) )
{
$email_banned = true;
}
if( in_array( $member['name'], $ban_filters['name'] ) )
{
$name_banned = true;
}
//-----------------------------------------
// Retrieve IP addresses
//-----------------------------------------
$ip_addresses = IPSMember::findIPAddresses( $member['member_id'] );
//-----------------------------------------
// Start form fields
//-----------------------------------------
$form['member'] = ipsRegistry::getClass('output')->formCheckbox( "ban__member", $member['member_banned'] );
$form['email'] = ipsRegistry::getClass('output')->formCheckbox( "ban__email", $email_banned );
$form['name'] = ipsRegistry::getClass('output')->formCheckbox( "ban__name", $name_banned );
$form['note'] = ipsRegistry::getClass('output')->formCheckbox( "ban__note", 0 );
$form['note_field'] = ipsRegistry::getClass('output')->formTextarea( "ban__note_field" );
$form['ips'] = array();
//-----------------------------------------
// What about IPs?
//-----------------------------------------
if( is_array($ip_addresses) AND count($ip_addresses) )
{
foreach( $ip_addresses as $ip_address => $count )
{
if( in_array( $ip_address, $ban_filters['ip'] ) )
{
$form['ips'][ $ip_address ] = ipsRegistry::getClass('output')->formCheckbox( "ban__ip_" . str_replace( '.', '_', $ip_address ), true );
}
else
{
$form['ips'][ $ip_address ] = ipsRegistry::getClass('output')->formCheckbox( "ban__ip_" . str_replace( '.', '_', $ip_address ), false );
}
}
}
$member_groups = array();
foreach( ipsRegistry::cache()->getCache('group_cache') as $group )
{
if( $group['g_id'] == $member['member_group_id'] )
{
$member['_group_title'] = $group['g_title'];
}
$member_groups[] = array( $group['g_id'], $group['g_title'] );
}
$form['groups_confirm'] = ipsRegistry::getClass('output')->formCheckbox( "ban__group_change", 0 );
$form['groups'] = ipsRegistry::getClass('output')->formDropdown( "ban__group", $member_groups, $member['member_group_id'] );
$output = $html->inline_ban_member_form( $member, $form );
break;
}
if( !$output AND $method AND method_exists( $html, $method ) )
{
$output = $html->$method( $member, $save_to, $div_id, $form_field, $text, $description );
}
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->returnHtml( $output );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Member property updater (AJAX)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class admin_members_ajax_editform extends ipsAjaxCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
switch( $this->request['do'] )
{
default:
case 'show':
$this->show();
break;
case 'remove_photo':
$this->remove_photo();
break;
}
}
/**
* Remove user's photo
*
* @return @e void [Outputs to screen]
*/
protected function remove_photo()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load( $member_id );
if ( ! $member['member_id'] )
{
$this->returnJsonError( $this->lang->words['m_noid'] );
exit();
}
//-----------------------------------------
// Allowed to upload pics for administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_photo_admin', 'members', 'members' ) )
{
$this->returnJsonError( $this->lang->words['m_editadmin'] );
exit();
}
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo' );
$photos = new $classToLoad( $this->registry );
$photos->remove( $member_id );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf($this->lang->words['m_imgremlog'], $member_id ) );
$member = IPSMember::load( $member_id );
$member = IPSMember::buildDisplayData( $member, 0 );
//-----------------------------------------
// Return
//-----------------------------------------
$this->returnJsonArray( array(
'success' => 1,
'pp_main_photo' => $member['pp_main_photo'],
'pp_main_width' => $member['pp_main_width'],
'pp_main_height' => $member['pp_main_height']
) );
}
/**
* Show the form
*
* @return @e void [Outputs to screen]
*/
protected function show()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = trim( IPSText::alphanumericalClean( $this->request['name'] ) );
$member_id = intval( $this->request['member_id'] );
$output = '';
//-----------------------------------------
// Load language and skin
//-----------------------------------------
$html = $this->registry->output->loadTemplate('cp_skin_member_form');
$this->lang->loadLanguageFile( array( 'admin_member' ) );
//-----------------------------------------
// Get member data
//-----------------------------------------
$member = IPSMember::load( $member_id, 'extendedProfile,customFields' );
//-----------------------------------------
// Got a member?
//-----------------------------------------
if ( ! $member['member_id'] )
{
$this->returnJsonError( $this->lang->words['m_noid'] );
}
//-----------------------------------------
// Return the form
//-----------------------------------------
if ( method_exists( $html, $name ) )
{
$output = $html->$name( $member );
}
else
{
$save_to = '';
$div_id = '';
$form_field = '';
$text = '';
$description = '';
$method = '';
switch( $name )
{
case 'inline_ban_member':
if( !$this->registry->getClass('class_permissions')->checkPermission( 'member_ban', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_noban']);
}
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_ban_admin', 'members', 'members' ) )
{
$this->returnJsonError($this->lang->words['m_noban']);
}
//-----------------------------------------
// INIT
//-----------------------------------------
$ban_filters = array( 'email' => array(), 'name' => array(), 'ip' => array() );
$email_banned = false;
$ip_banned = array();
$name_banned = false;
//-----------------------------------------
// Grab existing ban filters
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$ban_filters[ $r['ban_type'] ][] = $r['ban_content'];
}
//-----------------------------------------
// Check name and email address
//-----------------------------------------
if( in_array( $member['email'], $ban_filters['email'] ) )
{
$email_banned = true;
}
if( in_array( $member['name'], $ban_filters['name'] ) )
{
$name_banned = true;
}
//-----------------------------------------
// Retrieve IP addresses
//-----------------------------------------
$ip_addresses = IPSMember::findIPAddresses( $member['member_id'] );
//-----------------------------------------
// Start form fields
//-----------------------------------------
$form['member'] = ipsRegistry::getClass('output')->formCheckbox( "ban__member", $member['member_banned'] );
$form['email'] = ipsRegistry::getClass('output')->formCheckbox( "ban__email", $email_banned );
$form['name'] = ipsRegistry::getClass('output')->formCheckbox( "ban__name", $name_banned );
$form['note'] = ipsRegistry::getClass('output')->formCheckbox( "ban__note", 0 );
$form['note_field'] = ipsRegistry::getClass('output')->formTextarea( "ban__note_field" );
$form['ips'] = array();
//-----------------------------------------
// What about IPs?
//-----------------------------------------
if( is_array($ip_addresses) AND count($ip_addresses) )
{
foreach( $ip_addresses as $ip_address => $count )
{
if( in_array( $ip_address, $ban_filters['ip'] ) )
{
$form['ips'][ $ip_address ] = ipsRegistry::getClass('output')->formCheckbox( "ban__ip_" . str_replace( '.', '_', $ip_address ), true );
}
else
{
$form['ips'][ $ip_address ] = ipsRegistry::getClass('output')->formCheckbox( "ban__ip_" . str_replace( '.', '_', $ip_address ), false );
}
}
}
$member_groups = array();
foreach( ipsRegistry::cache()->getCache('group_cache') as $group )
{
if( $group['g_id'] == $member['member_group_id'] )
{
$member['_group_title'] = $group['g_title'];
}
$member_groups[] = array( $group['g_id'], $group['g_title'] );
}
$form['groups_confirm'] = ipsRegistry::getClass('output')->formCheckbox( "ban__group_change", 0 );
$form['groups'] = ipsRegistry::getClass('output')->formDropdown( "ban__group", $member_groups, $member['member_group_id'] );
$output = $html->inline_ban_member_form( $member, $form );
break;
}
if( !$output AND $method AND method_exists( $html, $method ) )
{
$output = $html->$method( $member, $save_to, $div_id, $form_field, $text, $description );
}
}
//-----------------------------------------
// Print...
//-----------------------------------------
$this->returnHtml( $output );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'bulkmail' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Рассылки</title>
<title>Bulk Mail</title>
<subitems>
<subitem>
<subitemtitle>Рассылки</subitemtitle>
<subitemtitle>Bulk Mail</subitemtitle>
<subitemlang>bulkmail</subitemlang>
<subsection>bulkmail</subsection>
<subitemurl>do=bulk_mail</subitemurl>
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление рассылками</grouptitle>
<grouptitle>Creating Bulk Mail</grouptitle>
<grouplang>mem_bulkmail</grouplang>
<items>
<item>
<key>bulkmail_addedit</key>
<string>Может добавлять/изменять рассылки?</string>
<string>Can add/edit bulk emails?</string>
</item>
<item>
<key>bulkmail_delete</key>
<string>Может удалять рассылки?</string>
<string>Can delete bulk emails?</string>
</item>
</items>
</group>
<group>
<grouptitle>Отправка рассылок</grouptitle>
<grouptitle>Sending/Resending Bulk Mails</grouptitle>
<grouplang>mem_bulkmailsend</grouplang>
<items>
<item>
<key>bulkmail_view</key>
<string>Может просматривать текущие рассылки?</string>
<string>Can monitor/view bulk emails?</string>
</item>
<item>
<key>bulkmail_send</key>
<string>Может запускать отправку рассылки?</string>
<string>Can send bulk emails?</string>
</item>
<item>
<key>bulkmail_cancel</key>
<string>Может отменить отправку рассылки?</string>
<string>Can cancel bulk emails?</string>
</item>
</items>
</group>
File diff suppressed because it is too large. Load diff
@@ -3,12 +3,12 @@
* @file defaultSection.php Define the default section for the 'cfields' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
* $LastChangedDate: 2010-10-14 13:11:17 -0400 (Thu, 14 Oct 2010) $
* @version v3.3.4
* $Revision: 477 $
*/
$DEFAULT_SECTION = 'customfields';
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'groups' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Управление группами</title>
<title>Manage Member Groups</title>
<subitems>
<subitem>
<subitemtitle>Управление группами пользователей</subitemtitle>
<subitemtitle>Manage Member Groups</subitemtitle>
<subitemlang>manage_groups</subitemlang>
<subsection>groups</subsection>
<subitemurl>do=groups_overview</subitemurl>
@@ -15,10 +15,10 @@
</subitems>
</item>
<item>
<title>Маски доступа</title>
<title>Manage User Permissions</title>
<subitems>
<subitem>
<subitemtitle>Управление масками доступа</subitemtitle>
<subitemtitle>Manage User Permissions</subitemtitle>
<subitemlang>manage_perms</subitemlang>
<subsection>permissions</subsection>
<subitemurl>do=overview</subitemurl>
@@ -1,44 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление группами</grouptitle>
<grouptitle>Managing Groups</grouptitle>
<grouplang>members_groups</grouplang>
<items>
<item>
<key>groups_add</key>
<string>Может добавлять группы?</string>
<string>Can add groups?</string>
</item>
<item>
<key>groups_add_admin</key>
<string>Может добавлять АДМИНИСТРАТОРСКИЕ группы?</string>
<string>Can add ADMIN groups?</string>
</item>
<item>
<key>groups_edit</key>
<string>Может редактировать группы?</string>
<string>Can edit groups?</string>
</item>
<item>
<key>groups_edit_admin</key>
<string>Может редактировать АДМИНИСТРАТОРСКИЕ группы?</string>
<string>Can edit ADMIN groups?</string>
</item>
<item>
<key>groups_delete</key>
<string>Может удалять группы?</string>
<string>Can delete groups?</string>
</item>
<item>
<key>groups_delete_admin</key>
<string>Может удалять АДМИНИСТРАТОРСКИЕ группы?</string>
<string>Can delete ADMIN groups?</string>
</item>
</items>
</group>
<group>
<grouptitle>Управление правами</grouptitle>
<grouptitle>Managing Permissions</grouptitle>
<grouplang>members_perms</grouplang>
<items>
<item>
<key>perms_manage</key>
<string>Может добавлять и редактировать маски доступа?</string>
<string>Can manage permission sets and configure permission access?</string>
</item>
<item>
<key>perms_delete</key>
<string>Может удалять маски доступа?</string>
<string>Can remove permission sets?</string>
</item>
</items>
</group>
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,251 +1,251 @@
<?php
/**
* @file banfilters.php Provides helper methods to add ban filters
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-03-22 12:48:06 -0400 (Tue, 22 Mar 2011) $
* @version v3.2.3
* $Revision: 8149 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
/**
*
* @class admin_members_members_banfilters
* @brief Provides helper methods to add ban filters
*/
class admin_members_members_banfilters extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load skin & setup some stuff */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_banfilters' );
$this->form_code = $this->html->form_code = 'module=members&amp;section=banfilters&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=banfilters&';
/* Load lang */
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
/* What to do... */
switch( $this->request['do'] )
{
case 'ban_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
$this->banAdd();
break;
case 'ban_delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_remove' );
$this->banDelete();
break;
default:
case 'ban':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
$this->banOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Displays the ban overview screen
*
* @return @e void
*/
public function banOverview()
{
/* INI */
$ban = array();
$ips = array();
$emails = array();
$names = array();
/* Get ban filters */
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$ban[ $r['ban_type'] ][ $r['ban_id'] ] = $r;
}
/* IPs */
if( isset( $ban['ip'] ) AND is_array( $ban['ip'] ) AND count( $ban['ip'] ) )
{
foreach( $ban['ip'] as $entry )
{
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT', 1 );
$ips[] = $entry;
}
}
/* Emails */
if( isset( $ban['email'] ) AND is_array( $ban['email'] ) AND count( $ban['email'] ) )
{
foreach( $ban['email'] as $entry )
{
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
$emails[] = $entry;
}
}
/* Banned Names */
if( isset( $ban['name'] ) AND is_array( $ban['name'] ) AND count( $ban['name'] ) )
{
foreach( $ban['name'] as $entry )
{
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
$names[] = $entry;
}
}
/* Output */
$this->registry->output->html .= $this->html->banOverview( $ips, $emails, $names );
}
/**
* Add a new ban filter
*
* @return @e void
*/
public function banAdd()
{
$this->request['bantext'] = trim($this->request['bantext']);
/* Error checking */
if( ! $this->request['bantext'] )
{
$this->registry->output->global_message = $this->lang->words['ban_entersomething'];
$this->banOverview();
return;
}
/* Check for duplicate */
$result = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'banfilters',
'where' => "ban_content='{$this->request['bantext']}' and ban_type='{$this->request['bantype']}'"
) );
if ( $result['ban_id'] )
{
$this->registry->output->global_message = $this->lang->words['ban_dupe'];
$this->banOverview();
return;
}
/* Insert the new ban filter */
$this->DB->insert( 'banfilters', array( 'ban_type' => trim($this->request['bantype']),
'ban_content' => trim($this->request['bantext']),
'ban_date' => time(),
'ban_reason' => trim($this->request['banreason'])
)
);
/* Rebuild cacne and bounce */
$this->rebuildBanCache();
$this->registry->output->global_message = $this->lang->words['ban_added'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=ban' );
}
/**
* Delete a ban filter
*
* @return @e void
*/
public function banDelete()
{
/* INI */
$ids = array();
/* Loop through the request fields and find checked ban filters */
foreach( $this->request as $key => $value )
{
if( preg_match( '/^banid_(\d+)$/', $key, $match ) )
{
if( $this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
/* Clean the array */
$ids = IPSLib::cleanIntArray( $ids );
/* Delete any checked ban filters */
if ( count( $ids ) )
{
$this->DB->delete( 'banfilters', 'ban_id IN(' . implode( ",", $ids ) . ')' );
}
/* Rebuild the cache */
$this->rebuildBanCache();
/* Bounce */
$this->registry->output->global_message = $this->lang->words['ban_removed'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=ban' );
}
/**
* Rebuilds the ban cache
*
* @return @e void
*/
public function rebuildBanCache()
{
/* INI */
$cache = array();
/* Get the ban filters */
$this->DB->build( array( 'select' => 'ban_content', 'from' => 'banfilters', 'where' => "ban_type='ip'" ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$cache[] = $r['ban_content'];
}
/* Update the cache */
$this->cache->setCache( 'banfilters', $cache, array( 'array' => 1 ) );
}
<?php
/**
* @file banfilters.php Provides helper methods to add ban filters
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-03-22 12:48:06 -0400 (Tue, 22 Mar 2011) $
* @version v3.3.4
* $Revision: 8149 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
/**
*
* @class admin_members_members_banfilters
* @brief Provides helper methods to add ban filters
*/
class admin_members_members_banfilters extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
/* Load skin & setup some stuff */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_banfilters' );
$this->form_code = $this->html->form_code = 'module=members&amp;section=banfilters&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=banfilters&';
/* Load lang */
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
/* What to do... */
switch( $this->request['do'] )
{
case 'ban_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
$this->banAdd();
break;
case 'ban_delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_remove' );
$this->banDelete();
break;
default:
case 'ban':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ban_manage' );
$this->banOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Displays the ban overview screen
*
* @return @e void
*/
public function banOverview()
{
/* INI */
$ban = array();
$ips = array();
$emails = array();
$names = array();
/* Get ban filters */
$this->DB->build( array( 'select' => '*', 'from' => 'banfilters', 'order' => 'ban_date desc' ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$ban[ $r['ban_type'] ][ $r['ban_id'] ] = $r;
}
/* IPs */
if( isset( $ban['ip'] ) AND is_array( $ban['ip'] ) AND count( $ban['ip'] ) )
{
foreach( $ban['ip'] as $entry )
{
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT', 1 );
$ips[] = $entry;
}
}
/* Emails */
if( isset( $ban['email'] ) AND is_array( $ban['email'] ) AND count( $ban['email'] ) )
{
foreach( $ban['email'] as $entry )
{
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
$emails[] = $entry;
}
}
/* Banned Names */
if( isset( $ban['name'] ) AND is_array( $ban['name'] ) AND count( $ban['name'] ) )
{
foreach( $ban['name'] as $entry )
{
$entry['_date'] = $this->registry->class_localization->getDate( $entry['ban_date'], 'SHORT' );
$names[] = $entry;
}
}
/* Output */
$this->registry->output->html .= $this->html->banOverview( $ips, $emails, $names );
}
/**
* Add a new ban filter
*
* @return @e void
*/
public function banAdd()
{
$this->request['bantext'] = trim($this->request['bantext']);
/* Error checking */
if( ! $this->request['bantext'] )
{
$this->registry->output->global_message = $this->lang->words['ban_entersomething'];
$this->banOverview();
return;
}
/* Check for duplicate */
$result = $this->DB->buildAndFetch( array( 'select' => '*',
'from' => 'banfilters',
'where' => "ban_content='{$this->request['bantext']}' and ban_type='{$this->request['bantype']}'"
) );
if ( $result['ban_id'] )
{
$this->registry->output->global_message = $this->lang->words['ban_dupe'];
$this->banOverview();
return;
}
/* Insert the new ban filter */
$this->DB->insert( 'banfilters', array( 'ban_type' => trim($this->request['bantype']),
'ban_content' => trim($this->request['bantext']),
'ban_date' => time(),
'ban_reason' => trim($this->request['banreason'])
)
);
/* Rebuild cacne and bounce */
$this->rebuildBanCache();
$this->registry->output->global_message = $this->lang->words['ban_added'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=ban' );
}
/**
* Delete a ban filter
*
* @return @e void
*/
public function banDelete()
{
/* INI */
$ids = array();
/* Loop through the request fields and find checked ban filters */
foreach( $this->request as $key => $value )
{
if( preg_match( '/^banid_(\d+)$/', $key, $match ) )
{
if( $this->request[ $match[0] ] )
{
$ids[] = $match[1];
}
}
}
/* Clean the array */
$ids = IPSLib::cleanIntArray( $ids );
/* Delete any checked ban filters */
if ( count( $ids ) )
{
$this->DB->delete( 'banfilters', 'ban_id IN(' . implode( ",", $ids ) . ')' );
}
/* Rebuild the cache */
$this->rebuildBanCache();
/* Bounce */
$this->registry->output->global_message = $this->lang->words['ban_removed'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'].$this->form_code.'do=ban' );
}
/**
* Rebuilds the ban cache
*
* @return @e void
*/
public function rebuildBanCache()
{
/* INI */
$cache = array();
/* Get the ban filters */
$this->DB->build( array( 'select' => 'ban_content', 'from' => 'banfilters', 'where' => "ban_type='ip'" ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$cache[] = $r['ban_content'];
}
/* Update the cache */
$this->cache->setCache( 'banfilters', $cache, array( 'array' => 1 ) );
}
}
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'members' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,377 +1,377 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Member property updater (AJAX)
* Last Updated: $Date: 2011-06-06 18:06:01 -0400 (Mon, 06 Jun 2011) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://hatynka.in
* @version $Revision: 8982 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class admin_members_members_editform extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
switch( $this->request['do'] )
{
case 'save_display_name':
$this->save_member_name( 'members_display_name' );
break;
case 'save_name':
$this->save_member_name( 'name' );
break;
case 'save_password':
$this->save_password();
break;
case 'save_email':
$this->save_email();
break;
}
}
/**
* Change a member's email address
*
* @return @e void [Outputs to screen]
*/
protected function save_email()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$email = trim( $this->request['email'] );
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load( $member_id );
if ( ! $member['member_id'] )
{
$this->registry->output->showError( $this->lang->words['m_noid'] );
}
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
{
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
}
//-----------------------------------------
// Is this email addy taken? CONVERGE THIS??
//-----------------------------------------
$email_check = IPSMember::load( strtolower($email) );
if ( $email_check['member_id'] AND $email_check['member_id'] != $member_id )
{
$this->registry->output->showError( $this->lang->words['m_emailalready'] );
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changeEmail( trim( strtolower( $member['email'] ) ), trim( strtolower( $email ) ), $member );
//-----------------------------------------
// We don't want to die just from a Converge error
//-----------------------------------------
/*if ( $han_login->return_code AND ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' ) )
{
$this->returnJsonError( $this->lang->words['m_emailalready'] );
exit();
}*/
//-----------------------------------------
// Update member
//-----------------------------------------
IPSLib::runMemberSync( 'onEmailChange', $member_id, strtolower( $email ), $member['email'] );
IPSMember::save( $member_id, array( 'core' => array( 'email' => strtolower( $email ) ) ) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_emailchangelog'], $member['email'], $email, $member_id ) );
$this->registry->output->global_message = $this->lang->words['email_updated_success'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
}
/**
* Change a member's password
*
* @return @e void [Outputs to screen]
*/
protected function save_password()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$password = IPSText::parseCleanValue( $_POST['password'] );
$password2 = IPSText::parseCleanValue( $_POST['password2'] );
$new_key = intval( $this->request['new_key'] );
$new_salt = intval( $this->request['new_salt'] );
$salt = str_replace( '\\', "\\\\", IPSMember::generatePasswordSalt(5) );
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5( trim($password) );
//-----------------------------------------
// AJAX debug
//-----------------------------------------
IPSDebug::fireBug( 'info', array( 'Password: ' . $password ) );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $password OR ! $password2 )
{
$this->registry->output->showError( $this->lang->words['password_nogood'] );
}
if ( $password != $password2 )
{
$this->registry->output->showError( $this->lang->words['m_passmatch'] );
}
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
{
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
}
//-----------------------------------------
// Check Converge: Password
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changePass( $member['email'], $md5_once, $password, $member );
/*if ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' )
{
$this->returnJsonError( $this->lang->words['m_passchange']);
exit();
}*/
//-----------------------------------------
// Local DB
//-----------------------------------------
$update = array();
if( $new_salt )
{
$update['members_pass_salt'] = $salt;
}
if( $new_key )
{
$update['member_login_key'] = $key;
}
if( count($update) )
{
IPSMember::save( $member_id, array( 'core' => $update ) );
}
IPSMember::updatePassword( $member_id, $md5_once );
IPSLib::runMemberSync( 'onPassChange', $member_id, $password );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_passlog'], $member_id ) );
$this->registry->output->global_message = $this->lang->words['pw_updated_success'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
}
/**
* Update a user's login or display name
*
* @param string Field to update
* @return @e void [Outputs to screen]
*/
protected function save_member_name( $field='members_display_name' )
{
$member_id = intval( $this->request['member_id'] );
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
{
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
}
if ( $field == 'members_display_name' )
{
$display_name = $this->request['display_name'];
$display_name = str_replace("&#43;", "+", $display_name );
}
else
{
$display_name = $this->request['name'];
$display_name = str_replace("&#43;", "+", $display_name );
$display_name = str_replace( '|', '&#124;' , $display_name );
$display_name = trim( preg_replace( "/\s{2,}/", " ", $display_name ) );
}
if ( $this->settings['strip_space_chr'] )
{
// use hexdec to convert between '0xAD' and chr
$display_name = IPSText::removeControlCharacters( $display_name );
}
if ( $field == 'members_display_name' AND preg_match( "#[\[\];,\|]#", str_replace( '&#39;', "'", str_replace( '&amp;', '&', str_replace( '&quot;', '"', str_replace( '&#33;', '!', $display_name ) ) ) ) ) )
{
$this->registry->output->showError( $this->lang->words['m_displaynames'] );
}
try
{
if ( IPSMember::getFunction()->updateName( $member_id, $display_name, $field ) === TRUE )
{
if ( $field == 'members_display_name' )
{
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_dnamelog'], $member['members_display_name'], $display_name ));
}
else
{
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_namelog'], $member['name'], $display_name ) );
//-----------------------------------------
// If updating a name, and display names
// disabled, update display name too
//-----------------------------------------
if( !ipsRegistry::$settings['auth_allow_dnames'] )
{
IPSMember::getFunction()->updateName( $member_id, $display_name, 'members_display_name' );
}
//-----------------------------------------
// I say, did we choose to email 'dis member?
//-----------------------------------------
if ( $this->request['send_email'] == 1 )
{
//-----------------------------------------
// By golly, we did!
//-----------------------------------------
$msg = trim( IPSText::stripslashes( nl2br( $_POST['email_contents'] ) ) );
$msg = str_replace( "{old_name}", $member['name'], $msg );
$msg = str_replace( "{new_name}", $display_name , $msg );
$msg = str_replace( "<#BOARD_NAME#>", $this->settings['board_name'], $msg );
$msg = str_replace( "<#BOARD_ADDRESS#>", $this->settings['board_url'] . '/index.' . $this->settings['php_ext'], $msg );
IPSText::getTextClass('email')->message = stripslashes( IPSText::getTextClass('email')->cleanMessage($msg) );
IPSText::getTextClass('email')->subject = $this->lang->words['m_changesubj'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
}
}
$this->cache->rebuildCache( 'stats', 'global' );
}
else
{
# We should absolutely never get here. So this is a fail-safe, really to
# prevent a "false" positive outcome for the end-user
$this->registry->output->showError( $this->lang->words['m_namealready'] );
}
}
catch( Exception $error )
{
// $this->returnJsonError( $error->getMessage() );
switch( $error->getMessage() )
{
case 'NO_USER':
$this->registry->output->showError( $this->lang->words['m_noid'] );
break;
case 'NO_PERMISSION':
case 'NO_NAME':
$this->registry->output->showError( sprintf($this->lang->words['m_morethan3'], $this->settings['max_user_name_length'] ) );
break;
case 'ILLEGAL_CHARS':
$this->registry->output->showError( $this->lang->words['m_illegal'] );
break;
case 'USER_NAME_EXISTS':
$this->registry->output->showError( $this->lang->words['m_namealready'] );
break;
default:
$this->registry->output->showError( $error->getMessage() );
break;
}
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
if( $field == 'name' )
{
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changeName( $member['name'], $display_name, $member['email'], $member );
}
else
{
IPSLib::runMemberSync( 'onNameChange', $member_id, $display_name );
}
$this->registry->output->global_message = $this->lang->words[ $field . '_updated_success'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Member property updater (AJAX)
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class admin_members_members_editform extends ipsCommand
{
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ), 'members' );
switch( $this->request['do'] )
{
case 'save_display_name':
$this->save_member_name( 'members_display_name' );
break;
case 'save_name':
$this->save_member_name( 'name' );
break;
case 'save_password':
$this->save_password();
break;
case 'save_email':
$this->save_email();
break;
}
}
/**
* Change a member's email address
*
* @return @e void [Outputs to screen]
*/
protected function save_email()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$email = trim( $this->request['email'] );
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load( $member_id );
if ( ! $member['member_id'] )
{
$this->registry->output->showError( $this->lang->words['m_noid'] );
}
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
{
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
}
//-----------------------------------------
// Is this email addy taken? CONVERGE THIS??
//-----------------------------------------
$email_check = IPSMember::load( strtolower($email) );
if ( $email_check['member_id'] AND $email_check['member_id'] != $member_id )
{
$this->registry->output->showError( $this->lang->words['m_emailalready'] );
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changeEmail( trim( strtolower( $member['email'] ) ), trim( strtolower( $email ) ), $member );
//-----------------------------------------
// We don't want to die just from a Converge error
//-----------------------------------------
/*if ( $han_login->return_code AND ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' ) )
{
$this->returnJsonError( $this->lang->words['m_emailalready'] );
exit();
}*/
//-----------------------------------------
// Update member
//-----------------------------------------
IPSLib::runMemberSync( 'onEmailChange', $member_id, strtolower( $email ), $member['email'] );
IPSMember::save( $member_id, array( 'core' => array( 'email' => strtolower( $email ) ) ) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_emailchangelog'], $member['email'], $email, $member_id ) );
$this->registry->output->global_message = $this->lang->words['email_updated_success'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
}
/**
* Change a member's password
*
* @return @e void [Outputs to screen]
*/
protected function save_password()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$member_id = intval( $this->request['member_id'] );
$password = IPSText::parseCleanValue( $_POST['password'] );
$password2 = IPSText::parseCleanValue( $_POST['password2'] );
$new_key = intval( $this->request['new_key'] );
$new_salt = intval( $this->request['new_salt'] );
$salt = str_replace( '\\', "\\\\", IPSMember::generatePasswordSalt(5) );
$key = IPSMember::generateAutoLoginKey();
$md5_once = md5( trim($password) );
//-----------------------------------------
// AJAX debug
//-----------------------------------------
IPSDebug::fireBug( 'info', array( 'Password: ' . $password ) );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $password OR ! $password2 )
{
$this->registry->output->showError( $this->lang->words['password_nogood'] );
}
if ( $password != $password2 )
{
$this->registry->output->showError( $this->lang->words['m_passmatch'] );
}
//-----------------------------------------
// Get member
//-----------------------------------------
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
{
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
}
//-----------------------------------------
// Check Converge: Password
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changePass( $member['email'], $md5_once, $password, $member );
/*if ( $han_login->return_code != 'METHOD_NOT_DEFINED' AND $han_login->return_code != 'SUCCESS' )
{
$this->returnJsonError( $this->lang->words['m_passchange']);
exit();
}*/
//-----------------------------------------
// Local DB
//-----------------------------------------
$update = array();
if( $new_salt )
{
$update['members_pass_salt'] = $salt;
}
if( $new_key )
{
$update['member_login_key'] = $key;
}
if( count($update) )
{
IPSMember::save( $member_id, array( 'core' => $update ) );
}
IPSMember::updatePassword( $member_id, $md5_once );
IPSLib::runMemberSync( 'onPassChange', $member_id, $password );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( sprintf( $this->lang->words['m_passlog'], $member_id ) );
$this->registry->output->global_message = $this->lang->words['pw_updated_success'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
}
/**
* Update a user's login or display name
*
* @param string Field to update
* @return @e void [Outputs to screen]
*/
protected function save_member_name( $field='members_display_name' )
{
$member_id = intval( $this->request['member_id'] );
$member = IPSMember::load( $member_id );
//-----------------------------------------
// Allowed to edit administrators?
//-----------------------------------------
if( $member['g_access_cp'] AND !$this->registry->getClass('class_permissions')->checkPermission( 'member_edit_admin', 'members', 'members' ) )
{
$this->registry->output->showError( $this->lang->words['m_editadmin'] );
}
if ( $field == 'members_display_name' )
{
$display_name = $this->request['display_name'];
$display_name = str_replace("&#43;", "+", $display_name );
}
else
{
$display_name = $this->request['name'];
$display_name = str_replace("&#43;", "+", $display_name );
$display_name = str_replace( '|', '&#124;' , $display_name );
$display_name = trim( preg_replace( "/\s{2,}/", " ", $display_name ) );
}
if ( $this->settings['strip_space_chr'] )
{
// use hexdec to convert between '0xAD' and chr
$display_name = IPSText::removeControlCharacters( $display_name );
}
if ( $field == 'members_display_name' AND preg_match( "#[\[\];,\|]#", str_replace( '&#39;', "'", str_replace( '&amp;', '&', str_replace( '&quot;', '"', str_replace( '&#33;', '!', $display_name ) ) ) ) ) )
{
$this->registry->output->showError( $this->lang->words['m_displaynames'] );
}
try
{
if ( IPSMember::getFunction()->updateName( $member_id, $display_name, $field, TRUE ) === TRUE )
{
if ( $field == 'members_display_name' )
{
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_dnamelog'], $member['members_display_name'], $display_name ));
}
else
{
ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf( $this->lang->words['m_namelog'], $member['name'], $display_name ) );
//-----------------------------------------
// If updating a name, and display names
// disabled, update display name too
//-----------------------------------------
if( !ipsRegistry::$settings['auth_allow_dnames'] )
{
IPSMember::getFunction()->updateName( $member_id, $display_name, 'members_display_name', TRUE );
}
//-----------------------------------------
// I say, did we choose to email 'dis member?
//-----------------------------------------
if ( $this->request['send_email'] == 1 )
{
//-----------------------------------------
// By golly, we did!
//-----------------------------------------
$msg = trim( IPSText::stripslashes( nl2br( $_POST['email_contents'] ) ) );
$msg = str_replace( "{old_name}", $member['name'], $msg );
$msg = str_replace( "{new_name}", $display_name , $msg );
$msg = str_replace( "<#BOARD_NAME#>", $this->settings['board_name'], $msg );
$msg = str_replace( "<#BOARD_ADDRESS#>", $this->settings['board_url'] . '/index.' . $this->settings['php_ext'], $msg );
IPSText::getTextClass('email')->message = stripslashes( IPSText::getTextClass('email')->cleanMessage($msg) );
IPSText::getTextClass('email')->subject = $this->lang->words['m_changesubj'];
IPSText::getTextClass('email')->to = $member['email'];
IPSText::getTextClass('email')->sendMail();
}
}
$this->cache->rebuildCache( 'stats', 'global' );
}
else
{
# We should absolutely never get here. So this is a fail-safe, really to
# prevent a "false" positive outcome for the end-user
$this->registry->output->showError( $this->lang->words['m_namealready'] );
}
}
catch( Exception $error )
{
// $this->returnJsonError( $error->getMessage() );
switch( $error->getMessage() )
{
case 'NO_USER':
$this->registry->output->showError( $this->lang->words['m_noid'] );
break;
case 'NO_PERMISSION':
case 'NO_NAME':
$this->registry->output->showError( sprintf($this->lang->words['m_morethan3'], $this->settings['max_user_name_length'] ) );
break;
case 'ILLEGAL_CHARS':
$this->registry->output->showError( $this->lang->words['m_illegal'] );
break;
case 'USER_NAME_EXISTS':
$this->registry->output->showError( $this->lang->words['m_namealready'] );
break;
default:
$this->registry->output->showError( $error->getMessage() );
break;
}
}
//-----------------------------------------
// Load handler...
//-----------------------------------------
if( $field == 'name' )
{
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );
$han_login = new $classToLoad( $this->registry );
$han_login->init();
$han_login->changeName( $member['name'], $display_name, $member['email'], $member );
}
else
{
IPSLib::runMemberSync( 'onNameChange', $member_id, $display_name );
}
$this->registry->output->global_message = $this->lang->words[ $field . '_updated_success'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . 'module=members&do=viewmember&member_id=' . $member_id );
}
}
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,157 +1,157 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Configure default notification options
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://hatynka.in
* @version $Rev: 8644 $
*
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_members_members_notifications extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Notifications library
*
* @var object
*/
protected $notifyLibrary;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_notifications' );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=members&amp;section=notifications';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=notifications';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
//-----------------------------------------
// Permissions config
//-----------------------------------------
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'configure_notifications' );
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$this->notifyLibrary = new $classToLoad( $this->registry );
//-----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'save':
$this->saveDefaults();
break;
default:
case 'show':
$this->showDefaults();
break;
}
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Show form to configure notification default options
*
* @return @e void
*/
public function showDefaults()
{
$_configOptions = $this->notifyLibrary->getNotificationData();
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
$this->registry->output->html .= $this->html->showConfigurationOptions( $_configOptions, $_notifyConfig );
}
/**
* Save default notification configuration
*
* @return @e void
*/
public function saveDefaults()
{
$_configOptions = $this->notifyLibrary->getNotificationData();
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
foreach( $_configOptions as $option )
{
$_notifyConfig[ $option['key'] ] = array();
$_notifyConfig[ $option['key'] ]['selected'] = ( is_array($this->request['default_' . $option['key'] ]) AND count($this->request['default_' . $option['key'] ]) ) ? $this->request['default_' . $option['key'] ] : array();
$_notifyConfig[ $option['key'] ]['disabled'] = ( is_array($this->request['disabled_' . $option['key'] ]) AND count($this->request['disabled_' . $option['key'] ]) ) ? $this->request['disabled_' . $option['key'] ] : array();
$_notifyConfig[ $option['key'] ]['disable_override'] = intval($this->request['disable_override_' . $option['key'] ]);
}
$this->notifyLibrary->saveNotificationConfig( $_notifyConfig );
$this->registry->output->global_message = $this->lang->words['notificationconfig_saved'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Configure default notification options
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
*
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_members_members_notifications extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Notifications library
*
* @var object
*/
protected $notifyLibrary;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate( 'cp_skin_notifications' );
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=members&amp;section=notifications';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=notifications';
//-----------------------------------------
// Load lang
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
//-----------------------------------------
// Permissions config
//-----------------------------------------
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'configure_notifications' );
//-----------------------------------------
// Notifications library
//-----------------------------------------
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
$this->notifyLibrary = new $classToLoad( $this->registry );
//-----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
case 'save':
$this->saveDefaults();
break;
default:
case 'show':
$this->showDefaults();
break;
}
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Show form to configure notification default options
*
* @return @e void
*/
public function showDefaults()
{
$_configOptions = $this->notifyLibrary->getNotificationData();
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
$this->registry->output->html .= $this->html->showConfigurationOptions( $_configOptions, $_notifyConfig );
}
/**
* Save default notification configuration
*
* @return @e void
*/
public function saveDefaults()
{
$_configOptions = $this->notifyLibrary->getNotificationData();
$_notifyConfig = $this->notifyLibrary->getDefaultNotificationConfig();
foreach( $_configOptions as $option )
{
$_notifyConfig[ $option['key'] ] = array();
$_notifyConfig[ $option['key'] ]['selected'] = ( is_array($this->request['default_' . $option['key'] ]) AND count($this->request['default_' . $option['key'] ]) ) ? $this->request['default_' . $option['key'] ] : array();
$_notifyConfig[ $option['key'] ]['disabled'] = ( is_array($this->request['disabled_' . $option['key'] ]) AND count($this->request['disabled_' . $option['key'] ]) ) ? $this->request['disabled_' . $option['key'] ] : array();
$_notifyConfig[ $option['key'] ]['disable_override'] = intval($this->request['disable_override_' . $option['key'] ]);
}
$this->notifyLibrary->saveNotificationConfig( $_notifyConfig );
$this->registry->output->global_message = $this->lang->words['notificationconfig_saved'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
}
@@ -1,314 +1,314 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Member management
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://hatynka.in
* @version $Revision: 8644 $
*
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_members_members_ranks extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_ranks');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=members&amp;section=ranks';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=ranks';
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member' ) );
///-----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'title':
$this->_titlesStart();
break;
case 'rank_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
$this->_titlesForm( 'edit' );
break;
case 'rank_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
$this->_titlesForm( 'add' );
break;
case 'do_add_rank':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
$this->_titlesSave( 'add' );
break;
case 'do_rank_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
$this->_titlesSave( 'edit' );
break;
case 'rank_delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_delete' );
$this->_titlesDelete();
break;
}
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
$this->registry->getClass('output')->sendOutput();
}
/**
* Recache ranks
*
* @return @e void
*/
public function titlesRecache()
{
$ranks = array();
$this->DB->build( array( 'select' => 'id, title, pips, posts',
'from' => 'titles',
'order' => 'posts DESC',
) );
$this->DB->execute();
while ( $i = $this->DB->fetch() )
{
$ranks[ $i['id'] ] = array(
'TITLE' => $i['title'],
'PIPS' => $i['pips'],
'POSTS' => $i['posts'],
);
}
$this->cache->setCache( 'ranks', $ranks, array( 'array' => 1 ) );
}
/**
* Overview page
*
* @return @e void [Outputs to screen]
*/
protected function _titlesStart()
{
$this->registry->output->extra_nav[] = array( '', $this->lang->words['member_rank_nav'] );
$titles = array();
//-----------------------------------------
// Parse macro
//-----------------------------------------
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_replacements', 'where' => "replacement_set_id=0 AND replacement_key='pip_pip'" ) );
$row['A_STAR'] = str_replace( "{style_image_url}", $this->settings['img_url'], $row['replacement_content'] );
//-----------------------------------------
// Lets get on with it...
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'titles', 'order' => "posts" ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['A_STAR'] = $row['A_STAR'];
$titles[] = $r;
}
$this->registry->output->html .= $this->html->titlesOverview( $titles );
}
/**
* Save rank [add/edit]
*
* @param string 'add' or 'edit'
* @return @e void [Outputs to screen]
*/
protected function _titlesSave( $type = 'add' )
{
//-----------------------------------------
// check for input
//-----------------------------------------
foreach( array( 'title', 'pips' ) as $field )
{
if ( ! isset( $this->request[ $field ] ) )
{
$this->registry->output->showError( $this->lang->words['rnk_completeform'], 11239 );
}
}
if ( $this->request['pips'] > 100 )
{
$this->registry->output->showError( $this->lang->words['rnk_max100'], 11240 );
}
if( $type == 'add' )
{
$this->DB->insert( 'titles', array(
'posts' => intval( trim( $this->request['posts'] ) ),
'title' => trim($this->request['title']),
'pips' => trim($this->request['pips']),
) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_added'] );
}
else
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11241 );
}
$this->DB->update( 'titles', array ( 'posts' => trim($this->request['posts']),
'title' => trim($this->request['title']),
'pips' => trim($this->request['pips']),
) , "id=" . intval( $this->request['id'] ) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_edit'] );
}
$this->titlesRecache();
if( $type == 'add' )
{
$this->registry->output->global_message = $this->lang->words['rnk_added2'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&amp;do=title' );
}
else
{
$this->registry->output->global_message = $this->lang->words['rnk_edited'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&amp;do=title' );
}
}
/**
* Delete a rank
*
* @return @e void [Outputs to screen]
*/
protected function _titlesDelete()
{
//-----------------------------------------
// check for input
//-----------------------------------------
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['rnk_notfounddel'], 11242 );
}
$this->DB->delete( 'titles', "id=" . intval($this->request['id']) );
$this->titlesRecache();
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_removed'] );
$this->registry->output->global_message = $this->lang->words['rnk_removed2'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&amp;do=title' );
}
/**
* Show the form to add/edit a rank
*
* @param string Type of form (add|edit)
* @return @e void [Outputs to screen]
*/
protected function _titlesForm( $mode='edit' )
{
$this->registry->output->extra_nav[] = array( '', $this->lang->words['rnk_setup'] );
if ( $mode == 'edit' )
{
$form_code = 'do_rank_edit';
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11243 );
}
$rank = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'titles', 'where' => "id=" . intval($this->request['id']) ) );
$button = $this->lang->words['rnk_editrank'];
}
else
{
$form_code = 'do_add_rank';
$rank = array( 'posts' => '', 'title' => "", 'pips' => "");
$button = $this->lang->words['rnk_addrank'];
}
//-----------------------------------------
$this->registry->output->html .= $this->html->titlesForm( $rank, $form_code, $button );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Member management
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_members_members_ranks extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Load skin
//-----------------------------------------
$this->html = $this->registry->output->loadTemplate('cp_skin_ranks');
//-----------------------------------------
// Set up stuff
//-----------------------------------------
$this->form_code = $this->html->form_code = 'module=members&amp;section=ranks';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=ranks';
//-----------------------------------------
// Load lang
//-----------------------------------------
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member' ) );
///-----------------------------------------
// What to do...
//-----------------------------------------
switch( $this->request['do'] )
{
default:
case 'title':
$this->_titlesStart();
break;
case 'rank_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
$this->_titlesForm( 'edit' );
break;
case 'rank_add':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
$this->_titlesForm( 'add' );
break;
case 'do_add_rank':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_add' );
$this->_titlesSave( 'add' );
break;
case 'do_rank_edit':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_edit' );
$this->_titlesSave( 'edit' );
break;
case 'rank_delete':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'ranks_delete' );
$this->_titlesDelete();
break;
}
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
$this->registry->getClass('output')->sendOutput();
}
/**
* Recache ranks
*
* @return @e void
*/
public function titlesRecache()
{
$ranks = array();
$this->DB->build( array( 'select' => 'id, title, pips, posts',
'from' => 'titles',
'order' => 'posts DESC',
) );
$this->DB->execute();
while ( $i = $this->DB->fetch() )
{
$ranks[ $i['id'] ] = array(
'TITLE' => $i['title'],
'PIPS' => $i['pips'],
'POSTS' => $i['posts'],
);
}
$this->cache->setCache( 'ranks', $ranks, array( 'array' => 1 ) );
}
/**
* Overview page
*
* @return @e void [Outputs to screen]
*/
protected function _titlesStart()
{
$this->registry->output->extra_nav[] = array( '', $this->lang->words['member_rank_nav'] );
$titles = array();
//-----------------------------------------
// Parse macro
//-----------------------------------------
$row = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'skin_replacements', 'where' => "replacement_set_id=0 AND replacement_key='pip_pip'" ) );
$row['A_STAR'] = str_replace( "{style_image_url}", $this->settings['img_url'], $row['replacement_content'] );
//-----------------------------------------
// Lets get on with it...
//-----------------------------------------
$this->DB->build( array( 'select' => '*', 'from' => 'titles', 'order' => "posts" ) );
$this->DB->execute();
while ( $r = $this->DB->fetch() )
{
$r['A_STAR'] = $row['A_STAR'];
$titles[] = $r;
}
$this->registry->output->html .= $this->html->titlesOverview( $titles );
}
/**
* Save rank [add/edit]
*
* @param string 'add' or 'edit'
* @return @e void [Outputs to screen]
*/
protected function _titlesSave( $type = 'add' )
{
//-----------------------------------------
// check for input
//-----------------------------------------
foreach( array( 'title', 'pips' ) as $field )
{
if ( ! isset( $this->request[ $field ] ) )
{
$this->registry->output->showError( $this->lang->words['rnk_completeform'], 11239 );
}
}
if ( $this->request['pips'] > 100 )
{
$this->registry->output->showError( $this->lang->words['rnk_max100'], 11240 );
}
if( $type == 'add' )
{
$this->DB->insert( 'titles', array(
'posts' => intval( trim( $this->request['posts'] ) ),
'title' => trim($this->request['title']),
'pips' => trim($this->request['pips']),
) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_added'] );
}
else
{
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11241 );
}
$this->DB->update( 'titles', array ( 'posts' => trim($this->request['posts']),
'title' => trim($this->request['title']),
'pips' => trim($this->request['pips']),
) , "id=" . intval( $this->request['id'] ) );
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_edit'] );
}
$this->titlesRecache();
if( $type == 'add' )
{
$this->registry->output->global_message = $this->lang->words['rnk_added2'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&amp;do=title' );
}
else
{
$this->registry->output->global_message = $this->lang->words['rnk_edited'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&amp;do=title' );
}
}
/**
* Delete a rank
*
* @return @e void [Outputs to screen]
*/
protected function _titlesDelete()
{
//-----------------------------------------
// check for input
//-----------------------------------------
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['rnk_notfounddel'], 11242 );
}
$this->DB->delete( 'titles', "id=" . intval($this->request['id']) );
$this->titlesRecache();
ipsRegistry::getClass('adminFunctions')->saveAdminLog( $this->lang->words['rnk_removed'] );
$this->registry->output->global_message = $this->lang->words['rnk_removed2'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code . '&amp;do=title' );
}
/**
* Show the form to add/edit a rank
*
* @param string Type of form (add|edit)
* @return @e void [Outputs to screen]
*/
protected function _titlesForm( $mode='edit' )
{
$this->registry->output->extra_nav[] = array( '', $this->lang->words['rnk_setup'] );
if ( $mode == 'edit' )
{
$form_code = 'do_rank_edit';
if ( !$this->request['id'] )
{
$this->registry->output->showError( $this->lang->words['rnk_notfound'], 11243 );
}
$rank = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'titles', 'where' => "id=" . intval($this->request['id']) ) );
$button = $this->lang->words['rnk_editrank'];
}
else
{
$form_code = 'do_add_rank';
$rank = array( 'posts' => '', 'title' => "", 'pips' => "");
$button = $this->lang->words['rnk_addrank'];
}
//-----------------------------------------
$this->registry->output->html .= $this->html->titlesForm( $rank, $form_code, $button );
}
}
@@ -1,295 +1,295 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.2.3
* Reputation System
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
* </pre>
*
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://hatynka.in
* @version $Rev: 8644 $
*
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_members_members_reputation extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin & Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_reputation' );
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
/* URL Bits */
$this->form_code = $this->html->form_code = 'module=members&amp;section=reputation';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=reputation';
/* What to do */
switch( $this->request['do'] )
{
case 'add_level_form':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->levelForm( 'add' );
break;
case 'do_add_level':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->doLevelForm( 'add' );
break;
case 'edit_level_form':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->levelForm( 'edit' );
break;
case 'do_edit_level':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->doLevelForm( 'edit' );
break;
case 'delete_level':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_delete' );
$this->deleteLevel();
break;
default:
case 'overview':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->reputationOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Rebuilds the reputation level cache
*
* @return @e void
*/
public function rebuildReputationLevelCache()
{
/* Cache */
$cache = array();
/* Query the levels */
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points DESC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$cache[] = $r;
}
/* Update the cache */
$this->cache->setCache( 'reputation_levels', $cache, array( 'array' => 1 ) );
}
/**
* Removes the selected reputation level
*
* @return @e void
*/
public function deleteLevel()
{
/* ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['invalid_id'], 11244 );
}
/* Delete */
$this->DB->delete( 'reputation_levels', "level_id={$id}" );
$this->rebuildReputationLevelCache();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['rep_level_removed'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
/**
* Handles the add/edit reputation level form
*
* @param string $mode Either add or edit
* @return @e void
*/
public function doLevelForm( $mode='add' )
{
/* Error Checking */
$errors = array();
if( ! $this->request['level_title'] && ! $this->request['level_image'] )
{
$errors[] = $this->lang->words['rep_no_title_img'];
}
if( count( $errors ) )
{
$this->levelForm( $mode, $errors );
return;
}
/* Build the data array */
$data = array(
'level_title' => $this->request['level_title'],
'level_image' => $this->request['level_image'],
'level_points' => intval( $this->request['level_points'] )
);
/* Add the level */
if( $mode == 'add' )
{
/* Insert */
$this->DB->insert( 'reputation_levels', $data );
$this->rebuildReputationLevelCache();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['rep_level_added'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
else
{
/* ID Check */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['invalid_id'], 11245 );
}
/* Update */
$this->DB->update( 'reputation_levels', $data, "level_id={$id}" );
$this->rebuildReputationLevelCache();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['rep_level_edited'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
}
/**
* Form for adding/exiting reputation levels
*
* @param string $mode Either add or edit
* @param array $errors Array of error messages to display
* @return @e void
*/
public function levelForm( $mode='add', $errors=array() )
{
/* Add Level Form */
if( $mode == 'add' )
{
/* ID */
$id = 0;
/* Data */
$data = array();
/* Text Bits */
$title = $this->lang->words['rep_form_add_title'];
$do = 'do_add_level';
}
/* Edit Level Form */
else
{
/* ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['invalid_id'], 11246 );
}
/* Data */
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'reputation_levels', 'where' => 'level_id=' . $id ) );
/* Text Bits */
$title = $this->lang->words['rep_form_edit_title'];
$do = 'do_edit_level';
}
/* Default Values */
$data['level_title'] = isset( $this->request['level_title'] ) ? $this->request['level_title'] : $data['level_title'];
$data['level_image'] = isset( $this->request['level_image'] ) ? $this->request['level_image'] : $data['level_image'];
$data['level_points'] = isset( $this->request['level_points'] ) ? $this->request['level_points'] : $data['level_points'];
/* Form Elements */
$form = array();
$form['level_title'] = $this->registry->output->formInput( 'level_title' , $data['level_title'] );
$form['level_image'] = $this->registry->output->formInput( 'level_image' , $data['level_image'] );
$form['level_points'] = $this->registry->output->formInput( 'level_points', $data['level_points'] );
/* Output */
$this->registry->output->html .= $this->html->reputationForm( $id, $do, $title, $form, $errors );
}
/**
* Reputation overview
*
* @return @e void
*/
public function reputationOverview()
{
/* INIT */
$levels = array();
/* Query Levels */
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points ASC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$r['level_image'] = $r['level_image'] ? "<img src='{$this->settings['public_dir']}style_extra/reputation_icons/{$r['level_image']}'>" : '';
$levels[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->reputationOverview( $levels );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Reputation System
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Rev: 10914 $
*
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
exit();
}
class admin_members_members_reputation extends ipsCommand
{
/**
* Skin object
*
* @var object Skin templates
*/
protected $html;
/**
* Shortcut for url
*
* @var string URL shortcut
*/
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @var string JS URL shortcut
*/
protected $form_code_js;
/**
* Main class entry point
*
* @param object ipsRegistry reference
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
/* Load Skin & Lang */
$this->html = $this->registry->output->loadTemplate( 'cp_skin_reputation' );
$this->registry->class_localization->loadLanguageFile( array( 'admin_member' ) );
/* URL Bits */
$this->form_code = $this->html->form_code = 'module=members&amp;section=reputation';
$this->form_code_js = $this->html->form_code_js = 'module=members&section=reputation';
/* What to do */
switch( $this->request['do'] )
{
case 'add_level_form':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->levelForm( 'add' );
break;
case 'do_add_level':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->doLevelForm( 'add' );
break;
case 'edit_level_form':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->levelForm( 'edit' );
break;
case 'do_edit_level':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->doLevelForm( 'edit' );
break;
case 'delete_level':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_delete' );
$this->deleteLevel();
break;
default:
case 'overview':
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reps_manage' );
$this->reputationOverview();
break;
}
/* Output */
$this->registry->output->html_main .= $this->registry->output->global_template->global_frame_wrapper();
$this->registry->output->sendOutput();
}
/**
* Rebuilds the reputation level cache
*
* @return @e void
*/
public function rebuildReputationLevelCache()
{
/* Cache */
$cache = array();
/* Query the levels */
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points DESC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$cache[] = $r;
}
/* Update the cache */
$this->cache->setCache( 'reputation_levels', $cache, array( 'array' => 1 ) );
}
/**
* Removes the selected reputation level
*
* @return @e void
*/
public function deleteLevel()
{
/* ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['invalid_id'], 11244 );
}
/* Delete */
$this->DB->delete( 'reputation_levels', "level_id={$id}" );
$this->rebuildReputationLevelCache();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['rep_level_removed'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
/**
* Handles the add/edit reputation level form
*
* @param string $mode Either add or edit
* @return @e void
*/
public function doLevelForm( $mode='add' )
{
/* Error Checking */
$errors = array();
if( ! $this->request['level_title'] && ! $this->request['level_image'] )
{
$errors[] = $this->lang->words['rep_no_title_img'];
}
if( count( $errors ) )
{
$this->levelForm( $mode, $errors );
return;
}
/* Build the data array */
$data = array(
'level_title' => $this->request['level_title'],
'level_image' => $this->request['level_image'],
'level_points' => intval( $this->request['level_points'] )
);
/* Add the level */
if( $mode == 'add' )
{
/* Insert */
$this->DB->insert( 'reputation_levels', $data );
$this->rebuildReputationLevelCache();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['rep_level_added'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
else
{
/* ID Check */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['invalid_id'], 11245 );
}
/* Update */
$this->DB->update( 'reputation_levels', $data, "level_id={$id}" );
$this->rebuildReputationLevelCache();
/* Redirect */
$this->registry->output->global_message = $this->lang->words['rep_level_edited'];
$this->registry->output->silentRedirectWithMessage( $this->settings['base_url'] . $this->form_code );
}
}
/**
* Form for adding/exiting reputation levels
*
* @param string $mode Either add or edit
* @param array $errors Array of error messages to display
* @return @e void
*/
public function levelForm( $mode='add', $errors=array() )
{
/* Add Level Form */
if( $mode == 'add' )
{
/* ID */
$id = 0;
/* Data */
$data = array();
/* Text Bits */
$title = $this->lang->words['rep_form_add_title'];
$do = 'do_add_level';
}
/* Edit Level Form */
else
{
/* ID */
$id = intval( $this->request['id'] );
if( ! $id )
{
$this->registry->output->showError( $this->lang->words['invalid_id'], 11246 );
}
/* Data */
$data = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'reputation_levels', 'where' => 'level_id=' . $id ) );
/* Text Bits */
$title = $this->lang->words['rep_form_edit_title'];
$do = 'do_edit_level';
}
/* Default Values */
$data['level_title'] = isset( $this->request['level_title'] ) ? $this->request['level_title'] : $data['level_title'];
$data['level_image'] = isset( $this->request['level_image'] ) ? $this->request['level_image'] : $data['level_image'];
$data['level_points'] = isset( $this->request['level_points'] ) ? $this->request['level_points'] : $data['level_points'];
/* Form Elements */
$form = array();
$form['level_title'] = $this->registry->output->formInput( 'level_title' , $data['level_title'] );
$form['level_image'] = $this->registry->output->formInput( 'level_image' , $data['level_image'] );
$form['level_points'] = $this->registry->output->formInput( 'level_points', $data['level_points'] );
/* Output */
$this->registry->output->html .= $this->html->reputationForm( $id, $do, $title, $form, $errors );
}
/**
* Reputation overview
*
* @return @e void
*/
public function reputationOverview()
{
/* INIT */
$levels = array();
/* Query Levels */
$this->DB->build( array( 'select' => '*', 'from' => 'reputation_levels', 'order' => 'level_points ASC' ) );
$this->DB->execute();
while( $r = $this->DB->fetch() )
{
$r['level_image'] = $r['level_image'] ? "<img src='{$this->settings['public_dir']}style_extra/reputation_icons/{$r['level_image']}'>" : '';
$levels[] = $r;
}
/* Output */
$this->registry->output->html .= $this->html->reputationOverview( $levels );
}
}
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Управление пользователями</title>
<title>Manage Members</title>
<subitems>
<subitem>
<subitemtitle>Управление пользователями</subitemtitle>
<subitemtitle>Manage Members</subitemtitle>
<subitemlang>manage_members</subitemlang>
<subsection>members</subsection>
<subitemurl>do=members_overview</subitemurl>
@@ -16,24 +16,24 @@
</item>
<item>
<title>Звания</title>
<title>Member Ranks</title>
<subitems>
<subitem>
<subitemtitle>Управление званиями пользователей</subitemtitle>
<subitemtitle>Member Ranks</subitemtitle>
<subitemlang>mem_ranks</subitemlang>
<subsection>ranks</subsection>
<subitemurl>do=ranks_overview</subitemurl>
<subitemrolekey>ranks_add</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitem>
</subitems>
</item>
<item>
<title>Репутация</title>
<title>Member Reputation</title>
<subitems>
<subitem>
<subitemtitle>Управление репутацией пользователей</subitemtitle>
<subitemtitle>Member Reputation</subitemtitle>
<subitemlang>mem_rep</subitemlang>
<subsection>reputation</subsection>
<subitemurl>do=overview</subitemurl>
@@ -41,61 +41,61 @@
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</item>
<item>
<title>Дополнительные поля</title>
<title>Member Management Tools</title>
<subitems>
<subitem>
<subitemtitle>Управление дополнительными полями профиля</subitemtitle>
<subitemtitle>Member Management Tools</subitemtitle>
<subitemlang>mem_tools</subitemlang>
<subsection>tools</subsection>
<subitemurl></subitemurl>
<subitemrolekey>membertools_ip</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitem>
</subitems>
</item>
<item>
<title>Добавление пользователя</title>
<title>Add New Member</title>
<subitems>
<subitem>
<subitemtitle>Добавление пользователя</subitemtitle>
<subitemtitle>Add New Member</subitemtitle>
<subitemlang>mem_add</subitemlang>
<subsection>members</subsection>
<subitemurl>do=add</subitemurl>
<subitemrolekey>member_add</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitem>
</subitems>
</item>
</item>
<item>
<title>Бан фильтры</title>
<title>Ban Filters</title>
<subitems>
<subitem>
<subitemtitle>Управление бан фильтрами</subitemtitle>
<subitemtitle>Ban Filters</subitemtitle>
<subitemlang>banfilters</subitemlang>
<subsection>banfilters</subsection>
<subitemurl></subitemurl>
<subitemrolekey>ban_manage</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitem>
</subitems>
</item>
<item>
<title>Настройки уведомлений</title>
<title>Notification Defaults</title>
<subitems>
<subitem>
<subitemtitle>Настройки уведомлений</subitemtitle>
<subitemtitle>Notification Defaults</subitemtitle>
<subitemlang>notifications</subitemlang>
<subsection>notifications</subsection>
<subitemurl></subitemurl>
<subitemrolekey>configure_notifications</subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitem>
</subitems>
</item>
</tabitems>
@@ -1,170 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление пользователями</grouptitle>
<grouptitle>Managing Members</grouptitle>
<grouplang>members_members</grouplang>
<items>
<item>
<key>member_add</key>
<string>Может добавлять?</string>
<string>Can add members?</string>
</item>
<item>
<key>member_add_admin</key>
<string>Может добавлять администраторов?</string>
<string>Can add ADMINS?</string>
</item>
<item>
<key>member_edit</key>
<string>Может изменять?</string>
<string>Can edit members?</string>
</item>
<item>
<key>member_edit_admin</key>
<string>Может изменять администраторов?</string>
<string>Can edit ADMINS?</string>
</item>
<item>
<key>member_delete</key>
<string>Может удалять?</string>
<string>Can delete members?</string>
</item>
<item>
<key>member_delete_admin</key>
<string>Может удалять администраторов?</string>
<string>Can delete ADMINS?</string>
</item>
<item>
<key>member_login</key>
<string>Can log in as members?</string>
</item>
<item>
<key>members_merge</key>
<string>Может объединять?</string>
<string>Can merge two user accounts?</string>
</item>
<item>
<key>member_suspend</key>
<string>Может блокировать?</string>
<string>Can suspend and unsuspend members?</string>
</item>
<item>
<key>member_suspend_admin</key>
<string>Может блокировать администраторов?</string>
<string>Can suspend and unsuspend ADMINS?</string>
</item>
<item>
<key>member_prune</key>
<string>Может удалять?</string>
<string>Can prune members?</string>
</item>
<item>
<key>member_prune_admin</key>
<string>Может удалять администраторов?</string>
<string>Can prune ADMINS?</string>
</item>
<item>
<key>member_move</key>
<string>Может переносить из группы в группу?</string>
<string>Can bulk move members to other groups? (Does not apply to editing members where the group can still be changed)</string>
</item>
<item>
<key>member_move_admin1</key>
<string>Может переносить администраторов в другие группы?</string>
<string>Can move ADMINS to other groups?</string>
</item>
<item>
<key>member_move_admin2</key>
<string>Может переносить в группу администраторов?</string>
<string>Can promote members to ADMIN?</string>
</item>
<item>
<key>member_ban</key>
<string>Может банить?</string>
<string>Can ban members?</string>
</item>
<item>
<key>member_ban_admin</key>
<string>Может банить администраторов?</string>
<string>Can ban ADMINS?</string>
</item>
<item>
<key>member_photo</key>
<string>Может изменять фотографии пользователям?</string>
<string>Can upload new member photos?</string>
</item>
<item>
<key>member_photo_admin</key>
<string>Может изменять фотографии администраторам?</string>
<string>Can upload new photos for ADMINS?</string>
</item>
<item>
<key>membertools_validating</key>
<string>Может управлять ожидающими активации?</string>
<string>Can manage validating members?</string>
</item>
<item>
<key>membertools_locked</key>
<string>Может управлять заблокированными?</string>
<string>Can manage locked members?</string>
</item>
<item>
<key>membertools_banned</key>
<string>Может управлять забаненными?</string>
<string>Can manage banned members?</string>
</item>
<item>
<key>membertools_spam</key>
<string>Может управлять спам-пользователями?</string>
<string>Can manage spam members?</string>
</item>
<item>
<key>membertools_incomplete</key>
<string>Может управлять не завершившими регистрацию?</string>
<string>Can manage incomplete members?</string>
</item>
<item>
<key>membertools_delete_pms</key>
<string>Может удалять личные сообщения?</string>
<string>Can delete private messages?</string>
</item>
</items>
</group>
<group>
<grouptitle>Инструменты</grouptitle>
<grouptitle>Member Tools</grouptitle>
<grouplang>members_tools</grouplang>
<items>
<item>
<key>membertools_ip</key>
<string>Может использовать инструменты работы с IP-адресами?</string>
<string>Can use the IP address tools?</string>
</item>
</items>
</group>
<group>
<grouptitle>Звания</grouptitle>
<grouptitle>Member Ranks</grouptitle>
<grouplang>members_ranks</grouplang>
<items>
<item>
<key>ranks_add</key>
<string>Может просматривать и добавлять?</string>
<string>Can view and add new member ranks?</string>
</item>
<item>
<key>ranks_edit</key>
<string>Может изменять?</string>
<string>Can edit member ranks?</string>
</item>
<item>
<key>ranks_delete</key>
<string>Может удалять?</string>
<string>Can delete member ranks?</string>
</item>
</items>
</group>
<group>
<grouptitle>Бан-фильтр</grouptitle>
<grouptitle>Managing Ban Filters</grouptitle>
<grouplang>members_banfilters</grouplang>
<items>
<item>
<key>ban_manage</key>
<string>Может управлять фильтром?</string>
<string>Can manage ban filters?</string>
</item>
<item>
<key>ban_remove</key>
<string>Может удалять правила?</string>
<string>Can remove ban filters?</string>
</item>
</items>
</group>
<group>
<grouptitle>Репутация</grouptitle>
<grouptitle>Member Reputation</grouptitle>
<grouplang>members_reputation</grouplang>
<items>
<item>
<key>reps_manage</key>
<string>Может управлять?</string>
<string>Can manage reputation levels?</string>
</item>
<item>
<key>reps_delete</key>
<string>Может удалять уровни репутации?</string>
<string>Can delete reputation levels?</string>
</item>
</items>
</group>
<group>
<grouptitle>Уведомления</grouptitle>
<grouptitle>Notification Defaults</grouptitle>
<grouplang>members_notifications</grouplang>
<items>
<item>
<key>configure_notifications</key>
<string>Может настраивать значения по-умолчанию для уведомлений?</string>
<string>Configure notification defaults?</string>
</item>
</items>
</group>
@@ -3,11 +3,11 @@
* @file defaultSection.php Define the default section for the 'restrictions' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since 20th February 2002
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8655 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,10 +2,10 @@
<menu>
<tabitems>
<item>
<title>Управление администраторскими ограничениями</title>
<title>Manage ACP Restrictions</title>
<subitems>
<subitem>
<subitemtitle>Администраторские ограничения</subitemtitle>
<subitemtitle>Manage ACP Restrictions</subitemtitle>
<subitemlang>restrictions</subitemlang>
<subsection>restrictions</subsection>
<subitemurl>do=overview</subitemurl>
@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Управление ограничениями доступа</grouptitle>
<grouptitle>Manage ACP Restrictions</grouptitle>
<grouplang>members_restrictions</grouplang>
<items>
<item>
<key>restrictions_add_member</key>
<string>Может добавлять ограничения?</string>
<string>Can add member restrictions?</string>
</item>
<item>
<key>restrictions_edit_member</key>
<string>Может изменять ограничения?</string>
<string>Can edit member restrictions?</string>
</item>
<item>
<key>restrictions_delete_member</key>
<string>Может удалять ограничения?</string>
<string>Can remove member restrictions?</string>
</item>
<item>
<key>restrictions_add_group</key>
<string>Может добавлять ограничения для групп?</string>
<string>Can add group restrictions?</string>
</item>
<item>
<key>restrictions_edit_group</key>
<string>Может изменять ограничения для групп?</string>
<string>Can edit group restrictions?</string>
</item>
<item>
<key>restrictions_delete_group</key>
<string>Может удалять ограничения для групп?</string>
<string>Can remove group restrictions?</string>
</item>
</items>
</group>
@@ -0,0 +1,239 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Warning Actions
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $ (original: Mark)
* @copyright © 2011 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly.";
exit();
}
class admin_members_warnings_actions extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Init
//-----------------------------------------
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'actions_view' );
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member' ), 'members' );
$this->html = $this->registry->output->loadTemplate( 'cp_skin_warnings_actions' );
$this->form_code = $this->html->form_code = 'module=warnings&amp;section=actions&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=warnings&section=actions&';
//-----------------------------------------
// What are we doing
//-----------------------------------------
switch ( $this->request['do'] )
{
case 'add':
$this->form( 'add' );
break;
case 'edit':
$this->form( 'edit' );
break;
case 'save':
$this->save();
break;
case 'delete':
$this->delete();
break;
case 'do_delete':
$this->do_delete();
break;
case 'reorder':
$this->reorder();
break;
default:
$this->manage();
break;
}
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
$this->registry->getClass('output')->sendOutput();
}
/**
* Action: Manage
*/
private function manage()
{
$actions = array();
$this->DB->build( array( 'select' => '*', 'from' => 'members_warn_actions', 'order' => 'wa_points ASC' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$actions[ $row['wa_id'] ] = $row;
}
$this->registry->output->html .= $this->html->manage( $actions );
}
/**
* Action: Show form
*/
private function form( $type )
{
$current = array();
if ( $type == 'edit' )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'actions_edit' );
$id = intval( $this->request['id'] );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_id={$id}" ) );
if ( !$current['wa_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112160', FALSE, '', 404 );
}
}
else
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'actions_add' );
}
$this->registry->output->html .= $this->html->form( $current );
}
/**
* Action: Save
*/
private function save()
{
//-----------------------------------------
// Validate Data
//-----------------------------------------
if ( !$this->request['points'] )
{
ipsRegistry::getClass('output')->showError( 'err_warning_action_points', '112161', FALSE, '', 500 );
}
//-----------------------------------------
// Save
//-----------------------------------------
$save = array(
'wa_points' => floatval( $this->request['points'] ),
'wa_mq' => ( $this->request['mq_perm'] ) ? -1 : intval( $this->request['mq'] ),
'wa_mq_unit' => ( $this->request['mq_unit'] == 'd' ) ? 'd' : 'h',
'wa_rpa' => ( $this->request['rpa_perm'] ) ? -1 :intval( $this->request['rpa'] ),
'wa_rpa_unit' => ( $this->request['rpa_unit'] == 'd' ) ? 'd' : 'h',
'wa_suspend' => ( $this->request['suspend_perm'] ) ? -1 :intval( $this->request['suspend'] ),
'wa_suspend_unit' => ( $this->request['suspend_unit'] == 'd' ) ? 'd' : 'h',
'wa_ban_group' => ( intval( $this->request['ban_group'] ) > 0 ) ? intval( $this->request['ban_group_id'] ) : 0,
'wa_override' => intval( $this->request['override'] )
);
if ( $this->request['id'] )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'actions_edit' );
$id = intval( $this->request['id'] );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_id={$id}" ) );
if ( !$current['wa_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112162', FALSE, '', 500 );
}
$this->DB->update( 'members_warn_actions', $save, "wa_id={$id}" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['warn_actions_edited'], $save['wa_name'] ) );
}
else
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'actions_add' );
$this->DB->insert( 'members_warn_actions', $save );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['warn_actions_created'], $save['wa_name'] ) );
}
//-----------------------------------------
// Display
//-----------------------------------------
$this->registry->output->redirect( "{$this->settings['base_url']}app=members&amp;module=warnings&amp;section=actions", $this->lang->words['warn_actions_saved'] );
}
/**
* Action: Delete
*/
private function delete()
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'actions_delete' );
$id = intval( $this->request['id'] );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_id={$id}" ) );
if ( !$current['wa_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112163', FALSE, '', 404 );
}
$new = intval( $this->request['new'] );
$new = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_actions', 'where' => "wa_id={$new}" ) );
if ( !$current['wa_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112164', FALSE, '', 500 );
}
$this->DB->delete( 'members_warn_actions', "wa_id={$id}" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['warn_actions_deleted'], $current['wa_name'] ) );
$this->registry->output->redirect( "{$this->settings['base_url']}app=members&amp;module=warnings&amp;section=actions", $this->lang->words['warn_actions_del_saved'] );
}
}
@@ -0,0 +1,14 @@
<?php
/**
* @file defaultSection.php Define the default section for the 'warnings' module
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 07th May 2012
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
$DEFAULT_SECTION = 'reasons';
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,274 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.3.4
* Warning Reasons
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* </pre>
*
* @author $Author: bfarber $ (original: Mark)
* @copyright © 2011 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @version $Revision: 10914 $
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly.";
exit();
}
class admin_members_warnings_reasons extends ipsCommand
{
/**
* Skin object shortcut
*
* @var $html
*/
public $html;
/**
* String for the screen url bit
*
* @var $form_code
*/
public $form_code = '';
/**
* String for the JS url bit
*
* @var $form_code_js
*/
public $form_code_js = '';
/**
* Main function executed automatically by the controller
*
* @param object $registry Registry object
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
//-----------------------------------------
// Init
//-----------------------------------------
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reasons_view' );
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'admin_member' ), 'members' );
$this->html = $this->registry->output->loadTemplate( 'cp_skin_warnings_reasons' );
$this->form_code = $this->html->form_code = 'module=warnings&amp;section=reasons&amp;';
$this->form_code_js = $this->html->form_code_js = 'module=warnings&section=reasons&';
//-----------------------------------------
// What are we doing
//-----------------------------------------
switch ( $this->request['do'] )
{
case 'add':
$this->form( 'add' );
break;
case 'edit':
$this->form( 'edit' );
break;
case 'save':
$this->save();
break;
case 'delete':
$this->delete();
break;
case 'do_delete':
$this->do_delete();
break;
case 'reorder':
$this->reorder();
break;
default:
$this->manage();
break;
}
//-----------------------------------------
// Pass to CP output hander
//-----------------------------------------
$this->registry->getClass('output')->html_main .= $this->registry->getClass('output')->global_template->global_frame_wrapper();
$this->registry->getClass('output')->sendOutput();
}
/**
* Action: Manage
*/
private function manage()
{
$reasons = array();
$this->DB->build( array( 'select' => '*', 'from' => 'members_warn_reasons', 'order' => 'wr_order' ) );
$this->DB->execute();
while( $row = $this->DB->fetch() )
{
$reasons[ $row['wr_id'] ] = $row;
}
$this->registry->output->html .= $this->html->manage( $reasons );
}
/**
* Action: Show form
*/
private function form( $type )
{
$current = array();
if ( $type == 'edit' )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reasons_edit' );
$id = intval( $this->request['id'] );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$id}" ) );
if ( !$current['wr_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112150', FALSE, '', 404 );
}
}
else
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reasons_add' );
}
$this->registry->output->html .= $this->html->form( $current );
}
/**
* Action: Save
*/
private function save()
{
//-----------------------------------------
// Validate Data
//-----------------------------------------
if ( !$this->request['name'] )
{
ipsRegistry::getClass('output')->showError( 'err_warning_reason_name', '112151', FALSE, '', 500 );
}
//-----------------------------------------
// Save
//-----------------------------------------
$save = array(
'wr_name' => $this->request['name'],
'wr_points' => floatval( $this->request['points'] ),
'wr_points_override' => intval( $this->request['points_override'] ),
'wr_remove' => intval( $this->request['remove'] ),
'wr_remove_unit' => ( $this->request['remove_unit'] == 'd' ) ? 'd' : 'h',
'wr_remove_override' => intval( $this->request['remove_override'] )
);
if ( $this->request['id'] )
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reasons_edit' );
$id = intval( $this->request['id'] );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$id}" ) );
if ( !$current['wr_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112152', FALSE, '', 500 );
}
$this->DB->update( 'members_warn_reasons', $save, "wr_id={$id}" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['warn_reasons_edited'], $save['wr_name'] ) );
}
else
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reasons_add' );
$top = $this->DB->buildAndFetch( array( 'select' => 'MAX(wr_id) as _top', 'from' => 'members_warn_reasons' ) );
$save['wr_order'] = ++$top['_top'];
$this->DB->insert( 'members_warn_reasons', $save );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['warn_reasons_created'], $save['wr_name'] ) );
}
//-----------------------------------------
// Display
//-----------------------------------------
$this->registry->output->redirect( "{$this->settings['base_url']}app=members&amp;module=warnings&amp;section=reasons", $this->lang->words['warn_reasons_saved'] );
}
/**
* Action: Delete
*/
private function delete()
{
$this->registry->getClass('class_permissions')->checkPermissionAutoMsg( 'reasons_delete' );
$id = intval( $this->request['id'] );
$current = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$id}" ) );
if ( !$current['wr_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112153', FALSE, '', 404 );
}
$new = intval( $this->request['new'] );
$new = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'members_warn_reasons', 'where' => "wr_id={$new}" ) );
if ( !$current['wr_id'] )
{
ipsRegistry::getClass('output')->showError( 'err_no_warn_reason', '112154', FALSE, '', 500 );
}
$this->DB->delete( 'members_warn_reasons', "wr_id={$id}" );
$this->registry->adminFunctions->saveAdminLog( sprintf( $this->lang->words['warn_reasons_deleted'], $current['wl_name'] ) );
$this->registry->output->redirect( "{$this->settings['base_url']}app=members&amp;module=warnings&amp;section=reasons", $this->lang->words['warn_reasons_del_saved'] );
}
/**
* AJAX Action: Reorder
*/
private function reorder()
{
/* Get ajax class */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classAjax.php', 'classAjax' );
$ajax = new $classToLoad();
//-----------------------------------------
// Checks...
//-----------------------------------------
if( $this->registry->adminFunctions->checkSecurityKey( $this->request['md5check'], true ) === false )
{
$ajax->returnString( $this->lang->words['postform_badmd5'] );
exit();
}
//-----------------------------------------
// Save new position
//-----------------------------------------
$position = 1;
if( is_array($this->request['reasons']) AND count($this->request['reasons']) )
{
foreach( $this->request['reasons'] as $this_id )
{
$this->DB->update( 'members_warn_reasons', array( 'wr_order' => $position ), 'wr_id=' . $this_id );
$position++;
}
}
$ajax->returnString( 'OK' );
}
}
@@ -0,0 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com/">IP.Board</a>
</body>
</html>
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<tabitems>
<item>
<title>Reasons</title>
<subitems>
<subitem>
<subitemtitle>Reasons</subitemtitle>
<subitemlang>warn_reasons</subitemlang>
<subsection>reasons</subsection>
<subitemurl></subitemurl>
<subitemrolekey></subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
<item>
<title>Actions</title>
<subitems>
<subitem>
<subitemtitle>Actions</subitemtitle>
<subitemlang>warn_actions</subitemlang>
<subsection>actions</subsection>
<subitemurl></subitemurl>
<subitemrolekey></subitemrolekey>
<subisredirect>0</subisredirect>
</subitem>
</subitems>
</item>
</tabitems>
</menu>
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<group>
<grouptitle>Reasons</grouptitle>
<grouplang>warn_reasons</grouplang>
<items>
<item>
<key>reasons_view</key>
<string>Can view warning reasons?</string>
</item>
<item>
<key>reasons_edit</key>
<string>Can edit warning reasons?</string>
</item>
<item>
<key>reasons_add</key>
<string>Can add new warning reasons?</string>
</item>
<item>
<key>reasons_delete</key>
<string>Can delete warning reasons?</string>
</item>
</items>
</group>
<group>
<grouptitle>Actions</grouptitle>
<grouplang>warn_actions</grouplang>
<items>
<item>
<key>actions_view</key>
<string>Can view warning actions?</string>
</item>
<item>
<key>actions_edit</key>
<string>Can edit warning actions?</string>
</item>
<item>
<key>actions_add</key>
<string>Can add new warning actions?</string>
</item>
<item>
<key>actions_delete</key>
<string>Can delete warning actions?</string>
</item>
</items>
</group>
</permissions>