Version 2.3.6
This commit is contained in:
1 parent
a3bb603c96
commit
19b38c7c74
764 files changed
+143731
-118164
No files matched your search
@@ -222,8 +222,8 @@ class Text_MappedDiff extends Text_Diff {
|
||||
function Text_MappedDiff($from_lines, $to_lines,
|
||||
$mapped_from_lines, $mapped_to_lines)
|
||||
{
|
||||
assert(count($from_lines) == count($mapped_from_lines));
|
||||
assert(count($to_lines) == count($mapped_to_lines));
|
||||
@assert(count($from_lines) == count($mapped_from_lines));
|
||||
@assert(count($to_lines) == count($mapped_to_lines));
|
||||
|
||||
parent::Text_Diff($mapped_from_lines, $mapped_to_lines);
|
||||
|
||||
@@ -383,8 +383,8 @@ class Text_Diff_Engine_native {
|
||||
$edits = array();
|
||||
$xi = $yi = 0;
|
||||
while ($xi < $n_from || $yi < $n_to) {
|
||||
assert($yi < $n_to || $this->xchanged[$xi]);
|
||||
assert($xi < $n_from || $this->ychanged[$yi]);
|
||||
@assert($yi < $n_to || $this->xchanged[$xi]);
|
||||
@assert($xi < $n_from || $this->ychanged[$yi]);
|
||||
|
||||
// Skip matching "snake".
|
||||
$copy = array();
|
||||
@@ -482,7 +482,7 @@ class Text_Diff_Engine_native {
|
||||
foreach ($matches as $y) {
|
||||
if (empty($this->in_seq[$y])) {
|
||||
$k = $this->_lcsPos($y);
|
||||
assert($k > 0);
|
||||
@assert($k > 0);
|
||||
$ymids[$k] = $ymids[$k - 1];
|
||||
break;
|
||||
}
|
||||
@@ -490,7 +490,7 @@ class Text_Diff_Engine_native {
|
||||
|
||||
while (list($junk, $y) = each($matches)) {
|
||||
if ($y > $this->seq[$k - 1]) {
|
||||
assert($y < $this->seq[$k]);
|
||||
@assert($y < $this->seq[$k]);
|
||||
/* Optimization: this is a common case: next match is
|
||||
* just replacing previous match. */
|
||||
$this->in_seq[$this->seq[$k]] = false;
|
||||
@@ -498,7 +498,7 @@ class Text_Diff_Engine_native {
|
||||
$this->in_seq[$y] = 1;
|
||||
} elseif (empty($this->in_seq[$y])) {
|
||||
$k = $this->_lcsPos($y);
|
||||
assert($k > 0);
|
||||
@assert($k > 0);
|
||||
$ymids[$k] = $ymids[$k - 1];
|
||||
}
|
||||
}
|
||||
@@ -536,7 +536,7 @@ class Text_Diff_Engine_native {
|
||||
}
|
||||
}
|
||||
|
||||
assert($ypos != $this->seq[$end]);
|
||||
@assert($ypos != $this->seq[$end]);
|
||||
|
||||
$this->in_seq[$this->seq[$end]] = false;
|
||||
$this->seq[$end] = $ypos;
|
||||
@@ -620,7 +620,7 @@ class Text_Diff_Engine_native {
|
||||
$i = 0;
|
||||
$j = 0;
|
||||
|
||||
assert('count($lines) == count($changed)');
|
||||
@assert('count($lines) == count($changed)');
|
||||
$len = count($lines);
|
||||
$other_len = count($other_changed);
|
||||
|
||||
@@ -641,7 +641,7 @@ class Text_Diff_Engine_native {
|
||||
}
|
||||
|
||||
while ($i < $len && ! $changed[$i]) {
|
||||
assert('$j < $other_len && ! $other_changed[$j]');
|
||||
@assert('$j < $other_len && ! $other_changed[$j]');
|
||||
$i++; $j++;
|
||||
while ($j < $other_len && $other_changed[$j]) {
|
||||
$j++;
|
||||
@@ -673,11 +673,11 @@ class Text_Diff_Engine_native {
|
||||
while ($start > 0 && $changed[$start - 1]) {
|
||||
$start--;
|
||||
}
|
||||
assert('$j > 0');
|
||||
@assert('$j > 0');
|
||||
while ($other_changed[--$j]) {
|
||||
continue;
|
||||
}
|
||||
assert('$j >= 0 && !$other_changed[$j]');
|
||||
@assert('$j >= 0 && !$other_changed[$j]');
|
||||
}
|
||||
|
||||
/* Set CORRESPONDING to the end of the changed run, at the
|
||||
@@ -698,7 +698,7 @@ class Text_Diff_Engine_native {
|
||||
$i++;
|
||||
}
|
||||
|
||||
assert('$j < $other_len && ! $other_changed[$j]');
|
||||
@assert('$j < $other_len && ! $other_changed[$j]');
|
||||
$j++;
|
||||
if ($j < $other_len && $other_changed[$j]) {
|
||||
$corresponding = $i;
|
||||
@@ -714,11 +714,11 @@ class Text_Diff_Engine_native {
|
||||
while ($corresponding < $i) {
|
||||
$changed[--$start] = 1;
|
||||
$changed[--$i] = 0;
|
||||
assert('$j > 0');
|
||||
@assert('$j > 0');
|
||||
while ($other_changed[--$j]) {
|
||||
continue;
|
||||
}
|
||||
assert('$j >= 0 && !$other_changed[$j]');
|
||||
@assert('$j >= 0 && !$other_changed[$j]');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -833,4 +833,4 @@ class Text_Diff_Op_change extends Text_Diff_Op {
|
||||
return $reverse = &new Text_Diff_Op_change($this->final, $this->orig);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -205,4 +205,4 @@ class Text_Diff_Renderer {
|
||||
return $this->_deleted($orig) . "---\n" . $this->_added($final);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -136,4 +136,4 @@ class Text_Diff_Renderer_inline extends Text_Diff_Renderer {
|
||||
return $words;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -46,4 +46,4 @@ class Text_Diff_Renderer_unified extends Text_Diff_Renderer {
|
||||
return $this->_deleted($orig) . $this->_added($final);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -256,4 +256,4 @@ class Text_Diff3_BlockBuilder {
|
||||
array_splice($array, sizeof($array), 0, $lines);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-08-01 17:02:55 +0100 (Tue, 01 Aug 2006) $
|
||||
| > $Revision: 425 $
|
||||
@@ -92,13 +84,21 @@ class class_ajax
|
||||
/**
|
||||
* Convert and make safe an incoming string
|
||||
*/
|
||||
function convert_and_make_safe( $value )
|
||||
function convert_and_make_safe( $value, $parse_incoming=1 )
|
||||
{
|
||||
$value = rawurldecode( $value );
|
||||
|
||||
|
||||
$value = $this->convert_unicode( $value );
|
||||
|
||||
// This is apparently not needed with the convert_unicode changes I made
|
||||
|
||||
$value = $this->convert_html_entities( $value );
|
||||
$value = $this->ipsclass->parse_clean_value( $value );
|
||||
|
||||
if( $parse_incoming OR ( strtolower($this->ipsclass->vars['gb_char_set']) != 'iso-8859-1' &&
|
||||
strtolower($this->ipsclass->vars['gb_char_set']) != 'utf-8' ) )
|
||||
{
|
||||
$value = $this->ipsclass->parse_clean_value( $value );
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ class class_ajax
|
||||
*/
|
||||
function error_handler()
|
||||
{
|
||||
@header( "Content-type: text/xml;charset={$this->ipsclass->vars['gb_char_set']}" );
|
||||
@header( "Content-type: text/xml" );
|
||||
$this->print_nocache_headers();
|
||||
$this->xml_output = $this->xml_header."\r\n<errors>\r\n";
|
||||
$this->xml_output .= "<error><message>Âû íå àâòîðèçîâàíû</message></error>\r\n";
|
||||
$this->xml_output .= "<error><message>You must be logged in to access this feature</message></error>\r\n";
|
||||
$this->xml_output .= "</errors>";
|
||||
print $this->xml_output;
|
||||
exit();
|
||||
@@ -179,8 +179,8 @@ class class_ajax
|
||||
|
||||
if ( strtolower( $this->ipsclass->vars['gb_char_set'] ) == 'iso-8859-1' )
|
||||
{
|
||||
$string = str_replace( "ì", "“", $string );
|
||||
$string = str_replace( "î", "”", $string );
|
||||
$string = str_replace( "ì", "“", $string );
|
||||
$string = str_replace( "î", "”", $string );
|
||||
}
|
||||
|
||||
// Other stuff
|
||||
@@ -267,19 +267,19 @@ class class_ajax
|
||||
|
||||
function convert_unicode($t)
|
||||
{
|
||||
/*if ( strtolower($this->ipsclass->vars['gb_char_set']) == 'utf-8' )
|
||||
if ( strtolower($this->ipsclass->vars['gb_char_set']) == 'utf-8' )
|
||||
{
|
||||
return preg_replace_callback( '#%u([0-9A-F]{1,4})#i', array( &$this, 'dec_char_ref_to_utf8_hexdec' ), utf8_encode($t) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return preg_replace_callback( '#%u([0-9A-F]{1,4})#i', create_function( '$matches', "return '&#' . hexdec(\$matches[1]) . ';';" ), $t );
|
||||
}*/
|
||||
}
|
||||
|
||||
// Javascript escape function always sends unicode
|
||||
|
||||
$text = preg_replace_callback( '#%u([0-9A-F]{1,4})#i', array( &$this, 'dec_char_ref_to_utf8_hexdec' ), utf8_encode($t) );
|
||||
|
||||
|
||||
if ( strtolower($this->ipsclass->vars['gb_char_set']) != 'utf-8' )
|
||||
{
|
||||
$text = $this->ipsclass->txt_convert_charsets( $text, 'UTF-8' );
|
||||
@@ -298,7 +298,7 @@ class class_ajax
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "/&#(\d+?)([^\d;])/i", "&#\\1;\\2", $t );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Continue...
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -2,26 +2,16 @@
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power KERNEL
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2006 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| 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)
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > API SERVER: Send and receive API data
|
||||
@@ -144,6 +134,13 @@ class class_api_server
|
||||
{
|
||||
if ( ! $incoming )
|
||||
{
|
||||
# PHP Bug: http://bugs.php.net/bug.php?id=41293
|
||||
|
||||
if( phpversion() == "5.2.2" )
|
||||
{
|
||||
$GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents( "php://input" );
|
||||
}
|
||||
|
||||
$incoming = isset( $GLOBALS['HTTP_RAW_POST_DATA'] ) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
|
||||
}
|
||||
|
||||
@@ -153,6 +150,8 @@ class class_api_server
|
||||
|
||||
$this->api_decode_request( $incoming );
|
||||
|
||||
$this->raw_request = $incoming;
|
||||
|
||||
$api_call = explode( ".", $this->method_name );
|
||||
|
||||
if ( count($api_call) > 1 )
|
||||
@@ -270,7 +269,7 @@ class class_api_server
|
||||
// Return false
|
||||
//-----------------------------------------
|
||||
|
||||
$this->api_send_error( 100, 'No methodRequest function -' . htmlspecialchars( $this->method_name ) . 'defined / found' );
|
||||
$this->api_send_error( 100, 'No methodRequest function -' . htmlspecialchars( $this->method_name ) . ' defined / found' );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -483,9 +482,11 @@ class class_api_server
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$_params = $this->xmlrpc->xml_rpc_get_params( $raw );
|
||||
$this->method_name = $this->xmlrpc->xml_rpc_get_method_name( $raw );
|
||||
$this->params = array();
|
||||
$_params = $this->xmlrpc->xml_rpc_get_params( $raw );
|
||||
$this->method_name = $this->xmlrpc->xml_rpc_get_method_name( $raw );
|
||||
$this->params = array();
|
||||
$this->_raw_in_data = var_export( $raw, TRUE );
|
||||
$this->_raw_out_data = var_export( $_params, TRUE );
|
||||
|
||||
//-----------------------------------------
|
||||
// Debug?
|
||||
@@ -505,7 +506,7 @@ class class_api_server
|
||||
{
|
||||
foreach( $_params[0] as $k => $v )
|
||||
{
|
||||
if ( $k == $this->serialized_key )
|
||||
if ( $k != '' && $k == $this->serialized_key )
|
||||
{
|
||||
$_tmp = $this->decode_base64_array( $v );
|
||||
|
||||
@@ -514,7 +515,7 @@ class class_api_server
|
||||
$this->params = array_merge( $this->params, $_tmp );
|
||||
}
|
||||
}
|
||||
else if ( $k == $this->cookie_serialized_key )
|
||||
else if ( $k != '' && $k == $this->cookie_serialized_key )
|
||||
{
|
||||
$_cookies = $this->decode_base64_array( $v );
|
||||
|
||||
@@ -537,7 +538,6 @@ class class_api_server
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -581,7 +581,14 @@ class class_api_server
|
||||
*/
|
||||
function decode_base64_array( $data )
|
||||
{
|
||||
return unserialize( base64_decode( $data ) );
|
||||
if ( ! is_array( $data ) )
|
||||
{
|
||||
return unserialize( base64_decode( $data ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,24 +2,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Cache Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| 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)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
|
||||
@@ -2,22 +2,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Cache Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
|
||||
@@ -2,22 +2,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Cache Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
@@ -79,6 +72,11 @@ class cache_lib
|
||||
|
||||
function disconnect()
|
||||
{
|
||||
if( function_exists( 'eaccelerator_gc' ) )
|
||||
{
|
||||
eaccelerator_gc();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,22 +2,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Cache Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
|
||||
@@ -2,22 +2,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Cache Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
|
||||
@@ -2,22 +2,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Cache Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| Invision Power Dynamic v1.0.0
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER DYNAMIC IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionpower.com/dynamic/
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Id$
|
||||
| > $Revision: 128 $
|
||||
@@ -62,75 +55,57 @@ class class_captcha
|
||||
var $ipsclass;
|
||||
|
||||
/**
|
||||
* GD version
|
||||
* @var integer
|
||||
* Captcha plug in class
|
||||
* @var string
|
||||
*/
|
||||
var $gd_version = 0;
|
||||
var $_plugInClass = '';
|
||||
|
||||
/**
|
||||
* Backgrounds path
|
||||
* @var string
|
||||
* Return an error if GD is not installed?
|
||||
* My most verbose string name. I'm so proud.
|
||||
* @var boolean
|
||||
*/
|
||||
var $path_background = '';
|
||||
var $show_error_gd_img = FALSE;
|
||||
|
||||
/**
|
||||
* Fonts path
|
||||
* Error string
|
||||
* @var string
|
||||
*/
|
||||
var $path_fonts = '';
|
||||
|
||||
var $error_string = '';
|
||||
|
||||
/**
|
||||
* Constructor bah to PHP 4
|
||||
*
|
||||
* @param object IPSClass object
|
||||
* @param string Captcha plug-in to use
|
||||
*/
|
||||
function class_captcha( $ipsclass, $plugin )
|
||||
{
|
||||
$this->ipsclass =& $ipsclass;
|
||||
$plugin = $this->ipsclass->txt_alphanumerical_clean( $plugin );
|
||||
|
||||
if ( ! file_exists( KERNEL_PATH . 'class_captcha_plugin/' . $plugin . '.php' ) )
|
||||
{
|
||||
$plugin = 'default';
|
||||
}
|
||||
|
||||
require_once( KERNEL_PATH . 'class_captcha_plugin/' . $plugin . '.php' );
|
||||
$this->_plugInClass = new captchaPlugIn( $ipsclass );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initializes captcha session
|
||||
// Initializes captcha session and returns the template bit
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Initializes captcha session
|
||||
* Clears out "dead" entries, adds new row and returns
|
||||
* unique ID for use in an image
|
||||
* template bit
|
||||
*
|
||||
* @return string Captcha unique ID
|
||||
* @return string HTML Template bit
|
||||
*/
|
||||
function captcha_create_session()
|
||||
function getTemplate()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Clear old
|
||||
//-----------------------------------------
|
||||
|
||||
$this->captcha_clear_sessions( $this->ipsclass->ip_address );
|
||||
|
||||
//-----------------------------------------
|
||||
// Create new ID
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha_unique_id = md5( uniqid( time() ) );
|
||||
$captcha_string = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// Create new string
|
||||
//-----------------------------------------
|
||||
|
||||
mt_srand( (double) microtime() * 1000000 );
|
||||
$final_rand = md5( uniqid( mt_rand(), TRUE ) );
|
||||
mt_srand();
|
||||
|
||||
for( $i = 0; $i < 6; $i++ )
|
||||
{
|
||||
$captcha_string .= $final_rand{ mt_rand(0, 31) };
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add to the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'captcha', array( 'captcha_unique_id' => $captcha_unique_id,
|
||||
'captcha_string' => $captcha_string,
|
||||
'captcha_ipaddress' => $this->ipsclass->ip_address,
|
||||
'captcha_date' => time() ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return ID
|
||||
//-----------------------------------------
|
||||
|
||||
return $captcha_unique_id;
|
||||
return $this->_plugInClass->getTemplate();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -140,602 +115,23 @@ class class_captcha
|
||||
/**
|
||||
* Show the captcha bot image
|
||||
*
|
||||
* @param string captcha_unique_id The captcha DB row
|
||||
* @param string captcha_input The user entered data
|
||||
* @return void
|
||||
* @return boolean
|
||||
* @since 1.0
|
||||
*/
|
||||
function captcha_validate( $captcha_unique_id, $captcha_input )
|
||||
function validate()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha_input = trim( strtolower($captcha_input) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the info from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
|
||||
'from' => 'captcha',
|
||||
'where' => "captcha_unique_id='".$captcha_unique_id."'" ) );
|
||||
|
||||
if ( ! $captcha['captcha_unique_id'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $captcha['captcha_string'] != $captcha_input )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return $this->_plugInClass->validate();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Captcha show image
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Show the captcha bot image
|
||||
* Fetch Plug In Class Handle
|
||||
*
|
||||
* @param string captcha_unique_id
|
||||
* @return void
|
||||
* @since 1.0
|
||||
* If you need it...
|
||||
*/
|
||||
function captcha_show_image( $captcha_unique_id )
|
||||
function fetchPlugInClassHandle()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// CHECK
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $captcha_unique_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the info from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
|
||||
'from' => 'captcha',
|
||||
'where' => "captcha_unique_id='".$captcha_unique_id."'" ) );
|
||||
|
||||
if ( ! $captcha['captcha_unique_id'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->captcha_show_gd_img( $captcha['captcha_string'] );
|
||||
return $this->_plugInClass;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Show GD created security image...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Show anti-spam bot GD image numbers
|
||||
*
|
||||
* @param string Number string
|
||||
* @return void
|
||||
* @since 1.0
|
||||
*/
|
||||
function captcha_show_gd_img( $content="" )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Is GD Available?
|
||||
//-----------------------------------------
|
||||
|
||||
if( !extension_loaded('gd') )
|
||||
{
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$content = ' '. preg_replace( "/(\w)/", "\\1 ", $content ) .' ';
|
||||
$allow_fonts = isset( $this->ipsclass->vars['captcha_allow_fonts'] ) ? $this->ipsclass->vars['captcha_allow_fonts'] : 1;
|
||||
$use_fonts = 0;
|
||||
$tmp_x = 135;
|
||||
$tmp_y = 20;
|
||||
$image_x = 200;
|
||||
$image_y = 60;
|
||||
$circles = 3;
|
||||
$continue_loop = TRUE;
|
||||
$_started = FALSE;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get backgrounds and fonts...
|
||||
//-----------------------------------------
|
||||
|
||||
$backgrounds = $this->_captcha_show_gd_img_get_backgrounds();
|
||||
$fonts = $this->_captcha_show_gd_img_get_fonts();
|
||||
|
||||
//-----------------------------------------
|
||||
// Seed rand functions for PHP versions that don't
|
||||
//-----------------------------------------
|
||||
|
||||
mt_srand( (double) microtime() * 1000000 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a background?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->ipsclass->vars['gd_version'] > 1 )
|
||||
{
|
||||
while ( $continue_loop )
|
||||
{
|
||||
if ( is_array( $backgrounds ) AND count( $backgrounds ) )
|
||||
{
|
||||
$i = mt_rand(0, count( $backgrounds ) - 1 );
|
||||
|
||||
$background = $backgrounds[ $i ];
|
||||
$_file_extension = preg_replace( "#^.*\.(\w{2,4})$#is", "\\1", strtolower( $background ) );
|
||||
|
||||
switch( $_file_extension )
|
||||
{
|
||||
case 'jpg':
|
||||
case 'jpe':
|
||||
case 'jpeg':
|
||||
if ( ! function_exists('imagecreatefromjpeg') OR ! $im = @imagecreatefromjpeg($background) )
|
||||
{
|
||||
unset( $backgrounds[ $i ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
$_started = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'gif':
|
||||
if ( ! function_exists('imagecreatefromgif') OR ! $im = @imagecreatefromgif($background) )
|
||||
{
|
||||
unset( $backgrounds[ $i ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
$_started = TRUE;
|
||||
}
|
||||
break;
|
||||
case 'png':
|
||||
if ( ! function_exists('imagecreatefrompng') OR ! $im = @imagecreatefrompng($background) )
|
||||
{
|
||||
unset( $backgrounds[ $i ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
$_started = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Still not got one? DO OLD FASHIONED
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $_started !== TRUE )
|
||||
{
|
||||
if ( $this->ipsclass->vars['gd_version'] == 1 )
|
||||
{
|
||||
$im = imagecreate($image_x, $image_y);
|
||||
$tmp = imagecreate($tmp_x, $tmp_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
$im = imagecreatetruecolor($image_x, $image_y);
|
||||
$tmp = imagecreatetruecolor($tmp_x, $tmp_y);
|
||||
}
|
||||
|
||||
$white = ImageColorAllocate($tmp, 255, 255, 255);
|
||||
$black = ImageColorAllocate($tmp, 0, 0, 0);
|
||||
$grey = ImageColorAllocate($tmp, 200, 200, 200 );
|
||||
|
||||
imagefill($tmp, 0, 0, $white);
|
||||
|
||||
for ( $i = 1; $i <= $circles; $i++ )
|
||||
{
|
||||
$values = array(
|
||||
0 => rand(0, $tmp_x - 10),
|
||||
1 => rand(0, $tmp_y - 3),
|
||||
2 => rand(0, $tmp_x - 10),
|
||||
3 => rand(0, $tmp_y - 3),
|
||||
4 => rand(0, $tmp_x - 10),
|
||||
5 => rand(0, $tmp_y - 3),
|
||||
6 => rand(0, $tmp_x - 10),
|
||||
7 => rand(0, $tmp_y - 3),
|
||||
8 => rand(0, $tmp_x - 10),
|
||||
9 => rand(0, $tmp_y - 3),
|
||||
10 => rand(0, $tmp_x - 10),
|
||||
11 => rand(0, $tmp_y - 3),
|
||||
);
|
||||
|
||||
$randomcolor = imagecolorallocate( $tmp, rand(100,255), rand(100,255),rand(100,255) );
|
||||
imagefilledpolygon($tmp, $values, 6, $randomcolor );
|
||||
}
|
||||
|
||||
$num = strlen($content);
|
||||
$x_param = 0;
|
||||
$y_param = 0;
|
||||
|
||||
for( $i = 0; $i < $num; $i++ )
|
||||
{
|
||||
$x_param += rand(-1,12);
|
||||
$y_param = rand(-3,8);
|
||||
|
||||
if( $x_param + 18 > $image_x )
|
||||
{
|
||||
$x_param -= ceil( $x_param + 18 - $image_x );
|
||||
}
|
||||
|
||||
$randomcolor = imagecolorallocate( $tmp, rand(0,150), rand(0,150),rand(0,150) );
|
||||
|
||||
imagestring($tmp, 5, $x_param+1, $y_param+1, $content{$i}, $grey);
|
||||
imagestring($tmp, 5, $x_param, $y_param, $content{$i}, $randomcolor);
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Distort by resizing
|
||||
//-----------------------------------------
|
||||
|
||||
imagecopyresized($im, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y);
|
||||
|
||||
imagedestroy($tmp);
|
||||
|
||||
//-----------------------------------------
|
||||
// Background dots and lines
|
||||
//-----------------------------------------
|
||||
|
||||
$random_pixels = $image_x * $image_y / 10;
|
||||
|
||||
for ($i = 0; $i < $random_pixels; $i++)
|
||||
{
|
||||
$randomcolor = imagecolorallocate( $im, rand(0,150), rand(0,150),rand(0,150) );
|
||||
ImageSetPixel($im, rand(0, $image_x), rand(0, $image_y), $randomcolor);
|
||||
}
|
||||
|
||||
$no_x_lines = ($image_x - 1) / 5;
|
||||
|
||||
for ( $i = 0; $i <= $no_x_lines; $i++ )
|
||||
{
|
||||
ImageLine( $im, $i * $no_x_lines, 0, $i * $no_x_lines, $image_y, $grey );
|
||||
ImageLine( $im, $i * $no_x_lines, 0, ($i * $no_x_lines)+$no_x_lines, $image_y, $grey );
|
||||
}
|
||||
|
||||
$no_y_lines = ($image_y - 1) / 5;
|
||||
|
||||
for ( $i = 0; $i <= $no_y_lines; $i++ )
|
||||
{
|
||||
ImageLine( $im, 0, $i * $no_y_lines, $image_x, $i * $no_y_lines, $grey );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Can we use fonts?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $allow_fonts AND function_exists('imagettftext') AND is_array( $fonts ) AND count( $fonts ) )
|
||||
{
|
||||
if ( function_exists('imageantialias') )
|
||||
{
|
||||
imageantialias( $im, TRUE );
|
||||
}
|
||||
|
||||
$num = strlen($content);
|
||||
$x_param = -18;
|
||||
$y_param = 0;
|
||||
$_font = $fonts[ mt_rand( 0, count( $fonts ) - 1 ) ];
|
||||
|
||||
for( $i = 0; $i < $num; $i++ )
|
||||
{
|
||||
$y_param = rand( 35, 48 );
|
||||
|
||||
# Main color
|
||||
$col_r = rand(50,200);
|
||||
$col_g = rand(0,150);
|
||||
$col_b = rand(50,200);
|
||||
# High light
|
||||
$col_r_l = ( $col_r + 50 > 255 ) ? 255 : $col_r + 50;
|
||||
$col_g_l = ( $col_g + 50 > 255 ) ? 255 : $col_g + 50;
|
||||
$col_b_l = ( $col_b + 50 > 255 ) ? 255 : $col_b + 50;
|
||||
# Low light
|
||||
$col_r_d = ( $col_r - 50 < 0 ) ? 0 : $col_r - 50;
|
||||
$col_g_d = ( $col_g - 50 < 0 ) ? 0 : $col_g - 50;
|
||||
$col_b_d = ( $col_b - 50 < 0 ) ? 0 : $col_b - 50;
|
||||
|
||||
$color_main = imagecolorallocate( $im, $col_r, $col_g, $col_b );
|
||||
$color_light = imagecolorallocate( $im, $col_r_l, $col_g_l, $col_b_l );
|
||||
$color_dark = imagecolorallocate( $im, $col_r_d, $col_g_d, $col_b_d );
|
||||
$_slant = mt_rand( -20, 40 );
|
||||
|
||||
if ( $i == 1 OR $i == 3 OR $i == 5 )
|
||||
{
|
||||
for( $ii = 0 ; $ii < 2 ; $ii++ )
|
||||
{
|
||||
$a = $x_param + 50;
|
||||
$b = mt_rand(0,100);
|
||||
$c = $a + 20;
|
||||
$d = $b + 20;
|
||||
$e = ( $i == 3 ) ? mt_rand( 280, 320 ) : mt_rand( -280, -320 );
|
||||
|
||||
imagearc( $im, $a , $b , $c, $d, 0, $e, $color_light );
|
||||
imagearc( $im, $a+1, $b+1, $c, $d, 0, $e, $color_main );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $_result = @imagettftext( $im, 24, $_slant, $x_param - 1, $y_param - 1, $color_light, $_font, $content{$i} ) )
|
||||
{
|
||||
$use_fonts = FALSE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
@imagettftext( $im, 24, $_slant, $x_param + 1, $y_param + 1, $color_dark, $_font, $content{$i} );
|
||||
@imagettftext( $im, 24, $_slant, $x_param, $y_param, $color_main, $_font, $content{$i} );
|
||||
}
|
||||
|
||||
$x_param += rand( 15, 18 );
|
||||
|
||||
if( $x_param + 18 > $image_x )
|
||||
{
|
||||
$x_param -= ceil( $x_param + 18 - $image_x );
|
||||
}
|
||||
}
|
||||
|
||||
$use_fonts = TRUE;
|
||||
}
|
||||
|
||||
if ( ! $use_fonts )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Continue with nice background image
|
||||
//-----------------------------------------
|
||||
|
||||
$tmp = imagecreatetruecolor($tmp_x , $tmp_y );
|
||||
$tmp2 = imagecreatetruecolor($image_x, $image_y);
|
||||
|
||||
$white = imagecolorallocate( $tmp, 255, 255, 255 );
|
||||
$black = imagecolorallocate( $tmp, 0, 0, 0 );
|
||||
$grey = imagecolorallocate( $tmp, 100, 100, 100 );
|
||||
$transparent = imagecolorallocate( $tmp2, 255, 255, 255 );
|
||||
$_white = imagecolorallocate( $tmp2, 255, 255, 255 );
|
||||
|
||||
imagefill($tmp , 0, 0, $white );
|
||||
imagefill($tmp2, 0, 0, $_white);
|
||||
|
||||
$num = strlen($content);
|
||||
$x_param = 0;
|
||||
$y_param = 0;
|
||||
|
||||
for( $i = 0; $i < $num; $i++ )
|
||||
{
|
||||
if ( $i > 0 )
|
||||
{
|
||||
$x_param += rand( 6, 12 );
|
||||
|
||||
if( $x_param + 18 > $image_x )
|
||||
{
|
||||
$x_param -= ceil( $x_param + 18 - $image_x );
|
||||
}
|
||||
}
|
||||
|
||||
$y_param = rand( 0, 5 );
|
||||
|
||||
$randomcolor = imagecolorallocate( $tmp, rand(50,200), rand(50,200),rand(50,200) );
|
||||
|
||||
imagestring( $tmp, 5, $x_param + 1, $y_param + 1, $content{$i}, $grey );
|
||||
imagestring( $tmp, 5, $x_param , $y_param , $content{$i}, $randomcolor );
|
||||
}
|
||||
|
||||
imagecopyresized($tmp2, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y );
|
||||
|
||||
$tmp2 = $this->captcha_show_gd_img_wave( $tmp2, 8, true );
|
||||
|
||||
imagecolortransparent( $tmp2, $transparent );
|
||||
imagecopymerge( $im, $tmp2, 0, 0, 0, 0, $image_x, $image_y, 100 );
|
||||
|
||||
imagedestroy($tmp);
|
||||
imagedestroy($tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Blur?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( function_exists( 'imagefilter' ) )
|
||||
{
|
||||
@imagefilter( $im, IMG_FILTER_GAUSSIAN_BLUR );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Render a border
|
||||
//-----------------------------------------
|
||||
|
||||
$black = imagecolorallocate( $im, 0, 0, 0 );
|
||||
|
||||
imageline( $im, 0, 0, $image_x, 0, $black );
|
||||
imageline( $im, 0, 0, 0, $image_y, $black );
|
||||
imageline( $im, $image_x - 1, 0, $image_x - 1, $image_y, $black );
|
||||
imageline( $im, 0, $image_y - 1, $image_x, $image_y - 1, $black );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show it!
|
||||
//-----------------------------------------
|
||||
|
||||
@header( "Content-Type: image/jpeg" );
|
||||
|
||||
imagejpeg( $im );
|
||||
imagedestroy( $im );
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Create wave effect for GD images...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Create wave effect for GD images
|
||||
*
|
||||
* @param object Image resource
|
||||
* @return object Returned image resource
|
||||
* @since 1.0
|
||||
*/
|
||||
function captcha_show_gd_img_wave( $im, $wave=10 )
|
||||
{
|
||||
$_width = imagesx( $im );
|
||||
$_height = imagesy( $im );
|
||||
|
||||
$tmp = imagecreatetruecolor( $_width, $_height );
|
||||
|
||||
$_direction = ( time() % 2 ) ? TRUE : FALSE;
|
||||
|
||||
for ( $x = 0; $x < $_width; $x++ )
|
||||
{
|
||||
for ( $y = 0 ; $y < $_height ; $y++ )
|
||||
{
|
||||
$xo = $wave * sin( 2 * 3.1415 * $y / 128 );
|
||||
$yo = $wave * cos( 2 * 3.1415 * $x / 128 );
|
||||
|
||||
$_x = $x - $xo;
|
||||
$_y = $y - $yo;
|
||||
|
||||
if ( ($_x > 0 AND $_x < $_width) AND ($_y > 0 AND $_y < $_height) )
|
||||
{
|
||||
$index = imagecolorat($im, $_x, $_y);
|
||||
$colors = imagecolorsforindex($im, $index);
|
||||
$color = imagecolorresolve( $tmp, $colors['red'], $colors['green'], $colors['blue'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$color = imagecolorresolve( $tmp, 255, 255, 255 );
|
||||
}
|
||||
|
||||
imagesetpixel( $tmp, $x, $y, $color );
|
||||
}
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Removes extinct captcha sessions
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Removes extinct captcha sessions
|
||||
* Clears out "dead" entries
|
||||
*
|
||||
* @param string Optional IP address to clear out on
|
||||
* @return string void
|
||||
*/
|
||||
|
||||
function captcha_clear_sessions( $ip_address='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$time = time() - 60 * 3600;
|
||||
$extra = ( $ip_address ) ? ' OR captcha_ipaddress="'.$ip_address.'"' : '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'captcha',
|
||||
'where' => 'captcha_date < ' . $time . $extra ) );
|
||||
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Load up the backgrounds
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Loads up the backgrounds.
|
||||
*
|
||||
* @return array backgrounds
|
||||
*/
|
||||
|
||||
function _captcha_show_gd_img_get_backgrounds()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$images = array();
|
||||
$_path = $this->path_background;
|
||||
|
||||
if ( $_dir = @opendir( $_path ) )
|
||||
{
|
||||
while( false !== ( $_file = @readdir( $_dir ) ) )
|
||||
{
|
||||
if ( preg_match( "#\.(gif|jpeg|jpg|png)$#i", $_file ) )
|
||||
{
|
||||
$images[] = $_path . '/' . $_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $images;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Load up the fonts
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Loads up the fonts.
|
||||
*
|
||||
* @return array fonts
|
||||
*/
|
||||
|
||||
function _captcha_show_gd_img_get_fonts()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$fonts = array();
|
||||
$_path = $this->path_fonts;
|
||||
|
||||
if ( $_dir = @opendir( $_path ) )
|
||||
{
|
||||
while( false !== ( $_file = @readdir( $_dir ) ) )
|
||||
{
|
||||
if ( preg_match( "#\.(ttf)$#i", $_file ) )
|
||||
{
|
||||
$fonts[] = $_path . '/' . $_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $fonts;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,819 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Dynamic v1.0.0
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER DYNAMIC IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionpower.com/dynamic/
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Id$
|
||||
| > $Revision: 128 $
|
||||
| > $Date: 2006-01-20 12:46:26 +0000 (Fri, 20 Jan 2006) $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > CAPTCHA ANTI-SPAM CLASS
|
||||
| > Script written by Matt Mecham
|
||||
| > Date started: Thursday 2 February (11:08)
|
||||
|
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* CAPTCHA CLASS
|
||||
* PLUG IN: Default GD image
|
||||
* @package IPDYNAMIC
|
||||
* @author Matt Mecham
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
class captchaPlugin
|
||||
{
|
||||
/**
|
||||
* Global IPS class array
|
||||
* @var object
|
||||
*/
|
||||
var $ipsclass;
|
||||
|
||||
/**
|
||||
* GD version
|
||||
* @var integer
|
||||
*/
|
||||
var $gd_version = 0;
|
||||
|
||||
/**
|
||||
* Backgrounds path
|
||||
* @var string
|
||||
*/
|
||||
var $path_background = '';
|
||||
|
||||
/**
|
||||
* Fonts path
|
||||
* @var string
|
||||
*/
|
||||
var $path_fonts = '';
|
||||
|
||||
/**
|
||||
* Return an error if GD is not installed?
|
||||
* My most verbose string name. I'm so proud.
|
||||
* @var boolean
|
||||
*/
|
||||
var $show_error_gd_img = FALSE;
|
||||
|
||||
/**
|
||||
* Error string
|
||||
* @var string
|
||||
*/
|
||||
var $error_string = '';
|
||||
|
||||
/**
|
||||
* Constructor bah to PHP 4
|
||||
*
|
||||
* @param object IPSClass object
|
||||
* @param string Captcha plug-in to use
|
||||
*/
|
||||
function captchaPlugin( $ipsclass )
|
||||
{
|
||||
$this->ipsclass =& $ipsclass;
|
||||
|
||||
$this->gd_version = $this->ipsclass->vars['gd_version'];
|
||||
$this->path_background = ROOT_PATH . 'style_captcha/captcha_backgrounds';
|
||||
$this->path_fonts = ROOT_PATH . 'style_captcha/captcha_fonts';
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initializes captcha session
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Initializes captcha session
|
||||
* Clears out "dead" entries, adds new row and returns
|
||||
* unique ID for use in an image
|
||||
*
|
||||
* @return string Captcha unique ID
|
||||
*/
|
||||
function getTemplate()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Clear old
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_clearSessions( $this->ipsclass->ip_address );
|
||||
|
||||
//-----------------------------------------
|
||||
// Create new ID
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha_unique_id = md5( uniqid( time() ) );
|
||||
$captcha_string = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// Create new string
|
||||
//-----------------------------------------
|
||||
|
||||
/* Seed the random number generator */
|
||||
$unique_id = uniqid( mt_rand(), TRUE );
|
||||
$unique_id .= md5( $this->ipsclass->vars['sql_pass'] );
|
||||
usleep( mt_rand( 15000,1000000 ) );
|
||||
mt_srand( (double) microtime() * 1000000 );
|
||||
|
||||
/* Array of characters */
|
||||
$array_of_chars = array(
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'
|
||||
);
|
||||
|
||||
/* Get 6 random characters */
|
||||
for( $i = 0; $i < 6; $i++ )
|
||||
{
|
||||
$idx = rand( 0, count( $array_of_chars ) );
|
||||
$captcha_string .= $array_of_chars[ $idx ];
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Add to the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'reg_antispam', array( 'regid' => $captcha_unique_id,
|
||||
'regcode' => $captcha_string,
|
||||
'ip_address' => $this->ipsclass->ip_address,
|
||||
'ctime' => time() ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return Template Bit
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->ipsclass->compiled_templates['skin_global']->captchaGD( $captcha_unique_id );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Captcha validate
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Show the captcha bot image
|
||||
*
|
||||
* @return void
|
||||
* @since 1.0
|
||||
*/
|
||||
function validate()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha_unique_id = $this->ipsclass->txt_alphanumerical_clean( $_REQUEST['regid'] );
|
||||
$captcha_input_NOT_CLEAN = trim( strtolower( $_REQUEST['reg_code'] ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the info from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
|
||||
'from' => 'reg_antispam',
|
||||
'where' => "regid='". addslashes( $captcha_unique_id )."'" ) );
|
||||
|
||||
if ( ! $captcha['regid'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $captcha['regcode'] != $captcha_input_NOT_CLEAN )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_clearSessions( $this->ipsclass->ip_address );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Captcha show image
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Show the captcha bot image
|
||||
*
|
||||
* @param string captcha_unique_id
|
||||
* @return void
|
||||
* @since 1.0
|
||||
*/
|
||||
function captcha_show_image( $captcha_unique_id )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// CHECK
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! $captcha_unique_id )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the info from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
|
||||
'from' => 'reg_antispam',
|
||||
'where' => "regid='".addslashes( $captcha_unique_id )."'" ) );
|
||||
|
||||
if ( ! $captcha['regid'] )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show it...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_captcha_show_gd_img( $captcha['regcode'] );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Show GD created security image...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Show anti-spam bot GD image numbers
|
||||
*
|
||||
* @param string Number string
|
||||
* @return void
|
||||
* @since 1.0
|
||||
*/
|
||||
function _captcha_show_gd_img( $content="" )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Is GD Available?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! extension_loaded('gd') )
|
||||
{
|
||||
if ( $this->show_error_gd_img )
|
||||
{
|
||||
@header( "Content-Type: image/gif" );
|
||||
print base64_decode( "R0lGODlhyAA8AJEAAN/f3z8/P8zMzP///yH5BAAAAAAALAAAAADIADwAAAL/nI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMlgACwEHQXESfzgOzykQAqgMmFMr9Rq+GbHlqAFsFWnFVrfwIAvQAu15P0A14Nn8/ADhXd4dnl2YYCAioGHBgyDbnNzBIV0gYxzEYWdg1iLAnScmFuQdAt2UKZTcl+mip+HoYG+tKOfv3N5l5garnmPt6CwyaFzrranu7i0crObvoaKvMyMhrIQhFuyzcyGwXcOpoLYg7DGsZXk5r6DSN51RNfF0RPU5sy7gpnH5bjLhrk7Y9/RQNisfq2CRJauTR6xUuFyBx/yrWypMMmTlq/9IwQnKWcKG5cvMeShBIMOFIaV9w2eti6SBABAyjvBRFMaZCMaxsqtxl8iShjpj+VfqGCJg4XzOfJCK5DVWliFNXlSIENKjWrVy7ev0KNqzYsWTFwhlFU8waLk+efGF7hi0aSgu3iGmV1cxdoGTinimbiGOeP8SWhps6z3AkeMMWW20mMykqQyuJDbYWdufKBJWc2uWmAJZdO0yOKfTCCqHGiO4E/oKGriTYaBw5g/MDqynNlW9Uhmx66tM2i05dNcM8O6Rg2MHLYKraLTpDcLebTke4APkcduAoku0DWpe24MI96ewZPdiy6Rlx/0Y+XJevlNu/z6vtlHFxZbpv9f9edYkfxgVmjnqSxXYOYPfFVMgXIHGC0ltWDNXYJ6Lsw82AFVpWEk4pEabgbsfBM5FphyDWRh1OLCUgbC06NtNU6UV1T1Jl3YhjjjruyGOPPv4IZJBC6tDXGUDB4UUaK06RhRl/0aWWF3CR4YWESraR1ZCh6dMOiMNIFE2GI/bRJYiIEeULiloyUNSFLzWC3VXcqEJXTBe1qApDpbXUEYxr2tYeQCyyGMuIcxbokHfPvPjHf25mqeWHoLEX0iH0UScmUzSWNxmj20yH6Z+/yNTeM0N1cumkg9E4GHnluLcfeKLm95yLoO5ZKJrhgeaQm4xlFGshcK3pYZ9LradQrmY5nmhVdMm+qqpKYkIqpDyltWkpjJJaaKmd6kXjHUXvDPborOaei2666q7LbrvuvgtvvPLOS2+9YBUAADs=" );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$content = ' '. preg_replace( "/(\w)/", "\\1 ", $content ) .' ';
|
||||
$allow_fonts = isset( $this->ipsclass->vars['captcha_allow_fonts'] ) ? $this->ipsclass->vars['captcha_allow_fonts'] : 1;
|
||||
$use_fonts = 0;
|
||||
$tmp_x = 135;
|
||||
$tmp_y = 20;
|
||||
$image_x = 200;
|
||||
$image_y = 60;
|
||||
$circles = 3;
|
||||
$continue_loop = TRUE;
|
||||
$_started = FALSE;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get backgrounds and fonts...
|
||||
//-----------------------------------------
|
||||
|
||||
$backgrounds = $this->_captcha_show_gd_img_get_backgrounds();
|
||||
$fonts = $this->_captcha_show_gd_img_get_fonts();
|
||||
|
||||
//-----------------------------------------
|
||||
// Seed rand functions for PHP versions that don't
|
||||
//-----------------------------------------
|
||||
|
||||
mt_srand( (double) microtime() * 1000000 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Got a background?
|
||||
//-----------------------------------------
|
||||
$_imgs = array();
|
||||
|
||||
if ( $this->ipsclass->vars['gd_version'] > 1 )
|
||||
{
|
||||
while ( $continue_loop )
|
||||
{
|
||||
if ( is_array( $backgrounds ) AND count( $backgrounds ) )
|
||||
{
|
||||
$i = mt_rand(0, count( $backgrounds ) - 1 );
|
||||
|
||||
$background = $backgrounds[ $i ];
|
||||
$_file_extension = preg_replace( "#^.*\.(\w{2,4})$#is", "\\1", strtolower( $background ) );
|
||||
|
||||
switch( $_file_extension )
|
||||
{
|
||||
case 'jpg':
|
||||
case 'jpe':
|
||||
case 'jpeg':
|
||||
if ( ! function_exists('imagecreatefromjpeg') OR ! $im = @imagecreatefromjpeg($background) )
|
||||
{
|
||||
unset( $backgrounds[ $i ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_imgs[] = $im;
|
||||
|
||||
if( count( $_imgs ) > 2 )
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
$_started = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'gif':
|
||||
if ( ! function_exists('imagecreatefromgif') OR ! $im = @imagecreatefromgif($background) )
|
||||
{
|
||||
unset( $backgrounds[ $i ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_imgs[] = $im;
|
||||
|
||||
if( count( $_imgs ) > 2 )
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
$_started = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'png':
|
||||
if ( ! function_exists('imagecreatefrompng') OR ! $im = @imagecreatefrompng($background) )
|
||||
{
|
||||
unset( $backgrounds[ $i ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_imgs[] = $im;
|
||||
|
||||
if( count( $_imgs ) > 2 )
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
$_started = TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$continue_loop = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a new background */
|
||||
if( count( $_imgs > 2 ) )
|
||||
{
|
||||
/* Setup */
|
||||
$strip_count = 8;
|
||||
$strips = ceil( $image_x / $strip_count );
|
||||
$im = imagecreatetruecolor( $image_x, $image_y );
|
||||
$curr_offset = 0;
|
||||
|
||||
for( $i = 0; $i < $strip_count; $i++ )
|
||||
{
|
||||
/* Alternate the background */
|
||||
$alternate++;
|
||||
$alternate = ( $alternate > 2 ) ? 0 : $alternate;
|
||||
|
||||
/* Width of the strip */
|
||||
$end_strip = ( $i * $strips ) + rand( 1, $strips );
|
||||
|
||||
/* Copy the splice */
|
||||
imagecopymerge( $im, $_imgs[$alternate], $curr_offset, 0, $curr_offset, 0, $end_strip, $image_y, rand( 1, 100 ) );
|
||||
|
||||
/* Increment the offset */
|
||||
$curr_offset += $end_strip;
|
||||
}
|
||||
|
||||
$_started = TRUE;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Still not got one? DO OLD FASHIONED
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $_started !== TRUE )
|
||||
{
|
||||
if ( $this->ipsclass->vars['gd_version'] == 1 )
|
||||
{
|
||||
$im = imagecreate($image_x, $image_y);
|
||||
$tmp = imagecreate($tmp_x, $tmp_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
$im = imagecreatetruecolor($image_x, $image_y);
|
||||
$tmp = imagecreatetruecolor($tmp_x, $tmp_y);
|
||||
}
|
||||
|
||||
$white = ImageColorAllocate($tmp, 255, 255, 255);
|
||||
$black = ImageColorAllocate($tmp, 0, 0, 0);
|
||||
$grey = ImageColorAllocate($tmp, 200, 200, 200 );
|
||||
|
||||
imagefill($tmp, 0, 0, $white);
|
||||
|
||||
for ( $i = 1; $i <= $circles; $i++ )
|
||||
{
|
||||
$values = array(
|
||||
0 => rand(0, $tmp_x - 10),
|
||||
1 => rand(0, $tmp_y - 3),
|
||||
2 => rand(0, $tmp_x - 10),
|
||||
3 => rand(0, $tmp_y - 3),
|
||||
4 => rand(0, $tmp_x - 10),
|
||||
5 => rand(0, $tmp_y - 3),
|
||||
6 => rand(0, $tmp_x - 10),
|
||||
7 => rand(0, $tmp_y - 3),
|
||||
8 => rand(0, $tmp_x - 10),
|
||||
9 => rand(0, $tmp_y - 3),
|
||||
10 => rand(0, $tmp_x - 10),
|
||||
11 => rand(0, $tmp_y - 3),
|
||||
);
|
||||
|
||||
$randomcolor = imagecolorallocate( $tmp, rand(100,255), rand(100,255),rand(100,255) );
|
||||
imagefilledpolygon($tmp, $values, 6, $randomcolor );
|
||||
}
|
||||
|
||||
$num = strlen($content);
|
||||
$x_param = 0;
|
||||
$y_param = 0;
|
||||
|
||||
for( $i = 0; $i < $num; $i++ )
|
||||
{
|
||||
$x_param += rand(-1,12);
|
||||
$y_param = rand(-3,8);
|
||||
|
||||
if( $x_param + 18 > $image_x )
|
||||
{
|
||||
$x_param -= ceil( $x_param + 18 - $image_x );
|
||||
}
|
||||
|
||||
$randomcolor = imagecolorallocate( $tmp, rand(0,150), rand(0,150),rand(0,150) );
|
||||
|
||||
imagestring($tmp, 5, $x_param+1, $y_param+1, $content{$i}, $grey);
|
||||
imagestring($tmp, 5, $x_param, $y_param, $content{$i}, $randomcolor);
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Distort by resizing
|
||||
//-----------------------------------------
|
||||
|
||||
imagecopyresized($im, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y);
|
||||
|
||||
imagedestroy($tmp);
|
||||
|
||||
//-----------------------------------------
|
||||
// Background dots and lines
|
||||
//-----------------------------------------
|
||||
|
||||
$random_pixels = $image_x * $image_y / 10;
|
||||
|
||||
for ($i = 0; $i < $random_pixels; $i++)
|
||||
{
|
||||
$randomcolor = imagecolorallocate( $im, rand(0,150), rand(0,150),rand(0,150) );
|
||||
ImageSetPixel($im, rand(0, $image_x), rand(0, $image_y), $randomcolor);
|
||||
}
|
||||
|
||||
$no_x_lines = ($image_x - 1) / 5;
|
||||
|
||||
for ( $i = 0; $i <= $no_x_lines; $i++ )
|
||||
{
|
||||
ImageLine( $im, $i * $no_x_lines, 0, $i * $no_x_lines, $image_y, $grey );
|
||||
ImageLine( $im, $i * $no_x_lines, 0, ($i * $no_x_lines)+$no_x_lines, $image_y, $grey );
|
||||
}
|
||||
|
||||
$no_y_lines = ($image_y - 1) / 5;
|
||||
|
||||
for ( $i = 0; $i <= $no_y_lines; $i++ )
|
||||
{
|
||||
ImageLine( $im, 0, $i * $no_y_lines, $image_x, $i * $no_y_lines, $grey );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Can we use fonts?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $allow_fonts AND function_exists('imagettftext') AND is_array( $fonts ) AND count( $fonts ) )
|
||||
{
|
||||
if ( function_exists('imageantialias') )
|
||||
{
|
||||
imageantialias( $im, TRUE );
|
||||
}
|
||||
|
||||
$num = strlen($content);
|
||||
$x_param = -10;
|
||||
$y_param = 0;
|
||||
|
||||
for( $i = 0; $i < $num; $i++ )
|
||||
{
|
||||
/* Random Font */
|
||||
$_font = $fonts[ mt_rand( 0, count( $fonts ) - 1 ) ];
|
||||
|
||||
$y_param = rand( 35, 48 );
|
||||
|
||||
# Main color
|
||||
$col_r = rand(50,200);
|
||||
$col_g = rand(0,150);
|
||||
$col_b = rand(50,200);
|
||||
# High light
|
||||
$col_r_l = ( $col_r + 50 > 255 ) ? 255 : $col_r + 50;
|
||||
$col_g_l = ( $col_g + 50 > 255 ) ? 255 : $col_g + 50;
|
||||
$col_b_l = ( $col_b + 50 > 255 ) ? 255 : $col_b + 50;
|
||||
# Low light
|
||||
$col_r_d = ( $col_r - 50 < 0 ) ? 0 : $col_r - 50;
|
||||
$col_g_d = ( $col_g - 50 < 0 ) ? 0 : $col_g - 50;
|
||||
$col_b_d = ( $col_b - 50 < 0 ) ? 0 : $col_b - 50;
|
||||
|
||||
$color_main = imagecolorallocate( $im, $col_r, $col_g, $col_b );
|
||||
$color_light = imagecolorallocate( $im, $col_r_l, $col_g_l, $col_b_l );
|
||||
$color_dark = imagecolorallocate( $im, $col_r_d, $col_g_d, $col_b_d );
|
||||
$_slant = mt_rand( -20, 40 );
|
||||
|
||||
if ( $i == 1 OR $i == 3 OR $i == 5 )
|
||||
{
|
||||
for( $ii = 0 ; $ii < 2 ; $ii++ )
|
||||
{
|
||||
$a = $x_param + 50;
|
||||
$b = mt_rand(0,100);
|
||||
$c = $a + 20;
|
||||
$d = $b + 20;
|
||||
$e = ( $i == 3 ) ? mt_rand( 280, 320 ) : mt_rand( -280, -320 );
|
||||
|
||||
imagearc( $im, $a , $b , $c, $d, 0, $e, $color_light );
|
||||
imagearc( $im, $a+1, $b+1, $c, $d, 0, $e, $color_main );
|
||||
}
|
||||
}
|
||||
|
||||
$text_size = rand( 24, 30 ); //24
|
||||
|
||||
if ( ! $_result = @imagettftext( $im, $text_size, $_slant, $x_param - 1, $y_param - 1, $color_light, $_font, $content[$i] ) )
|
||||
{
|
||||
$use_fonts = FALSE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
@imagettftext( $im, $text_size, $_slant, $x_param + 1, $y_param + 1, $color_dark, $_font, $content[$i] );
|
||||
@imagettftext( $im, $text_size, $_slant, $x_param, $y_param, $color_main, $_font, $content[$i] );
|
||||
}
|
||||
|
||||
$x_param += rand( 13, 16 ); //15,18
|
||||
|
||||
if( $x_param + 18 > $image_x )
|
||||
{
|
||||
$x_param -= ceil( $x_param + 18 - $image_x );
|
||||
}
|
||||
}
|
||||
|
||||
$use_fonts = TRUE;
|
||||
}
|
||||
|
||||
if ( ! $use_fonts )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Continue with nice background image
|
||||
//-----------------------------------------
|
||||
|
||||
$tmp = imagecreatetruecolor($tmp_x , $tmp_y );
|
||||
$tmp2 = imagecreatetruecolor($image_x, $image_y);
|
||||
|
||||
$white = imagecolorallocate( $tmp, 255, 255, 255 );
|
||||
$black = imagecolorallocate( $tmp, 0, 0, 0 );
|
||||
$grey = imagecolorallocate( $tmp, 100, 100, 100 );
|
||||
$transparent = imagecolorallocate( $tmp2, 255, 255, 255 );
|
||||
$_white = imagecolorallocate( $tmp2, 255, 255, 255 );
|
||||
|
||||
imagefill($tmp , 0, 0, $white );
|
||||
imagefill($tmp2, 0, 0, $_white);
|
||||
|
||||
$num = strlen($content);
|
||||
$x_param = 0;
|
||||
$y_param = 0;
|
||||
|
||||
for( $i = 0; $i < $num; $i++ )
|
||||
{
|
||||
if ( $i > 0 )
|
||||
{
|
||||
$x_param += rand( 6, 12 );
|
||||
|
||||
if( $x_param + 18 > $image_x )
|
||||
{
|
||||
$x_param -= ceil( $x_param + 18 - $image_x );
|
||||
}
|
||||
}
|
||||
|
||||
$y_param = rand( 0, 5 );
|
||||
|
||||
$randomcolor = imagecolorallocate( $tmp, rand(50,200), rand(50,200),rand(50,200) );
|
||||
|
||||
imagestring( $tmp, 5, $x_param + 1, $y_param + 1, $content{$i}, $grey );
|
||||
imagestring( $tmp, 5, $x_param , $y_param , $content{$i}, $randomcolor );
|
||||
}
|
||||
|
||||
imagecopyresized($tmp2, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y );
|
||||
|
||||
$tmp2 = $this->_captcha_show_gd_img_wave( $tmp2, 8, true );
|
||||
|
||||
imagecolortransparent( $tmp2, $transparent );
|
||||
imagecopymerge( $im, $tmp2, 0, 0, 0, 0, $image_x, $image_y, 100 );
|
||||
|
||||
imagedestroy($tmp);
|
||||
imagedestroy($tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Blur?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( function_exists( 'imagefilter' ) )
|
||||
{
|
||||
@imagefilter( $im, IMG_FILTER_GAUSSIAN_BLUR );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Render a border
|
||||
//-----------------------------------------
|
||||
|
||||
$black = imagecolorallocate( $im, 0, 0, 0 );
|
||||
|
||||
imageline( $im, 0, 0, $image_x, 0, $black );
|
||||
imageline( $im, 0, 0, 0, $image_y, $black );
|
||||
imageline( $im, $image_x - 1, 0, $image_x - 1, $image_y, $black );
|
||||
imageline( $im, 0, $image_y - 1, $image_x, $image_y - 1, $black );
|
||||
|
||||
//-----------------------------------------
|
||||
// Show it!
|
||||
//-----------------------------------------
|
||||
|
||||
@header( "Content-Type: image/jpeg" );
|
||||
|
||||
imagejpeg( $im );
|
||||
imagedestroy( $im );
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Create wave effect for GD images...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Create wave effect for GD images
|
||||
*
|
||||
* @param object Image resource
|
||||
* @return object Returned image resource
|
||||
* @since 1.0
|
||||
*/
|
||||
function _captcha_show_gd_img_wave( $im, $wave=10 )
|
||||
{
|
||||
$_width = imagesx( $im );
|
||||
$_height = imagesy( $im );
|
||||
|
||||
$tmp = imagecreatetruecolor( $_width, $_height );
|
||||
|
||||
$_direction = ( time() % 2 ) ? TRUE : FALSE;
|
||||
|
||||
for ( $x = 0; $x < $_width; $x++ )
|
||||
{
|
||||
for ( $y = 0 ; $y < $_height ; $y++ )
|
||||
{
|
||||
$xo = $wave * sin( 2 * 3.1415 * $y / 128 );
|
||||
$yo = $wave * cos( 2 * 3.1415 * $x / 128 );
|
||||
|
||||
$_x = $x - $xo;
|
||||
$_y = $y - $yo;
|
||||
|
||||
if ( ($_x > 0 AND $_x < $_width) AND ($_y > 0 AND $_y < $_height) )
|
||||
{
|
||||
$index = imagecolorat($im, $_x, $_y);
|
||||
$colors = imagecolorsforindex($im, $index);
|
||||
$color = imagecolorresolve( $tmp, $colors['red'], $colors['green'], $colors['blue'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$color = imagecolorresolve( $tmp, 255, 255, 255 );
|
||||
}
|
||||
|
||||
imagesetpixel( $tmp, $x, $y, $color );
|
||||
}
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Removes extinct captcha sessions
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Removes extinct captcha sessions
|
||||
* Clears out "dead" entries
|
||||
*
|
||||
* @param string Optional IP address to clear out on
|
||||
* @return string void
|
||||
*/
|
||||
|
||||
function _clearSessions( $ip_address='' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$time = time() - 60 * 3600;
|
||||
$extra = ( $ip_address ) ? ' OR ip_address="'.$ip_address.'"' : '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'reg_antispam',
|
||||
'where' => 'ctime < ' . $time . $extra ) );
|
||||
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Load up the backgrounds
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Loads up the backgrounds.
|
||||
*
|
||||
* @return array backgrounds
|
||||
*/
|
||||
|
||||
function _captcha_show_gd_img_get_backgrounds()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$images = array();
|
||||
$_path = $this->path_background;
|
||||
|
||||
if ( $_dir = @opendir( $_path ) )
|
||||
{
|
||||
while( false !== ( $_file = @readdir( $_dir ) ) )
|
||||
{
|
||||
if ( preg_match( "#\.(gif|jpeg|jpg|png)$#i", $_file ) )
|
||||
{
|
||||
$images[] = $_path . '/' . $_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $images;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Load up the fonts
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Loads up the fonts.
|
||||
*
|
||||
* @return array fonts
|
||||
*/
|
||||
|
||||
function _captcha_show_gd_img_get_fonts()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$fonts = array();
|
||||
$_path = $this->path_fonts;
|
||||
|
||||
if ( $_dir = @opendir( $_path ) )
|
||||
{
|
||||
while( false !== ( $_file = @readdir( $_dir ) ) )
|
||||
{
|
||||
if ( preg_match( "#\.(ttf)$#i", $_file ) )
|
||||
{
|
||||
$fonts[] = $_path . '/' . $_file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $fonts;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Dynamic v1.0.0
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER DYNAMIC IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionpower.com/dynamic/
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Id$
|
||||
| > $Revision: 128 $
|
||||
| > $Date: 2006-01-20 12:46:26 +0000 (Fri, 20 Jan 2006) $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > CAPTCHA ANTI-SPAM CLASS
|
||||
| > Script written by Matt Mecham
|
||||
| > Date started: Thursday 2 February (11:08)
|
||||
|
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* CAPTCHA CLASS
|
||||
* PLUG IN: Default GD image
|
||||
* @package IPDYNAMIC
|
||||
* @author Matt Mecham
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a PHP library that handles calling reCAPTCHA.
|
||||
* - Documentation and latest version
|
||||
* http://recaptcha.net/plugins/php/
|
||||
* - Get a reCAPTCHA API Key
|
||||
* http://recaptcha.net/api/getkey
|
||||
* - Discussion group
|
||||
* http://groups.google.com/group/recaptcha
|
||||
*
|
||||
* Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
|
||||
* AUTHORS:
|
||||
* Mike Crawford
|
||||
* Ben Maurer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* The reCAPTCHA server URL's
|
||||
*/
|
||||
define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
|
||||
define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");
|
||||
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
|
||||
|
||||
class captchaPlugin
|
||||
{
|
||||
/**
|
||||
* Global IPS class array
|
||||
* @var object
|
||||
*/
|
||||
var $ipsclass;
|
||||
|
||||
|
||||
/**
|
||||
* Error string
|
||||
* @var string
|
||||
*/
|
||||
var $error_string = '';
|
||||
|
||||
/**
|
||||
* Constructor bah to PHP 4
|
||||
*
|
||||
* @param object IPSClass object
|
||||
* @param string Captcha plug-in to use
|
||||
*/
|
||||
function captchaPlugin( $ipsclass )
|
||||
{
|
||||
$this->ipsclass =& $ipsclass;
|
||||
|
||||
$this->public_key = $this->ipsclass->vars['recaptcha_public_key'];
|
||||
$this->private_key = $this->ipsclass->vars['recaptcha_private_key'];
|
||||
$this->useSSL = false; //$this->ipsclass->vars['logins_over_https']; - IPB3 feature...shhhh ;) :P
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initializes captcha session
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Initializes captcha session
|
||||
* Clears out "dead" entries, adds new row and returns
|
||||
* unique ID for use in an image
|
||||
*
|
||||
* @return string HTML
|
||||
*/
|
||||
function getTemplate()
|
||||
{
|
||||
if ( ! $this->public_key )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($this->useSSL)
|
||||
{
|
||||
$server = RECAPTCHA_API_SECURE_SERVER;
|
||||
}
|
||||
else
|
||||
{
|
||||
$server = RECAPTCHA_API_SERVER;
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
if( $this->ipsclass->vars['recaptcha_language'] )
|
||||
{
|
||||
$html .= "<script type='text/javascript'>var RecaptchaOptions = { lang : '{$this->ipsclass->vars['recaptcha_language']}' };</script>";
|
||||
}
|
||||
|
||||
$html .= '<script type="text/javascript" src="'. $server . '/challenge?k=' . $this->public_key . '"></script>
|
||||
<noscript>
|
||||
<iframe src="'. $server . '/noscript?k=' . $this->public_key . '" height="300" width="500" frameborder="0"></iframe><br/>
|
||||
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
|
||||
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
|
||||
</noscript>';
|
||||
|
||||
//-----------------------------------------
|
||||
// Return Template Bit
|
||||
//-----------------------------------------
|
||||
|
||||
return $this->ipsclass->compiled_templates['skin_global']->captchaRecaptcha( $html );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Captcha validate
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Show the captcha bot image
|
||||
*
|
||||
* @return void
|
||||
* @since 1.0
|
||||
*/
|
||||
function validate()
|
||||
{
|
||||
if ( !$this->private_key )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$captcha_unique_id = $_REQUEST['recaptcha_challenge_field'];
|
||||
$captcha_input = $_REQUEST['recaptcha_response_field'];
|
||||
|
||||
if ( $captcha_input == null || strlen($captcha_input) == 0 || $captcha_unique_id == null || strlen($captcha_unique_id) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$response = $this->_recaptchaPost( RECAPTCHA_VERIFY_SERVER, "/verify",
|
||||
array (
|
||||
'privatekey' => $this->private_key,
|
||||
'remoteip' => $this->ipsclass->ip_address,
|
||||
'challenge' => $captcha_unique_id,
|
||||
'response' => $captcha_input
|
||||
)
|
||||
);
|
||||
|
||||
$answers = explode( "\n", $response [1] );
|
||||
|
||||
if ( trim ($answers [0]) == 'true' )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a URL where the user can sign up for reCAPTCHA. If your application
|
||||
* has a configuration page where you enter a key, you should provide a link
|
||||
* using this function.
|
||||
*
|
||||
* @access public
|
||||
* @param string $domain The domain where the page is hosted
|
||||
* @param string $appname The name of your application
|
||||
*/
|
||||
function getSignupUrl( $domain = null, $appname = null )
|
||||
{
|
||||
return "http://recaptcha.net/api/getkey?" . $this->_encodeQueryString( array( 'domain' => $domain, 'app' => $appname ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits an HTTP POST to a reCAPTCHA server
|
||||
*
|
||||
* @access private
|
||||
* @param string $host
|
||||
* @param string $path
|
||||
* @param array $data
|
||||
* @param int port
|
||||
* @return array response
|
||||
*/
|
||||
function _recaptchaPost( $host, $path, $data, $port = 80 )
|
||||
{
|
||||
$req = $this->_encodeQueryString( $data );
|
||||
|
||||
$http_request = "POST $path HTTP/1.0\r\n";
|
||||
$http_request .= "Host: $host\r\n";
|
||||
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
|
||||
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
|
||||
$http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
|
||||
$http_request .= "\r\n";
|
||||
$http_request .= $req;
|
||||
|
||||
$response = '';
|
||||
|
||||
if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
fwrite($fs, $http_request);
|
||||
|
||||
while ( !feof($fs) )
|
||||
{
|
||||
$response .= fgets($fs, 1160); // One TCP-IP packet
|
||||
}
|
||||
|
||||
fclose($fs);
|
||||
|
||||
$response = explode( "\r\n\r\n", $response, 2 );
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode array of data into a query string
|
||||
*
|
||||
* @access private
|
||||
* @param array $data
|
||||
* @return string query string
|
||||
*/
|
||||
function _encodeQueryString( $data )
|
||||
{
|
||||
$req = "";
|
||||
|
||||
foreach ( $data as $key => $value )
|
||||
{
|
||||
$req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
|
||||
}
|
||||
|
||||
// Cut the last '&'
|
||||
$req = substr( $req, 0, strlen($req)-1 );
|
||||
|
||||
return $req;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,22 +3,15 @@
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power KERNEL
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| (c) 2006 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Communication Class: Allows data to be sent via HTTP:POST
|
||||
@@ -259,7 +252,7 @@ class class_communication
|
||||
|
||||
if ( ! $url_parts['host'] )
|
||||
{
|
||||
$this->errors[] = "Íå íàéäåí õîñò â çàäàííîì URL '$file_location'!";
|
||||
$this->errors[] = "No host found in the URL '$file_location'!";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -315,7 +308,7 @@ class class_communication
|
||||
|
||||
if ( ! $fp = @fsockopen( $host, $port, $errno, $errstr, $fsocket_timeout ) )
|
||||
{
|
||||
$this->errors[] = "Ñîåäèíåíèå ïðåðâàíî óäàëåííûì ñåðâåðîì $host";
|
||||
$this->errors[] = "CONNECTION REFUSED FROM $host";
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
@@ -335,7 +328,7 @@ class class_communication
|
||||
|
||||
if ( ! fputs( $fp, $header . $post_back_str ) )
|
||||
{
|
||||
$this->errors[] = "Íå âîçìîæíî îòïðàâèòü çàïðîñ óäàëåííîìó ñåðâåðó $host!";
|
||||
$this->errors[] = "Unable to send request to $host!";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -347,7 +340,7 @@ class class_communication
|
||||
|
||||
if ( ! fputs( $fp, $header ) )
|
||||
{
|
||||
$this->errors[] = "Íå óäàëîñü àâòîðèçîâàòüñÿ!";
|
||||
$this->errors[] = "Authorization Failed!";
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
|
||||
@@ -2,24 +2,15 @@
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| 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)
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > CONVERT CHAR SET FUNCTIONS (Simple, light parser)
|
||||
|
||||
@@ -3,22 +3,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [DB Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
@@ -53,10 +46,10 @@
|
||||
* $db->build_query( array( 'select' => 'd.*',
|
||||
* 'from' => array( 'dnames_change' => 'd' ),
|
||||
* 'where' => 'dname_member_id='.$id,
|
||||
* 'add_join' => 0 => array( 'select' => 'm.members_display_name',
|
||||
* 'add_join' => array( 0 => array( 'select' => 'm.members_display_name',
|
||||
* 'from' => array( 'members' => 'm' ),
|
||||
* 'where' => 'm.id=d.dname_member_id',
|
||||
* 'type' => 'inner' ),
|
||||
* 'type' => 'inner' ) ),
|
||||
* 'order' => 'dname_date DESC' ) );
|
||||
* $db->exec_query();
|
||||
* </code>
|
||||
@@ -116,7 +109,6 @@ class db_main
|
||||
'error_log' => '' ,
|
||||
'use_error_log' => 0 ,
|
||||
'use_debug_log' => 0 ,
|
||||
'mysql_codepage' => 'cp1251' ,
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -126,7 +118,6 @@ class db_main
|
||||
*/
|
||||
var $error = "";
|
||||
var $error_no = "";
|
||||
var $error_codepage = "windows_1251";
|
||||
|
||||
/**
|
||||
* Return error message or die inline
|
||||
@@ -494,6 +485,24 @@ class db_main
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Shutdown replace into
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Alias for do_replace_into
|
||||
*
|
||||
* @see do_update
|
||||
* @since 2.1
|
||||
*/
|
||||
|
||||
function do_shutdown_replace_into( $tbl, $arr, $where )
|
||||
{
|
||||
# Alias, redirect.
|
||||
$this->do_replace_into( $tbl, $arr, $where, TRUE );
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Quick function: DO DELETE
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -570,7 +579,7 @@ class db_main
|
||||
function build_and_exec_query( $a )
|
||||
{
|
||||
$this->build_query( $a );
|
||||
|
||||
|
||||
$ci = $this->exec_query();
|
||||
|
||||
if ( isset($a['select']) AND $a['select'] )
|
||||
@@ -594,6 +603,21 @@ class db_main
|
||||
|
||||
function build_query_from_cache( $q="", $args=array(), $method='sql_queries' )
|
||||
{
|
||||
if ( $method == 'sql_queries' and !method_exists( $this->sql, $q ) )
|
||||
{
|
||||
if ( is_array( $this->loaded_classes ) )
|
||||
{
|
||||
foreach ( $this->loaded_classes as $sql_extension_obj )
|
||||
{
|
||||
if ( method_exists( $this->$sql_extension_obj, $q ) )
|
||||
{
|
||||
$method = $sql_extension_obj;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $this->obj['query_cache_file'] and $method == 'sql_queries' )
|
||||
{
|
||||
$this->cur_query .= $this->sql->$q( $args );
|
||||
@@ -748,11 +772,12 @@ class db_main
|
||||
else if ( $this->obj['use_error_log'] AND $this->obj['error_log'] )
|
||||
{
|
||||
$_error_string = "\n===================================================";
|
||||
$_error_string .= "\n Âðåìÿ: ". date( 'r' );
|
||||
$_error_string .= "\n Êîä îøèáêè: " . $this->error_no;
|
||||
$_error_string .= "\n Ñîîáùåíèå ñåðâåðà: " . $this->error;
|
||||
$_error_string .= "\n IP Àäðåñ êëèåíòà: " . $_SERVER['REMOTE_ADDR'];
|
||||
$_error_string .= "\n Çàïðîñ: ".$the_error;
|
||||
$_error_string .= "\n Date: ". date( 'r' );
|
||||
$_error_string .= "\n Error Number: " . $this->error_no;
|
||||
$_error_string .= "\n Error: " . $this->error;
|
||||
$_error_string .= "\n IP Address: " . $_SERVER['REMOTE_ADDR'];
|
||||
$_error_string .= "\n Page: " . $_SERVER['REQUEST_URI'];
|
||||
$_error_string .= "\n ".$the_error;
|
||||
|
||||
if ( $FH = @fopen( $this->obj['error_log'], 'a' ) )
|
||||
{
|
||||
@@ -760,28 +785,24 @@ class db_main
|
||||
@fclose( $FH );
|
||||
}
|
||||
|
||||
print "<html><head>
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $this->error_codepage . "\" />
|
||||
<title>Îøèáêà ðàáîòû äðàéâåðà ÁÄ</title>
|
||||
print "<html><head><title>IPS Driver Error</title>
|
||||
<style>P,BODY{ font-family:arial,sans-serif; font-size:11px; }</style></head><body>
|
||||
<blockquote><h1>Îøèáêà ïðè ðàáîòå ñ áàçîé äàííûõ</h1><b>Âîçíèêëà ïðîáëåìà ïðè ðàáîòå ñ áàçîé äàííûõ.</b><br>
|
||||
Âû ìîæåòå ïîïðîáîâàòü îáíîâèòü ýòó ñòðàíèöó, íàæàâ <a href=\"javascript:window.location=window.location;\">ñþäà</a>
|
||||
<blockquote><h1>IPS Driver Error</h1><b>There appears to be an error with the database.</b><br>
|
||||
You can try to refresh the page by clicking <a href=\"javascript:window.location=window.location;\">here</a>
|
||||
</body></html>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$the_error .= "\n\nÑîîáùåíèå ñåðâåðà: ".$this->error."\n";
|
||||
$the_error .= "Êîä îøèáêè: ".$this->error_no."\n";
|
||||
$the_error .= "Âðåìÿ: ".date("l dS \o\f F Y h:i:s A");
|
||||
$the_error .= "\n\nSQL error: ".$this->error."\n";
|
||||
$the_error .= "SQL error code: ".$this->error_no."\n";
|
||||
$the_error .= "Date: ".date("l dS \o\f F Y h:i:s A");
|
||||
|
||||
$out = "<html><head>
|
||||
<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $this->error_codepage . "\" />
|
||||
<title>Îøèáêà ðàáîòû äðàéâåðà ÁÄ</title>
|
||||
$out = "<html><head><title>IPS Driver Error</title>
|
||||
<style>P,BODY{ font-family:arial,sans-serif; font-size:11px; }</style></head><body>
|
||||
<blockquote><h1>Îøèáêà ïðè ðàáîòå ñ áàçîé äàííûõ</h1><b>Âîçíèêëà ïðîáëåìà ïðè ðàáîòå ñ áàçîé äàííûõ.</b><br>
|
||||
Âû ìîæåòå ïîïðîáîâàòü îáíîâèòü ýòó ñòðàíèöó, íàæàâ <a href=\"javascript:window.location=window.location;\">ñþäà</a>.
|
||||
<br><br><b>Îòëàäî÷íàÿ èíôîðìàöèÿ:</b><br>
|
||||
<form name='mysql'><textarea rows=\"15\" cols=\"60\">".htmlspecialchars($the_error)."</textarea></form><br>Ïðèíîñèì ñâîè èçâèíåíèÿ çà âîçìîæíûå íåóäîáñòâà.</blockquote></body></html>";
|
||||
<blockquote><h1>IPS Driver Error</h1><b>There appears to be an error with the database.</b><br>
|
||||
You can try to refresh the page by clicking <a href=\"javascript:window.location=window.location;\">here</a>.
|
||||
<br><br><b>Error Returned</b><br>
|
||||
<form name='mysql'><textarea rows=\"15\" cols=\"60\">".htmlspecialchars($the_error)."</textarea></form><br>We apologise for any inconvenience</blockquote></body></html>";
|
||||
|
||||
|
||||
print $out;
|
||||
@@ -1026,10 +1047,10 @@ class db_main
|
||||
if ( $this->obj['use_debug_log'] AND $this->obj['debug_log'] )
|
||||
{
|
||||
$_string = "\n==============================================================================";
|
||||
$_string .= "\n Äàòà: ". date( 'r' );
|
||||
$_string .= "\n IP Àäðåñ êëèåíòà: " . $_SERVER['REMOTE_ADDR'];
|
||||
$_string .= "\n Âðåìÿ âûïîëíåíèÿ: ".$endtime;
|
||||
$_string .= "\n Çàïðîñ: ".$query;
|
||||
$_string .= "\n Date: ". date( 'r' );
|
||||
$_string .= "\n IP Address: " . $_SERVER['REMOTE_ADDR'];
|
||||
$_string .= "\n Time Taken: ".$endtime;
|
||||
$_string .= "\n ".$query;
|
||||
$_string .= "\n==============================================================================";
|
||||
$_string .= "\n".$data;
|
||||
|
||||
|
||||
@@ -3,22 +3,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [DB Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > MySQL Driver Module
|
||||
@@ -44,6 +37,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
//define( 'FORCE_MYSQL_ONLY', 1 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Define KERNEL_PATH if not
|
||||
// defined - i.e. installation
|
||||
@@ -81,4 +76,10 @@ else
|
||||
require( KERNEL_PATH."class_db_mysql_client.php" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Clean up
|
||||
//-----------------------------------------
|
||||
|
||||
unset( $versions );
|
||||
|
||||
?>
|
||||
@@ -3,22 +3,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [DB Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > MySQLi Driver Module
|
||||
@@ -75,6 +68,8 @@ if ( ! defined('IPS_MAIN_DB_CLASS_LEGACY') )
|
||||
*/
|
||||
class db_driver_mysql extends db_main
|
||||
{
|
||||
var $cached_fields = array();
|
||||
var $cached_tables = array();
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set up required vars
|
||||
@@ -153,30 +148,13 @@ class db_driver_mysql extends db_main
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$this->sql_set_collation_and_cp();
|
||||
|
||||
unset( $this->obj['sql_host'] );
|
||||
unset( $this->obj['sql_user'] );
|
||||
unset( $this->obj['sql_pass'] );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function sql_set_collation_and_cp()
|
||||
{
|
||||
$this->sql_get_version();
|
||||
|
||||
if ( $this->mysql_version >= 40101 )
|
||||
{
|
||||
$res = mysql_query( "SHOW CHARSET LIKE '" . $this->obj['mysql_codepage'] . "'", $this->connection_id );
|
||||
|
||||
$charset = mysql_fetch_row($res);
|
||||
|
||||
mysql_query( "SET NAMES " . $this->obj['mysql_codepage'], $this->connection_id );
|
||||
mysql_query( "SET CHARACTER SET " . $this->obj['mysql_codepage'], $this->connection_id );
|
||||
mysql_query( "SET character_set_connection = " . $this->obj['mysql_codepage'], $this->connection_id );
|
||||
mysql_query( "SET collation_connection = " . $charset[2], $this->connection_id );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function sql_can_subquery()
|
||||
{
|
||||
$this->sql_get_version();
|
||||
@@ -240,6 +218,52 @@ class db_driver_mysql extends db_main
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Quick function: DO REPLACE INTO
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_replace_into( $tbl, $arr, $where='', $shutdown=FALSE )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Form query
|
||||
//-----------------------------------------
|
||||
|
||||
$dba = $this->compile_db_insert_string( $arr );
|
||||
|
||||
$query = "REPLACE INTO ".$this->obj['sql_tbl_prefix']."$tbl ({$dba['FIELD_NAMES']}) VALUES({$dba['FIELD_VALUES']})";
|
||||
|
||||
//-----------------------------------------
|
||||
// Shut down query?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->no_prefix_convert = 1;
|
||||
|
||||
if ( $shutdown )
|
||||
{
|
||||
if ( ! $this->obj['use_shutdown'] )
|
||||
{
|
||||
$this->is_shutdown = 1;
|
||||
$return = $this->query( $query );
|
||||
$this->no_prefix_convert = 0;
|
||||
$this->is_shutdown = 1;
|
||||
return $return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->obj['shutdown_queries'][] = $query;
|
||||
$this->no_prefix_convert = 0;
|
||||
$this->cur_query = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = $this->query( $query );
|
||||
$this->no_prefix_convert = 0;
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Quick function: DO INSERT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -556,20 +580,20 @@ class db_driver_mysql extends db_main
|
||||
|
||||
if ( preg_match( "#(?:/\*|\*/)#i", $_tmp ) )
|
||||
{
|
||||
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå äîïóñêàþò èñïîëüçîâàíèå êîììåíòàðèåâ â SQL çàïðîñå.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
|
||||
$this->fatal_error( "You are not allowed to use comments in your SQL query.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( preg_match( "#[^_a-zA-Z]union[^_a-zA-Z]#s", $_tmp ) )
|
||||
{
|
||||
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå ïîçâîëÿþò èñïîëüçîâàòü UNION-çàïðîñû.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
|
||||
$this->fatal_error( "UNION query joins are not allowed.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );
|
||||
return false;
|
||||
}
|
||||
else if ( preg_match_all( "#[^_a-zA-Z](select)[^_a-zA-Z]#s", $_tmp, $matches ) )
|
||||
{
|
||||
if ( count( $matches ) > 1 )
|
||||
{
|
||||
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå ïîçâîëÿþò èñïîëüçîâàòü âëîæåííûå SELECT â çàïðîñàõ.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
|
||||
$this->fatal_error( "SUB SELECT query joins are not allowed.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -591,7 +615,7 @@ class db_driver_mysql extends db_main
|
||||
|
||||
if (! $this->query_id )
|
||||
{
|
||||
$this->fatal_error($the_query);
|
||||
$this->fatal_error("mySQL query error: $the_query");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -620,7 +644,7 @@ class db_driver_mysql extends db_main
|
||||
$_data .= "\n+------------------------------------------------------------------------------+";
|
||||
}
|
||||
|
||||
$this->write_debug_log( $query, $_data, $endtime );
|
||||
$this->write_debug_log( $the_query, $_data, $endtime );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -747,9 +771,16 @@ class db_driver_mysql extends db_main
|
||||
// ADD FIELD
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function sql_add_field( $table, $field_name, $field_type, $field_default="''" )
|
||||
function sql_add_field( $table, $field_name, $field_type, $field_default='' )
|
||||
{
|
||||
$this->query( "ALTER TABLE ".$this->obj['sql_tbl_prefix']."{$table} ADD $field_name $field_type default {$field_default}" );
|
||||
$default = 'NULL';
|
||||
|
||||
if( $field_default !== '' )
|
||||
{
|
||||
$default = "default {$field_default}";
|
||||
}
|
||||
|
||||
$this->query( "ALTER TABLE ".$this->obj['sql_tbl_prefix']."{$table} ADD {$field_name} {$field_type} {$default}" );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -785,8 +816,12 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function sql_get_table_schematic( $table )
|
||||
{
|
||||
$this->return_die = 1;
|
||||
|
||||
$qid = $this->query( "SHOW CREATE TABLE ".$this->obj['sql_tbl_prefix']."{$table}" );
|
||||
|
||||
$this->return_die = 0;
|
||||
|
||||
if( $qid )
|
||||
{
|
||||
return $this->fetch_row($qid);
|
||||
@@ -941,17 +976,22 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function get_table_names()
|
||||
{
|
||||
if( is_array($this->cached_tables) AND count($this->cached_tables) )
|
||||
{
|
||||
return $this->cached_tables;
|
||||
}
|
||||
|
||||
$result = mysql_list_tables($this->obj['sql_database']);
|
||||
$num_tables = @mysql_numrows($result);
|
||||
for ($i = 0; $i < $num_tables; $i++)
|
||||
{
|
||||
$tables[] = mysql_tablename($result, $i);
|
||||
$this->cached_tables[] = mysql_tablename($result, $i);
|
||||
}
|
||||
|
||||
// free result docs say only for select, explain, describe, show queries
|
||||
//mysql_free_result($result);
|
||||
|
||||
return $tables;
|
||||
return $this->cached_tables;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -964,7 +1004,7 @@ class db_driver_mysql extends db_main
|
||||
|
||||
$return = 0;
|
||||
|
||||
if ( in_array( SQL_PREFIX.$table, $table_names ) )
|
||||
if ( in_array( $this->obj['sql_tbl_prefix'].$table, $table_names ) )
|
||||
{
|
||||
$return = 1;
|
||||
}
|
||||
@@ -973,6 +1013,52 @@ class db_driver_mysql extends db_main
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check if field exists
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function field_exists($field, $table)
|
||||
{
|
||||
if( array_key_exists( $table, $this->cached_fields ) )
|
||||
{
|
||||
if( in_array( $field, $this->cached_fields[ $table ] ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$this->return_die = 1;
|
||||
$this->error = "";
|
||||
$return = 0;
|
||||
|
||||
$q = $this->query( "SHOW fields FROM " . $this->obj['sql_tbl_prefix'] . $table );
|
||||
|
||||
if( $q AND $this->get_num_rows($q) )
|
||||
{
|
||||
while( $check = $this->fetch_row($q) )
|
||||
{
|
||||
$this->cached_fields[ $table ][] = $check['Field'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$this->failed AND in_array( $field, $this->cached_fields[ $table ] ) )
|
||||
{
|
||||
$return = 1;
|
||||
}
|
||||
|
||||
$this->error = "";
|
||||
$this->return_die = 0;
|
||||
$this->error_no = 0;
|
||||
$this->failed = 0;
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -1001,9 +1087,14 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function _get_error_number()
|
||||
{
|
||||
$conid = $this->connection_id ? $this->connection_id : '';
|
||||
|
||||
return @mysql_errno( $conid );
|
||||
if( $this->connection_id )
|
||||
{
|
||||
return @mysql_errno( $this->connection_id );
|
||||
}
|
||||
else
|
||||
{
|
||||
return @mysql_errno();
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -1012,9 +1103,14 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function _get_error_string()
|
||||
{
|
||||
$conid = $this->connection_id ? $this->connection_id : '';
|
||||
|
||||
return @mysql_error( $conid );
|
||||
if( $this->connection_id )
|
||||
{
|
||||
return @mysql_error( $this->connection_id );
|
||||
}
|
||||
else
|
||||
{
|
||||
return @mysql_error();
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@@ -3,22 +3,15 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [DB Abstraction]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > MySQLi Driver Module
|
||||
@@ -78,6 +71,9 @@ class db_driver_mysql extends db_main
|
||||
{
|
||||
var $connect_failed = 0;
|
||||
|
||||
var $cached_fields = array();
|
||||
var $cached_tables = array();
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Set up required vars
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -123,10 +119,23 @@ class db_driver_mysql extends db_main
|
||||
// Connect
|
||||
//-----------------------------------------
|
||||
|
||||
$this->connection_id = @mysqli_connect( $this->obj['sql_host'] ,
|
||||
$this->obj['sql_user'] ,
|
||||
$this->obj['sql_pass']
|
||||
);
|
||||
if( $this->obj['sql_port'] )
|
||||
{
|
||||
$this->connection_id = @mysqli_connect( $this->obj['sql_host'] ,
|
||||
$this->obj['sql_user'] ,
|
||||
$this->obj['sql_pass'],
|
||||
$this->obj['sql_database'],
|
||||
$this->obj['sql_port']
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->connection_id = @mysqli_connect( $this->obj['sql_host'] ,
|
||||
$this->obj['sql_user'] ,
|
||||
$this->obj['sql_pass'],
|
||||
$this->obj['sql_database']
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! $this->connection_id )
|
||||
{
|
||||
@@ -135,37 +144,21 @@ class db_driver_mysql extends db_main
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( ! mysqli_select_db( $this->connection_id, $this->obj['sql_database'] ) )
|
||||
/*if ( ! mysqli_select_db( $this->connection_id, $this->obj['sql_database'] ) )
|
||||
{
|
||||
$this->fatal_error();
|
||||
return FALSE;
|
||||
}
|
||||
}*/
|
||||
|
||||
$this->sql_set_collation_and_cp();
|
||||
mysqli_autocommit( $this->connection_id, TRUE );
|
||||
|
||||
unset( $this->obj['sql_host'] );
|
||||
unset( $this->obj['sql_user'] );
|
||||
unset( $this->obj['sql_pass'] );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function sql_set_collation_and_cp()
|
||||
{
|
||||
$this->sql_get_version();
|
||||
|
||||
if ( $this->mysql_version >= 40101 )
|
||||
{
|
||||
$res = mysqli_query( $this->connection_id, "SHOW CHARSET LIKE '" . $this->obj['mysql_codepage'] . "'");
|
||||
|
||||
$charset = mysqli_fetch_row($res);
|
||||
|
||||
mysqli_query( $this->connection_id, "SET NAMES " . $this->obj['mysql_codepage'] );
|
||||
mysqli_query( $this->connection_id, "SET CHARACTER SET " . $this->obj['mysql_codepage'] );
|
||||
mysqli_query( $this->connection_id, "SET character_set_connection = " . $this->obj['mysql_codepage'] );
|
||||
mysqli_query( $this->connection_id, "SET collation_connection = " . $charset[2] );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function sql_can_subquery()
|
||||
{
|
||||
$this->sql_get_version();
|
||||
@@ -211,7 +204,7 @@ class db_driver_mysql extends db_main
|
||||
$this->is_shutdown = 1;
|
||||
$return = $this->query( $query );
|
||||
$this->no_prefix_convert = 0;
|
||||
$this->is_shutdown = 1;
|
||||
$this->is_shutdown = 0;
|
||||
return $return;
|
||||
}
|
||||
else
|
||||
@@ -274,6 +267,52 @@ class db_driver_mysql extends db_main
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Quick function: DO REPLACE INTO
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_replace_into( $tbl, $arr, $where='', $shutdown=FALSE )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Form query
|
||||
//-----------------------------------------
|
||||
|
||||
$dba = $this->compile_db_insert_string( $arr );
|
||||
|
||||
$query = "REPLACE INTO ".$this->obj['sql_tbl_prefix']."$tbl ({$dba['FIELD_NAMES']}) VALUES({$dba['FIELD_VALUES']})";
|
||||
|
||||
//-----------------------------------------
|
||||
// Shut down query?
|
||||
//-----------------------------------------
|
||||
|
||||
$this->no_prefix_convert = 1;
|
||||
|
||||
if ( $shutdown )
|
||||
{
|
||||
if ( ! $this->obj['use_shutdown'] )
|
||||
{
|
||||
$this->is_shutdown = 1;
|
||||
$return = $this->query( $query );
|
||||
$this->no_prefix_convert = 0;
|
||||
$this->is_shutdown = 1;
|
||||
return $return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->obj['shutdown_queries'][] = $query;
|
||||
$this->no_prefix_convert = 0;
|
||||
$this->cur_query = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = $this->query( $query );
|
||||
$this->no_prefix_convert = 0;
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SIMPLE: UPDATE
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -545,20 +584,20 @@ class db_driver_mysql extends db_main
|
||||
|
||||
if ( preg_match( "#(?:/\*|\*/)#i", $_tmp ) )
|
||||
{
|
||||
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå äîïóñêàþò èñïîëüçîâàíèå êîììåíòàðèåâ â SQL çàïðîñå.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
|
||||
$this->fatal_error( "You are not allowed to use comments in your SQL query.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( preg_match( "#[^_a-zA-Z]union[^_a-zA-Z]#s", $_tmp ) )
|
||||
{
|
||||
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå ïîçâîëÿþò èñïîëüçîâàòü UNION-çàïðîñû.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
|
||||
$this->fatal_error( "UNION query joins are not allowed.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );
|
||||
return false;
|
||||
}
|
||||
else if ( preg_match_all( "#[^_a-zA-Z](select)[^_a-zA-Z]#s", $_tmp, $matches ) )
|
||||
{
|
||||
if ( count( $matches ) > 1 )
|
||||
{
|
||||
$this->fatal_error( "Íàñòðîéêè äðàéâåðà íå ïîçâîëÿþò èñïîëüçîâàòü âëîæåííûå SELECT â çàïðîñàõ.\nÈçìåíèòå àòðèáóò allow_sub_select íà 1 ó îáúåêòà äðàéâåðà äëÿ âûêëþ÷åíèÿ ýòîé ïðîâåðêè." );
|
||||
$this->fatal_error( "SUB SELECT query joins are not allowed.\nAdd \$this->ipsclass->DB->allow_sub_select=1; before any query construct to allow them" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -580,7 +619,7 @@ class db_driver_mysql extends db_main
|
||||
|
||||
if (! $this->query_id )
|
||||
{
|
||||
$this->fatal_error($the_query);
|
||||
$this->fatal_error("mySQL query error: $the_query");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -704,7 +743,7 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function fetch_row($query_id = "")
|
||||
{
|
||||
if ( !$query_id )
|
||||
if ( ! $query_id )
|
||||
{
|
||||
$query_id = $this->query_id;
|
||||
}
|
||||
@@ -736,9 +775,16 @@ class db_driver_mysql extends db_main
|
||||
// ADD FIELD
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function sql_add_field( $table, $field_name, $field_type, $field_default="''" )
|
||||
function sql_add_field( $table, $field_name, $field_type, $field_default='' )
|
||||
{
|
||||
$this->query( "ALTER TABLE ".$this->obj['sql_tbl_prefix']."{$table} ADD $field_name $field_type default {$field_default}" );
|
||||
$default = 'NULL';
|
||||
|
||||
if( $field_default !== '' )
|
||||
{
|
||||
$default = "default {$field_default}";
|
||||
}
|
||||
|
||||
$this->query( "ALTER TABLE ".$this->obj['sql_tbl_prefix']."{$table} ADD {$field_name} {$field_type} {$default}" );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -774,8 +820,12 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function sql_get_table_schematic( $table )
|
||||
{
|
||||
$this->return_die = 1;
|
||||
|
||||
$qid = $this->query( "SHOW CREATE TABLE ".$this->obj['sql_tbl_prefix']."{$table}" );
|
||||
|
||||
$this->return_die = 0;
|
||||
|
||||
if( $qid )
|
||||
{
|
||||
return $this->fetch_row($qid);
|
||||
@@ -924,16 +974,29 @@ class db_driver_mysql extends db_main
|
||||
|
||||
function get_table_names()
|
||||
{
|
||||
if ( is_array( $this->cached_tables ) AND count( $this->cached_tables ) )
|
||||
{
|
||||
return $this->cached_tables;
|
||||
}
|
||||
|
||||
$_tmp = $this->return_die;
|
||||
$this->return_die = 1;
|
||||
|
||||
$tbl = $this->query( "SHOW TABLES FROM `{$this->obj['sql_database']}`" );
|
||||
|
||||
while( $result = mysqli_fetch_row($tbl) )
|
||||
$this->return_die = $_tmp;
|
||||
|
||||
if( $tbl AND $this->get_num_rows($tbl) )
|
||||
{
|
||||
$tables[] = $result[0];
|
||||
while( $result = mysqli_fetch_row($tbl) )
|
||||
{
|
||||
$this->cached_tables[] = $result[0];
|
||||
}
|
||||
}
|
||||
|
||||
mysqli_free_result($tbl);
|
||||
|
||||
return $tables;
|
||||
return $this->cached_tables;
|
||||
}
|
||||
|
||||
|
||||
@@ -947,7 +1010,7 @@ class db_driver_mysql extends db_main
|
||||
|
||||
$return = 0;
|
||||
|
||||
if ( in_array( SQL_PREFIX.$table, $table_names ) )
|
||||
if ( in_array( trim( $this->obj['sql_tbl_prefix'] . $table ), $table_names ) )
|
||||
{
|
||||
$return = 1;
|
||||
}
|
||||
@@ -955,7 +1018,52 @@ class db_driver_mysql extends db_main
|
||||
unset($table_names);
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check if field exists
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function field_exists($field, $table)
|
||||
{
|
||||
if( array_key_exists( $table, $this->cached_fields ) )
|
||||
{
|
||||
if( in_array( $field, $this->cached_fields[ $table ] ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$this->return_die = 1;
|
||||
$this->error = "";
|
||||
$return = 0;
|
||||
|
||||
$q = $this->query( "SHOW fields FROM " . $this->obj['sql_tbl_prefix'] . $table );
|
||||
|
||||
if( $q AND $this->get_num_rows($q) )
|
||||
{
|
||||
while( $check = $this->fetch_row($q) )
|
||||
{
|
||||
$this->cached_fields[ $table ][] = $check['Field'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$this->failed AND in_array( $field, $this->cached_fields[ $table ] ) )
|
||||
{
|
||||
$return = 1;
|
||||
}
|
||||
|
||||
$this->error = "";
|
||||
$this->return_die = 0;
|
||||
$this->error_no = 0;
|
||||
$this->failed = 0;
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Return an array of fields
|
||||
|
||||
@@ -2,22 +2,12 @@
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel Module
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| (c) 2005 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Difference Engine.
|
||||
@@ -260,7 +250,7 @@ class class_difference
|
||||
{
|
||||
$str_array = $this->_explode_trim( chr(10), $str );
|
||||
$out_array = array();
|
||||
|
||||
|
||||
reset($str_array);
|
||||
|
||||
foreach( $str_array as $low )
|
||||
@@ -290,7 +280,7 @@ class class_difference
|
||||
|
||||
foreach( $tmp as $i )
|
||||
{
|
||||
if ( $remove_blank AND ! $i )
|
||||
if ( $remove_blank AND ( $i === '' OR $i === NULL ) ) //!$i AND $i !== 0 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -299,7 +289,7 @@ class class_difference
|
||||
$final[] = trim($i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $final;
|
||||
}
|
||||
|
||||
@@ -397,7 +387,7 @@ class class_difference
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Îøèáêà: ôàéëà íå ñóùåñòâóåò";
|
||||
return "Error, files not written to disk";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +444,7 @@ class class_difference
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Îøèáêà: ôàéëà íå ñóùåñòâóåò";
|
||||
return "Error, files not written to disk";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+274
-113
@@ -1,24 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Email Functions]
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Core Module
|
||||
@@ -74,147 +66,169 @@ class class_email
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $from = "";
|
||||
var $from = "";
|
||||
|
||||
/**
|
||||
* From email address
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $from_display = "";
|
||||
|
||||
/**
|
||||
* To email address
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $to = "";
|
||||
var $to = "";
|
||||
|
||||
/**
|
||||
* Email subject
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $subject = "";
|
||||
var $subject = "";
|
||||
|
||||
/**
|
||||
* Email message contents
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $message = "";
|
||||
var $message = "";
|
||||
|
||||
/**
|
||||
* Plain text message contents
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $pt_message = "";
|
||||
|
||||
/**
|
||||
* Attachments: Parts
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $parts = array();
|
||||
var $parts = array();
|
||||
|
||||
/**
|
||||
* BCC Email addresses
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $bcc = array();
|
||||
var $bcc = array();
|
||||
|
||||
/**
|
||||
* Email headers (sep. \r\n)
|
||||
* Email headers
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $mail_headers = "";
|
||||
var $mail_headers = array();
|
||||
|
||||
/**
|
||||
* Header EOL
|
||||
* RFC specs state \r\n
|
||||
* However most servers support \n
|
||||
* @var string
|
||||
*/
|
||||
var $header_eol = "\n";
|
||||
|
||||
/**
|
||||
* Attachments: Multi-part
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $multipart = "";
|
||||
var $multipart = "";
|
||||
|
||||
/**
|
||||
* Attachments: Boundry
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $boundry = "----=_NextPart_000_0022_01C1BD6C.D0C0F9F0";
|
||||
var $boundry = "----=_NextPart_000_0022_01C1BD6C.D0C0F9F0";
|
||||
|
||||
/**
|
||||
* HTML email flag
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
var $html_email = 0;
|
||||
var $html_email = 0;
|
||||
|
||||
/**
|
||||
* Email character set
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $char_set = 'iso-8859-1';
|
||||
var $char_set = 'utf-8';
|
||||
|
||||
/**
|
||||
* SMTP:
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
var $smtp_fp = FALSE;
|
||||
var $smtp_fp = null;
|
||||
|
||||
/**
|
||||
* SMTP: Message
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $smtp_msg = "";
|
||||
var $smtp_msg = "";
|
||||
|
||||
/**
|
||||
* SMTP: Port
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
var $smtp_port = 25;
|
||||
var $smtp_port = 25;
|
||||
|
||||
/**
|
||||
* SMTP: Host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $smtp_host = "localhost";
|
||||
var $smtp_host = "localhost";
|
||||
|
||||
/**
|
||||
* SMTP: Username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $smtp_user = "";
|
||||
var $smtp_user = "";
|
||||
|
||||
/**
|
||||
* SMTP: Password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $smtp_pass = "";
|
||||
var $smtp_pass = "";
|
||||
|
||||
/**
|
||||
* SMTP: Return code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $smtp_code = "";
|
||||
var $smtp_code = "";
|
||||
|
||||
/**
|
||||
* SMTP: Wrap email addresses in brackets flag
|
||||
*
|
||||
* @var integer boolean
|
||||
*/
|
||||
var $wrap_brackets = 0;
|
||||
var $wrap_brackets = 0;
|
||||
|
||||
/**
|
||||
* Default email method (mail or smtp)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $mail_method = 'mail';
|
||||
var $mail_method = 'mail';
|
||||
|
||||
/**
|
||||
* Dump email to flat file for testing
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
var $temp_dump = 0;
|
||||
var $temp_dump = 0;
|
||||
|
||||
/**
|
||||
* Error message
|
||||
@@ -280,6 +294,9 @@ class class_email
|
||||
|
||||
function build_headers()
|
||||
{
|
||||
$extra_headers = array();
|
||||
$extra_header_rfc = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// HTML (hitmuhl)
|
||||
// If we're sending HTML messages, then
|
||||
@@ -288,39 +305,56 @@ class class_email
|
||||
//-----------------------------------------
|
||||
|
||||
$this->pt_message = $this->message;
|
||||
$this->pt_message = str_replace( "<br />", "\n", $this->pt_message );
|
||||
$this->pt_message = str_replace( "<br>" , "\n", $this->pt_message );
|
||||
$this->pt_message = strip_tags( $this->pt_message );
|
||||
|
||||
$this->pt_message = html_entity_decode( $this->pt_message, ENT_QUOTES );
|
||||
$this->pt_message = str_replace( '\', '\\', $this->pt_message );
|
||||
$this->pt_message = str_replace( '$', '$', $this->pt_message );
|
||||
|
||||
// Now put & back...
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Start mail headers
|
||||
//-----------------------------------------
|
||||
|
||||
$this->mail_headers .= "Return-Path: ".$this->from."\n";
|
||||
$this->mail_headers .= "X-Priority: 3\n";
|
||||
$this->mail_headers .= "X-Mailer: IPB PHP Mailer\n";
|
||||
$this->mail_headers['MIME-Version'] = "1.0";
|
||||
|
||||
//-----------------------------------------
|
||||
// From and to...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->mail_headers .= "From: ".$this->from."\n";
|
||||
if( $this->from_display )
|
||||
{
|
||||
$this->mail_headers['From'] = '"' . $this->from_display . '" <' . $this->from . '>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->mail_headers['From'] = '<' . $this->from . '>';
|
||||
}
|
||||
|
||||
if ( $this->mail_method != 'smtp' )
|
||||
{
|
||||
if ( count( $this->bcc ) > 1 )
|
||||
{
|
||||
$this->mail_headers .= "Bcc: ".implode( "," , $this->bcc ) . "\n";
|
||||
$this->mail_headers['Bcc'] = implode( "," , $this->bcc );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->to )
|
||||
{
|
||||
$this->mail_headers .= "To: ".$this->to."\n";
|
||||
$this->mail_headers['To'] = $this->to;
|
||||
}
|
||||
$this->mail_headers .= "Subject: ".$this->subject."\n";
|
||||
|
||||
$this->mail_headers['Subject'] = $this->subject;
|
||||
}
|
||||
|
||||
# Start MIME headers
|
||||
$this->mail_headers .= "MIME-Version: 1.0\n";
|
||||
$this->mail_headers['Return-Path'] = $this->from;
|
||||
$this->mail_headers['X-Priority'] = "3";
|
||||
$this->mail_headers['X-Mailer'] = "IPS PHP Mailer";
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments?
|
||||
@@ -328,66 +362,116 @@ class class_email
|
||||
|
||||
if ( count ($this->parts) > 0 )
|
||||
{
|
||||
# Format PT message
|
||||
if ( $this->html_email )
|
||||
if ( ! $this->html_email )
|
||||
{
|
||||
$this->pt_message = str_replace( "<br />", "\n", $this->pt_message );
|
||||
$this->pt_message = str_replace( "<br>" , "\n", $this->pt_message );
|
||||
$this->pt_message = strip_tags( $this->pt_message );
|
||||
$extra_headers[0]['Content-Type'] = "multipart/mixed;\n\tboundary=\"".$this->boundry."\"";
|
||||
|
||||
$extra_headers[0]['notencode'] = "\n\nThis is a MIME encoded message.\n\n--".$this->boundry."\n";
|
||||
|
||||
$extra_headers[1]['Content-Type'] = "text/plain;\n\tcharset=\"".$this->char_set."\"";
|
||||
#$extra_headers[1]['Content-Transfer-Encoding'] = "quoted-printable";
|
||||
|
||||
$extra_headers[1]['notencode'] = "\n\n".$this->message."\n\n--".$this->boundry;
|
||||
}
|
||||
else
|
||||
{
|
||||
$extra_headers[0]['Content-Type'] = "multipart/mixed;\n\tboundary=\"".$this->boundry."\"";
|
||||
|
||||
$extra_headers[0]['notencode'] = "\n\nThis is a MIME encoded message.\n\n--".$this->boundry."\n";
|
||||
|
||||
$extra_headers[1]['Content-Type'] = "text/html;\n\tcharset=\"".$this->char_set."\"";
|
||||
#$extra_headers[1]['Content-Transfer-Encoding'] = "quoted-printable";
|
||||
|
||||
$extra_headers[1]['notencode'] = "\n\n".$this->message."\n\n--".$this->boundry;
|
||||
}
|
||||
|
||||
# Force plain text emails only
|
||||
$this->html_email = 0;
|
||||
$extra_headers[2]['notencode'] = $this->build_multipart();
|
||||
|
||||
reset($extra_headers);
|
||||
|
||||
foreach( $extra_headers as $subset => $the_header )
|
||||
{
|
||||
foreach( $the_header as $k => $v )
|
||||
{
|
||||
if( $k == 'notencode' )
|
||||
{
|
||||
$extra_headers_rfc .= $v;
|
||||
}
|
||||
else
|
||||
{
|
||||
$v = $this->encode_headers( array( 'v' => $v ) );
|
||||
|
||||
$extra_headers_rfc .= $k.': '.$v['v'].$this->header_eol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Do headers
|
||||
$this->mail_headers .= "Content-type: multipart/mixed;boundary=\"".$this->boundry."\"\n\nThis is a MIME encoded message.\n\n--".$this->boundry;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort out HTML / PT emails
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->html_email )
|
||||
{
|
||||
# Format PT message
|
||||
$this->pt_message = str_replace( "<br />", "\n", $this->pt_message );
|
||||
$this->pt_message = str_replace( "<br>" , "\n", $this->pt_message );
|
||||
$this->pt_message = strip_tags( $this->pt_message );
|
||||
|
||||
# Do headers
|
||||
$this->mail_headers .= "Content-type: multipart/alternative;boundary=\"".$this->boundry."\"\n\nThis is a MIME encoded message.\n\n--".$this->boundry;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// HTML headers...
|
||||
//-----------------------------------------
|
||||
|
||||
# Plain text version...
|
||||
$this->mail_headers .= "\nContent-Type: text/plain;\n\tcharset=\"".$this->char_set."\"\n\n".$this->pt_message."\n\n--".$this->boundry;
|
||||
|
||||
# HTML version
|
||||
if ( $this->html_email )
|
||||
{
|
||||
$this->mail_headers .= "\nContent-Type: text/html;\n\tcharset=\"".$this->char_set."\"\n\n".$this->message."\n\n";
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Do the attachments last
|
||||
//-----------------------------------------
|
||||
|
||||
if ( count ($this->parts) > 0 )
|
||||
{
|
||||
$this->mail_headers .= $this->build_multipart();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Stop double printing message
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->html_email OR count ($this->parts) > 0 )
|
||||
{
|
||||
$this->message = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// HTML (hitmuhl) ?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $this->html_email )
|
||||
{
|
||||
$extra_headers[0]['Content-Type'] = "multipart/alternative;\n\tboundary=\"".$this->boundry."\"";
|
||||
|
||||
$extra_headers[0]['notencode'] = "\n\nThis is a MIME encoded message.\n\n--".$this->boundry."\n";
|
||||
|
||||
$extra_headers[1]['Content-Type'] = "text/html;\n\tcharset=\"".$this->char_set."\"";
|
||||
#$extra_headers[1]['Content-Transfer-Encoding'] = "quoted-printable";
|
||||
|
||||
$extra_headers[1]['notencode'] = "\n\n".$this->message."\n\n--".$this->boundry."\n";
|
||||
|
||||
$extra_headers[2]['Content-Type'] = "text/plain;\n\tcharset=\"".$this->char_set."\"";
|
||||
#$extra_headers[2]['Content-Transfer-Encoding'] = "quoted-printable";
|
||||
|
||||
$extra_headers[2]['notencode'] = "\n\n".$this->pt_message."\n\n";
|
||||
|
||||
reset($extra_headers);
|
||||
|
||||
foreach( $extra_headers as $subset => $the_header )
|
||||
{
|
||||
foreach( $the_header as $k => $v )
|
||||
{
|
||||
if( $k == 'notencode' )
|
||||
{
|
||||
$extra_headers_rfc .= $v;
|
||||
}
|
||||
else
|
||||
{
|
||||
$v = $this->encode_headers( array( 'v' => $v ) );
|
||||
|
||||
$extra_headers_rfc .= $k.': '.$v['v'].$this->header_eol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->mail_headers['Content-type'] = 'text/plain; charset="'.$this->char_set.'"';
|
||||
}
|
||||
}
|
||||
|
||||
$this->encode_headers();
|
||||
|
||||
foreach( $this->mail_headers as $k => $v )
|
||||
{
|
||||
$this->rfc_headers .= $k.": ".$v.$this->header_eol;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Attachments extra?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $extra_headers_rfc )
|
||||
{
|
||||
$this->rfc_headers .= $extra_headers_rfc;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -404,12 +488,12 @@ class class_email
|
||||
{
|
||||
$multipart = "";
|
||||
|
||||
for ( $i = sizeof($this->parts) - 1 ; $i >= 0 ; $i-- )
|
||||
for ($i = sizeof($this->parts) - 1 ; $i >= 0 ; $i--)
|
||||
{
|
||||
$multipart .= "\n--" . $this->boundry . "\n" . $this->_encode_attachment($this->parts[$i]);
|
||||
$multipart .= $this->header_eol . $this->encode_attachment($this->parts[$i]) . "--" . $this->boundry;
|
||||
}
|
||||
|
||||
return $multipart;
|
||||
return $multipart . "--\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -445,6 +529,13 @@ class class_email
|
||||
|
||||
$this->build_headers();
|
||||
|
||||
if( $this->mail_method != 'smtp' )
|
||||
{
|
||||
$subject = $this->encode_headers( array( 'Subject' => $this->subject ) );
|
||||
|
||||
$this->subject = $subject['Subject'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Lets go..
|
||||
//-----------------------------------------
|
||||
@@ -457,12 +548,18 @@ class class_email
|
||||
|
||||
if ($this->temp_dump == 1)
|
||||
{
|
||||
$blah = $this->subject."\n------------\n".$this->mail_headers."\n\n".$this->message;
|
||||
$blah = $this->subject."\n------------\n".$this->rfc_headers."\n\n".$this->message;
|
||||
|
||||
$pathy = str_replace( '//', '/', $this->root_path.'/_mail/'.date("M-j-Y,hi-A").str_replace( '@', '+', $this->to ).".php" );
|
||||
$fh = fopen ($pathy, 'w');
|
||||
fputs ($fh, $blah, strlen($blah) );
|
||||
fclose($fh);
|
||||
if( !is_dir( $this->root_path . '/_mail' ) )
|
||||
{
|
||||
@mkdir( $this->root_path . '/_mail' );
|
||||
@chmod( $this->root_path . '/_mail', 0777 );
|
||||
}
|
||||
|
||||
$pathy = str_replace( '//', '/', $this->root_path . '/_mail/' . date("M-j-Y,hi-A") . str_replace( '@', '+', $this->to ) . '.php' );
|
||||
$fh = @fopen( $pathy, 'w' );
|
||||
@fputs( $fh, $blah, strlen($blah) );
|
||||
@fclose( $fh );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -472,10 +569,10 @@ class class_email
|
||||
|
||||
if ($this->mail_method != 'smtp')
|
||||
{
|
||||
if ( ! @mail( $this->to, $this->subject, $this->message, $this->mail_headers, $this->extra_opts ) )
|
||||
if ( ! @mail( $this->to, $this->subject, $this->message, $this->rfc_headers, $this->extra_opts ) )
|
||||
{
|
||||
# Try without args for safe mode peeps
|
||||
if ( ! @mail( $this->to, $this->subject, $this->message, $this->mail_headers ) )
|
||||
if ( ! @mail( $this->to, $this->subject, $this->message, $this->rfc_headers ) )
|
||||
{
|
||||
$this->fatal_error("Could not send the email", "Failed at 'mail' command");
|
||||
}
|
||||
@@ -498,9 +595,11 @@ class class_email
|
||||
|
||||
$this->to = "";
|
||||
$this->from = "";
|
||||
$this->from_display = "";
|
||||
$this->message = "";
|
||||
$this->pt_message = "";
|
||||
$this->subject = "";
|
||||
$this->mail_headers = "";
|
||||
$this->mail_headers = array();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -627,8 +726,13 @@ class class_email
|
||||
|
||||
if ( $this->smtp_code != 250 )
|
||||
{
|
||||
$this->smtp_error("HELO");
|
||||
return;
|
||||
$this->smtp_send_cmd("EHLO ".$this->smtp_host);
|
||||
|
||||
if ( $this->smtp_code != 250 )
|
||||
{
|
||||
$this->smtp_error("HELO,EHLO");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -705,7 +809,7 @@ class class_email
|
||||
{
|
||||
if ( $this->wrap_brackets )
|
||||
{
|
||||
$this->smtp_send_cmd("RCPT TO:<".$to_email.">");
|
||||
$this->smtp_send_cmd("RCPT TO:<".$to_email.">");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -783,6 +887,7 @@ class class_email
|
||||
|
||||
function fatal_error($msg, $help="")
|
||||
{
|
||||
|
||||
$this->error_msg = $msg;
|
||||
$this->error_help = $help;
|
||||
|
||||
@@ -800,14 +905,70 @@ class class_email
|
||||
* @return string Processed data
|
||||
*/
|
||||
|
||||
function _encode_attachment($part)
|
||||
function encode_attachment($part)
|
||||
{
|
||||
$msg = chunk_split(base64_encode($part['data']));
|
||||
|
||||
return "Content-Type: ".$part['ctype']. ($part['name'] ? ";\n\tname =\"".$part['name']."\"" : "").
|
||||
"\nContent-Transfer-Encoding: ".$part['encode']."\nContent-Disposition: attachment;\n\tfilename=\"".$part['name']."\"\n\n".$msg."\n";
|
||||
$headers = array();
|
||||
$header_str = "";
|
||||
|
||||
$headers['Content-Type'] = $part['ctype']. ($part['name'] ? "; name =\"".$part['name']."\"" : "");
|
||||
$headers['Content-Transfer-Encoding'] = $part['encode'];
|
||||
$headers['Content-Disposition'] = "attachment; filename=\"".$part['name']."\"";
|
||||
|
||||
$headers = $this->encode_headers( $headers );
|
||||
|
||||
foreach( $headers as $k => $v )
|
||||
{
|
||||
$header_str .= $k.': '.$v.$this->header_eol;
|
||||
}
|
||||
|
||||
$header_str .= "\n\n".$msg."\n";
|
||||
|
||||
return $header_str;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ENCODE HEADERS - RFC2047
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function encode_headers( $headers = array() )
|
||||
{
|
||||
$enc_headers = count($headers) ? $headers : $this->mail_headers;
|
||||
|
||||
foreach( $enc_headers as $header => $value)
|
||||
{
|
||||
preg_match_all( '/(\w*[\x80-\xFF]+\w*)/', $value, $matches );
|
||||
|
||||
foreach ($matches[1] as $value)
|
||||
{
|
||||
if( $header == 'From' )
|
||||
{
|
||||
// Either sendmail or the email servers don't like 'From' encoded...let's remove the board name
|
||||
// and just move along, as email address cannot contain nasty characters themselves
|
||||
|
||||
$this->mail_headers['From'] = $this->from;
|
||||
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$replacement = preg_replace_callback( '/([\x80-\xFF])/', create_function( '$match', 'return "=" . strtoupper( dechex( ord( "$match[1]" ) ) );' ), $value );
|
||||
|
||||
$value = str_replace( $value, '=?' . $this->char_set . '?Q?' . $replacement . '?=', $value );
|
||||
}
|
||||
|
||||
if( !count($headers) )
|
||||
{
|
||||
$this->mail_headers[ $header ] = $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$enc_headers[ $header ] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $enc_headers;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,22 +2,15 @@
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| (c) 2004 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
| INVISION POWER BOARD IS NOT FREE SOFTWARE!
|
||||
| http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > File Management Functions
|
||||
@@ -145,7 +138,7 @@ class class_file_management
|
||||
|
||||
if ( ! file_exists( $file_location ) )
|
||||
{
|
||||
$this->errors[] = "Ôàéë '$file_location' íå ñóùåñòâóåò, ïðîâåðüòå ïóòü.";
|
||||
$this->errors[] = "File '$file_location' does not exist, please check the path.";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -228,7 +221,7 @@ class class_file_management
|
||||
|
||||
if ( ! $url_parts['host'] )
|
||||
{
|
||||
$this->errors[] = "Íå íàéäåí õîñò â çàäàííîì URL '$file_location'!";
|
||||
$this->errors[] = "No host found in the URL '$file_location'!";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -237,7 +230,7 @@ class class_file_management
|
||||
//-------------------------------
|
||||
|
||||
$host = $url_parts['host'];
|
||||
$port = ( isset($url_parts['port']) ) ? $url_parts['port'] : 80;
|
||||
$port = ( isset($url_parts['port']) ) ? $url_parts['port'] : ( $url_parts['scheme'] == 'https' ? 443 : 80 );
|
||||
|
||||
//-------------------------------
|
||||
// Tidy up path
|
||||
@@ -261,9 +254,9 @@ class class_file_management
|
||||
// Open connection
|
||||
//-------------------------------
|
||||
|
||||
if ( ! $fp = @fsockopen( $host, $port, $errno, $errstr, $fsocket_timeout ) )
|
||||
if ( ! $fp = @fsockopen( $port == 443 ? "ssl://" . $host : $host, $port, $errno, $errstr, $fsocket_timeout ) )
|
||||
{
|
||||
$this->errors[] = "Ñîåäèíåíèå ïðåðâàíî óäàëåííûì ñåðâåðîì $host";
|
||||
$this->errors[] = "Could not establish a connection with $host";
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
@@ -278,7 +271,7 @@ class class_file_management
|
||||
|
||||
if ( ! fputs( $fp, "GET $path HTTP/1.0\r\nHost:$host\r\nConnection: Keep-Alive\r\n{$final_carriage}" ) )
|
||||
{
|
||||
$this->errors[] = "Íå âîçìîæíî îòïðàâèòü çàïðîñ óäàëåííîìó ñåðâåðó $host!";
|
||||
$this->errors[] = "Unable to send request to $host!";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -290,7 +283,7 @@ class class_file_management
|
||||
|
||||
if ( ! fputs( $fp, $header ) )
|
||||
{
|
||||
$this->errors[] = "Íå óäàëîñü àâòîðèçîâàòüñÿ!";
|
||||
$this->errors[] = "Authorization Failed!";
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -375,7 +368,7 @@ class class_file_management
|
||||
|
||||
if ( ! is_dir( $from_path ) )
|
||||
{
|
||||
$this->errors[] = "Íå âîçìîæíî íàéòè äèðåêòîðèþ '$from_path'";
|
||||
$this->errors[] = "Could not locate directory '$from_path'";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -383,7 +376,7 @@ class class_file_management
|
||||
{
|
||||
if ( ! @mkdir( $to_path, $mode ) )
|
||||
{
|
||||
$this->errors[] = "Íå âîçìîæíî ñîçäàòü äèðåêòîðèþ '$to_path' ïðîâåðüòå ïðàâà äîñòóïà (CHMOD) è ïîïðîáóéòå ñíîâà";
|
||||
$this->errors[] = "Could not create directory '$to_path' please check the CHMOD permissions and re-try";
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
@@ -407,7 +399,7 @@ class class_image
|
||||
{
|
||||
$thumb = @imagecreatetruecolor( $im['img_width'], $im['img_height'] );
|
||||
|
||||
if( $this->image_type == 'png' )
|
||||
if( $this->image_type == 'png' OR $this->image_type == 'gif' )
|
||||
{
|
||||
@imagealphablending( $thumb, FALSE );
|
||||
@imagesavealpha( $thumb, TRUE );
|
||||
@@ -434,7 +426,7 @@ class class_image
|
||||
$this->out_file_name = preg_replace( "/^(.*)\..+?$/", "\\1", $this->in_file_name ) . '_thumb';
|
||||
}
|
||||
|
||||
if ( function_exists( 'imagepng' ) AND $this->image_type == 'png' )
|
||||
if ( function_exists( 'imagepng' ) AND ($this->image_type == 'png' OR $this->image_type == 'gif') )
|
||||
{
|
||||
$this->file_extension = 'png';
|
||||
@imagepng( $thumb, $this->out_file_dir."/".$this->out_file_name.'.png' );
|
||||
@@ -513,6 +505,7 @@ class class_image
|
||||
{
|
||||
if ( $this->out_type == 'file' )
|
||||
{
|
||||
//$return['thumb_location'] = $this->in_file_name;
|
||||
$return['thumb_width'] = $img_size[0];
|
||||
$return['thumb_height'] = $img_size[1];
|
||||
$return['original_width'] = $img_size[0];
|
||||
|
||||
@@ -2,22 +2,11 @@
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Core Class
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| by Matthew Mecham, Brandon Farber, Josh Williams, Remco Wilting
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-12-06 15:03:36 +0000 (Wed, 06 Dec 2006) $
|
||||
| > $Revision: 774 $
|
||||
@@ -155,7 +144,7 @@ class class_ipsclass_core
|
||||
// Make sure we take a valid IP address
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ( ! $this->ip_address OR $this->ip_address == '...' ) AND ! isset( $_SERVER['SHELL'] ) )
|
||||
if ( ( ! $this->ip_address OR $this->ip_address == '...' ) AND ! isset( $_SERVER['SHELL'] ) AND $_SERVER['SESSIONNAME'] != 'Console' )
|
||||
{
|
||||
print "Could not determine your IP address";
|
||||
exit();
|
||||
|
||||
@@ -0,0 +1,396 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [Application Profiling]
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Application Profiling
|
||||
| > Module written by Brandon Farber
|
||||
| > Date started: Monday 28th February 2005 16:46
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* IPS Kernel Pages: Application Profiling Layer [PHP5]
|
||||
*
|
||||
* @package IPS_KERNEL
|
||||
* @subpackage ApplicationProfiling
|
||||
* @author Brandon Farber
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gateway for application profiling
|
||||
*
|
||||
* $a = new class_profiling();
|
||||
* $a->output_results( true, false );
|
||||
*/
|
||||
|
||||
//-----------------------------------------
|
||||
// Define KERNEL_PATH if not
|
||||
// defined - i.e. installation
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! defined('KERNEL_PATH') )
|
||||
{
|
||||
if( defined('INS_KERNEL_PATH') )
|
||||
{
|
||||
define( 'KERNEL_PATH', INS_KERNEL_PATH );
|
||||
}
|
||||
else
|
||||
{
|
||||
define( 'KERNEL_PATH', str_replace( "//", "/", str_replace( "\\", "/", dirname( __FILE__ ) ) ) . "/" );
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Define ROOT_PATH if not
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! defined('ROOT_PATH') )
|
||||
{
|
||||
$path = str_replace( "//", "/", str_replace( "\\", "/", dirname( __FILE__ ) ) );
|
||||
$path_bits = explode( "/", $path );
|
||||
array_pop( $path_bits );
|
||||
|
||||
define( 'ROOT_PATH', implode( "/", $path_bits ) . "/" );
|
||||
}
|
||||
|
||||
|
||||
class class_profiling
|
||||
{
|
||||
var $start_time = array();
|
||||
var $end_time = array();
|
||||
var $running_time = array();
|
||||
|
||||
var $start_memory = array();
|
||||
var $end_memory = array();
|
||||
|
||||
var $descriptions = array();
|
||||
|
||||
var $timer_stack = array();
|
||||
var $internal_count = array();
|
||||
var $stack_trace = null;
|
||||
|
||||
var $cur_timer = null;
|
||||
var $init_time = 0;
|
||||
|
||||
var $init_memory = 0;
|
||||
var $total_memory = 0;
|
||||
var $peak_memory = 0;
|
||||
|
||||
|
||||
function __construct( $start_apd = false )
|
||||
{
|
||||
$this->start_time = array();
|
||||
$this->end_time = array();
|
||||
$this->running_time = array();
|
||||
|
||||
$this->start_memory = array();
|
||||
$this->end_memory = array();
|
||||
|
||||
$this->descriptions = array();
|
||||
|
||||
$this->timer_stack = array();
|
||||
$this->internal_count = array();
|
||||
$this->stack_trace = "Profiling Class Initialized\n";
|
||||
|
||||
$this->cur_timer = null;
|
||||
$this->init_time = $this->get_micro_seconds();
|
||||
|
||||
$this->init_memory = $this->get_current_memory();
|
||||
$this->total_memory = $this->init_memory;
|
||||
$this->peak_memory = $this->init_memory;
|
||||
|
||||
if( $start_apd == true && function_exists( 'apd_set_pprof_trace' ) )
|
||||
{
|
||||
apd_set_pprof_trace();
|
||||
}
|
||||
|
||||
$this->start_session( 'Overall' );
|
||||
}
|
||||
|
||||
|
||||
function start_session( $name, $desc='' )
|
||||
{
|
||||
$x = array_push( $this->timer_stack, $this->cur_timer );
|
||||
|
||||
if( isset($this->timer_stack[ $x - 1 ]) )
|
||||
{
|
||||
$this->_suspend_timer( $this->timer_stack[ $x - 1 ] );
|
||||
}
|
||||
|
||||
$this->start_time[ $name ] = $this->get_micro_seconds();
|
||||
$this->start_memory[ $name ] = $this->get_current_memory();
|
||||
|
||||
$this->cur_timer = $name;
|
||||
|
||||
$this->descriptions[ $name ] = $desc;
|
||||
|
||||
if( array_key_exists( $name, $this->internal_count ) )
|
||||
{
|
||||
$this->internal_count[ $name ]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->internal_count[ $name ] = 1;
|
||||
}
|
||||
|
||||
$this->stack_trace .= "Started Session '{$name}'\n";
|
||||
|
||||
$backtrace = debug_backtrace();
|
||||
|
||||
if( is_array($backtrace) AND count($backtrace) )
|
||||
{
|
||||
$cnt = 0;
|
||||
|
||||
foreach( array_reverse( $backtrace ) as $trace )
|
||||
{
|
||||
$cnt++;
|
||||
|
||||
$this->stack_trace .= "\t{$cnt}. Function '{$trace['function']}' in {$trace['file']} (line {$trace['line']})\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function stop_session( $name )
|
||||
{
|
||||
$this->end_time[ $name ] = $this->get_micro_seconds();
|
||||
$this->end_memory[ $name ] = $this->get_current_memory();
|
||||
|
||||
if( !array_key_exists( $name, $this->running_time ) )
|
||||
{
|
||||
$this->running_time[ $name ] = $this->get_elapsed_time( $name );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->running_time[ $name ] += $this->get_elapsed_time( $name );
|
||||
}
|
||||
|
||||
$this->cur_timer = array_pop( $this->timer_stack );
|
||||
|
||||
$this->stack_trace .= "Stopped Session '{$name}'\n";
|
||||
|
||||
if( isset($this->cur_timer) )
|
||||
{
|
||||
$this->_resume_timer( $this->cur_timer );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function get_elapsed_time( $name )
|
||||
{
|
||||
if( !array_key_exists( $name, $this->start_time ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( array_key_exists( $name, $this->end_time ) )
|
||||
{
|
||||
return ( $this->end_time[ $name ] - $this->start_time[ $name ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( $this->get_micro_seconds() - $this->start_time[ $name ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_total_time()
|
||||
{
|
||||
return ( $this->get_micro_seconds() - $this->init_time );
|
||||
}
|
||||
|
||||
|
||||
function get_peak_memory()
|
||||
{
|
||||
if( function_exists( 'memory_get_peak_usage' ) )
|
||||
{
|
||||
$this->peak_memory = memory_get_peak_usage();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( count( $this->start_memory ) )
|
||||
{
|
||||
foreach( $this->start_memory as $mem_entry )
|
||||
{
|
||||
if( $mem_entry > $this->peak_memory )
|
||||
{
|
||||
$this->peak_memory = $mem_entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( count( $this->end_memory ) )
|
||||
{
|
||||
foreach( $this->end_memory as $mem_entry )
|
||||
{
|
||||
if( $mem_entry > $this->peak_memory )
|
||||
{
|
||||
$this->peak_memory = $mem_entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->peak_memory;
|
||||
}
|
||||
|
||||
|
||||
function _resume_timer( $name )
|
||||
{
|
||||
$this->stack_trace .= "Resumed Session '{$name}'\n";
|
||||
|
||||
$this->start_time[ $name ] = $this->get_micro_seconds();
|
||||
}
|
||||
|
||||
|
||||
function _suspend_timer( $name )
|
||||
{
|
||||
$this->stack_trace .= "Suspended Session '{$name}'\n";
|
||||
|
||||
$this->end_time[ $name ] = $this->get_micro_seconds();
|
||||
|
||||
if( !array_key_exists( $name, $this->running_time ) )
|
||||
{
|
||||
$this->running_time[ $name ] = $this->get_elapsed_time( $name );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->running_time[ $name ] += $this->get_elapsed_time( $name );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function get_micro_seconds()
|
||||
{
|
||||
$tmp = explode( " ", microtime() );
|
||||
|
||||
return ( $tmp[0] + $tmp[1] );
|
||||
}
|
||||
|
||||
|
||||
function get_current_memory()
|
||||
{
|
||||
if( ! function_exists( 'memory_get_usage' ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return memory_get_usage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function format_memory( $val=0 )
|
||||
{
|
||||
if( $val >= 1048576 )
|
||||
{
|
||||
return ( round( ( $val / 1048576 * 100 ), 2 ) / 100 ) . 'MB';
|
||||
}
|
||||
else if( $val >= 1024 )
|
||||
{
|
||||
return ( round( ( $val / 1024 * 100 ), 2 ) / 100 ) . 'KB';
|
||||
}
|
||||
else
|
||||
{
|
||||
return intval( $val ) . 'b';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function output_results( $display_backtrace=true, $log=false )
|
||||
{
|
||||
$this->stop_session( 'Overall' );
|
||||
$this->total_memory = $this->get_current_memory();
|
||||
|
||||
$timed_total = 0;
|
||||
$percent_total = 0;
|
||||
$output = null;
|
||||
|
||||
$overall_time = $this->get_total_time();
|
||||
$overall_memory = $this->get_peak_memory();
|
||||
|
||||
if( $log == false )
|
||||
{
|
||||
print "<pre>\n";
|
||||
}
|
||||
|
||||
ksort($this->descriptions);
|
||||
|
||||
$output = "============================================================================\n";
|
||||
$output .= " PROFILER OUTPUT\n";
|
||||
$output .= "============================================================================\n";
|
||||
$output .= "Calls Time Memory Routine\n";
|
||||
$output .= "----------------------------------------------------------------------------\n";
|
||||
|
||||
foreach( $this->descriptions as $key => $val )
|
||||
{
|
||||
$this_total = $this->running_time[$key];
|
||||
$this_count = $this->internal_count[$key];
|
||||
$this_percent = ( $this_total / $overall_time ) * 100;
|
||||
$this_memory = $this->format_memory( $this->end_memory[ $key ] - $this->start_memory[ $key ] );
|
||||
|
||||
$timed_total += $this_total;
|
||||
$percent_total += $this_percent;
|
||||
$mem_total += $this->end_memory[ $key ] - $this->start_memory[ $key ];
|
||||
|
||||
$output .= sprintf( "%3d %3.4f ms (%3.2f %%) %s %s\n", $this_count, $this_total * 1000, $this_percent, $this_memory, $key);
|
||||
}
|
||||
|
||||
$output .= "\n";
|
||||
|
||||
$missed_time = $overall_time - $timed_total;
|
||||
$missed_percent = ( $missed_time / $overall_time ) * 100;
|
||||
$percent_total += $missed_percent;
|
||||
$missed_memory = $this->format_memory( $this->total_memory - $this->init_memory - $mem_total );
|
||||
|
||||
$output .= sprintf( " %3.4f ms (%3.2f %%) %s %s\n", $missed_time * 1000, $missed_percent, $missed_memory, 'Leaked' );
|
||||
|
||||
$output .= "============================================================================\n";
|
||||
$output .= "Start Memory: " . $this->format_memory( $this->init_memory ) . "\n";
|
||||
$output .= "Total Memory: " . $this->format_memory( $this->total_memory ) . "\n";
|
||||
$output .= "Peak Memory: " . $this->format_memory( $this->peak_memory ) . "\n";
|
||||
$output .= "============================================================================\n";
|
||||
|
||||
$output .= sprintf( " %3.4f ms (%3.2f %%) %s %s\n", $timed_total * 1000, $pecent_total, $this->format_memory( $this->total_memory ), 'OVERALL TIME' );
|
||||
|
||||
$output .= "============================================================================\n";
|
||||
|
||||
if( $display_backtrace == true )
|
||||
{
|
||||
$output .= "Backtrace\n";
|
||||
$output .= $this->stack_trace;
|
||||
}
|
||||
|
||||
if( $log == false )
|
||||
{
|
||||
print $output . '</pre>';
|
||||
}
|
||||
else
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,553 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > XML ARCHIVE CLASS: Handling methods (KERNEL)
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: 25th February
|
||||
|
|
||||
| > Module Version Number: 1.0.0
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* IPS Kernel Pages: XMLArchive
|
||||
*
|
||||
* This class contains all generic functions to handle
|
||||
* the creation and extraction of XML Archive documents
|
||||
* This is a proprietry technology of IPS, Inc.
|
||||
*
|
||||
* Example Usage:
|
||||
* <code>
|
||||
*
|
||||
* $xmlarchive = new class_xmlarchive();
|
||||
*
|
||||
* $xmlarchive->xml_add_file( 'some/dir/filename.html' );
|
||||
* $xmlarchive->xml_add_file_contents( $data, 'some/dir/filename.html' );
|
||||
*
|
||||
* $xmlarchive->xml_add_file( 'some/dir/filename.html', array( 'custom_tag' => $value ) );
|
||||
* $xmlarchive->xml_add_file_contents( $data, 'some/dir/filename.html', array( 'custom_tag' => $value ) );
|
||||
*
|
||||
* $xmlarchive->xml_add_directory( 'some/dir' );
|
||||
* $xmlarchive->xml_create_archive();
|
||||
*
|
||||
* $xmlarchive->xml_save( 'filename.xml' );
|
||||
* $xmlarchive->xml_save_gzip( 'filename.xml.gz' );
|
||||
*
|
||||
* $contents = $xmlarchive->xml_get_contents();
|
||||
*
|
||||
* $xmlarchive->xml_read_archive( 'filename.xml' );
|
||||
* $xmlarchive->xml_read_archive_data( $xml_data );
|
||||
* </code>
|
||||
* ERROR NUMBERS:
|
||||
* <ul>
|
||||
* <li>001: No such directory or file
|
||||
* <li>002: Not a directory
|
||||
* <li>003: Could not write archive to disk
|
||||
* <li>004: No XML document to save
|
||||
* <li>005: Could not load xml data
|
||||
* </ul>
|
||||
*
|
||||
* @package IPS_KERNEL
|
||||
* @author Matt Mecham
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 2.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* XMLArchive Creation and Extraction Functions
|
||||
*
|
||||
* Methods and functions for handling XMLArchive documents
|
||||
*
|
||||
* @package IPS_KERNEL
|
||||
* @author Matt Mecham
|
||||
* @version 2.1
|
||||
*/
|
||||
|
||||
class class_resources_reader
|
||||
{
|
||||
/**
|
||||
* XML content
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $xml = "";
|
||||
|
||||
/**
|
||||
* File array
|
||||
*
|
||||
* @var artay
|
||||
*/
|
||||
var $file_array = array();
|
||||
|
||||
/**
|
||||
* Error number
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
var $error_number = 0;
|
||||
|
||||
/**
|
||||
* Error message
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $error_message = "";
|
||||
|
||||
/**
|
||||
* Work files
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $workfiles = array();
|
||||
|
||||
/**
|
||||
* Non binary file extensions
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $non_binary = 'txt htm html xml css js cgi php php3';
|
||||
|
||||
/**
|
||||
* Strip path
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $strip_path = "";
|
||||
|
||||
/**
|
||||
* Root path
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $root_path = "";
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CONSTRUCTOR
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function class_resources_reader( $root_path="" )
|
||||
{
|
||||
$tmp = "";
|
||||
$this->root_path = $root_path;
|
||||
|
||||
//-----------------------------------
|
||||
// Get the XML class
|
||||
//-----------------------------------
|
||||
|
||||
require_once( $this->root_path.'class_xml.php' );
|
||||
|
||||
$this->xml = new class_xml();
|
||||
|
||||
$this->error_number = 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// READ Archive from disk
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Read an XML document from disk
|
||||
*
|
||||
* @param string File name
|
||||
* @return void
|
||||
*/
|
||||
function xml_read_archive( $filename )
|
||||
{
|
||||
if ( file_exists( $filename ) )
|
||||
{
|
||||
if ( strstr( $filename, '.gz' ) )
|
||||
{
|
||||
if ( $FH = @gzopen( $filename, 'r' ) )
|
||||
{
|
||||
$data = @gzread( $FH, $filename );
|
||||
@gzclose( $FH );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '005';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $FH = @fopen( $filename, 'r' ) )
|
||||
{
|
||||
$data = @fread( $FH, filesize( $filename ) );
|
||||
@fclose( $FH );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '005';
|
||||
}
|
||||
}
|
||||
|
||||
$this->xml_read_archive_data( $data );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '001';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// READ Archive from data
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Read an XML document from passed data
|
||||
*
|
||||
* @param string Raw XML Data
|
||||
* @return void
|
||||
*/
|
||||
function xml_read_archive_data( $data )
|
||||
{
|
||||
if ( $data )
|
||||
{
|
||||
$this->xml->xml_parse_document( $data );
|
||||
|
||||
if ( is_array( $this->xml->xml_array ) )
|
||||
{
|
||||
$this->file_array = array();
|
||||
|
||||
foreach( $this->xml->xml_array['xmlarchive']['fileset']['file'] as $entry )
|
||||
{
|
||||
$this_array = array();
|
||||
|
||||
if( is_array( $entry ) )
|
||||
{
|
||||
foreach ( $entry as $k => $v )
|
||||
{
|
||||
if ( $k == 'content' )
|
||||
{
|
||||
$v['VALUE'] = base64_decode( preg_replace( "/\s/", "", $entry['content']['VALUE'] ) );
|
||||
}
|
||||
|
||||
$this_array[ $k ] = $v['VALUE'];
|
||||
}
|
||||
|
||||
$this->file_array[] = $this_array;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SAVE XML to disk
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Write out the XML document as a GZIP file
|
||||
*
|
||||
* @param string FIlename
|
||||
* @return void
|
||||
*/
|
||||
function xml_save_gzip( $filename )
|
||||
{
|
||||
if ( $this->xml->xml_document )
|
||||
{
|
||||
if ( $FH = @gzopen( $filename, 'wb' ) )
|
||||
{
|
||||
@gzwrite( $FH, $this->xml->xml_document );
|
||||
@gzclose( $FH );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '003';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '004';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// SAVE XML to disk
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Write out the XML document as a normal file
|
||||
*
|
||||
* @param string FIlename
|
||||
* @return void
|
||||
*/
|
||||
function xml_save( $filename )
|
||||
{
|
||||
if ( $this->xml->xml_document )
|
||||
{
|
||||
if ( $FH = @fopen( $filename, 'wb' ) )
|
||||
{
|
||||
@fwrite( $FH, $this->xml->xml_document );
|
||||
@fclose( $FH );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '003';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '004';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// XML get contents
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Method of getting XML document from this class
|
||||
*
|
||||
* @return string XML document
|
||||
*/
|
||||
function xml_get_contents()
|
||||
{
|
||||
return $this->xml->xml_document;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Create the XML archive
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Create the XML archive
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function xml_create_archive()
|
||||
{
|
||||
$this->xml->xml_set_root( 'xmlarchive', array( 'generator' => 'IPB', 'created' => time() ) );
|
||||
$this->xml->xml_add_group( 'fileset' );
|
||||
|
||||
$entry = array();
|
||||
|
||||
foreach( $this->file_array as $f )
|
||||
{
|
||||
$content = array();
|
||||
|
||||
foreach ( $f as $k => $v )
|
||||
{
|
||||
if ( $k == 'content' )
|
||||
{
|
||||
$v = chunk_split(base64_encode($v));
|
||||
}
|
||||
|
||||
$content[] = $this->xml->xml_build_simple_tag( $k, $v );
|
||||
}
|
||||
|
||||
$entry[] = $this->xml->xml_build_entry( 'file', $content );
|
||||
}
|
||||
|
||||
$this->xml->xml_add_entry_to_group( 'fileset', $entry );
|
||||
|
||||
$this->xml->xml_format_document();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add directory contents
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function xml_add_directory( $dir )
|
||||
{
|
||||
$this->error_number = "";
|
||||
|
||||
//-----------------------------------
|
||||
// Got dir?
|
||||
//-----------------------------------
|
||||
|
||||
if ( ! is_dir($dir) )
|
||||
{
|
||||
$this->error_number = '001';
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Populate this->workfiles
|
||||
//-----------------------------------
|
||||
|
||||
$this->workfiles = array();
|
||||
$this->_xml_get_dir_contents( $dir );
|
||||
|
||||
//-----------------------------------
|
||||
// Add them into the file array
|
||||
//-----------------------------------
|
||||
|
||||
foreach ( $this->workfiles as $f )
|
||||
{
|
||||
$this->xml_add_file( $f );
|
||||
}
|
||||
|
||||
$this->workfiles = array();
|
||||
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add File (interface to file_contents)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function xml_add_file( $filename, $extra_tags=array() )
|
||||
{
|
||||
//-----------------------------------
|
||||
// Kill OS X hidden files
|
||||
//-----------------------------------
|
||||
|
||||
if ( preg_match( "/\.ds_store/i", $filename ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( file_exists( $filename ) )
|
||||
{
|
||||
if ( $FH = @fopen( $filename, 'rb' ) )
|
||||
{
|
||||
$data = @fread( $FH, filesize( $filename ) );
|
||||
@fclose( $FH );
|
||||
}
|
||||
|
||||
$this->xml_add_file_contents( $data, $filename, $extra_tags );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '001';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add File Contents
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function xml_add_file_contents( $data, $filename, $extra_tags=array() )
|
||||
{
|
||||
$ext = preg_replace( "/.*\.(.+?)$/", "\\1", $filename );
|
||||
|
||||
$binary = 1;
|
||||
|
||||
//-----------------------------------
|
||||
// ASCII?
|
||||
//-----------------------------------
|
||||
|
||||
if ( strstr( ' '.$this->non_binary.' ', ' '.$ext.' ' ) )
|
||||
{
|
||||
$binary = 0;
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Get dir / filename
|
||||
//-----------------------------------
|
||||
|
||||
$dir_path = array();
|
||||
$dir_path = explode( "/", $filename );
|
||||
|
||||
if ( count( $dir_path ) )
|
||||
{
|
||||
$real_filename = array_pop( $dir_path );
|
||||
}
|
||||
|
||||
$real_filename = $real_filename ? $real_filename : $filename;
|
||||
|
||||
$path = implode( "/", $dir_path );
|
||||
|
||||
if ( $this->strip_path )
|
||||
{
|
||||
$path = preg_replace( "#". preg_quote($this->strip_path, '#')."/?#", "", $path );
|
||||
}
|
||||
|
||||
$this_array = array(
|
||||
'filename' => $real_filename,
|
||||
'content' => $data,
|
||||
'path' => $path,
|
||||
'binary' => $binary
|
||||
);
|
||||
|
||||
foreach( $extra_tags as $k => $v )
|
||||
{
|
||||
if ( $k and ! in_array( $k, array_keys($this_array) ) )
|
||||
{
|
||||
$this_array[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$this->file_array[] = $this_array;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INTERNAL: Get directory contents
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function _xml_get_dir_contents( $dir )
|
||||
{
|
||||
$dir = preg_replace( "#/$#", "", $dir );
|
||||
|
||||
if ( file_exists($dir) )
|
||||
{
|
||||
if ( is_dir($dir) )
|
||||
{
|
||||
$handle = opendir($dir);
|
||||
|
||||
while (($filename = readdir($handle)) !== false)
|
||||
{
|
||||
if (($filename != ".") && ($filename != ".."))
|
||||
{
|
||||
if ( is_dir( $dir."/".$filename ) )
|
||||
{
|
||||
//-----------------------------------
|
||||
// Recurse
|
||||
//-----------------------------------
|
||||
|
||||
$this->_xml_get_dir_contents($dir."/".$filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------
|
||||
// Add file to list
|
||||
//-----------------------------------
|
||||
|
||||
$this->workfiles[] = $dir."/".$filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '002';
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_number = '001';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
+194
-204
File diff suppressed because it is too large.
Load diff
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
@@ -44,7 +36,7 @@
|
||||
*/
|
||||
|
||||
define( 'IPS_TEMPLATE_DEBUG' , 0 );
|
||||
define( 'IPS_TEMPLATE_DEBUG_FILE', dirname( _FILE_ ) . '/../cache/template_debug.cgi' );
|
||||
define( 'IPS_TEMPLATE_DEBUG_FILE', dirname( __FILE__ ) . '/../cache/template_debug.cgi' );
|
||||
|
||||
/**
|
||||
* Template Engine (NOT USED CURRENTLY: FOR IPB 3.0, IP.Dynamic)
|
||||
@@ -113,7 +105,81 @@ class class_template
|
||||
*
|
||||
* @param $data string The actual contents of the class, php tags 'an all.
|
||||
*/
|
||||
function convert_cache_to_eval($data='', $full_class_name='')
|
||||
function convert_cache_to_eval($data='', $full_class_name='', $id=1)
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$final_content = $this->_return_function_data( $data );
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab "linked" template bits
|
||||
//-----------------------------------------
|
||||
|
||||
/*
|
||||
<__templatebits__>
|
||||
<bit>skin_global:personal_portal_gender_image</bit>
|
||||
<bit>skin_global:personal_portal_online_image</bit>
|
||||
</__templatebits__>
|
||||
*/
|
||||
|
||||
if ( strstr( $data, '<__templatebits__>' ) )
|
||||
{
|
||||
$_templates = array();
|
||||
|
||||
preg_match( "#<__templatebits__>(.+?)</__templatebits__>#is", $data, $match );
|
||||
|
||||
if ( $match[1] )
|
||||
{
|
||||
preg_match_all( "#<bit>(.+?)</bit>#is", $data, $matches );
|
||||
|
||||
for ( $i = 0; $i < count( $matches[0] ); $i++)
|
||||
{
|
||||
list( $file, $name ) = explode( ':', $matches[1][$i] );
|
||||
|
||||
if ( $file AND $name )
|
||||
{
|
||||
$_templates[ $file ][] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Got stuff to load?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_array( $_templates ) AND count( $_templates ) )
|
||||
{
|
||||
foreach( $_templates as $file => $idx )
|
||||
{
|
||||
$_data = implode( '', file( CACHE_PATH."cache/skin_cache/cacheid_".$id."/".$file.".php" ) );
|
||||
|
||||
$final_content .= $this->_return_function_data( $_data, $_templates[ $file ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the stuff...
|
||||
//-----------------------------------------
|
||||
|
||||
$out = "class {$full_class_name} {\n\n";
|
||||
$out .= "\t".'var $ipsclass;'."\n";
|
||||
$out .= $final_content;
|
||||
$out .= "\n\n}";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* _return_function_data
|
||||
*
|
||||
* Extracts function data
|
||||
*
|
||||
* @param $data string The actual contents of the class, php tags 'an all.
|
||||
*/
|
||||
function _return_function_data( $data='', $function_find=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
@@ -192,6 +258,14 @@ class class_template
|
||||
|
||||
foreach( $functions as $fname => $ftext )
|
||||
{
|
||||
if ( is_array( $function_find ) AND count( $function_find ) )
|
||||
{
|
||||
if ( ! in_array( $fname, $function_find ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
preg_match( "/".'\$'."IPBHTML\s+?\.?=\s+?<<<EOF(.+?)EOF;\s?/si", $ftext, $matches );
|
||||
|
||||
$func_data = trim( $config[$fname] );
|
||||
@@ -199,15 +273,10 @@ class class_template
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return the stuff...
|
||||
// Return...
|
||||
//-----------------------------------------
|
||||
|
||||
$out = "class {$full_class_name} {\n\n";
|
||||
$out .= "\t".'var $ipsclass;'."\n";
|
||||
$out .= $final_content;
|
||||
$out .= "\n\n}";
|
||||
|
||||
return $out;
|
||||
return $final_content;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -433,11 +502,15 @@ class class_template
|
||||
foreach( $_tmp_func_data as $_i )
|
||||
{
|
||||
preg_match( "#".'\$'."(\w+)(=|,|$)#i", $_i, $match );
|
||||
$_final[] = '$'.$match[1];
|
||||
|
||||
if( count($match) )
|
||||
{
|
||||
$_final[] = '$'.$match[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$clean_func_data = implode( ",", $_final );
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
// Keep the server busy for a while
|
||||
//----------------------------------------
|
||||
@@ -602,7 +675,7 @@ class class_template
|
||||
if ( strstr( strtolower($statement), 'as' ) )
|
||||
{
|
||||
# Get the last part of the argument
|
||||
list( $_trash, $keep ) = explode( 'as', $statement );
|
||||
list( $_trash, $keep ) = explode( ' as', $statement );
|
||||
$keep = trim($keep);
|
||||
|
||||
if ( strstr( $keep, '=>' ) )
|
||||
@@ -646,7 +719,7 @@ class class_template
|
||||
// Create PHP statement
|
||||
//----------------------------------------
|
||||
|
||||
$function_name = '__foreach_loop__'. uniqid( 'id_' );
|
||||
$function_name = '__foreach_loop__'. str_replace( '.', '', uniqid( 'id_', TRUE ) );
|
||||
$php_statement = '<xxforeach_'.$function_name.'xx>$this->'.$function_name.'('.$clean_func_data.')</xxforeach_'.$function_name.'xx>';
|
||||
$php_block = $this->_process_raw_html_logic( addslashes($block) );
|
||||
$php_tags = $this->_process_raw_php_tags( $block );
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
@@ -256,7 +248,7 @@ class class_upload
|
||||
$FILE_NAME = isset($_FILES[ $this->upload_form_field ]['name']) ? $_FILES[ $this->upload_form_field ]['name'] : '';
|
||||
$FILE_SIZE = isset($_FILES[ $this->upload_form_field ]['size']) ? $_FILES[ $this->upload_form_field ]['size'] : '';
|
||||
$FILE_TYPE = isset($_FILES[ $this->upload_form_field ]['type']) ? $_FILES[ $this->upload_form_field ]['type'] : '';
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// Naughty Opera adds the filename on the end of the
|
||||
// mime type - we don't want this.
|
||||
@@ -275,7 +267,15 @@ class class_upload
|
||||
or !$_FILES[ $this->upload_form_field ]['size']
|
||||
or ($_FILES[ $this->upload_form_field ]['name'] == "none") )
|
||||
{
|
||||
$this->error_no = 1;
|
||||
if( $_FILES[ $this->upload_form_field ]['error'] == 2 )
|
||||
{
|
||||
$this->error_no = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error_no = 1;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ class class_upload
|
||||
//-------------------------------------------------
|
||||
|
||||
$this->file_extension = $this->_get_file_extension( $FILE_NAME );
|
||||
|
||||
|
||||
if ( ! $this->file_extension )
|
||||
{
|
||||
$this->error_no = 2;
|
||||
@@ -334,7 +334,7 @@ class class_upload
|
||||
//-------------------------------------------------
|
||||
|
||||
$FILE_NAME = preg_replace( "/[^\w\.]/", "_", $FILE_NAME );
|
||||
|
||||
|
||||
$this->original_file_name = $FILE_NAME;
|
||||
|
||||
//-------------------------------------------------
|
||||
@@ -355,12 +355,17 @@ class class_upload
|
||||
// Make safe?
|
||||
//-------------------------------------------------
|
||||
|
||||
$renamed = 0;
|
||||
|
||||
if ( $this->make_script_safe )
|
||||
{
|
||||
if ( preg_match( "/\.(cgi|pl|js|asp|php|html|htm|jsp|jar)$/i", $FILE_NAME ) )
|
||||
if ( preg_match( "/\.(cgi|pl|js|asp|php|html|htm|jsp|jar)(\.|$)/i", $FILE_NAME ) )
|
||||
{
|
||||
$FILE_TYPE = 'text/plain';
|
||||
$this->file_extension = 'txt';
|
||||
$this->parsed_file_name = preg_replace( "/\.(cgi|pl|js|asp|php|html|htm|jsp|jar)(\.|$)/i", "$2", $this->parsed_file_name );
|
||||
|
||||
$renamed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,12 +375,12 @@ class class_upload
|
||||
|
||||
if ( is_array( $this->image_ext ) and count( $this->image_ext ) )
|
||||
{
|
||||
if ( in_array( $this->file_extension, $this->image_ext ) )
|
||||
if ( in_array( $this->real_file_extension, $this->image_ext ) )
|
||||
{
|
||||
$this->is_image = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// Add on the extension...
|
||||
//-------------------------------------------------
|
||||
@@ -405,7 +410,17 @@ class class_upload
|
||||
{
|
||||
@chmod( $this->saved_upload_name, 0777 );
|
||||
}
|
||||
|
||||
|
||||
if( !$renamed )
|
||||
{
|
||||
$this->check_xss_infile();
|
||||
|
||||
if( $this->error_no )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// Is it an image?
|
||||
//-------------------------------------------------
|
||||
@@ -453,12 +468,50 @@ class class_upload
|
||||
if( filesize($this->saved_upload_name) != $_FILES[ $this->upload_form_field ]['size'] )
|
||||
{
|
||||
@unlink( $this->saved_upload_name );
|
||||
|
||||
|
||||
$this->error_no = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INTERNAL: Check for XSS inside file
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Checks for XSS inside file. If found, sets error_no to 5 and returns
|
||||
*
|
||||
* @param void
|
||||
*/
|
||||
|
||||
function check_xss_infile()
|
||||
{
|
||||
// HTML added inside an inline file is not good in IE...
|
||||
|
||||
$fh = fopen( $this->saved_upload_name, 'rb' );
|
||||
|
||||
$file_check = fread( $fh, 512 );
|
||||
|
||||
fclose( $fh );
|
||||
|
||||
if( !$file_check )
|
||||
{
|
||||
@unlink( $this->saved_upload_name );
|
||||
$this->error_no = 5;
|
||||
return;
|
||||
}
|
||||
|
||||
# Thanks to Nicolas Grekas from comments at www.splitbrain.org for helping to identify all vulnerable HTML tags
|
||||
|
||||
else if( preg_match( "#<script|<html|<head|<title|<body|<pre|<table|<a\s+href|<img|<plaintext|<cross\-domain\-policy#si", $file_check ) )
|
||||
{
|
||||
@unlink( $this->saved_upload_name );
|
||||
$this->error_no = 5;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INTERNAL: Get file extension
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
@@ -205,7 +197,9 @@ class class_xml
|
||||
*
|
||||
* @ var string
|
||||
*/
|
||||
var $doc_type = 'WINDOWS-1251';
|
||||
var $doc_type = 'ISO-8859-1';
|
||||
|
||||
var $use_doctype = 1;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CONSTRUCTOR
|
||||
@@ -213,7 +207,7 @@ class class_xml
|
||||
|
||||
function class_xml()
|
||||
{
|
||||
@ini_set("memory_limit", "128M");
|
||||
//@ini_set("memory_limit", "128M");
|
||||
|
||||
//$this->header = '<?xml version="1.0" encoding="'.$this->doc_type.'"?'.'>';
|
||||
}
|
||||
@@ -268,7 +262,7 @@ class class_xml
|
||||
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE , 0);
|
||||
xml_parse_into_struct($parser, $xml, $vals);
|
||||
xml_parser_free($parser);
|
||||
|
||||
|
||||
$this->xml_array = $this->_xml_get_children($vals, $i);
|
||||
}
|
||||
|
||||
@@ -437,7 +431,14 @@ class class_xml
|
||||
|
||||
if ( $type === 'complete' )
|
||||
{
|
||||
$tag['VALUE'] = $this->_xml_unconvert_safecdata($thisvals['value']);
|
||||
if( isset( $thisvals['value'] ) )
|
||||
{
|
||||
$tag['VALUE'] = $this->_xml_unconvert_safecdata( $thisvals['value'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$tag['VALUE'] = '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,29 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| 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: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
| > $Author: matt $
|
||||
| > $Date: 2008-02-06 11:55:42 -0500 (Wed, 06 Feb 2008) $
|
||||
| > $Revision: 1184 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > XML-RPC handling methods (KERNEL)
|
||||
@@ -163,7 +153,7 @@ class class_xml_rpc
|
||||
$this->_add_debug( "DECODING XML data: " . $_xml );
|
||||
$this->_add_debug( "DECODE RESULT XML data: " . var_export( $data, TRUE ) );
|
||||
}
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -471,12 +461,19 @@ class class_xml_rpc
|
||||
|
||||
foreach( $data_array as $k => $v )
|
||||
{
|
||||
$_type = isset( $this->map_type_to_key[ $k ] ) ? $this->map_type_to_key[ $k ] : $this->get_xmlrpc_string_type( $v );
|
||||
if ( is_array( $v ) )
|
||||
{
|
||||
$xmldata .= $this->_xml_rpc_build_document_recurse( "", $k, $v, 4 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_type = isset( $this->map_type_to_key[ $k ] ) ? $this->map_type_to_key[ $k ] : $this->get_xmlrpc_string_type( $v );
|
||||
|
||||
$xmldata .= "\t\t\t\t<member>\n";
|
||||
$xmldata .= "\t\t\t\t\t<name>".$k."</name>\n";
|
||||
$xmldata .= "\t\t\t\t\t<value><".$_type.">" . htmlspecialchars($v) . "</".$_type."></value>\n";
|
||||
$xmldata .= "\t\t\t\t</member>\n";
|
||||
$xmldata .= "\t\t\t\t<member>\n";
|
||||
$xmldata .= "\t\t\t\t\t<name>".$k."</name>\n";
|
||||
$xmldata .= "\t\t\t\t\t<value><".$_type.">" . htmlspecialchars($v) . "</".$_type."></value>\n";
|
||||
$xmldata .= "\t\t\t\t</member>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$xmldata .= "\t\t\t</struct>\n";
|
||||
@@ -490,6 +487,54 @@ class class_xml_rpc
|
||||
return $xmldata;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Creates an XML-RPC complex document
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Creates an XML-RPC complex document
|
||||
*
|
||||
* @param array Array of fields to send (must be in key => value pairings)
|
||||
* @param string Method name (optional)
|
||||
* @return string finished document
|
||||
*/
|
||||
function _xml_rpc_build_document_recurse( $xmldata, $k, $v, $depth=4 )
|
||||
{
|
||||
$xmldata .= "\t<member>\n";
|
||||
$xmldata .= "\t\t<name>".$k."</name>\n";
|
||||
$xmldata .= "\t\t<value>\n";
|
||||
$xmldata .= "\t\t\t<array>\n";
|
||||
$xmldata .= "\t\t\t\t<data>\n";
|
||||
$xmldata .= "\t\t\t\t\t<value>\n";
|
||||
$xmldata .= "\t\t\t\t\t\t<struct>\n";
|
||||
|
||||
foreach( $v as $_k => $_v )
|
||||
{
|
||||
if ( is_array( $_v ) )
|
||||
{
|
||||
$depth++;
|
||||
$xmldata .= $this->_xml_rpc_build_document_recurse( $xmldata, $k, $v, $depth );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_type = isset( $this->map_type_to_key[ $_k ] ) ? $this->map_type_to_key[ $_k ] : $this->get_xmlrpc_string_type( $_v );
|
||||
|
||||
$xmldata .= "\t\t\t\t\t\t\t<member>\n";
|
||||
$xmldata .= "\t\t\t\t\t\t\t\t<name>".$_k."</name>\n";
|
||||
$xmldata .= "\t\t\t\t\t\t\t\t<value><".$_type.">" . htmlspecialchars($_v) . "</".$_type."></value>\n";
|
||||
$xmldata .= "\t\t\t\t\t\t\t</member>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$xmldata .= "\t\t\t\t\t\t</struct>\n";
|
||||
$xmldata .= "\t\t\t\t\t</value>\n";
|
||||
$xmldata .= "\t\t\t\t</data>\n";
|
||||
$xmldata .= "\t\t\t</array>\n";
|
||||
$xmldata .= "\t\t</value>\n";
|
||||
$xmldata .= "\t</member>\n";
|
||||
|
||||
return $xmldata;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Return True
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -613,7 +658,7 @@ class class_xml_rpc
|
||||
|
||||
if ( ! $url_parts['host'] )
|
||||
{
|
||||
$this->errors[] = "Íå íàéäåí õîñò â çàäàííîì URL '$file_location'!";
|
||||
$this->errors[] = "No host found in the URL '$file_location'!";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -623,7 +668,7 @@ class class_xml_rpc
|
||||
|
||||
$host = $url_parts['host'];
|
||||
|
||||
$port = ( isset($url_parts['port']) ) ? $url_parts['port'] : 80;
|
||||
$port = ( isset($url_parts['port']) ) ? $url_parts['port'] : ( $url_parts['scheme'] == 'https' ? 443 : 80 );
|
||||
|
||||
//-----------------------------------------
|
||||
// User and pass?
|
||||
@@ -653,15 +698,16 @@ class class_xml_rpc
|
||||
$path .= "?" . $url_parts["query"];
|
||||
}
|
||||
|
||||
if ( ! $fp = @fsockopen( $host, $port, $errno, $errstr, $fsocket_timeout ) )
|
||||
if ( ! $fp = @fsockopen( $port == 443 ? "ssl://" . $host : $host, $port, $errno, $errstr, $fsocket_timeout ) )
|
||||
{
|
||||
$this->errors[] = "Ñîåäèíåíèå ïðåðâàíî óäàëåííûì ñåðâåðîì $host";
|
||||
$this->errors[] = "CONNECTION REFUSED FROM $host";
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$header = "POST $path HTTP/1.0\r\n";
|
||||
$header .= "User-Agent: IPS XML-RPC Client Library (\$Revision: 1184 $)\r\n";
|
||||
$header .= "Host: $host\r\n";
|
||||
|
||||
if ( $this->auth_user && $this->auth_pass )
|
||||
@@ -677,7 +723,7 @@ class class_xml_rpc
|
||||
|
||||
if ( ! fputs( $fp, $header . $xmldata ) )
|
||||
{
|
||||
$this->errors[] = "Íå âîçìîæíî îòïðàâèòü çàïðîñ óäàëåííîìó ñåðâåðó $host!";
|
||||
$this->errors[] = "Unable to send request to $host!";
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.2.2
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Monday 05th of March 2007 10:10:55 PM
|
||||
| Release: e3790216629e5a2aaf37070b32237f06
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:03:20 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 22 $
|
||||
@@ -419,6 +411,15 @@ class class_xmlarchive
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// And Windows...
|
||||
//-----------------------------------
|
||||
|
||||
if ( preg_match( "/thumbs\.db/i", $filename ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( file_exists( $filename ) )
|
||||
{
|
||||
if ( $FH = @fopen( $filename, 'rb' ) )
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -0,0 +1,372 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Services Kernel [DB Tools]
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
+---------------------------------------------------------------------------
|
||||
| THIS IS NOT FREE / OPEN SOURCE SOFTWARE
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2007-10-18 15:47:19 -0400 (Thu, 18 Oct 2007) $
|
||||
| > $Revision: 1137 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > MySQL DB Tools
|
||||
| > Module written by Remco Wilting
|
||||
| > Date started: Tuesday 1st March 2005 15:40
|
||||
|
|
||||
| > Module Version Number: 2.1.001
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
class db_tools
|
||||
{
|
||||
var $ipsclass;
|
||||
|
||||
var $has_issues = 0;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Constructor
|
||||
/*-------------------------------------------------------------------------*/
|
||||
function db_tools( & $ipsclass )
|
||||
{
|
||||
$this->ipsclass = & $ipsclass;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Diagnose the table indexes
|
||||
// @input sql_statements array of create table/index statements to check
|
||||
// @output array array of results ( table, index, status, message, fixsql )
|
||||
//-------------------------------------------------------------
|
||||
|
||||
function db_index_diag( & $sql_statements )
|
||||
{
|
||||
$indexes = array();
|
||||
$error_count = 0;
|
||||
if( is_array($sql_statements) && count($sql_statements) )
|
||||
{
|
||||
foreach( $sql_statements as $definition )
|
||||
{
|
||||
$table_name = "";
|
||||
$fields_str = "";
|
||||
$primary_key = "";
|
||||
$tablename = array();
|
||||
$fields = array();
|
||||
$final_keys = array();
|
||||
$col_definition = "";
|
||||
$colmatch = array();
|
||||
$final_primary = array();
|
||||
|
||||
if ( preg_match( "#CREATE TABLE\s+?(.+?)\s+?\(#ie", $definition, $tablename ) )
|
||||
{
|
||||
$table_name = $tablename[1];
|
||||
if ( preg_match( "#\s+?PRIMARY\s+?KEY\s+?\((.*?)\)(?:(?:[,\s+?$])?\((.+?)\))?#is", $definition, $fields ) )
|
||||
{
|
||||
$final_primary = array();
|
||||
if( count( $fields ) )
|
||||
{
|
||||
$primary_key = trim($fields[1]);
|
||||
|
||||
$col_definition = $this->sql_strip_ticks( $definition );
|
||||
|
||||
if ( preg_match( "#^\s+?{$primary_key}\s+?(.+?)(?:[,$])#im", $col_definition, $colmatch ) )
|
||||
{
|
||||
$col_definition = trim($colmatch[1]);
|
||||
}
|
||||
$final_primary = array( $primary_key, $col_definition );
|
||||
}
|
||||
}
|
||||
$table_array[$i] = $table_name;
|
||||
if ( count( $final_primary ) )
|
||||
{
|
||||
$primary_array[$i] = $final_primary;
|
||||
}
|
||||
}
|
||||
|
||||
if ( preg_match_all( "#(?<!PRIMARY)\s+?KEY\s+?(?:(\w+?)\s+?)?\((.*?)\)(?:(?:[,\s+?$])?\((.+?)\))?#is", $definition, $fields, PREG_PATTERN_ORDER ) )
|
||||
{
|
||||
if( count( $fields[2] ) )
|
||||
{
|
||||
$i = 0;
|
||||
|
||||
foreach( $fields[2] as $index_cols )
|
||||
{
|
||||
$index_cols = trim( $this->sql_strip_ticks( $index_cols ) );
|
||||
|
||||
$index_name = $fields[1][$i] ? $fields[1][$i] : $index_cols;
|
||||
|
||||
$final_keys[] = array( $index_name, implode( ",", array_map( 'trim', explode( ",", $index_cols ) ) ) );
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $table_name AND ( $primary_key OR count($final_keys) ) )
|
||||
{
|
||||
$indexes[] = array( 'table' => $table_name,
|
||||
'primary' => $final_primary,
|
||||
'index' => $final_keys
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !count($indexes) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$output = array();
|
||||
|
||||
foreach( $indexes as $data )
|
||||
{
|
||||
$table_name = str_replace( "ibf_", "", $data['table']);
|
||||
|
||||
$row = $this->ipsclass->DB->sql_get_table_schematic( $table_name );
|
||||
|
||||
$tbl = $this->sql_strip_ticks( $row['Create Table'] );
|
||||
|
||||
if( isset( $data['primary'] ) && is_array($data['primary']) AND count($data['primary']) )
|
||||
{
|
||||
$index_name = $data['primary'][0];
|
||||
$column_definition = $data['primary'][1];
|
||||
|
||||
if ( preg_match( "#\s+?PRIMARY\s+?KEY\s+?\({$index_name}\)?[,\s+?$]?#is", $tbl, $match ) )
|
||||
{
|
||||
$output[] = array( 'table' => SQL_PREFIX.$table_name,
|
||||
'index' => $index_name,
|
||||
'status' => 'ok',
|
||||
'message' => '',
|
||||
'fixsql' => '' );
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_needed = "ALTER TABLE ".SQL_PREFIX."$table_name CHANGE {$index_name} {$index_name} {$column_definition}, ADD PRIMARY KEY ({$index_name})";
|
||||
|
||||
if( !$this->ipsclass->DB->field_exists( $index_name, $table_name ) )
|
||||
{
|
||||
$query_needed = str_replace( "CHANGE {$index_name}", "ADD", $query_needed );
|
||||
}
|
||||
|
||||
$this->has_issues = 1;
|
||||
|
||||
$output[] = array( 'table' => SQL_PREFIX.$table_name,
|
||||
'index' => $index_name,
|
||||
'status' => 'error',
|
||||
'message' => 'Missing primary key',
|
||||
'fixsql' => $query_needed );
|
||||
$error_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $data['index'] ) && is_array( $data['index'] ) and count( $data['index'] ) )
|
||||
{
|
||||
foreach( $data['index'] as $indexes )
|
||||
{
|
||||
$index_name = $indexes[0];
|
||||
$index_cols = $indexes[1] ? $indexes[1] : $index_name;
|
||||
$ok = 0;
|
||||
|
||||
if ( preg_match( "#(?<!PRIMARY)\s+?KEY\s+?{$index_name}\s+?(\((.+?)\))?#is", $tbl, $match ) )
|
||||
{
|
||||
$ok = 1;
|
||||
|
||||
//-----------------------------------------
|
||||
// Multi index column?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $index_cols != $table_cols )
|
||||
{
|
||||
foreach( explode( ',', $indexes[1] ) as $mc )
|
||||
{
|
||||
if ( ! strstr( $match[2], $mc ) )
|
||||
{
|
||||
$this->has_issues = 1;
|
||||
|
||||
$output[] = array( 'table' => SQL_PREFIX.$table_name,
|
||||
'index' => $index_name,
|
||||
'status' => 'error',
|
||||
'message' => 'Missing field \''.$mc.'\'',
|
||||
'fixsql' => 'ALTER TABLE '.SQL_PREFIX.$table_name.' DROP INDEX '.$index_name.', ADD INDEX '.$index_name.' ('.$index_cols.')' );
|
||||
$error_count++;
|
||||
$ok = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$output[] = array( 'table' => SQL_PREFIX.$table_name,
|
||||
'index' => $index_name,
|
||||
'status' => 'error',
|
||||
'message' => 'Missing index \''.$index_name.'\'',
|
||||
'fixsql' => 'ALTER TABLE '.SQL_PREFIX.$table_name.' ADD INDEX '.$index_name.'('.$index_cols.')' );
|
||||
$error_count++;
|
||||
}
|
||||
|
||||
if ( $ok )
|
||||
{
|
||||
$output[] = array( 'table' => SQL_PREFIX.$table_name,
|
||||
'index' => $index_name,
|
||||
'status' => 'ok',
|
||||
'message' => '',
|
||||
'fixsql' => '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array( 'error_count' => $error_count, 'results' => $output );
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Diagnose the DB tables
|
||||
// @input sql_statements array of create table statements to check
|
||||
// @output array array of results ( key, table, status, message, fixsql )
|
||||
//-------------------------------------------------------------
|
||||
|
||||
function db_table_diag( & $sql_statements )
|
||||
{
|
||||
$queries_needed = array();
|
||||
$tables_needed = array();
|
||||
$error_count = 0;
|
||||
|
||||
if( is_array( $sql_statements ) && count( $sql_statements ) )
|
||||
{
|
||||
foreach( $sql_statements as $the_table )
|
||||
{
|
||||
$expected_columns = array();
|
||||
|
||||
if( preg_match("#CREATE TABLE\s+?(.+?)\s+?\(#ie", $the_table, $bits))
|
||||
{
|
||||
$tbl_name = $bits[1];
|
||||
$tbl_name = str_replace( "ibf_", "", $tbl_name );
|
||||
|
||||
$table_defs[$tbl_name] = str_replace( "ibf_", SQL_PREFIX, $the_table );
|
||||
|
||||
// Get the columns and lose the first line (it's the table name)
|
||||
$columns_array = explode( "\n", $the_table );
|
||||
array_shift($columns_array);
|
||||
|
||||
// Get rid of the end junk
|
||||
if ( (strpos(end($columns_array), ");") == 0) ||
|
||||
(strpos(end($columns_array), ")") == 0) ||
|
||||
(strpos(end($columns_array), ";") == 0) )
|
||||
{
|
||||
array_pop($columns_array);
|
||||
}
|
||||
|
||||
reset($columns_array);
|
||||
|
||||
foreach( $columns_array as $col )
|
||||
{
|
||||
$temp = preg_split( "/[\s]+/" , $col );
|
||||
$col_name = trim( next( $temp ) );
|
||||
|
||||
if( $col_name != "PRIMARY" &&
|
||||
$col_name != "KEY" &&
|
||||
$col_name != "UNIQUE" &&
|
||||
$col_name != "" &&
|
||||
$col_name != "(" &&
|
||||
$col_name != ";" &&
|
||||
$col_name != ");" )
|
||||
{
|
||||
$expected_columns[] = $col_name;
|
||||
$this->columns_to_defs[$tbl_name][$col_name] = trim( str_replace( ',', ';', $col ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ( preg_match("#ALTER TABLE ([a-z_]*) ADD ([a-z_]*) #is", $the_table, $bits) )
|
||||
{
|
||||
if( $bits[1] != "" &&
|
||||
$bits[2] != "" &&
|
||||
$bits[2] != 'INDEX' &&
|
||||
strpos($bits[2], 'TYPE') === false )
|
||||
{
|
||||
$tbl_name = trim($bits[1]);
|
||||
$tbl_name = str_replace( "ibf_", "", $tbl_name );
|
||||
$col_name = trim($bits[2]);
|
||||
|
||||
$expected_columns[] = $col_name;
|
||||
$this->columns_to_defs[$tbl_name][$col_name] = str_replace( $bits[1], SQL_PREFIX . $tbl_name, $the_table ) . ";";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the current schema....
|
||||
$this->ipsclass->DB->return_die = 1;
|
||||
|
||||
if ( ! $this->ipsclass->DB->table_exists( $tbl_name ) )
|
||||
{
|
||||
$output[] = array( 'key' => $tbl_name,
|
||||
'table' => SQL_PREFIX.$tbl_name,
|
||||
'status' => 'error',
|
||||
'message' => 'missing table',
|
||||
'fixsql' => $table_defs[$tbl_name] );
|
||||
$error_count++;
|
||||
$this->ipsclass->DB->failed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Here we go...
|
||||
$missing = array();
|
||||
|
||||
foreach( $expected_columns as $trymeout )
|
||||
{
|
||||
if( ! $this->ipsclass->DB->field_exists( $trymeout, $tbl_name ) )
|
||||
{
|
||||
$missing[] = $trymeout;
|
||||
$query_needed = "ALTER TABLE " . SQL_PREFIX . $tbl_name . " ADD " . $this->columns_to_defs[$tbl_name][$trymeout];
|
||||
|
||||
if( preg_match( "/auto_increment;/", $query_needed ) )
|
||||
{
|
||||
$query_needed = substr( $query_needed, 0, -1 ).", ADD PRIMARY KEY( ". $trymeout . ");";
|
||||
}
|
||||
|
||||
$output[] = array( 'key' => $tbl_name.$trymeout,
|
||||
'table' => SQL_PREFIX.$tbl_name,
|
||||
'status' => 'error',
|
||||
'message' => 'Missing column \''.$trymeout.'\'',
|
||||
'fixsql' => $query_needed );
|
||||
$error_count++;
|
||||
}
|
||||
}
|
||||
if( !count( $missing ) )
|
||||
{
|
||||
$output[] = array( 'key' => $tbl_name,
|
||||
'table' => SQL_PREFIX.$tbl_name,
|
||||
'status' => 'ok',
|
||||
'message' => '',
|
||||
'fixsql' => '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array( 'error_count' => $error_count, 'results' => $output );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// sql_strip_ticks from field names
|
||||
//-----------------------------------------
|
||||
|
||||
function sql_strip_ticks($data)
|
||||
{
|
||||
return str_replace( "`", "", $data );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -0,0 +1,286 @@
|
||||
#
|
||||
# $Id: TIS620.TXT,v 1.2 1999/08/23 18:34:16 mleisher Exp $
|
||||
#
|
||||
# Copyright 1999 Computing Research Labs, New Mexico State University
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
|
||||
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
||||
# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
# THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
#
|
||||
# TCCII 2533 1009 / TIS 620 Thai. Generated from the table in the "tcs"
|
||||
# package.
|
||||
#
|
||||
# Mark Leisher <mleisher@crl.nmsu.edu>
|
||||
# 06 March 1998
|
||||
#
|
||||
0x00 0x0000 # <control>
|
||||
0x01 0x0001 # <control>
|
||||
0x02 0x0002 # <control>
|
||||
0x03 0x0003 # <control>
|
||||
0x04 0x0004 # <control>
|
||||
0x05 0x0005 # <control>
|
||||
0x06 0x0006 # <control>
|
||||
0x07 0x0007 # <control>
|
||||
0x08 0x0008 # <control>
|
||||
0x09 0x0009 # <control>
|
||||
0x0A 0x000A # <control>
|
||||
0x0B 0x000B # <control>
|
||||
0x0C 0x000C # <control>
|
||||
0x0D 0x000D # <control>
|
||||
0x0E 0x000E # <control>
|
||||
0x0F 0x000F # <control>
|
||||
0x10 0x0010 # <control>
|
||||
0x11 0x0011 # <control>
|
||||
0x12 0x0012 # <control>
|
||||
0x13 0x0013 # <control>
|
||||
0x14 0x0014 # <control>
|
||||
0x15 0x0015 # <control>
|
||||
0x16 0x0016 # <control>
|
||||
0x17 0x0017 # <control>
|
||||
0x18 0x0018 # <control>
|
||||
0x19 0x0019 # <control>
|
||||
0x1A 0x001A # <control>
|
||||
0x1B 0x001B # <control>
|
||||
0x1C 0x001C # <control>
|
||||
0x1D 0x001D # <control>
|
||||
0x1E 0x001E # <control>
|
||||
0x1F 0x001F # <control>
|
||||
0x20 0x0020 # SPACE
|
||||
0x21 0x0021 # EXCLAMATION MARK
|
||||
0x22 0x0022 # QUOTATION MARK
|
||||
0x23 0x0023 # NUMBER SIGN
|
||||
0x24 0x0024 # DOLLAR SIGN
|
||||
0x25 0x0025 # PERCENT SIGN
|
||||
0x26 0x0026 # AMPERSAND
|
||||
0x27 0x0027 # APOSTROPHE
|
||||
0x28 0x0028 # LEFT PARENTHESIS
|
||||
0x29 0x0029 # RIGHT PARENTHESIS
|
||||
0x2A 0x002A # ASTERISK
|
||||
0x2B 0x002B # PLUS SIGN
|
||||
0x2C 0x002C # COMMA
|
||||
0x2D 0x002D # HYPHEN-MINUS
|
||||
0x2E 0x002E # FULL STOP
|
||||
0x2F 0x002F # SOLIDUS
|
||||
0x30 0x0030 # DIGIT ZERO
|
||||
0x31 0x0031 # DIGIT ONE
|
||||
0x32 0x0032 # DIGIT TWO
|
||||
0x33 0x0033 # DIGIT THREE
|
||||
0x34 0x0034 # DIGIT FOUR
|
||||
0x35 0x0035 # DIGIT FIVE
|
||||
0x36 0x0036 # DIGIT SIX
|
||||
0x37 0x0037 # DIGIT SEVEN
|
||||
0x38 0x0038 # DIGIT EIGHT
|
||||
0x39 0x0039 # DIGIT NINE
|
||||
0x3A 0x003A # COLON
|
||||
0x3B 0x003B # SEMICOLON
|
||||
0x3C 0x003C # LESS-THAN SIGN
|
||||
0x3D 0x003D # EQUALS SIGN
|
||||
0x3E 0x003E # GREATER-THAN SIGN
|
||||
0x3F 0x003F # QUESTION MARK
|
||||
0x40 0x0040 # COMMERCIAL AT
|
||||
0x41 0x0041 # LATIN CAPITAL LETTER A
|
||||
0x42 0x0042 # LATIN CAPITAL LETTER B
|
||||
0x43 0x0043 # LATIN CAPITAL LETTER C
|
||||
0x44 0x0044 # LATIN CAPITAL LETTER D
|
||||
0x45 0x0045 # LATIN CAPITAL LETTER E
|
||||
0x46 0x0046 # LATIN CAPITAL LETTER F
|
||||
0x47 0x0047 # LATIN CAPITAL LETTER G
|
||||
0x48 0x0048 # LATIN CAPITAL LETTER H
|
||||
0x49 0x0049 # LATIN CAPITAL LETTER I
|
||||
0x4A 0x004A # LATIN CAPITAL LETTER J
|
||||
0x4B 0x004B # LATIN CAPITAL LETTER K
|
||||
0x4C 0x004C # LATIN CAPITAL LETTER L
|
||||
0x4D 0x004D # LATIN CAPITAL LETTER M
|
||||
0x4E 0x004E # LATIN CAPITAL LETTER N
|
||||
0x4F 0x004F # LATIN CAPITAL LETTER O
|
||||
0x50 0x0050 # LATIN CAPITAL LETTER P
|
||||
0x51 0x0051 # LATIN CAPITAL LETTER Q
|
||||
0x52 0x0052 # LATIN CAPITAL LETTER R
|
||||
0x53 0x0053 # LATIN CAPITAL LETTER S
|
||||
0x54 0x0054 # LATIN CAPITAL LETTER T
|
||||
0x55 0x0055 # LATIN CAPITAL LETTER U
|
||||
0x56 0x0056 # LATIN CAPITAL LETTER V
|
||||
0x57 0x0057 # LATIN CAPITAL LETTER W
|
||||
0x58 0x0058 # LATIN CAPITAL LETTER X
|
||||
0x59 0x0059 # LATIN CAPITAL LETTER Y
|
||||
0x5A 0x005A # LATIN CAPITAL LETTER Z
|
||||
0x5B 0x005B # LEFT SQUARE BRACKET
|
||||
0x5C 0x005C # REVERSE SOLIDUS
|
||||
0x5D 0x005D # RIGHT SQUARE BRACKET
|
||||
0x5E 0x005E # CIRCUMFLEX ACCENT
|
||||
0x5F 0x005F # LOW LINE
|
||||
0x60 0x0060 # GRAVE ACCENT
|
||||
0x61 0x0061 # LATIN SMALL LETTER A
|
||||
0x62 0x0062 # LATIN SMALL LETTER B
|
||||
0x63 0x0063 # LATIN SMALL LETTER C
|
||||
0x64 0x0064 # LATIN SMALL LETTER D
|
||||
0x65 0x0065 # LATIN SMALL LETTER E
|
||||
0x66 0x0066 # LATIN SMALL LETTER F
|
||||
0x67 0x0067 # LATIN SMALL LETTER G
|
||||
0x68 0x0068 # LATIN SMALL LETTER H
|
||||
0x69 0x0069 # LATIN SMALL LETTER I
|
||||
0x6A 0x006A # LATIN SMALL LETTER J
|
||||
0x6B 0x006B # LATIN SMALL LETTER K
|
||||
0x6C 0x006C # LATIN SMALL LETTER L
|
||||
0x6D 0x006D # LATIN SMALL LETTER M
|
||||
0x6E 0x006E # LATIN SMALL LETTER N
|
||||
0x6F 0x006F # LATIN SMALL LETTER O
|
||||
0x70 0x0070 # LATIN SMALL LETTER P
|
||||
0x71 0x0071 # LATIN SMALL LETTER Q
|
||||
0x72 0x0072 # LATIN SMALL LETTER R
|
||||
0x73 0x0073 # LATIN SMALL LETTER S
|
||||
0x74 0x0074 # LATIN SMALL LETTER T
|
||||
0x75 0x0075 # LATIN SMALL LETTER U
|
||||
0x76 0x0076 # LATIN SMALL LETTER V
|
||||
0x77 0x0077 # LATIN SMALL LETTER W
|
||||
0x78 0x0078 # LATIN SMALL LETTER X
|
||||
0x79 0x0079 # LATIN SMALL LETTER Y
|
||||
0x7A 0x007A # LATIN SMALL LETTER Z
|
||||
0x7B 0x007B # LEFT CURLY BRACKET
|
||||
0x7C 0x007C # VERTICAL LINE
|
||||
0x7D 0x007D # RIGHT CURLY BRACKET
|
||||
0x7E 0x007E # TILDE
|
||||
0x7F 0x007F # <control>
|
||||
0x80 0x0080 # <control>
|
||||
0x81 0x0081 # <control>
|
||||
0x82 0x0082 # <control>
|
||||
0x83 0x0083 # <control>
|
||||
0x84 0x0084 # <control>
|
||||
0x85 0x0085 # <control>
|
||||
0x86 0x0086 # <control>
|
||||
0x87 0x0087 # <control>
|
||||
0x88 0x0088 # <control>
|
||||
0x89 0x0089 # <control>
|
||||
0x8A 0x008A # <control>
|
||||
0x8B 0x008B # <control>
|
||||
0x8C 0x008C # <control>
|
||||
0x8D 0x008D # <control>
|
||||
0x8E 0x008E # <control>
|
||||
0x8F 0x008F # <control>
|
||||
0x90 0x0090 # <control>
|
||||
0x91 0x0091 # <control>
|
||||
0x92 0x0092 # <control>
|
||||
0x93 0x0093 # <control>
|
||||
0x94 0x0094 # <control>
|
||||
0x95 0x0095 # <control>
|
||||
0x96 0x0096 # <control>
|
||||
0x97 0x0097 # <control>
|
||||
0x98 0x0098 # <control>
|
||||
0x99 0x0099 # <control>
|
||||
0x9A 0x009A # <control>
|
||||
0x9B 0x009B # <control>
|
||||
0x9C 0x009C # <control>
|
||||
0x9D 0x009D # <control>
|
||||
0x9E 0x009E # <control>
|
||||
0x9F 0x009F # <control>
|
||||
0xA0 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xA1 0x0E01 # THAI CHARACTER KO KAI
|
||||
0xA2 0x0E02 # THAI CHARACTER KHO KHAI
|
||||
0xA3 0x0E03 # THAI CHARACTER KHO KHUAT
|
||||
0xA4 0x0E04 # THAI CHARACTER KHO KHWAI
|
||||
0xA5 0x0E05 # THAI CHARACTER KHO KHON
|
||||
0xA6 0x0E06 # THAI CHARACTER KHO RAKHANG
|
||||
0xA7 0x0E07 # THAI CHARACTER NGO NGU
|
||||
0xA8 0x0E08 # THAI CHARACTER CHO CHAN
|
||||
0xA9 0x0E09 # THAI CHARACTER CHO CHING
|
||||
0xAA 0x0E0A # THAI CHARACTER CHO CHANG
|
||||
0xAB 0x0E0B # THAI CHARACTER SO SO
|
||||
0xAC 0x0E0C # THAI CHARACTER CHO CHOE
|
||||
0xAD 0x0E0D # THAI CHARACTER YO YING
|
||||
0xAE 0x0E0E # THAI CHARACTER DO CHADA
|
||||
0xAF 0x0E0F # THAI CHARACTER TO PATAK
|
||||
0xB0 0x0E10 # THAI CHARACTER THO THAN
|
||||
0xB1 0x0E11 # THAI CHARACTER THO NANGMONTHO
|
||||
0xB2 0x0E12 # THAI CHARACTER THO PHUTHAO
|
||||
0xB3 0x0E13 # THAI CHARACTER NO NEN
|
||||
0xB4 0x0E14 # THAI CHARACTER DO DEK
|
||||
0xB5 0x0E15 # THAI CHARACTER TO TAO
|
||||
0xB6 0x0E16 # THAI CHARACTER THO THUNG
|
||||
0xB7 0x0E17 # THAI CHARACTER THO THAHAN
|
||||
0xB8 0x0E18 # THAI CHARACTER THO THONG
|
||||
0xB9 0x0E19 # THAI CHARACTER NO NU
|
||||
0xBA 0x0E1A # THAI CHARACTER BO BAIMAI
|
||||
0xBB 0x0E1B # THAI CHARACTER PO PLA
|
||||
0xBC 0x0E1C # THAI CHARACTER PHO PHUNG
|
||||
0xBD 0x0E1D # THAI CHARACTER FO FA
|
||||
0xBE 0x0E1E # THAI CHARACTER PHO PHAN
|
||||
0xBF 0x0E1F # THAI CHARACTER FO FAN
|
||||
0xC0 0x0E20 # THAI CHARACTER PHO SAMPHAO
|
||||
0xC1 0x0E21 # THAI CHARACTER MO MA
|
||||
0xC2 0x0E22 # THAI CHARACTER YO YAK
|
||||
0xC3 0x0E23 # THAI CHARACTER RO RUA
|
||||
0xC4 0x0E24 # THAI CHARACTER RU
|
||||
0xC5 0x0E25 # THAI CHARACTER LO LING
|
||||
0xC6 0x0E26 # THAI CHARACTER LU
|
||||
0xC7 0x0E27 # THAI CHARACTER WO WAEN
|
||||
0xC8 0x0E28 # THAI CHARACTER SO SALA
|
||||
0xC9 0x0E29 # THAI CHARACTER SO RUSI
|
||||
0xCA 0x0E2A # THAI CHARACTER SO SUA
|
||||
0xCB 0x0E2B # THAI CHARACTER HO HIP
|
||||
0xCC 0x0E2C # THAI CHARACTER LO CHULA
|
||||
0xCD 0x0E2D # THAI CHARACTER O ANG
|
||||
0xCE 0x0E2E # THAI CHARACTER HO NOKHUK
|
||||
0xCF 0x0E2F # THAI CHARACTER PAIYANNOI
|
||||
0xD0 0x0E30 # THAI CHARACTER SARA A
|
||||
0xD1 0x0E31 # THAI CHARACTER MAI HAN-AKAT
|
||||
0xD2 0x0E32 # THAI CHARACTER SARA AA
|
||||
0xD3 0x0E33 # THAI CHARACTER SARA AM
|
||||
0xD4 0x0E34 # THAI CHARACTER SARA I
|
||||
0xD5 0x0E35 # THAI CHARACTER SARA II
|
||||
0xD6 0x0E36 # THAI CHARACTER SARA UE
|
||||
0xD7 0x0E37 # THAI CHARACTER SARA UEE
|
||||
0xD8 0x0E38 # THAI CHARACTER SARA U
|
||||
0xD9 0x0E39 # THAI CHARACTER SARA UU
|
||||
0xDA 0x0E3A # THAI CHARACTER PHINTHU
|
||||
0xDB 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xDC 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xDD 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xDE 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xDF 0x0E3F # THAI CURRENCY SYMBOL BAHT
|
||||
0xE0 0x0E40 # THAI CHARACTER SARA E
|
||||
0xE1 0x0E41 # THAI CHARACTER SARA AE
|
||||
0xE2 0x0E42 # THAI CHARACTER SARA O
|
||||
0xE3 0x0E43 # THAI CHARACTER SARA AI MAIMUAN
|
||||
0xE4 0x0E44 # THAI CHARACTER SARA AI MAIMALAI
|
||||
0xE5 0x0E45 # THAI CHARACTER LAKKHANGYAO
|
||||
0xE6 0x0E46 # THAI CHARACTER MAIYAMOK
|
||||
0xE7 0x0E47 # THAI CHARACTER MAITAIKHU
|
||||
0xE8 0x0E48 # THAI CHARACTER MAI EK
|
||||
0xE9 0x0E49 # THAI CHARACTER MAI THO
|
||||
0xEA 0x0E4A # THAI CHARACTER MAI TRI
|
||||
0xEB 0x0E4B # THAI CHARACTER MAI CHATTAWA
|
||||
0xEC 0x0E4C # THAI CHARACTER THANTHAKHAT
|
||||
0xED 0x0E4D # THAI CHARACTER NIKHAHIT
|
||||
0xEE 0x0E4E # THAI CHARACTER YAMAKKAN
|
||||
0xEF 0x0E4F # THAI CHARACTER FONGMAN
|
||||
0xF0 0x0E50 # THAI DIGIT ZERO
|
||||
0xF1 0x0E51 # THAI DIGIT ONE
|
||||
0xF2 0x0E52 # THAI DIGIT TWO
|
||||
0xF3 0x0E53 # THAI DIGIT THREE
|
||||
0xF4 0x0E54 # THAI DIGIT FOUR
|
||||
0xF5 0x0E55 # THAI DIGIT FIVE
|
||||
0xF6 0x0E56 # THAI DIGIT SIX
|
||||
0xF7 0x0E57 # THAI DIGIT SEVEN
|
||||
0xF8 0x0E58 # THAI DIGIT EIGHT
|
||||
0xF9 0x0E59 # THAI DIGIT NINE
|
||||
0xFA 0x0E5A # THAI CHARACTER ANGKHANKHU
|
||||
0xFB 0x0E5B # THAI CHARACTER KHOMUT
|
||||
0xFC 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xFD 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xFE 0xFFFD # REPLACEMENT CHARACTER
|
||||
0xFF 0xFFFD # REPLACEMENT CHARACTER
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -1,10 +1 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
|
||||
<meta name="author" content="Êîìïàíèÿ IBResource è Invision Power Services Inc.">
|
||||
<title>Îøèáêà ðóññêîé âåðñèè Invision Power Board</title>
|
||||
</head><body>
|
||||
<h1>Îøèáêà <a href="http://www.ibresource.ru/">ðóññêîé âåðñèè Invision Power Board</a></h1>
|
||||
<font size="4">Âû ïîïàëè íà íåñóùåñòâóþùóþ ñòðàíèöó!<br>Ïîæàëóéñòà íàæìèòå íà êíîïî÷êó «<b>Íàçàä</b>» â âàøåì áðàóçåðå äëÿ âîçâðàùåíèÿ íà ïðåäûäóùóþ ñòðàíèöó.</font>
|
||||
</body>
|
||||
</html>
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>␍
|
||||
Reference in new issue
Block a user