\/?~]/'; $hash = '/[#]/'; if (!preg_match($capital, $password)) { $passwordError = true; } elseif (!preg_match($lower, $password)) { $passwordError = true; } elseif (!preg_match($number, $password)) { $passwordError = true; } elseif (!preg_match($special, $password)) { $passwordError = true; } elseif (strlen($password) < 6) { $passwordError = true; } elseif (preg_match($hash, $password)) { $passwordError = true; } if ($passwordError) throw new Exception("Weak password detected."); } if ($action == 'requirements') { $passed = []; $failed = []; $requiredPHP = 8.3; $currentPHP = explode('.', PHP_VERSION)[0] . '.' . explode('.', PHP_VERSION)[1]; if ($requiredPHP == $currentPHP) { $passed[] = "PHP version $requiredPHP is required"; } else { $failed[] = "PHP version $requiredPHP is required. Your current PHP version is $currentPHP"; } $extensions = ['BCMath', 'Ctype', 'cURL', 'DOM', 'Fileinfo', 'GD', 'JSON', 'Mbstring', 'OpenSSL', 'PCRE', 'PDO', 'pdo_mysql', 'Tokenizer', 'XML','Filter','Hash','Session','zip']; foreach ($extensions as $extension) { if (extension_loaded($extension)) { $passed[] = strtoupper($extension) . ' PHP Extension is required'; } else { $failed[] = strtoupper($extension) . ' PHP Extension is required'; } } if (function_exists('curl_version')) { $passed[] = 'Curl via PHP is required'; } else { $failed[] = 'Curl via PHP is required'; } if (file_get_contents(__FILE__)) { $passed[] = 'file_get_contents() is required'; } else { $failed[] = 'file_get_contents() is required'; } if (ini_get('allow_url_fopen')) { $passed[] = 'allow_url_fopen() is required'; } else { $failed[] = 'allow_url_fopen() is required'; } $dirs = ['../core/bootstrap/cache/', '../core/storage/', '../core/storage/app/', '../core/storage/framework/', '../core/storage/logs/']; foreach ($dirs as $dir) { $perm = substr(sprintf('%o', fileperms($dir)), -4); if ($perm >= '0775') { $passed[] = str_replace("../", "", $dir) . ' is required 0775 permission'; } else { $failed[] = str_replace("../", "", $dir) . ' is required 0775 permission. Current Permisiion is ' . $perm; } } if (file_exists('database.sql')) { $passed[] = 'database.sql should be available'; } else { $failed[] = 'database.sql should be available'; } if (file_exists('../.htaccess')) { $passed[] = '".htaccess" should be available in root directory'; } else { $failed[] = '".htaccess" should be available in root directory'; } } if ($_POST['db_type'] == 'create-new-database') { $_POST['db_name'] = $_POST['cp_user'] . '_' . $_POST['db_name']; $_POST['db_user'] = $_POST['cp_user'] . '_' . $_POST['db_user']; } if ($action == 'result') { $url = 'https://license.viserlab.com/install'; $params = $_POST; $params['product'] = $itemName; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); $response = json_decode($result, true); if (@$response['error'] == 'ok' && $_POST['db_type'] == 'create-new-database') { try { $cpanelusername = $_POST['cp_user']; $cpanelpassword = $_POST['cp_password']; $domain = $_SERVER['HTTP_HOST']; $authHeader[0] = "Authorization: Basic " . base64_encode($cpanelusername . ":" . $cpanelpassword) . "\n\r"; $dbname = $_POST['db_name']; $username = $_POST['db_user']; $password = $_POST['db_pass']; //check secure password checkSecurePassword($password); // Create the database $cpError = "cPanel not detected."; $createDbQuery = "https://$domain:2083/json-api/cpanel?cpanel_jsonapi_module=Mysql&cpanel_jsonapi_func=adddb&cpanel_jsonapi_apiversion=1&arg-0=$dbname"; $createDbCurl = curl_init(); curl_setopt($createDbCurl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($createDbCurl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($createDbCurl, CURLOPT_HEADER, 0); curl_setopt($createDbCurl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($createDbCurl, CURLOPT_HTTPHEADER, $authHeader); curl_setopt($createDbCurl, CURLOPT_URL, $createDbQuery); $createDbResult = curl_exec($createDbCurl); $createDbResult = json_decode($createDbResult); echo ""; $createDbError = @$createDbResult->data->error ?? @$createDbResult->data->reason ?? @$createDbResult->error; if ($createDbResult == false) { throw new Exception($cpError); } elseif ($createDbError) { $cpError = $createDbError ?? $cpError; $cpError = @$createDbResult->data->reason ? "Error from cPanel: " . $cpError : $cpError; throw new Exception($cpError); } curl_close($createDbCurl); // Create the user and assign privileges $cpError = "cPanel not detected."; $createUserCurl = curl_init(); curl_setopt($createUserCurl, CURLOPT_URL, "https://$domain:2083/json-api/cpanel"); curl_setopt($createUserCurl, CURLOPT_RETURNTRANSFER, true); curl_setopt($createUserCurl, CURLOPT_ENCODING, ''); curl_setopt($createUserCurl, CURLOPT_MAXREDIRS, 10); curl_setopt($createUserCurl, CURLOPT_TIMEOUT, 0); curl_setopt($createUserCurl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($createUserCurl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($createUserCurl, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($createUserCurl, CURLOPT_HTTPHEADER, $authHeader); curl_setopt( $createUserCurl, CURLOPT_POSTFIELDS, array( 'cpanel_jsonapi_module' => 'Mysql', 'cpanel_jsonapi_func' => 'adduser', 'cpanel_jsonapi_apiversion' => '1', 'arg-0' => $username, 'arg-1' => $password ) ); $createUserResult = curl_exec($createUserCurl); $createUserResult = json_decode($createUserResult); $createUserError = @$createUserResult->data->error ?? @$createUserResult->data->reason ?? @$createUserResult->error; if ($createUserResult == false) { throw new Exception($cpError); } elseif ($createUserError) { $cpError = $createUserError ?? $cpError; $cpError = @$createUserResult->data->reason ? "Error from cPanel: " . $cpError : $cpError; throw new Exception($cpError); } curl_close($createUserCurl); // Assign the database to the user $cpError = "cPanel not detected."; $createDbUserQuery = "https://$domain:2083/json-api/cpanel?cpanel_jsonapi_module=Mysql&cpanel_jsonapi_func=adduserdb&cpanel_jsonapi_apiversion=1&arg-0=$dbname&arg-1=$username&arg-2=ALL"; $assignCurl = curl_init(); curl_setopt($assignCurl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($assignCurl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($assignCurl, CURLOPT_HEADER, 0); curl_setopt($assignCurl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($assignCurl, CURLOPT_HTTPHEADER, $authHeader); curl_setopt($assignCurl, CURLOPT_URL, $createDbUserQuery); $assignDbResult = curl_exec($assignCurl); $assignDbResult = json_decode($assignDbResult); $assignError = @$assignDbResult->data->error ?? @$assignDbResult->data->reason ?? @$assignDbResult->error; if ($assignDbResult == false) { throw new Exception($cpError); } elseif ($assignError) { throw new Exception("There is an issue with assigning the user to the database."); } curl_close($assignCurl); } catch (Exception $e) { $response['error'] = 'error'; $response['message'] = $e->getMessage(); } } if (@$response['error'] == 'ok') { try { $db = new PDO("mysql:host=$_POST[db_host];dbname={$_POST['db_name']}", $_POST['db_user'], $_POST['db_pass']); $dbinfo = $db->query('SELECT VERSION()')->fetchColumn(); $engine = @explode('-', $dbinfo)[1]; $version = @explode('.', $dbinfo)[0] . '.' . @explode('.', $dbinfo)[1]; if (strtolower($engine) == 'mariadb') { if (!version_compare($version, '10.6','>=')) { $response['error'] = 'error'; $response['message'] = 'MariaDB 10.6+ Or MySQL 8.0+ Required.
Your current version is MariaDB ' . $version; } } else { if (!version_compare($version, '8.0','>=')) { $response['error'] = 'error'; $response['message'] = 'MariaDB 10.6+ Or MySQL 8.0+ Required.
Your current version is MySQL ' . $version; } } } catch (Exception $e) { $response['error'] = 'error'; $response['message'] = $_POST['db_type'] == 'create-new-database' ? 'There is a problem with creating the database.' : 'Database Credential is Not Valid'; } } if (@$response['error'] == 'ok') { try { $query = file_get_contents("database.sql"); $stmt = $db->prepare($query); $stmt->execute(); $stmt->closeCursor(); } catch (Exception $e) { $response['error'] = 'error'; $response['message'] = 'Problem Occurred When Importing Database!
Please Make Sure The Database is Empty.'; } } if (@$response['error'] == 'ok') { try { $file = fopen($response['location'], 'w'); fwrite($file, $response['body']); fclose($file); } catch (Exception $e) { $response['error'] = 'error'; $response['message'] = 'Problem Occurred When Writing Environment File.'; } } if (@$response['error'] == 'ok') { try { $db->query("UPDATE admins SET email='" . $_POST['email'] . "', username='" . $_POST['admin_user'] . "', password='" . password_hash($_POST['admin_pass'], PASSWORD_DEFAULT) . "' WHERE username='admin'"); } catch (Exception $e) { $response['message'] = 'EasyInstaller was unable to set the credentials of admin.'; } } } $sectionTitle = empty($action) ? 'Terms of Use' : $action; ?> Easy Installer by ViserLab

Easy Installer

'; if (@$response['error'] == 'ok') { echo '

Your system has been installed successfully!

'; if (@$response['message']) { echo '
' . $response['message'] . '
'; } echo '

Please rate us 5 stars on CodeCanyon if you found our installation process hassle-free and easy.

'; echo '

Please delete the "install" folder from the server.

'; echo ''; } else { if (@$response['message']) { echo '

' . $response['message'] . '

'; } else { echo '

Your Server is not Capable to Handle the Request.

'; } echo '
Try again. Or you can ask for support by creating a support ticket.
Try Again create ticket
'; } echo '
'; } elseif ($action == 'information') { ?>
Website URL
Database Details
Week password detected
Admin Credential
'; foreach ($failed as $fail) { echo ""; } echo '
$fail
'; } if (!count($failed)) { echo '
Requirements Check Passed!
'; } if (count($passed)) { echo '
'; echo '
'; foreach ($passed as $pass) { echo ""; } echo '
$pass
'; } echo '
'; if (count($failed)) { echo 'ReCheck '; } else { echo 'Next Step '; } echo '
'; } else { ?>

License to be used on one(1) domain(website) only!

The Regular license is for one website or domain only. If you want to use it on multiple websites or domains you have to purchase more licenses (1 website = 1 license). The Regular License grants you an ongoing, non-exclusive, worldwide license to make use of the item.

You Can:
  • Use on one(1) domain only.
  • Modify or edit as you want.
  • Translate to your choice of language(s).
If any issue or error occurred for your modification on our code/database, we will not be responsible for that.
You Cannot:
  • Resell, distribute, give away, or trade by any means to any third party or individual.
  • Include this product into other products sold on any market or affiliate websites.
  • Use on more than one(1) domain.

For more information, Please Check The License FAQ