Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -1,32 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Define the default restrictions section
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @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!
* $Author: ips_terabyte $
* @since 20th February 2002
* @version $Rev: 5713 $
*
* $LastChangedDate: 2011-05-05 12:40:49 -0400 (Thu, 05 May 2011) $
* @version v3.2.3
* $Revision: 8655 $
*/
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();
}
/**
* Very simply returns the default section if one is not
* passed in the URL
*/
$DEFAULT_SECTION = 'restrictions';
$DEFAULT_SECTION = 'restrictions';
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -3,19 +3,20 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* ACP Restrictions
* Last Updated: $Date: 2010-06-02 18:28:28 -0400 (Wed, 02 Jun 2010) $
* Last Updated: $Date: 2011-06-14 12:04:59 -0400 (Tue, 14 Jun 2011) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Members
* @link http://www.invisionpower.com
* @link http://hatynka.in
* @since 1st march 2002
* @version $Revision: 6445 $
* @version $Revision: 9039 $
* @todo Update class_xml references to classXml
*
*/
@@ -30,41 +31,36 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* Skin object
*
* @access private
* @var object Skin templates
*/
private $html;
protected $html;
/**
* Shortcut for url
*
* @access private
* @var string URL shortcut
*/
private $form_code;
protected $form_code;
/**
* Shortcut for url (javascript)
*
* @access private
* @var string JS URL shortcut
*/
private $form_code_js;
protected $form_code_js;
/**
* Member information
*
* @access private
* @var array Member information
*/
private $member_info = array();
protected $member_info = array();
/**
* Main class entry point
*
* @access public
* @param object ipsRegistry reference
* @return void [Outputs to screen]
* @return @e void [Outputs to screen]
*/
public function doExecute( ipsRegistry $registry )
{
@@ -165,11 +161,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* Saving the ACP restrictions - here's where it gets really dirty
*
* @access private
* @return void
* @return @e void
* @since 2.1.0.2005-7-11
*/
private function _restrictionsSave()
protected function _restrictionsSave()
{
$role_id = intval($this->request['id']);
$role_type = $this->request['type'];
@@ -206,6 +201,99 @@ class admin_members_restrictions_restrictions extends ipsCommand
return;
}
//-------------------------------
// Grab XML library
//-------------------------------
require_once( IPS_KERNEL_PATH . 'class_xml.php' );/*noLibHook*/
$xml = new class_xml();
$xml->doc_type = IPS_DOC_CHAR_SET;
//-------------------------------
// Start the madness...err parsing
//-------------------------------
foreach( ipsRegistry::$applications as $app_dir => $app_data )
{
if( !is_array(ipsRegistry::$modules[ $app_dir ]) OR !count(ipsRegistry::$modules[ $app_dir ]) )
{
continue;
}
$this->lang->loadLanguageFile( array( 'admin_menulang' ), $app_dir );
foreach( ipsRegistry::$modules[ $app_dir ] as $module )
{
$_file = IPSLib::getAppDir( $app_dir ) . '/modules_admin/' . $module['sys_module_key'] . '/xml/permissions.xml';
if( ! $module['sys_module_admin'] )
{
continue;
}
if( ! is_file( $_file ) )
{
continue;
}
$content = file_get_contents( $_file );
$xml->xml_parse_document( $content );
if ( ! is_array( $xml->xml_array['permissions']['group'][0] ) )
{
//-----------------------------------------
// Ensure [0] is populated
//-----------------------------------------
$xml->xml_array['permissions']['group'] = array( 0 => $xml->xml_array['permissions']['group'] );
}
//-----------------------------------------
// Loop through and sort out permissions and groups...
//-----------------------------------------
$group = 0;
foreach( $xml->xml_array['permissions']['group'] as $entry )
{
//-----------------------------------------
// Do we have a row matching this already?
//-----------------------------------------
$_title = ( $entry['grouplang']['VALUE'] AND $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] : $entry['grouptitle']['VALUE'];
$items = array();
$group++;
if( is_array($entry['items']) AND count($entry['items']) )
{
foreach( $entry['items'] as $item )
{
if( is_array($item) AND count($item) )
{
if( isset($item['key']) )
{
$items[ $item['key']['VALUE'] ] = ( $item['key']['VALUE'] AND $this->lang->words[ 'r__' . $item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $item['key']['VALUE'] ] : $item['string']['VALUE'];
}
else
{
foreach( $item as $sub_item )
{
$items[ $sub_item['key']['VALUE'] ] = ( $sub_item['key']['VALUE'] AND $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] : $sub_item['string']['VALUE'];
}
}
}
}
$perms[ $app_data['app_id'] ][ $module['sys_module_id'] ][ $group ]['title'] = $_title;
$perms[ $app_data['app_id'] ][ $module['sys_module_id'] ][ $group ]['items'] = $items;
}
}
}
}
//echo '<PRE>';print_r( $perms );exit();
$updated_permissions = array(
'applications' => array(),
'modules' => array(),
@@ -214,6 +302,9 @@ class admin_members_restrictions_restrictions extends ipsCommand
foreach( $_POST as $key => $value )
{
if( preg_match( "/^app_(\d+)$/", $key, $matches ) )
{
if( $value )
@@ -246,13 +337,11 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* Manage ACP restrictions - The meat and potatoes, so to speak
*
* @access private
* @param string [member|group]
* @return void
* @return @e void
* @since 2.1.0.2005-7-11
* @todo One of the only areas that still uses the old XML parser
*/
private function _restrictionsForm( $type='member' )
protected function _restrictionsForm( $type='member' )
{
//-------------------------------
// INIT
@@ -293,7 +382,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
// Grab XML library
//-------------------------------
require_once( IPS_KERNEL_PATH . 'class_xml.php' );
require_once( IPS_KERNEL_PATH . 'class_xml.php' );/*noLibHook*/
$xml = new class_xml();
$xml->doc_type = IPS_DOC_CHAR_SET;
@@ -308,6 +397,8 @@ class admin_members_restrictions_restrictions extends ipsCommand
{
continue;
}
$this->lang->loadLanguageFile( array( 'admin_menulang' ), $app_dir );
foreach( ipsRegistry::$modules[ $app_dir ] as $module )
{
@@ -318,7 +409,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
continue;
}
if( ! file_exists( $_file ) )
if( ! is_file( $_file ) )
{
continue;
}
@@ -348,7 +439,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
// Do we have a row matching this already?
//-----------------------------------------
$_title = $entry['grouptitle']['VALUE'];
$_title = ( $entry['grouplang']['VALUE'] AND $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $entry['grouplang']['VALUE'] ] : $entry['grouptitle']['VALUE'];
$items = array();
$group++;
@@ -360,13 +451,13 @@ class admin_members_restrictions_restrictions extends ipsCommand
{
if( isset($item['key']) )
{
$items[ $item['key']['VALUE'] ] = $item['string']['VALUE'];
$items[ $item['key']['VALUE'] ] = ( $item['key']['VALUE'] AND $this->lang->words[ 'r__' . $item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $item['key']['VALUE'] ] : $item['string']['VALUE'];
}
else
{
foreach( $item as $sub_item )
{
$items[ $sub_item['key']['VALUE'] ] = $sub_item['string']['VALUE'];
$items[ $sub_item['key']['VALUE'] ] = ( $sub_item['key']['VALUE'] AND $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] ) ? $this->lang->words[ 'r__' . $sub_item['key']['VALUE'] ] : $sub_item['string']['VALUE'];
}
}
}
@@ -389,11 +480,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* List members and groups with restrictions
*
* @access private
* @return void Outputs to screen
* @return @e void Outputs to screen
* @since 2.1.0.2005-7-7
*/
private function _acppermsList()
protected function _acppermsList()
{
//-------------------------------
// INIT
@@ -475,12 +565,11 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* Remove ACP restrictions - this will make a restricted member or group have full permissions
*
* @access private
* @param string [member|group]
* @return void
* @return @e void
* @since 2.1.0.2005-7-11
*/
private function _removePermissions( $type='member' )
protected function _removePermissions( $type='member' )
{
//-------------------------------
// INIT
@@ -516,12 +605,11 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* ACP Perms: Add member form
*
* @access private
* @param string [member|group]
* @return void
* @return @e void
* @since 2.1.0.2005-7-7
*/
private function _addRole( $type='member' )
protected function _addRole( $type='member' )
{
$this->registry->output->extra_nav[] = array( '', $this->lang->words['r_nav'] );
@@ -540,11 +628,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
* Checks input, adds row to DB if OK
* This bud's for you
*
* @access private
* @return void
* @return @e void
* @since 2.1.0.2005-7-8
*/
private function _addMemberDo()
protected function _addMemberDo()
{
//-------------------------------
// INIT
@@ -672,7 +759,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
$message = count($restrict) ? $this->lang->words['r_restrictbase'] : $this->lang->words['r_noacpaccessuntil'];
$this->registry->output->global_message = sprintf( $this->lang->words['r_addedmember'], $member['members_display_name'], $message );
$this->registry->output->setMessage( sprintf( $this->lang->words['r_addedmember'], $member['members_display_name'], $message ), 1 );
$this->request[ 'mid'] = $member['member_id'] ;
$this->_restrictionsForm( 'member' );
@@ -681,11 +768,10 @@ class admin_members_restrictions_restrictions extends ipsCommand
/**
* ACP Perms: Finish adding the group
*
* @access private
* @return void
* @return @e void
* @since 2.1.0.2005-7-8
*/
private function _addGroupDo()
protected function _addGroupDo()
{
//-------------------------------
// INIT
@@ -772,7 +858,7 @@ class admin_members_restrictions_restrictions extends ipsCommand
'row_perm_cache' => serialize( array() ),
'row_updated' => time() ) );
$this->registry->output->global_message = sprintf( $this->lang->words['r_addedgroup'], $group['g_title'] );
$this->registry->output->setMessage( sprintf( $this->lang->words['r_addedgroup'], $group['g_title'] ), 1 );
$this->_acppermsList();
}
}
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -6,6 +6,7 @@
<subitems>
<subitem>
<subitemtitle>Администраторские ограничения</subitemtitle>
<subitemlang>restrictions</subitemlang>
<subsection>restrictions</subsection>
<subitemurl>do=overview</subitemurl>
<subitemrolekey></subitemrolekey>
@@ -2,6 +2,7 @@
<permissions>
<group>
<grouptitle>Управление ограничениями доступа</grouptitle>
<grouplang>members_restrictions</grouplang>
<items>
<item>
<key>restrictions_add_member</key>