Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,28 +2,18 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-01-11 22:47:48 +0000 (Wed, 11 Jan 2006) $
|
||||
| > $Revision: 122 $
|
||||
| > $Author: bfarber $
|
||||
| > $Date: 2006-10-09 16:33:46 +0100 (Mon, 09 Oct 2006) $
|
||||
| > $Revision: 622 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Admin "welcome" screen functions
|
||||
@@ -37,7 +27,7 @@
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -84,21 +74,27 @@ class ad_index
|
||||
$sm_install = 1;
|
||||
}
|
||||
|
||||
if ( @file_exists( ROOT_PATH . 'install/install.lock' ) )
|
||||
if ( @file_exists( ROOT_PATH . 'install/installfiles/lock.php' ) )
|
||||
{
|
||||
$lock_file = 1;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//-----------------------------------------
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
if ( @file_exists( ROOT_PATH . 'upgrade/core/class_installer.php' ) )
|
||||
{
|
||||
unset($$k);
|
||||
define( 'INS_ROOT_PATH', ROOT_PATH.'upgrade/' );
|
||||
|
||||
require_once ROOT_PATH . 'upgrade/core/class_installer.php';
|
||||
require_once ROOT_PATH . 'upgrade/custom/app.php';
|
||||
|
||||
$upgrade = new application_installer();
|
||||
$upgrade->ipsclass =& $this->ipsclass;
|
||||
|
||||
$upgrade->get_version_latest();
|
||||
|
||||
if( $upgrade->last_poss_id > $upgrade->current_version )
|
||||
{
|
||||
$unfinished_upgrade = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -111,14 +107,14 @@ class ad_index
|
||||
// continue...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->page_title = "Äîáðî ïîæàëîâàòü â àäìèíöåíòð âàøåãî Invision Power Board";
|
||||
$this->ipsclass->admin->page_title = "Welcome to the Invision Power Board Administration CP";
|
||||
$this->ipsclass->admin->page_detail = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// PHP INFO?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->input['phpinfo'] )
|
||||
if ( isset($this->ipsclass->input['phpinfo']) AND $this->ipsclass->input['phpinfo'] )
|
||||
{
|
||||
@ob_start();
|
||||
phpinfo();
|
||||
@@ -135,6 +131,14 @@ class ad_index
|
||||
$php_body = str_replace( "%3B", "<br />" , $php_body );
|
||||
# PREVENT WRAP: Serialized array string cookies
|
||||
$php_body = str_replace( ";i:", ";<br />i:" , $php_body );
|
||||
# PREVENT WRAP: LS_COLORS env
|
||||
$php_body = str_replace( ":*.", "<br />:*." , $php_body );
|
||||
# PREVENT WRAP: PATH env
|
||||
$php_body = str_replace( "bin:/", "bin<br />:/" , $php_body );
|
||||
# PREVENT WRAP: Cookie %2C split
|
||||
$php_body = str_replace( "%2C", "%2C<br />" , $php_body );
|
||||
#PREVENT WRAP: Cookie , split
|
||||
$php_body = preg_replace( "#,(\d+),#", ",<br />\\1," , $php_body );
|
||||
|
||||
|
||||
$php_style = "<style type='text/css'>
|
||||
@@ -163,6 +167,8 @@ class ad_index
|
||||
// Upgrade history?
|
||||
//-----------------------------------------
|
||||
|
||||
$latest_version = array( 'upgrade_version_id' => NULL );
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(0, 5) ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
@@ -175,12 +181,12 @@ class ad_index
|
||||
|
||||
$upgrade_history[] = $r;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Resetting security image?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $_REQUEST['reset_security_flag'] == 1 AND $_REQUEST['new_build'] )
|
||||
if ( isset($_REQUEST['reset_security_flag']) AND $_REQUEST['reset_security_flag'] == 1 AND $_REQUEST['new_build'] )
|
||||
{
|
||||
$new_build = intval( $_REQUEST['new_build'] );
|
||||
$new_reason = trim( substr( $_REQUEST['new_reason'], 0, 1 ) );
|
||||
@@ -196,7 +202,7 @@ class ad_index
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->version = 'v'.$latest_version['upgrade_version_human'];
|
||||
$this->ipsclass->vn_full = $latest_version['upgrade_notes'] ? $latest_version['upgrade_notes'] : $this->ipsclass->vn_full;
|
||||
$this->ipsclass->vn_full = isset($latest_version['upgrade_notes']) AND $latest_version['upgrade_notes'] ? $latest_version['upgrade_notes'] : $this->ipsclass->vn_full;
|
||||
|
||||
$content['update_img'] = $this->html->update_img( base64_encode( $this->ipsclass->vn_full.'|^|'.$this->ipsclass->vars['board_url'] ) );
|
||||
|
||||
@@ -210,24 +216,26 @@ class ad_index
|
||||
// Notepad
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->input['save'] == 1 )
|
||||
if ( isset($this->ipsclass->input['save']) AND $this->ipsclass->input['save'] == 1 )
|
||||
{
|
||||
$this->ipsclass->DB->do_update( 'cache_store', array( 'cs_value' => $this->ipsclass->txt_stripslashes($_POST['notes']) ), "cs_key='adminnotes'" );
|
||||
$this->ipsclass->update_cache( array( 'value' => $this->ipsclass->txt_stripslashes($_POST['notes']), 'name' => 'adminnotes', 'donow' => 1, 'deletefirst' => 0, 'array' => 0 ) );
|
||||
}
|
||||
|
||||
$text = "Âû ìîæåòå èñïîëüçîâàòü ýòîò áëîê, êàê îáùèé áëîêíîò äëÿ âñåõ àäìèíèñòðàòîðîâ. Óäîáíî äëÿ ñîîáùåíèÿ äðóãèì àäìèíèñòðàòîðàì êàêèõ-ëèáî íîâîñòåé è ò.ä.";
|
||||
$text = "You can use this section to keep notes for yourself and other admins, etc.";
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'cache_store', 'where' => "cs_key='adminnotes'" ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
$this->ipsclass->init_load_cache( array( 'adminnotes', 'skinpanic' ) );
|
||||
|
||||
if ( ! $notes = $this->ipsclass->DB->fetch_row() )
|
||||
if ( !isset($this->ipsclass->cache['adminnotes']) OR !$this->ipsclass->cache['adminnotes'] )
|
||||
{
|
||||
$this->ipsclass->DB->do_insert( 'cache_store', array( 'cs_key' => 'adminnotes', 'cs_value' => $text ) );
|
||||
$this->ipsclass->update_cache( array( 'value' => $text, 'name' => 'adminnotes', 'donow' => 1, 'deletefirst' => 0, 'array' => 0 ) );
|
||||
|
||||
$notes = array( 'cs_key' => 'adminnotes', 'cs_value' => $text );
|
||||
$this->ipsclass->cache['adminnotes'] = $text;
|
||||
}
|
||||
|
||||
$content['ad_notes'] = $this->html->acp_notes( $notes['cs_value'] );
|
||||
$this->ipsclass->cache['adminnotes'] = htmlspecialchars($this->ipsclass->cache['adminnotes'], ENT_QUOTES);
|
||||
$this->ipsclass->cache['adminnotes'] = str_replace( "&#", "&#", $this->ipsclass->cache['adminnotes'] );
|
||||
|
||||
$content['ad_notes'] = $this->html->acp_notes( $this->ipsclass->cache['adminnotes'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Quick clicks
|
||||
@@ -255,6 +263,7 @@ class ad_index
|
||||
$t_time = time() - 60*10;
|
||||
$time_now = time();
|
||||
$seen_name = array();
|
||||
$acponline = "";
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => 's.session_member_name, s.session_location, s.session_log_in_time, s.session_running_time, s.session_ip_address',
|
||||
'from' => array( 'admin_sessions' => 's' ),
|
||||
@@ -267,7 +276,7 @@ class ad_index
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
if ( $seen_name[ $r['session_member_name'] ] == 1 )
|
||||
if ( isset($seen_name[ $r['session_member_name'] ]) AND $seen_name[ $r['session_member_name'] ] == 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -281,24 +290,22 @@ class ad_index
|
||||
|
||||
if ( ($r['_log_in'] / 60) < 1 )
|
||||
{
|
||||
$r['_log_in'] = sprintf("%0d", $r['_log_in']) . " ñåêóíä íàçàä";
|
||||
$r['_log_in'] = sprintf("%0d", $r['_log_in']) . " seconds ago";
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_log_in'] = sprintf("%0d", ($r['_log_in'] / 60) ) . " ìèíóò íàçàä";
|
||||
$r['_log_in'] = sprintf("%0d", ($r['_log_in'] / 60) ) . " minutes ago";
|
||||
}
|
||||
|
||||
if ( ($r['_click'] / 60) < 1 )
|
||||
{
|
||||
$r['_click'] = sprintf("%0d", $r['_click']) . " ñåêóíä íàçàä";
|
||||
$r['_click'] = sprintf("%0d", $r['_click']) . " seconds ago";
|
||||
}
|
||||
else
|
||||
{
|
||||
$r['_click'] = sprintf("%0d", ($r['_click'] / 60) ) . " ìèíóò íàçàä";
|
||||
$r['_click'] = sprintf("%0d", ($r['_click'] / 60) ) . " minutes ago";
|
||||
}
|
||||
|
||||
//$r['_host'] = @gethostbyaddr($r['session_ip_address']);
|
||||
|
||||
$r['session_location'] = $r['session_location'] ? $r['session_location'] : 'Index';
|
||||
|
||||
$acponline .= $this->html->acp_onlineadmin_row( $r );
|
||||
@@ -310,19 +317,18 @@ class ad_index
|
||||
// IPS latest news
|
||||
//-----------------------------------------
|
||||
|
||||
$content['latest_news'] = $this->html->acp_ips_news( 'http://www.ibresource.ru/forums/ibr_news.php' );
|
||||
$content['latest_news'] = $this->html->acp_ips_news( 'http://www.invisionpower.com/acp-ipb/getnews-2.php' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Stats
|
||||
//-----------------------------------------
|
||||
|
||||
$reg = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'COUNT(*) as reg', 'from' => 'validating', 'where' => 'lost_pass <> 1' ) );
|
||||
$reg = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'COUNT(*) as reg' , 'from' => 'validating', 'where' => 'lost_pass <> 1' ) );
|
||||
$coppa = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'COUNT(*) as coppa', 'from' => 'validating', 'where' => 'coppa_user=1' ) );
|
||||
|
||||
$content['stats'] = $this->html->acp_stats_wrapper( array( 'topics' => intval($this->ipsclass->cache['stats']['total_topics']),
|
||||
'replies' => intval($this->ipsclass->cache['stats']['total_replies']),
|
||||
'members' => intval($this->ipsclass->cache['stats']['mem_count']),
|
||||
'uploads' => $this->_get_uploads_size(),
|
||||
'validate' => intval( $reg['reg'] ),
|
||||
'coppa' => intval( $coppa['coppa'] ),
|
||||
'sql_driver' => strtoupper(SQL_DRIVER),
|
||||
@@ -330,7 +336,7 @@ class ad_index
|
||||
'php_version' => phpversion(),
|
||||
'php_sapi' => @php_sapi_name(),
|
||||
'ipb_version' => $this->ipsclass->version,
|
||||
'ipb_id' => $this->ipsclass->acpversion ) );
|
||||
'ipb_id' => $this->ipsclass->vn_full ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Piece it together
|
||||
@@ -348,18 +354,49 @@ class ad_index
|
||||
// Trashed skin?
|
||||
//-----------------------------------------
|
||||
|
||||
$skinmsg = $this->ipsclass->DB->simple_exec_query( array( "select" => '*', 'from' => "cache_store", "where" => "cs_key='skinpanic'" ) );
|
||||
|
||||
if ( $skinmsg['cs_value'] == 'rebuildemergency' )
|
||||
if ( isset($this->ipsclass->cache['skinpanic']) AND $this->ipsclass->cache['skinpanic'] == 'rebuildemergency' )
|
||||
{
|
||||
$this->ipsclass->html = str_replace( '<!--warningskin-->', $this->html->warning_rebuild_emergency(), $this->ipsclass->html );
|
||||
}
|
||||
|
||||
if ( $skinmsg['cs_value'] == 'rebuildupgrade' )
|
||||
if ( isset($this->ipsclass->cache['skinpanic']) AND $this->ipsclass->cache['skinpanic'] == 'rebuildupgrade' )
|
||||
{
|
||||
$this->ipsclass->html = str_replace( '<!--warningskin-->', $this->html->warning_rebuild_upgrade(), $this->ipsclass->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// IN DEV stuff...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( IN_DEV )
|
||||
{
|
||||
$last_update = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
|
||||
'from' => 'cache_store',
|
||||
'where' => "cs_key='in_dev_setting_update'" ) );
|
||||
|
||||
if ( ! $last_update['cs_value'] )
|
||||
{
|
||||
$this->ipsclass->DB->do_delete( 'cache_store', "cs_key='in_dev_setting_update'" );
|
||||
$this->ipsclass->DB->do_insert( 'cache_store', array( 'cs_value' => time(), 'cs_key' => "in_dev_setting_update" ) );
|
||||
$last_update = time();
|
||||
}
|
||||
|
||||
$last_settings_save = intval( @filemtime( ROOT_PATH . 'resources/settings.xml' ) );
|
||||
|
||||
if ( $last_settings_save > $last_update['cs_value'] )
|
||||
{
|
||||
$_mtime = $this->ipsclass->get_date( $last_settings_save , 'JOINED' );
|
||||
$_dbtime = $this->ipsclass->get_date( $last_update['cs_value'], 'JOINED' );
|
||||
|
||||
$_html = $this->ipsclass->skin_acp_global->warning_box( "settings.xml File Updated",
|
||||
"The 'resources/settings.xml' file has been updated. Please visit <a href='{$this->ipsclass->base_url}&section=tools'>this page</a> to re-import it to make sure your settings are up-to-date
|
||||
<br />Last modified time for 'settings.xml': $_mtime.
|
||||
<br />Last import run: $_dbtime" ) . "<br />";
|
||||
|
||||
$this->ipsclass->html = str_replace( '<!--in_dev_check-->', $_html, $this->ipsclass->html );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INSTALLER PRESENT?
|
||||
//-----------------------------------------
|
||||
@@ -376,6 +413,15 @@ class ad_index
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// UNFINISHED UPGRADE?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $unfinished_upgrade == 1 )
|
||||
{
|
||||
$this->ipsclass->html = str_replace( '<!--warningupgrade-->', $this->html->warning_upgrade(), $this->ipsclass->html );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INSUFFICIENT PHP VERSION?
|
||||
//-----------------------------------------
|
||||
@@ -398,7 +444,9 @@ class ad_index
|
||||
// ROOT ADMIN?
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group'])
|
||||
$lastactions = "";
|
||||
|
||||
if ( $this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// LAST 5 Admin Actions
|
||||
@@ -415,56 +463,32 @@ class ad_index
|
||||
}
|
||||
|
||||
$this->ipsclass->html = str_replace( '<!--acpactions-->', $this->html->acp_lastactions_wrapper( $lastactions ), $this->ipsclass->html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Last 5 log in attempts
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->build_query( array( 'select' => '*',
|
||||
'from' => 'admin_login_logs',
|
||||
'order' => 'admin_time DESC',
|
||||
'limit' => array( 0, 5 ) ) );
|
||||
|
||||
$this->ipsclass->DB->exec_query();
|
||||
|
||||
while ( $rowb = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$rowb['_admin_time'] = $this->ipsclass->admin->get_date( $rowb['admin_time'] );
|
||||
$rowb['_admin_img'] = $rowb['admin_success'] ? 'aff_tick.png' : 'aff_cross.png';
|
||||
|
||||
$logins .= $this->html->acp_last_logins_row( $rowb );
|
||||
}
|
||||
|
||||
$this->ipsclass->html = str_replace( '<!--acplogins-->', $this->html->acp_last_logins_wrapper( $logins ), $this->ipsclass->html );
|
||||
}
|
||||
|
||||
$this->ipsclass->admin->output();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Get uploads size
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _get_uploads_size()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Make sure the uploads path is correct
|
||||
//-----------------------------------------
|
||||
|
||||
$uploads_size = 0;
|
||||
|
||||
if ($dh = @opendir( $this->ipsclass->vars['upload_dir'] ))
|
||||
{
|
||||
while ( $file = @readdir( $dh ) )
|
||||
{
|
||||
if ( ! preg_match( "/^..?$|^index/i", $file ) )
|
||||
{
|
||||
$uploads_size += @filesize( $this->ipsclass->vars['upload_dir'] . "/" . $file );
|
||||
}
|
||||
}
|
||||
@closedir( $dh );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// This piece of code from Jesse's (jesse@jess.on.ca) contribution
|
||||
// to the PHP manual @ php.net posted without license
|
||||
//-----------------------------------------
|
||||
|
||||
if ($uploads_size >= 1048576)
|
||||
{
|
||||
$uploads_size = round($uploads_size / 1048576 * 100 ) / 100 . " ìåãàáàéò";
|
||||
}
|
||||
else if ($uploads_size >= 1024)
|
||||
{
|
||||
$uploads_size = round($uploads_size / 1024 * 100 ) / 100 . " êèëîáàéò";
|
||||
}
|
||||
else
|
||||
{
|
||||
$uploads_size = $uploads_size . " áàéò";
|
||||
}
|
||||
|
||||
return $uploads_size;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user