HEX
Server: Apache/2.4.59 (Debian)
System: Linux skycube.cz 4.19.0-25-amd64 #1 SMP Debian 4.19.289-2 (2023-08-08) x86_64
User: ilya (534)
PHP: 7.3.31-1~deb10u7
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/ilya/data/www/kamforum.ru/sources/components_acp/chatpara.php
<?php

/*
+--------------------------------------------------------------------------
|   Invision Power Board v2.1.5
|   =============================================
|   by Matthew Mecham
|   (c) 2001 - 2005 Invision Power Services, Inc.
|   http://www.invisionpower.com
|   =============================================
|   Web: http://www.invisionboard.com
|   Time: Tue, 18 Oct 2005 19:30:11 GMT
|   Release: 95f5a3c9ea538e4ebb097b9464fc22d2
|   Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|   > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
|   > $Revision: 23 $
|   > $Author: matt $
+---------------------------------------------------------------------------
|
|   > Admin Framework for IPS Services
|   > Module written by Matt Mecham
|   > Date started: 17 February 2003
|
|	> Module Version Number: 1.0.0
+--------------------------------------------------------------------------
*/


if ( ! defined( 'IN_ACP' ) )
{
	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
	exit();
}

class ad_chatpara
{
	var $ipsclass;
	var $base_url;
	
	/*-------------------------------------------------------------------------*/
	// IPB CONSTRUCTOR
	/*-------------------------------------------------------------------------*/
	
	function auto_run()
	{
		//-----------------------------------------
		// Kill globals - globals bad, Homer good.
		//-----------------------------------------
		
		$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
		
		foreach ( $tmp_in as $k => $v )
		{
			unset($$k);
		}
		
		//-----------------------------------------
		// Make sure we're a root admin, or else!
		//-----------------------------------------
		
		if ($this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'])
		{
			$this->ipsclass->admin->error("Sorry, these functions are for the root admin group only");
		}

		switch($this->ipsclass->input['code'])
		{
			case 'ipchat04':
				$this->chat_splash();
				break;
			case 'chatsettings':
				$this->chat04_config();
				break;
			case 'chatsave':
				$this->chat_save();
				break;
			case 'dochat':
				$this->chat_config_save();
				break;
			default:
				$this->chat_splash();
				break;
		}
	}
		
	
	/*-------------------------------------------------------------------------*/
	// CHAT SPLASH
	/*-------------------------------------------------------------------------*/
	
	function chat_splash()
	{
		//-----------------------------------------
		// Do we have an order number
		//-----------------------------------------
		
		if ( $this->ipsclass->vars['chat04_account_no'] )
		{
			$this->chat04_config();
		}
		else
		{
			$this->ipsclass->admin->page_title  = "Invision Power Chat (Parachat)";
			$this->ipsclass->admin->page_detail = "If you have already purchased IP Chat via Parachat, then simply enter your Site ID in the box below.";
			
			$this->ipsclass->html .= "<form action='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=chatsave' method='POST'>
									  <table style='background:#005' width='100%' cellpadding=4 cellspacing=0 border=0 align='center'>
									  <tr>
									   <td valign='middle' align='left'><b style='color:white'>Ordered IP Chat?</b></td>
									   <td valign='middle' align='left'><input type='text' size=35 name='account_no' value='enter your Site ID here...' onclick=\"this.value='';\"></td>
									   <td valign='middle' align='left'><input type='submit' class='realdarkbutton' value='Continue...'></td>
									  </tr>
									  </table>
									  </form>";
									  
			$this->ipsclass->admin->show_inframe( 'http://partners.parachat.com/invision/' );
		}
	}
	
	/*-------------------------------------------------------------------------*/
	// CHAT SAVE
	/*-------------------------------------------------------------------------*/
	
	function chat_save()
	{
		//-----------------------------------------
		// Load libby-do-dah
		//-----------------------------------------
		
		require_once( ROOT_PATH.'sources/action_admin/settings.php' );
		$adsettings           =  new ad_settings();
		$adsettings->ipsclass =& $this->ipsclass;
		
		$acc_number = $this->ipsclass->input['account_no'];
		
		if ( $acc_number == "" )
		{
			$this->ipsclass->admin->error("Sorry, that is not a valid IP Chat account number");
		}
		
		$this->ipsclass->DB->do_update( 'conf_settings', array( 'conf_value' => $acc_number ), "conf_key='chat04_account_no'" );
		$this->ipsclass->DB->do_update( 'conf_settings', array( 'conf_value' => '' )         , "conf_key='chat_account_no'" );
		$adsettings->setting_rebuildcache();
		
		//-----------------------------------------
		// Update this component
		//-----------------------------------------
		
		require_once( ROOT_PATH . 'sources/api/api_core.php' );
		require_once( ROOT_PATH . 'sources/api/api_components.php' );
		
		$api           =  new api_components();
		$api->ipsclass =& $this->ipsclass;
		
		$fields = array( 'com_enabled'    => 1,
						 'com_menu_data'  => array( 0 => array( 'menu_text'    => 'Chat Settings',
						 										'menu_url'     => 'code=chatsettings',
						 										'menu_permbit' => 'edit' ) ) );
		
		$api->acp_component_update( 'chatpara', $fields );
		
		//-----------------------------------------
		// Show config
		//-----------------------------------------
		
		$this->chat04_config();
	}
	
	/*-------------------------------------------------------------------------*/
	// NEW CHAT
	/*-------------------------------------------------------------------------*/
	
	function chat04_config()
	{
		$this->ipsclass->admin->page_detail = "You may edit the configuration below to suit";
		$this->ipsclass->admin->page_title  = "Invision Power Chat Configuration";
		
		//-----------------------------------------
		// Load libby-do-dah
		//-----------------------------------------
		
		require_once( ROOT_PATH.'sources/action_admin/settings.php' );
		$settings           =  new ad_settings();
		$settings->ipsclass =& $this->ipsclass;
		
		//-----------------------------------------
		// Did we reset the component?
		//-----------------------------------------
		
		if ( ! $this->ipsclass->vars['chat04_account_no'] )
		{
			$this->chat_splash();
		}
		else
		{
			//-----------------------------------------
			// Update version 6 or 7
			//-----------------------------------------
			
			if ( preg_match( "#^\d#", $this->ipsclass->vars['chat04_account_no'] ) )
			{
				$this->ipsclass->DB->do_update( 'conf_settings', array( 'conf_value' => 7 ), "conf_key='parachat_version'" );
			}
			else
			{
				$this->ipsclass->DB->do_update( 'conf_settings', array( 'conf_value' => 6 ), "conf_key='parachat_version'" );
			}
			
			$settings->setting_rebuildcache();
		}

		$settings->get_by_key        = 'chat04';
		$settings->return_after_save = 'section=components&act=chatpara&code=show';
		
		$settings->setting_view();
	}

}

?>