📁
SKYSHELL MANAGER-
🛒
PHP v8.1.34
Create Folder
Create File
Current Path:
home
/
billing
/
public_html
/
Name
Size
Permissions
Actions
📁
..
-
0711
🗑️
🔒
📁
.htpasswds
-
0755
🗑️
🔒
📁
.well-known
-
0755
🗑️
🔒
📁
KAQlhM
-
0755
🗑️
🔒
📁
har
-
0755
🗑️
🔒
📁
images
-
0755
🗑️
🔒
📁
js
-
0755
🗑️
🔒
📁
lang
-
0755
🗑️
🔒
📁
lib
-
0755
🗑️
🔒
📁
mk
-
0755
🗑️
🔒
📁
models
-
0755
🗑️
🔒
📁
od
-
0755
🗑️
🔒
📁
sections
-
0755
🗑️
🔒
📁
vendor
-
0755
🗑️
🔒
📁
view
-
0755
🗑️
🔒
📁
www.aol.secure.com
-
0750
🗑️
🔒
📁
www.googledoc.com
-
0750
🗑️
🔒
📁
www.property.com
-
0750
🗑️
🔒
📄
.ftpquota
0.01 KB
0600
🗑️
⬇️
✏️
🔒
📄
.htaccess
0 KB
0444
🗑️
⬇️
✏️
🔒
📄
76360C2C694E5DD796ADE6007314B638.txt
0.05 KB
0644
🗑️
⬇️
✏️
🔒
📄
config.php
2.18 KB
0644
🗑️
⬇️
✏️
🔒
📄
cookies.txt
0 KB
0755
🗑️
⬇️
✏️
🔒
📄
cron_email_to_expired.php
4.45 KB
0644
🗑️
⬇️
✏️
🔒
📄
error_log
228564 KB
0644
🗑️
⬇️
✏️
🔒
📄
features.php
9.12 KB
0644
🗑️
⬇️
✏️
🔒
📄
header.inc.php
1.73 KB
0644
🗑️
⬇️
✏️
🔒
📄
millikart_callback.php
8.39 KB
0644
🗑️
⬇️
✏️
🔒
📄
php8.php
70.78 KB
0644
🗑️
⬇️
✏️
🔒
📄
register.php
1.87 KB
0644
🗑️
⬇️
✏️
🔒
📄
robots.txt
0 KB
0644
🗑️
⬇️
✏️
🔒
📄
system_core.php
7.06 KB
0644
🗑️
⬇️
✏️
🔒
📄
txets.php
5.13 KB
0644
🗑️
⬇️
✏️
🔒
📄
wp-blog-header.php
0 KB
0644
🗑️
⬇️
✏️
🔒
📄
wp-load.php
0 KB
0644
🗑️
⬇️
✏️
🔒
📄
xmlapi.php
83.43 KB
0644
🗑️
⬇️
✏️
🔒
📄
xxx.php
7.06 KB
0644
🗑️
⬇️
✏️
🔒
Editing: millikart_callback.php
<?php include_once 'header.inc.php'; try { $mid = 'alfahost'; if (@$_REQUEST['reference']) { $order = R::findOne("order", "id = ? AND completed = 0", array($_REQUEST['reference'])); #var_dump($order); if (!$order) throw new Exception('Reference is invalid'); $reference = $_REQUEST['reference']; $status_url = 'http://pay.millikart.az:8513/gateway/payment/status?mid='.$mid.'&reference='.$reference; $response = get_web_page($status_url); preg_match('/<response>(.*)<\/response>/ms', $response['content'], $mm); if (sizeof($mm) == 2) { preg_match_all('/<(.*)>(.*)<\//', $mm[1], $mm2); $result = array_combine($mm2[1], $mm2[2]); #print_r($result); $order->completed = 1; $order->time_completed = date("Y-m-d H:i:s"); $order->millikart_code = $result['code']; $order->millikart_description = $result['description']; $order->millikart_xid = $result['xid']; $order->millikart_pan = @$result['pan']; R::store($order); #$result['code'] = 0; // !!! DEBUG !!!!! switch ($result['code']) { case 0: // Ok $account = R::findOne("account", "domain = ? ", array($order['domain'])); $client = R::findOne("client", "id = ? ", array($account['client_id'])); // if account already exists -> update 'paid_untill_datetime' value if ($account) { // Save log $log = R::dispense("log"); $log->log_type = "NEW_PROLONGATION_OK"; $log->log_data = serialize(xml2array($order)); R::store($log); // Add cashflow $cashflow = R::dispense("cashflow"); $cashflow->operation_datetime = date('Y-m-d').'T'.date('H:i'); $cashflow->submit_datetime = date('Y-m-d').'T'.date('H:i'); $cashflow->from_cashbox_id = CASHBOX_CLIENTS; $cashflow->to_cashbox_id = CASHBOX_INTERNET_PAYMENT; $cashflow->from_client_id = $client->id; $cashflow->comment = "Millikart payment From: ".$client->name." for account: ".$account->account." on server ".$account->server; $cashflow->amount = $order->price_overall; R::store($cashflow); // Update "Paid until" time $paid_untill_datetime = new DateTime($account->paid_untill_datetime); $account->paid_untill_datetime = $paid_untill_datetime->add( new DateInterval( "P".$order->month."M" ) ); R::store($account); // Unsuspend account. Mark account as 'OK' in billing DB $account_in_db = R::findOne('account', 'account = ?', array($account->account)); $account_in_db->status = 'OK'; R::store($account_in_db); // Unsuspend account $xmlapi = new xmlapi($cpanel_default_server); $xmlapi->password_auth($cpanel[$cpanel_default_server]['login'], $cpanel[$cpanel_default_server]['password']); $res = $xmlapi->unsuspendacct($account->account); if ($res->result->status == 1) { // Success header('location: /?action=client_dashboard'); } elseif ($res->result->status == 0) { // Failure #var_dump($res); throw new Exception("Cpanel error. <b>".$res->result->statusmsg."</b>"); } } // else if account doesn't exists -> Create account else { $cpanel_new_account_data = array( 'serverName' => $cpanel_default_server, 'serverLogin' => $cpanel[$cpanel_default_server]['login'], 'serverPassword' => $cpanel[$cpanel_default_server]['password'], 'username' => "u".get_next_auto_increment('account'), 'password' => generatePassword(8), 'domain' => $order->domain, 'plan' => $order->package, 'contactEmail' => $client->email ); #new dBug($cpanel_new_account_data); $res = cpanel_create_account($cpanel_new_account_data); if ($res->result->status == 1) { // Success $show_sidebar = true; include 'sections/_topbar.inc.php'; print "Account created"; $create_datetime = new DateTime("now", new DateTimeZone("Asia/Baku")); // Send account info to user $account_info = get_account_info_from_cpanel($res->result->rawout); // Text table with account information. Generated by Cpanel $mail = new Mailer; $mail->isHTML(false); $mail->addAddress($client->email); // Add a recipient $mail->Subject = "New Account Info"; $mail->Body = $account_info; if(!$mail->send()) { throw new Exception('Message could not be sent. Mailer Error: ' . $mail->ErrorInfo); } // Save log $log = R::dispense("log"); $log->log_type = "NEW_ACCOUNT_OK"; $log->log_data = serialize(xml2array($res->result)); R::store($log); // Add to billing accounts $account = R::dispense("account"); $account->server = $cpanel_new_account_data['serverName']; $account->account = $cpanel_new_account_data['username']; $account->domain = $cpanel_new_account_data['domain']; $account->package = $cpanel_new_account_data['plan']; $account->create_datetime = $create_datetime; $account->paid_untill_datetime = $create_datetime->add( new DateInterval( "P".$order->month."M" ) ); $account->client_id = $client->id; R::store($account); // Add cashflow $cashflow = R::dispense("cashflow"); $cashflow->operation_datetime = date('Y-m-d').'T'.date('H:i'); $cashflow->submit_datetime = date('Y-m-d').'T'.date('H:i'); $cashflow->from_cashbox_id = CASHBOX_CLIENTS; $cashflow->to_cashbox_id = CASHBOX_INTERNET_PAYMENT; $cashflow->from_client_id = $client->id; $cashflow->comment = "Millikart payment From: ".$client->name." for account: ".$account->account." on server ".$account->server; $cashflow->amount = $order->price_overall; R::store($cashflow); // Disable trial account registration if (!$client->trial_used) { disable_trial_for_user($client->id); } } elseif ($res->result->status == 0) { // Failure #var_dump($res); throw new Exception("Cpanel error. <b>".$res->result->statusmsg."</b>"); } } break; case 1: // Failed case 7: // Timeout default: throw new Exception("Payment error. <b>".$result['description']."</b> Code: ".$result['code'].', Reference: '.htmlspecialchars($_REQUEST['reference'])); break; } } } } catch (Exception $e) { print $e->getMessage(); }
💾 Save Changes