Version 2.1.7

This commit is contained in:
Neo committed 2025-12-19 00:21:15 -08:00
1 parent 0eecc172d9
commit f73f8bff6d
941 files changed
+215301 -103093

No files matched your search

+292
View File
@@ -0,0 +1,292 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board 2.1.7
| =============================================
| by Matthew Mecham
| (c) 2001 - 2005 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Tuesday 18th of July 2006 05:56:00 PM
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-02-02 17:23:13 +0000 (Thu, 02 Feb 2006) $
| > $Revision: 133 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Help Control functions
| > Module written by Matt Mecham
| > Date started: 2nd April 2002
|
| > Module Version Number: 1.0.0
| > DBA Checked: Mon 24th May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_ACP' ) )
{
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
exit();
}
class ad_login
{
# Global
var $ipsclass;
# HTML
var $html;
function auto_run()
{
//-----------------------------------------
// Kill globals - globals bad, Homer good.
//-----------------------------------------
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
foreach ( $tmp_in as $k => $v )
{
unset($$k);
}
//-----------------------------------------
// What to do?
//-----------------------------------------
switch($this->ipsclass->input['code'])
{
case 'login':
$this->login_form();
break;
case 'logout':
break;
case 'login-complete':
$this->login_complete();
break;
default:
$this->login_form();
break;
}
}
/*-------------------------------------------------------------------------*/
// Complete the log in
/*-------------------------------------------------------------------------*/
function login_complete()
{
//-----------------------------------------
// We must have submitted the form
// time to check some details.
//-----------------------------------------
$this->ipsclass->input['username'] = str_replace( '|', '&#124;', $this->ipsclass->input['username'] );
if ( empty($this->ipsclass->input['username']) )
{
$this->login_form("Âû äîëæíû ââåñòè èìÿ ïîëüçîâàòåëÿ ïåðåä òåì, êàê ïðîäîëæèòü");
}
if ( empty($this->ipsclass->input['password']) )
{
$this->login_form("Âû äîëæíû ââåñòè ïàðîëü ïåðåä òåì, êàê ïðîäîëæèòü");
}
//-----------------------------------------
// Attempt to get the details from the
// DB
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'login_getmember', array( 'username' => strtolower($this->ipsclass->input['username']) ) );
$this->ipsclass->DB->cache_exec_query();
$mem = $this->ipsclass->DB->fetch_row();
//-----------------------------------------
// Get perms
//-----------------------------------------
$this->ipsclass->sess->member = $mem;
$this->ipsclass->sess->build_group_permissions();
$mem = $this->ipsclass->sess->member;
if ( empty($mem['id']) )
{
$this->login_form("Íå ïîëó÷èëîñü îáíàðóæèòü òàêîå èìÿ ïîëüçîâàòåëÿ, ïîïðîáóéòå åùå ðàç");
}
//-----------------------------------------
// Load converge member
//-----------------------------------------
$this->ipsclass->converge->converge_load_member($mem['email']);
if ( ! $this->ipsclass->converge->member['converge_id'] )
{
$this->login_form("Íå ïîëó÷èëîñü îáíàðóæèòü òàêîå èìÿ ïîëüçîâàòåëÿ, ïîïðîáóéòå åùå ðàç");
}
//-----------------------------------------
// Check converge pass
//-----------------------------------------
$pass = md5( $this->ipsclass->input['password'] );
//-----------------------------------------
// Check password...
//-----------------------------------------
if ( $this->ipsclass->converge->converge_authenticate_member( $pass ) != TRUE )
{
$this->login_form("Ïàðîëü, êîòîðûé âû ââåëè - íåâåðåí");
}
else
{
if ($mem['g_access_cp'] != 1)
{
$this->login_form("Ó âàñ íåò ïðàâ äîñòóï â àäìèíöåíòð");
}
else
{
//-----------------------------------------
// Fix up query string...
//-----------------------------------------
$extra_query = "";
if ( $_POST['qstring'] )
{
$extra_query = urldecode( $_POST['qstring'] );
$extra_query = str_replace( "{$this->ipsclass->vars['board_url']}" , "" , $extra_query );
$extra_query = preg_replace( "!/?admin\.{$this->ipsclass->vars['php_ext']}!i", "" , $extra_query );
$extra_query = preg_replace( "!^\?!" , "" , $extra_query );
$extra_query = preg_replace( "!adsess=(\w){32}!" , "" , $extra_query );
$extra_query = preg_replace( "!s=(\w){32}!" , "" , $extra_query );
$extra_query = preg_replace( "!act=login!" , "" , $extra_query );
$extra_query = preg_replace( "!code=template-edit-bit!" , "" , $extra_query );
$extra_query = preg_replace( "!code=template-bits-list!" , "" , $extra_query );
$extra_query = preg_replace( "!bitname=(\w)!" , "" , $extra_query );
$extra_query = $this->ipsclass->parse_clean_value( $extra_query );
}
//-----------------------------------------
// All is good, rejoice as we set a
// session for this user
//-----------------------------------------
$sess_id = md5( uniqid( microtime() ) );
$db_string = $this->ipsclass->DB->compile_db_insert_string( array (
'session_id' => $sess_id,
'session_ip_address' => $this->ipsclass->ip_address,
'session_member_name' => $mem['name'],
'session_member_id' => $mem['id'],
'session_member_login_key' => $mem['member_login_key'],
'session_location' => 'index',
'session_log_in_time' => time(),
'session_running_time' => time(),
) );
$this->ipsclass->DB->query("INSERT INTO ibf_admin_sessions (".$db_string['FIELD_NAMES'].") VALUES (".$db_string['FIELD_VALUES'].")");
$this->ipsclass->input['adsess'] = $sess_id;
//-----------------------------------------
// Redirect...
//-----------------------------------------
$this->ipsclass->admin->redirect( $this->ipsclass->vars['board_url']."/admin.".$this->ipsclass->vars['php_ext']."?adsess=".$this->ipsclass->input['adsess']."&".$extra_query, 'Âõîä îñóùåñòâëåí' );
exit();
}
}
}
/*-------------------------------------------------------------------------*/
// Show the log in form
/*-------------------------------------------------------------------------*/
function login_form($message='')
{
//-----------------------------------------
// INIT
//-----------------------------------------
$message = $message ? $message : $this->ipsclass->admin_session['_session_message'];
//-------------------------------------------------------
// Remove all out of date sessions, like a good boy. Woof.
//-------------------------------------------------------
$cut_off_stamp = time() - 60*60*2;
$this->ipsclass->DB->query("DELETE FROM ibf_admin_sessions WHERE session_log_in_time < $cut_off_stamp");
//------------------------------------------------------
// AUTO Log in ma-thingy?
//------------------------------------------------------
$name = "";
$extra = "";
$mid = intval( $this->ipsclass->my_getcookie('member_id') );
if ( $mid > 0 )
{
$this->ipsclass->DB->query("SELECT m.id, m.name, m.mgroup, g.g_access_cp FROM ibf_members m, ibf_groups g WHERE m.id=$mid AND g.g_id=m.mgroup AND g.g_access_cp=1");
if ( $r = $this->ipsclass->DB->fetch_row() )
{
$name = $r['name'];
$extra = 'onload="document.theAdminForm.password.focus();"';
}
}
//------------------------------------------------------
// SHW DA FRM (txt msg stylee)
//------------------------------------------------------
$qs = str_replace( '&amp;' , '&', $this->ipsclass->parse_clean_value( urldecode( $_SERVER['QUERY_STRING'] ) ) );
$qs = str_replace( 'adsess=' , 'old_adsess=', $qs );
$qs = str_replace( 'act=menu', '', $qs );
$qs = str_replace( '&lt;' , '', $qs );
$qs = str_replace( '&gt;' , '', $qs );
$qs = str_replace( '(' , '', $qs );
$qs = str_replace( ')' , '', $qs );
$this->ipsclass->html_title = "IPB: Àäìèíöåíòð: Âõîä";
$this->ipsclass->html = str_replace( '<%CONTENT%>', $this->ipsclass->skin_global_acp->log_in_form( $qs, $message, $name ), $this->ipsclass->skin_global_acp->global_main_wrapper() );
$this->ipsclass->html = str_replace( '<%TITLE%>' , $this->ipsclass->html_title, $this->ipsclass->html );
$this->ipsclass->html = str_replace( "<body", "<body style='background-image:url({$this->ipsclass->skin_url}/images/blank.gif)'", $this->ipsclass->html );
@header("Content-type: text/html");
print $this->ipsclass->html;
exit();
}
}
?>