<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
<?php

//////////////////////////////////////////////////////////////
//===========================================================
// clone.php
//===========================================================
// SOFTACULOUS 
// Version : 4.2.8
// Inspired by the DESIRE to be the BEST OF ALL
// ----------------------------------------------------------
// Started by: Alons
// Date:       10th Jan 2009
// Time:       21:00 hrs
// Site:       http://www.softaculous.com/ (SOFTACULOUS)
// ----------------------------------------------------------
// Please Read the Terms of use at http://www.softaculous.com
// ----------------------------------------------------------
//===========================================================
// (c)Softaculous Inc.
//===========================================================
//////////////////////////////////////////////////////////////

if(!defined('SOFTACULOUS')){

	die('Hacking Attempt');

}

//The Install process
function __clone(){

global $__settings, $error, $software, $globals, $replace_data, $data;
	
	//Do we meet the Minimum software requirements
	__requirements();

	if(!empty($error)){
		return false;
	}
	
	$__settings['siteidentifier'] = srandstr(32);
	
	$temp = parse_url($__settings['softurl']);
	$__settings['relativeurl'] = $temp['path'];
	$__settings['domhost'] = $temp['host'];

	sclone_replace($replace_data, $__settings['softpath'].'/config.php', true);
	
	// We need the Database Prefix to upgrade
	$file = sfile($__settings['softpath'].'/config.php');
	
	if(empty($file)){
		$error[] = 'Could not read the config file to get the database prefix.';
		return false;
	}
	
	soft_preg_replace('/\$CFG->prefix(\s*?)=(\s*?)("|\')(.*?)("|\')(\s*?);/is', $file, $__settings['dbprefix'], 4);
	
	$dom_database = "UPDATE ".$__settings['dbprefix']."config SET value='".$__settings['domhost']."' WHERE name='chat_serverhost';";
	sdb_query($dom_database, $__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']);
	
	$dom_database1 = "UPDATE ".$__settings['dbprefix']."config SET value='".$__settings['siteidentifier'].$__settings['domhost']."' WHERE name='siteidentifier';";
	sdb_query($dom_database1, $__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']);
	
	$dom_database2 = "UPDATE ".$__settings['dbprefix']."config_log SET value='".$__settings['domhost']."' WHERE name='chat_serverhost';";
	sdb_query($dom_database2, $__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']);
	
	//deleting some cache directories
	@srm($__settings['softdatadir'].'/cache/');
	@srm($__settings['softdatadir'].'/localcache/');
	@srm($__settings['softdatadir'].'/temp/');
	
	@smkdir($__settings['softdatadir'].'/cache/', $globals['odc']);
	@smkdir($__settings['softdatadir'].'/localcache/', $globals['odc']);
	@smkdir($__settings['softdatadir'].'/temp/', $globals['odc']);
	
	@schmod($__settings['softdatadir'], $globals['odc'], 1);

}

//Check whether the Minimum Software configuration matches
function __requirements(){

global $__settings, $error, $software, $globals;

	//Get the PHP path
	if($globals['os'] == 'windows'){
		$__settings['php_path'] = sphpbin();
	}else{
		$__settings['php_path'] = 'php';
	}	
	
	return true;

}

?>