Settings updated successfully.
';
47 | header("location: ./accountsettings.php");
48 | }
49 | else{
50 | $_SESSION['msg']='
Something wents wrong.
';
51 | header("location: ./accountsettings.php");
52 | }
53 | }
54 | else{
55 | $_SESSION['msg']='
Password doesnt match.
';
56 | header("location: ./accountsettings.php");
57 | }
58 | }
59 | ?>
60 |
--------------------------------------------------------------------------------
/clientarea/activate.php:
--------------------------------------------------------------------------------
1 | 0){
7 | $_SESSION['msg']='
';
8 | header("location: ./login.php");
9 | }
10 | else{
11 | $_SESSION['msg']='
Something wents wrong.
';
12 | header("location: ./login.php");
13 | }
14 | }
15 | }
16 | ?>
--------------------------------------------------------------------------------
/clientarea/cpanel.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
20 |
21 |
22 |
Login into
23 |
You are about to redirect if you didnot redirected within 5 seconds please click on button bellow
24 |
31 |
34 |
35 |
36 |
39 |
--------------------------------------------------------------------------------
/clientarea/cpanelsettings.php:
--------------------------------------------------------------------------------
1 | 0){
8 | header('location: accounts.php');
9 | }
10 | $sql=mysqli_fetch_assoc($sl);
11 | ?>
12 |
13 |
20 |
34 |
35 |
49 |
50 |
51 |
52 |
Deactivate Account
53 |
62 |
You account will be deleted after 30 days of your account deactivation and all of the account data will be removed completely.
63 |
64 |
65 |
66 |
67 |
68 |
Reactivate Account
69 |
Deactivation of account cannot be undo you need to interact with staff inorder to get a full backup of your account
70 |
Create Ticket
71 |
72 |
73 |
74 | 0){
81 | $_SESSION['msg']="
Account label has been changed.
";
82 | header("location: ./cpanelsettings.php?aid=$id");
83 | }
84 | else{
85 | $_SESSION['msg']="
Something wen'ts wrong.
";
86 | header("location: ./cpanelsettings.php?aid=$id");
87 | }
88 | }
89 | ?>
90 |
--------------------------------------------------------------------------------
/clientarea/createaccount.php:
--------------------------------------------------------------------------------
1 |
6 |
41 |
--------------------------------------------------------------------------------
/clientarea/createticket.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
15 |
Create a new ticket
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | It can take upto 2 hours before respond
30 |
31 |
32 |
33 | 0){
38 | include "mail/newticket.php";
39 | $_SESSION['msg']='
Ticket created successfully.
';
40 | header("location: ./ticket.php?tid=$id");
41 | }
42 | else{
43 | $_SESSION['msg']='
Something wents wrong.
';
44 | header("location: ./createticket.php");
45 | }
46 | }
47 | ?>
48 |
--------------------------------------------------------------------------------
/clientarea/forget.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
Forget Password -
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/clientarea/function/changepassword.php:
--------------------------------------------------------------------------------
1 | $_POST['username'],
12 | 'password'=>$_POST['password'],
13 | );
14 | $id=$_POST['aid'];
15 | // alert client class
16 | $client=Client::create();
17 | // alert create function
18 | $request = $client->password([
19 | 'username'=>$tsData['username'],
20 | 'password'=>$tsData['password'],
21 | 'enabledigest'=>1,
22 | ]);
23 | // sending request
24 | $response=$request->send();
25 | //receiving respond
26 | if((int)$response->isSuccessful()==0&&strlen($response->getMessage())>1)
27 | $result="0";
28 | elseif((int)$response->isSuccessful()==1&&(int)$response->getMessage()==1)
29 | $result="1";
30 | elseif((int)$response->isSuccessful()==0&&(int)$response->getMessage()==0)
31 | $result="2";
32 | // showing results
33 | if($result==0){
34 | $_SESSION['msg']="
".$response->getMessage()."
";
35 | $sql=mysqli_query($connect,"update vhost_cpanel set cpanel_password='".$_POST['password']."' where cpanel_client_username='".$_POST['username']."'");
36 | header("location: ../cpanelsettings.php?aid=$id");
37 | }
38 | if($result==1){
39 | $sql=mysqli_query($connect,"update vhost_cpanel set cpanel_password='".$_POST['password']."' where cpanel_client_username='".$_POST['username']."'");
40 | header("location: ../cpanelsettings.php?aid=$id");
41 | }
42 | if($result==2){
43 | $_SESSION['msg']="
Sorry something went's wrong.
";
44 | header("location: ../cpanelsettings.php?aid=$id");
45 | }
46 | //end statment
47 | }
48 | ?>
--------------------------------------------------------------------------------
/clientarea/function/connect.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/clientarea/function/createaccount.php:
--------------------------------------------------------------------------------
1 | $UserName,
16 | 'password'=>$Password,
17 | 'domain'=>$_POST['domain'],
18 | 'email'=>$_COOKIE['client'],
19 | 'plan'=>API_PLAN,
20 | );
21 | // alert client class
22 | $client=Client::create();
23 | // alert create function
24 | $request=$client->createAccount([
25 | 'username'=>$tsData['username'],
26 | 'password'=>$tsData['password'],
27 | 'domain'=>$tsData['domain'],
28 | 'email'=>$tsData['email'],
29 | 'plan'=>$tsData['plan']
30 | ]);
31 | // sending request
32 | $response=$request->send();
33 | //receiving respond
34 | if((int)$response->isSuccessful()==1&&strlen($response->getMessage())>1)
35 | $result="1";
36 | elseif((int)$response->isSuccessful()==0&&strlen($response->getMessage())>1)
37 | $result="0";
38 | elseif((int)$response->isSuccessful()==0&&(int)$response->getMessage()==0)
39 | $result="2";
40 | // showing results
41 | $uname=$response->getVpUsername();
42 | $passwd=$tsData['password'];
43 | if($result==0){
44 | $Message = $response->getData();
45 | $_SESSION['msg']="
".$Message['result']['statusmsg']."
";
46 | header("location: ../accounts.php");
47 | }
48 | if($result==1){
49 | $sql=mysqli_query($connect,"insert into vhost_cpanel(client_id,cpanel_username,cpanel_client_username,cpanel_password,cpanel_status,cpanel_date,cpanel_label,cpanel_domain) values ('".$_POST['id']."','".$response->getVpUsername()."','".$tsData['username']."','".$tsData['password']."','1','".date("d-m-Y")."','".$_POST['label']."','".strtolower($_POST['domain'])."')");
50 | $_SESSION['msg']="
Account created successfully
";
51 | include "../mail/newaccount.php";
52 | header("location: ../accounts.php");
53 | }
54 | if($result==2){
55 | $_SESSION['msg']="
Sorry something went's wrong.
";
56 | header("location: ../createaccount.php");
57 | }
58 | //end statment
59 | }
60 | }
61 | else{
62 | $_SESSION['msg']="
You have reached the limit of free accounts.
";
63 | header("location: ../accounts.php");
64 | }
65 | ?>
66 |
--------------------------------------------------------------------------------
/clientarea/function/createssl.php:
--------------------------------------------------------------------------------
1 | $_POST['domain'],
7 | 'csr_organization' => $_POST['organization'],
8 | 'csr_department' => $_POST['departament'],
9 | 'csr_city' => $_POST['city'],
10 | 'csr_state' => $_POST['state'],
11 | 'csr_country' => $_POST['country'],
12 | 'csr_email' => $_POST['email']
13 | );
14 | $apiClient = new GoGetSSLApi();
15 | $token = $apiClient->auth(SSL_USERNAME, SSL_PASSWORD);
16 | $csrorder = $apiClient->generateCSR($CSRData);
17 | $csr_code = $csrorder['csr_code'];
18 | if(isset($_POST['create'])){
19 | $Country = 'PK';
20 | $Company = 'Hostella';
21 | $Phone = '03000000000';
22 | $City = 'Lahore';
23 | $Postal = '54000';
24 | $Email = $_POST['email'];
25 | $Address = 'Street 45C ARU';
26 | $ID = $_POST['id'];
27 | $Name = $_POST['name'];
28 | $FormData = array(
29 | 'product_id' => 65,
30 | 'csr' => $csr_code,
31 | 'server_count' => "-1",
32 | 'period' => 3,
33 | 'approver_email' => 'mahtabhassan159@gmail.com',
34 | 'webserver_type' => "1",
35 | 'admin_firstname' => $Name,
36 | 'admin_lastname' => $Name,
37 | 'admin_phone' => $Phone,
38 | 'admin_title' => "Mr",
39 | 'admin_email' => $Email,
40 | 'tech_firstname' => $Name,
41 | 'tech_lastname' => $Name,
42 | 'tech_phone' => $Phone,
43 | 'tech_title' => "Mr",
44 | 'tech_email' => $Email,
45 | 'org_name' => $Company,
46 | 'org_division' => "Hosting",
47 | 'org_addressline1' => $Address,
48 | 'org_city' => $City,
49 | 'org_country' => $Country,
50 | 'org_phone' => $Phone,
51 | 'org_postalcode' => $Postal,
52 | 'org_region' => "None",
53 | 'dcv_method' => "dns",
54 | );
55 | $apiClient = new GoGetSSLApi();
56 | $token = $apiClient->auth(SSL_USERNAME, SSL_PASSWORD);
57 | $Data = $apiClient->addSSLOrder($FormData);
58 | $csr_key = $csrorder['csr_key'];
59 | if(count($Data)>4){
60 | $sql = mysqli_query($connect,"INSERT INTO `vhost_ssl`(`ssl_key`,`client_id`,`private_key`) VALUES ('".$Data['order_id']."','".$ID."','".$csr_key."')");
61 | if($sql){
62 | $_SESSION['msg'] = '
63 |
64 | ×
65 |
66 | SSL requested successfully!
67 |
';
68 | header('location: ../ssls.php');
69 | }
70 | else{
71 | $_SESSION['msg'] = '
72 |
73 | ×
74 |
75 | Something went'."'".' wrong!
76 |
';
77 | header('location: ../newssl.php');
78 | }
79 | }
80 | else{
81 | $_SESSION['msg'] = '
82 |
83 | ×
84 |
85 | '.$Data['message'].'
86 |
';
87 | header('location: ../newssl.php');
88 | }
89 | }
90 | ?>
91 |
--------------------------------------------------------------------------------
/clientarea/function/deactivateaccount.php:
--------------------------------------------------------------------------------
1 | $_POST['username'],
12 | 'reason'=>$_POST['reason'],
13 | );
14 | $id=$_POST['aid'];
15 | // alert client class
16 | $client=Client::create();
17 | // alert create function
18 | $request = $client->suspend([
19 | 'username'=>strtolower($tsData['username']),
20 | 'reason'=>$tsData['reason'],
21 | ]);
22 | // sending request
23 | $response=$request->send();
24 | //receiving respond
25 | if((int)$response->isSuccessful()==0&&strlen($response->getMessage())>1)
26 | $result="0";
27 | elseif((int)$response->isSuccessful()==1&&(int)$response->getMessage()==1)
28 | $result="1";
29 | elseif((int)$response->isSuccessful()==0&&(int)$response->getMessage()==0)
30 | $result="2";
31 | // showing results
32 | $uname=$tsData['username'];
33 | if($result==0){
34 | $_SESSION['msg']="
".$response->getMessage()."
";
35 | $sql=mysqli_query($connect,"update vhost_cpanel set cpanel_status='2' where cpanel_client_username='".$_POST['username']."'");
36 | include "../mail/deactivateaccount.php";
37 | header("location: ../accounts.php");
38 | }
39 | if($result==1){
40 | $sql=mysqli_query($connect,"update vhost_cpanel set cpanel_status='2' where cpanel_client_username='".$_POST['username']."'");
41 | include "../mail/deactivateaccount.php";
42 | header("location: ../accounts.php");
43 | }
44 | if($result==2){
45 | $_SESSION['msg']="
Sorry something went's wrong.
";
46 | header("location: ../cpanelsettings.php?aid=$id");
47 | }
48 | //end statment
49 | }
50 | ?>
--------------------------------------------------------------------------------
/clientarea/function/domainchecker.php:
--------------------------------------------------------------------------------
1 | $_POST['domain'].$_POST['extension']
12 | );
13 | // alert Client Class
14 | $client=Client::create();
15 | // alert availability function
16 | $request=$client->availability(['domain'=>$tsData['domain']]);
17 | // sending request
18 | $response=$request->send();
19 | // getting response
20 | if((int)$response->isSuccessful()==0&&strlen($response->getMessage())>1)
21 | $result="0";
22 | elseif((int)$response->isSuccessful()==1&&(int)$response->getMessage()==1)
23 | $result="1";
24 | elseif((int)$response->isSuccessful()==0&&(int)$response->getMessage()==0)
25 | $result="2";
26 | // After getting results return them
27 | if($result==0){
28 | $_SESSION['msg']="
".$response->getMessage()."
";
29 | header("location: ../domainchecker.php");
30 | }
31 | if($result==1){
32 | $_SESSION['msg']="
Congratulations domain has been selected successfully.
";
33 | $_SESSION['domain']=$tsData['domain'];
34 | header("location: ../createaccount.php");
35 | }
36 | if($result==2){
37 | $_SESSION['msg']="
Sorry domain already registered.
";
38 | header("location: ../domainchecker.php");
39 | }
40 | // end statment
41 | }
--------------------------------------------------------------------------------
/clientarea/function/forget.php:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/clientarea/function/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Dear $name!
7 |
You have created new free web hosting account from our service EraHost and we hope you will use our service according to the guidelines given in the TOS page
8 |
9 |
Account Information
10 |
cPanel Username: $uname
11 | cPanel Password: $passwd
12 | cPanel URL: https://cpanel.flexhost.ga
13 |
FTP Information
14 |
FTP Username: $uname
15 | FTP Password: $passwd
16 | FTP Hostname: ftpupload.net
17 | FTP Port: 21
18 |
MySQL Information
19 |
MySQL Username: $uname
20 | MySQL Password: $passwd
21 | MySQL Hostname: sql112.flexhost.ga
22 | MySQL Port: 3306
23 |
24 |
Nameservers Information
25 |
You need to set your domain nameservers to given nameservers
26 | NS1: ns1.flexhost.ga
27 | NS2: ns2.flexhost.ga
28 |
29 | Best Regards EraHost
30 |
31 |
32 |
--------------------------------------------------------------------------------
/clientarea/function/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/clientarea/function/login.php:
--------------------------------------------------------------------------------
1 | 0){
6 | $res=mysqli_fetch_assoc($sql);
7 | if(password_verify($_POST['password'],$res['client_password'])){
8 | if(!empty($_POST['check'])){
9 | setcookie("client",$_POST['email'],time()+84600,"/");
10 | }
11 | else{
12 | setcookie("client",$_POST['email'],time()+86400*30,"/");
13 | }
14 | header("location: ../home.php");
15 | }
16 | else{
17 | $_SESSION['msg']='
Invalid email or password
';
18 | header("Location: ../login.php");
19 | }
20 | }
21 | else{
22 | $_SESSION['msg']='
Account doesnt exist.
';
23 | header("Location: ../login.php");
24 | }
25 | }
26 | ?>
--------------------------------------------------------------------------------
/clientarea/function/logout.php:
--------------------------------------------------------------------------------
1 | Successfully logged out.
';
7 | header("location: ../login.php");
8 | }
9 | else{
10 | $_SESSION['msg']='
Login to continue.
';
11 | header("location: ../login.php");
12 | }
13 | ?>
14 |
--------------------------------------------------------------------------------
/clientarea/function/reset.php:
--------------------------------------------------------------------------------
1 | 0){
6 | $_SESSION['msg']='
Password changed successfully
';
7 | header("location: ../login.php");
8 | }
9 | else{
10 | $_SESSION['msg']='
Something wents wrong.
';
11 | header("location: ../login.php");
12 | }
13 | }
14 | ?>
--------------------------------------------------------------------------------
/clientarea/function/signup.php:
--------------------------------------------------------------------------------
1 | 0){
6 | $_SESSION['msg']='
Account already exist.
';
7 | header("location: ../login.php");
8 | }
9 | else{
10 | if($_POST['password']==$_POST['cpassword']){
11 | $sql=mysqli_query($connect,"insert into vhost_client(client_name,client_email,client_password,client_status) values ('".$_POST['name']."','".$_POST['email']."','".password_hash($_POST['password'],PASSWORD_BCRYPT)."','0')");
12 | if($sql>0){
13 | $_SESSION['msg']='
Account Created successfully please check your email inbox
';
14 | $key=md5($_POST['email']);
15 | $uid=$_POST['email'];
16 | include "../mail/signup.php";
17 | header("location: ../login.php");
18 | }
19 | else{
20 | $_SESSION['msg']='
Something wents wrong.
';
21 | header("location: ../login.php");
22 | }
23 | }
24 | else{
25 | $_SESSION['msg']='
Password doesnt match
';
26 | header("location: ../login.php");
27 | }
28 | }
29 | ?>
30 |
--------------------------------------------------------------------------------
/clientarea/home.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
17 |
26 |
35 |
36 |
37 |
38 | Device Information
39 | Client IP: ".UserInfo::get_ip();
42 | echo "Client OS: ".UserInfo::get_device();
43 | echo "Client Browser: ".UserInfo::get_browser();
44 | echo "Service Domain: ".SITE_ADDR;
45 | ?>
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/clientarea/includes/connect.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/clientarea/includes/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/clientarea/index.php:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/clientarea/login.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
Login -
11 |
12 |
13 |
14 |
15 |
16 |
50 |
51 |
52 |
58 |
--------------------------------------------------------------------------------
/clientarea/mail/deactivateaccount.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
5 | $mail->isSMTP();
6 | $mail->Host=MAIL_HOST;
7 | $mail->SMTPAuth=true;
8 | $mail->Username=MAIL_USER;
9 | $mail->Password=MAIL_PASS;
10 | $mail->SMTPSecure='tls';
11 | $mail->Port=MAIL_PORT;
12 | $mail->From=MAIL_USER;
13 | $mail->FromName=SITE_NAME;
14 | $mail->addAddress($_COOKIE['client']);
15 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
16 | $mail->WordWrap=10000;
17 | $mail->isHTML(true);
18 | $host=$_SERVER['HTTP_HOST'];
19 | $mail->Subject='Account Deactivated';
20 | $deactivate="
21 |
22 |
23 |
Deactivate Account
24 |
Hi there, We had a good time with you while you were with us your account have been deactivate successfully and all files and database will be deleted within 30 days.
25 |
26 |
please create a new account if you want to host with us again❤
27 |
Regards ".SITE_NAME."
28 |
29 |
Need our help? We are here to help you out!
30 |
31 |
";
32 | $mail->Body=$deactivate;
33 | $mail->send();
34 | ?>
--------------------------------------------------------------------------------
/clientarea/mail/forget.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
5 | $mail->isSMTP();
6 | $mail->Host=MAIL_HOST;
7 | $mail->SMTPAuth=true;
8 | $mail->Username=MAIL_USER;
9 | $mail->Password=MAIL_PASS;
10 | $mail->SMTPSecure='tls';
11 | $mail->Port=MAIL_PORT;
12 | $mail->From=MAIL_USER;
13 | $mail->FromName=SITE_NAME;
14 | $mail->addAddress($_COOKIE['client']);
15 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
16 | $mail->WordWrap=10000;
17 | $mail->isHTML(true);
18 | $mail->Subject='Forget Password';
19 | $host=$_SERVER['HTTP_HOST'];
20 | $link="https://$host/clientarea/reset.php?uid=$uid&key=$key&reset=true";
21 | $newaccount="
22 |
23 |
24 |
Reset Password
25 |
Hi there, You have requested a password reset if you have not requested a password reset please let us know by replying this email.
26 |
Reset Password
27 |
28 |
After changing password please login to your account❤
29 |
Regards ".SITE_NAME."
30 |
31 |
Need our help? We are here to help you out!
32 |
33 |
";
34 | $mail->Body=$newaccount;
35 | $mail->send();
36 | ?>
--------------------------------------------------------------------------------
/clientarea/mail/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/clientarea/mail/newaccount.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
5 | $mail->isSMTP();
6 | $mail->Host=MAIL_HOST;
7 | $mail->SMTPAuth=true;
8 | $mail->Username=MAIL_USER;
9 | $mail->Password=MAIL_PASS;
10 | $mail->SMTPSecure='tls';
11 | $mail->Port=MAIL_PORT;
12 | $mail->From=MAIL_USER;
13 | $mail->FromName=SITE_NAME;
14 | $mail->addAddress($_COOKIE['client']);
15 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
16 | $mail->WordWrap=10000;
17 | $mail->isHTML(true);
18 | $mail->Subject='Account Created';
19 | $newaccount="
20 |
21 |
22 |
23 |
35 |
36 |
Dear Client!
37 |
You have created new free web hosting account from our service EraHost and we hope you will use our service according to the guidelines given in the TOS page
38 |
39 |
Account Information
40 |
cPanel Username: $uname
41 | cPanel Password: $passwd
42 | cPanel URL: https://cpanel.erahost.ml
43 |
FTP Information
44 |
FTP Username: $uname
45 | FTP Password: $passwd
46 | FTP Hostname: ftpupload.net
47 | FTP Port: 21
48 |
MySQL Information
49 |
MySQL Username: $uname
50 | MySQL Password: $passwd
51 | MySQL Hostname: sql112.erahost.ml
52 | MySQL Port: 3306
53 |
54 |
Nameservers Information
55 |
You need to set your domain nameservers to given nameservers
56 | NS1: ns1.flexhost.ga
57 | NS2: ns2.flexhost.ga
58 |
59 | Best Regards EraHost
60 |
61 |
62 | ";
63 | $mail->Body=$newaccount;
64 | $mail->send();
65 | ?>
--------------------------------------------------------------------------------
/clientarea/mail/newticket.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
5 | $mail->isSMTP();
6 | $mail->Host=MAIL_HOST;
7 | $mail->SMTPAuth=true;
8 | $mail->Username=MAIL_USER;
9 | $mail->Password=MAIL_PASS;
10 | $mail->SMTPSecure='tls';
11 | $mail->Port=MAIL_PORT;
12 | $mail->From=MAIL_USER;
13 | $mail->FromName=SITE_NAME;
14 | $mail->addAddress(MAIL_USER);
15 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
16 | $mail->WordWrap=10000;
17 | $mail->isHTML(true);
18 | $mail->Subject='New Ticket #'.$_POST['tid'];
19 | $host=$_SERVER['HTTP_HOST'];
20 | $newaccount="
21 |
22 |
23 |
New Ticket
24 |
Hi there, You have created a support ticket we do love to reply you and help you in any case currently your ticket is under queue once our support department finds your ticket we will get in touch with you❤.
25 |
Regards ".SITE_NAME."
26 |
27 |
Need our help? We are here to help you out!
28 |
29 |
";
30 | $mail->Body=$newaccount;
31 | $mail->send();
32 | ?>
--------------------------------------------------------------------------------
/clientarea/mail/signup.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
5 | $mail->isSMTP();
6 | $mail->Host=MAIL_HOST;
7 | $mail->SMTPAuth=true;
8 | $mail->Username=MAIL_USER;
9 | $mail->Password=MAIL_PASS;
10 | $mail->SMTPSecure='tls';
11 | $mail->Port=MAIL_PORT;
12 | $mail->From=MAIL_USER;
13 | $mail->FromName=SITE_NAME;
14 | $mail->addAddress($_POST['email']);
15 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
16 | $mail->WordWrap=10000;
17 | $mail->isHTML(true);
18 | $mail->Subject='Activate Account';
19 | $host=$_SERVER['HTTP_HOST'];
20 | $link="https://".$_SERVER['HTTP_HOST']."/clientarea/activate.php?key=$key&uid=$uid&activate=true";
21 | $mail->Body="
22 |
23 |
Activate Account
24 |
Hi there, We'll like you to be a member of our service please click on the button below inorder to verify your account.
25 |
Confirm Account
26 |
27 |
After confirming account please login to your account❤
28 |
Regards ".SITE_NAME."
29 |
30 |
Need our help? We are here to help you out!
31 |
32 |
";
33 | $mail->send();
34 | ?>
35 |
--------------------------------------------------------------------------------
/clientarea/mail/ticket.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
5 | $mail->isSMTP();
6 | $mail->Host=MAIL_HOST;
7 | $mail->SMTPAuth=true;
8 | $mail->Username=MAIL_USER;
9 | $mail->Password=MAIL_PASS;
10 | $mail->SMTPSecure='tls';
11 | $mail->Port=MAIL_PORT;
12 | $mail->From=MAIL_USER;
13 | $mail->FromName=SITE_NAME;
14 | $mail->addAddress(MAIL_USER);
15 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
16 | $mail->WordWrap=10000;
17 | $mail->isHTML(true);
18 | $mail->Subject='Ticket #'.$_POST['tid'];
19 | $host=$_SERVER['HTTP_HOST'];
20 | $link="https://".$host."/clientarea/ticket.php?tid=".$_POST['tid'];
21 | $newaccount="
22 |
23 |
24 |
Ticket Reply
25 |
Hi there, You would like to know that you have received a message from our support depatment to view full message click on the button below.
26 |
View Ticket
27 |
28 |
If you have any other question please let us know❤
29 |
Regards ".SITE_NAME."
30 |
31 |
Need our help? We are here to help you out!
32 |
33 |
";
34 | $mail->Body=$newaccount;
35 | $mail->send();
36 | ?>
--------------------------------------------------------------------------------
/clientarea/newssl.php:
--------------------------------------------------------------------------------
1 |
6 |
57 |
--------------------------------------------------------------------------------
/clientarea/resend.php:
--------------------------------------------------------------------------------
1 | SMTPDebug=false;
7 | $mail->isSMTP();
8 | $mail->Host=MAIL_HOST;
9 | $mail->SMTPAuth=true;
10 | $mail->Username=MAIL_USER;
11 | $mail->Password=MAIL_PASS;
12 | $mail->SMTPSecure='tls';
13 | $mail->Port=MAIL_PORT;
14 | $mail->From=MAIL_USER;
15 | $mail->FromName=SITE_NAME;
16 | $mail->addAddress($_COOKIE['client']);
17 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
18 | $mail->WordWrap=10000;
19 | $mail->isHTML(true);
20 | $mail->Subject='Activate Account';
21 | $host=$_SERVER['HTTP_HOST'];
22 | $link="https://".$_SERVER['HTTP_HOST']."/clientarea/activate.php?key=".md5($_GET['uid'])."&uid=".$_GET['uid']."&activate=true";
23 | $mail->Body="
24 |
25 |
26 |
Activate Account
27 |
Hi there, We'll like you to be a member of our service please click on the button below inorder to verify your account.
28 |
Confirm Account
29 |
30 |
After confirming account please login to your account❤
31 |
Regards ".SITE_NAME."
32 |
33 |
Need our help? We are here to help you out!
34 |
35 |
36 | ";
37 | $mail->send();
38 | header("location: home.php");
39 | }
40 | ?>
41 |
--------------------------------------------------------------------------------
/clientarea/reset.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
Reset Password -
9 |
10 |
11 |
12 |
13 |
14 |
43 |
--------------------------------------------------------------------------------
/clientarea/signup.php:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
Client Signup -
8 |
9 |
10 |
11 |
12 |
13 |
48 |
49 |
50 |
56 |
--------------------------------------------------------------------------------
/clientarea/ssls.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
SSL
11 |
Create SSL
12 |
13 |
14 |
15 |
16 | ID
17 | Domain
18 | Status
19 | Method
20 | Action
21 |
22 |
23 |
24 | 0){
27 | while($ssl=mysqli_fetch_assoc($sql)){
28 | $apiClient = new GoGetSSLApi();
29 | $token = $apiClient->auth(SSL_USERNAME,SSL_PASSWORD);
30 | $app = $apiClient->getOrderStatus($ssl['ssl_key']);
31 | $id=$app['order_id'];
32 | $domain=$app['domain'];
33 | $method='DNS';
34 | if($app['status']=='processing'){
35 | $status=" Processing ";
36 | }
37 | elseif($app['status']=='active'){
38 | $status=" Active ";
39 | }
40 | elseif($app['status']=='cancelled'){
41 | $status=" Cancelled ";
42 | }
43 | elseif($app['status']=='expired'){
44 | $status=" Expired ";
45 | }
46 | echo "
47 | #$id
48 | $domain
49 | $status
50 | DNS
51 | Manage
52 | ";
53 | }
54 | }
55 | else{
56 | echo 'No SSL Yet ';
57 | }
58 | ?>
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/clientarea/ticket.php:
--------------------------------------------------------------------------------
1 | 0){
7 | header('location: tickets.php');
8 | }
9 | $ticket=mysqli_fetch_assoc($sl);
10 | ?>
11 |
Ticket #
12 |
13 |
19 |
20 |
21 |
Subject:
22 |
23 |
24 | by on at
25 |
26 |
27 |
28 | 0){
31 | while($app=mysqli_fetch_assoc($sql)){
32 | if($app['reply_by']==0){
33 | $r="Staff";
34 | }
35 | else{
36 | $r=$user['client_name'];
37 | }
38 | ?>
39 |
40 |
41 |
Reply to #
42 |
43 |
44 | by on at
45 |
46 |
47 |
48 |
49 | }
50 | }
51 | ?>
52 |
53 |
54 |
Reply to Ticket
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | You cannot reply to this ticket because this ticket had been closed. if you have any further questions please open another support ticket.
69 |
70 |
71 |
72 |
73 |
74 |
75 | 0){
79 | include "mail/ticket.php";
80 | $_SESSION['msg']='
Reply added successfully.
';
81 | header("location: ./ticket.php?tid=".$_POST['tid']."");
82 | }
83 | else{
84 | $_SESSION['msg']='
Something wents wrong.
';
85 | header("location: ./ticket.php?tid=".$_POST['tid']."");
86 | }
87 | }
88 | ?>
89 |
--------------------------------------------------------------------------------
/clientarea/tickets.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
Tickets
10 |
Create Ticket
11 |
12 |
13 |
14 |
15 | TID
16 | Ticket Date
17 | Status
18 | Action
19 |
20 |
21 |
22 | 0){
25 | while($app=mysqli_fetch_assoc($sql)){
26 | $id=$app['ticket_id'];
27 | $date=$app['ticket_date'];
28 | if($app['ticket_status']==0){
29 | $status="Open";
30 | }
31 | else{
32 | if($app['ticket_status']==1){
33 | $status="Replied";
34 | }
35 | else{
36 | $status="Closed";
37 | }
38 | }
39 | echo "
40 | #$id
41 | $date
42 | $status
43 | Manage
44 | ";
45 | }
46 | }
47 | else{
48 | echo 'No Tickets Yet ';
49 | }
50 | ?>
51 |
52 |
53 |
54 |
tickets found
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/clientarea/validate.php:
--------------------------------------------------------------------------------
1 | Login to continue
';
5 | header("location: ./login.php");
6 | }
7 | else{
8 | $sql=mysqli_query($connect,"select * from vhost_client where client_email='".$_COOKIE['client']."'");
9 | if(mysqli_num_rows($sql)>0){
10 | $user=mysqli_fetch_assoc($sql);
11 | }
12 | else{
13 | header('location: login.php');
14 | }
15 | }
16 | if($user['client_status']!=0){
17 | header('location: index.php');
18 | }
19 | ?>
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
Validation Error
45 |
You need to validate your account before you can use our free hosting service please click on the link that had been sent your registered email address.
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/contact.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
Contact US
12 |
Send message by filling up the form
13 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | General Department
29 | Support Department
30 | Request Feature
31 | Admin Letter
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | SEND
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
Email us:
49 | Phone us:
50 | WhatsApp: +92 309 4428355
51 | Company Location
52 |
53 |
54 |
55 |
56 |
57 |
58 | SMTPDebug=true;
66 | $mail->isSMTP();
67 | $mail->Host=MAIL_HOST;
68 | $mail->SMTPAuth=true;
69 | $mail->Username=MAIL_USER;
70 | $mail->Password=MAIL_PASS;
71 | $mail->SMTPSecure='tls';
72 | $mail->Port=MAIL_PORT;
73 | $mail->From=MAIL_USER;
74 | $mail->FromName=SITE_NAME;
75 | $mail->addAddress('mahtabhassan159@gmail.com');
76 | $mail->addReplyTo(MAIL_USER,SITE_NAME);
77 | $mail->WordWrap=10000;
78 | $mail->isHTML(true);
79 | $mail->Subject=$_POST['subjuct'];
80 | $mail->Body="Email: ".$_POST['email']."
Department: ".$_POST['department']."
Message: ".$_POST['message']."
IP Address: ".$ip;
81 | if($mail->send()){
82 | $_SESSION['msg']='
Message successfully sent!
';
83 | header("Location: ./contact.php");
84 | }
85 | else{
86 | $_SESSION['msg']='
Something wents wrong
';
87 | header("Location: ./contact.php");
88 | }
89 | }
90 | ?>
--------------------------------------------------------------------------------
/error_fix.txt:
--------------------------------------------------------------------------------
1 | /clientarea/mail/signup.php syntax error fixed
2 | /clientarea/cpanel.php line user login restriction
3 | /clientarea/account.php line user access restriction
4 | /clientarea/function/logout.php logout dueration changed
5 | /clientarea/createaccount.php blank error fixed
6 |
--------------------------------------------------------------------------------
/hash_generator.php:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/includes/config.php:
--------------------------------------------------------------------------------
1 | whmcs -> api
16 | define('API_PASS','MOFH WHMCS API Password');// resellerpanel -> whmcs -> api
17 | define('API_PLAN','MOFH Reseller Plan Name');// resellerpanel -> plans -> plan name
18 | // Mail Settings
19 | define('MAIL_PORT','SMTP PORT');// 587
20 | define('MAIL_USER','SMTP Username');// example@example.com
21 | define('MAIL_PASS','SMTP Password');// example123
22 | define('MAIL_HOST','SMTP Host');// smtp.example.com
23 | // SSL Info
24 | define('SSL_USERNAME', 'SSL API Username');
25 | define('SSL_PASSWORD', 'SSL API Password');
26 | ?>
27 |
--------------------------------------------------------------------------------
/includes/footer.php:
--------------------------------------------------------------------------------
1 |
2 |
Forget the stereotypes of free hosting!
3 |
SIGNUP NOW
4 |
5 |
6 |
38 |
39 |
--------------------------------------------------------------------------------
/includes/header.php:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
">
14 |
15 |
16 |
17 |
18 |
/template/image/icon.png" type="image/png" sizes="16x16">
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/includes/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/template/cpanel/img/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/template/cpanel/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/template/css/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/template/image/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NXTS-Developers/PROJECT-HUSTAL/bf245b95f619fd6ee0a39e6019d960295e5f55c4/template/image/icon.png
--------------------------------------------------------------------------------
/template/image/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/template/image/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NXTS-Developers/PROJECT-HUSTAL/bf245b95f619fd6ee0a39e6019d960295e5f55c4/template/image/logo.png
--------------------------------------------------------------------------------
/template/image/sample.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NXTS-Developers/PROJECT-HUSTAL/bf245b95f619fd6ee0a39e6019d960295e5f55c4/template/image/sample.webp
--------------------------------------------------------------------------------
/template/image/server2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NXTS-Developers/PROJECT-HUSTAL/bf245b95f619fd6ee0a39e6019d960295e5f55c4/template/image/server2.jpg
--------------------------------------------------------------------------------
/template/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/template/js/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/autoload.php:
--------------------------------------------------------------------------------
1 |
Oops! There was a problem. Apparently You are using the php version '.phpversion().' a lower version than the one indicated
Anake script requires the php version 5.5.+ ');
7 | }
8 | //
9 | }
10 |
11 | // Protect the entered data function
12 | function setProtect($var) {
13 | $var = htmlspecialchars($var);
14 | $var = htmlentities($var);
15 | return $var;
16 | }
17 |
18 | // Verify Installation
19 | function existInstall() {
20 | $install = dirname(dirname(__FILE__)).'\install.php';
21 | if(file_exists($install)) echo '
Please remove the install.php file from your directory
';
22 | }
23 |
24 |
25 | // autoload.php @generated by Composer
26 | require_once __DIR__.'/composer/autoload_real.php';
27 | return ComposerAutoloaderInitde2463ad17a0d1e0ea230da827613a0f::getLoader();
28 |
--------------------------------------------------------------------------------
/vendor/composer/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Copyright (c) Nils Adermann, Jordi Boggiano
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is furnished
9 | to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_classmap.php:
--------------------------------------------------------------------------------
1 | $vendorDir.'/guzzlehttp/promises/src/functions_include.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir.'/guzzlehttp/psr7/src/functions_include.php',
8 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir.'/guzzlehttp/guzzle/src/functions_include.php',
9 | );
10 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_namespaces.php:
--------------------------------------------------------------------------------
1 | array($vendorDir.'/psr/http-message/src'),
8 | 'HansAdema\\AnakeClient\\Tests\\' => array($vendorDir.'/hansadema/anake-client/tests'),
9 | 'HansAdema\\AnakeClient\\' => array($vendorDir.'/hansadema/anake-client/src'),
10 | 'GuzzleHttp\\Psr7\\' => array($vendorDir.'/guzzlehttp/psr7/src'),
11 | 'GuzzleHttp\\Promise\\' => array($vendorDir.'/guzzlehttp/promises/src'),
12 | 'GuzzleHttp\\' => array($vendorDir.'/guzzlehttp/guzzle/src'),
13 | );
14 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_real.php:
--------------------------------------------------------------------------------
1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
23 | if($useStaticLoader) {
24 | require_once __DIR__.'/autoload_static.php';
25 |
26 | call_user_func(\Composer\Autoload\ComposerStaticInitde2463ad17a0d1e0ea230da827613a0f::getInitializer($loader));
27 | } else {
28 | $map = require __DIR__.'/autoload_namespaces.php';
29 | foreach($map as $namespace => $path) {
30 | $loader->set($namespace, $path);
31 | }
32 |
33 | $map = require __DIR__.'/autoload_psr4.php';
34 | foreach($map as $namespace => $path) {
35 | $loader->setPsr4($namespace, $path);
36 | }
37 |
38 | $classMap = require __DIR__.'/autoload_classmap.php';
39 | if($classMap) {
40 | $loader->addClassMap($classMap);
41 | }
42 | }
43 |
44 | $loader->register(true);
45 |
46 | if($useStaticLoader) {
47 | $includeFiles = Composer\Autoload\ComposerStaticInitde2463ad17a0d1e0ea230da827613a0f::$files;
48 | } else {
49 | $includeFiles = require __DIR__.'/autoload_files.php';
50 | }
51 | foreach($includeFiles as $fileIdentifier => $file) {
52 | composerRequirede2463ad17a0d1e0ea230da827613a0f($fileIdentifier, $file);
53 | }
54 |
55 | return $loader;
56 | }
57 | }
58 |
59 | function composerRequirede2463ad17a0d1e0ea230da827613a0f($fileIdentifier, $file) {
60 | if(empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
61 | require $file;
62 |
63 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
64 | }
65 | }
--------------------------------------------------------------------------------
/vendor/composer/autoload_static.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/..'.'/guzzlehttp/promises/src/functions_include.php',
8 | 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__.'/..'.'/guzzlehttp/psr7/src/functions_include.php',
9 | '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__.'/..'.'/guzzlehttp/guzzle/src/functions_include.php',
10 | );
11 |
12 | public static $prefixLengthsPsr4 = array (
13 | 'P' =>
14 | array (
15 | 'Psr\\Http\\Message\\' => 17,
16 | ),
17 | 'H' =>
18 | array (
19 | 'HansAdema\\AnakeClient\\Tests\\' => 27,
20 | 'HansAdema\\AnakeClient\\' => 21,
21 | ),
22 | 'G' =>
23 | array (
24 | 'GuzzleHttp\\Psr7\\' => 16,
25 | 'GuzzleHttp\\Promise\\' => 19,
26 | 'GuzzleHttp\\' => 11,
27 | ),
28 | );
29 |
30 | public static $prefixDirsPsr4 = array (
31 | 'Psr\\Http\\Message\\' =>
32 | array (
33 | 0 => __DIR__.'/..'.'/psr/http-message/src',
34 | ),
35 | 'HansAdema\\AnakeClient\\Tests\\' =>
36 | array (
37 | 0 => __DIR__.'/..'.'/hansadema/anake-client/tests',
38 | ),
39 | 'HansAdema\\AnakeClient\\' =>
40 | array (
41 | 0 => __DIR__.'/..'.'/hansadema/anake-client/src',
42 | ),
43 | 'GuzzleHttp\\Psr7\\' =>
44 | array (
45 | 0 => __DIR__.'/..'.'/guzzlehttp/psr7/src',
46 | ),
47 | 'GuzzleHttp\\Promise\\' =>
48 | array (
49 | 0 => __DIR__.'/..'.'/guzzlehttp/promises/src',
50 | ),
51 | 'GuzzleHttp\\' =>
52 | array (
53 | 0 => __DIR__.'/..'.'/guzzlehttp/guzzle/src',
54 | ),
55 | );
56 |
57 | public static function getInitializer(ClassLoader $loader) {
58 | return \Closure::bind(function () use ($loader) {
59 | $loader->prefixLengthsPsr4 = ComposerStaticInitde2463ad17a0d1e0ea230da827613a0f::$prefixLengthsPsr4;
60 | $loader->prefixDirsPsr4 = ComposerStaticInitde2463ad17a0d1e0ea230da827613a0f::$prefixDirsPsr4;
61 |
62 | }, null, ClassLoader::class);
63 | }
64 | }
--------------------------------------------------------------------------------
/vendor/composer/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/ClientInterface.php:
--------------------------------------------------------------------------------
1 | filename = $cookieFile;
27 | $this->storeSessionCookies = $storeSessionCookies;
28 |
29 | if (file_exists($cookieFile)) {
30 | $this->load($cookieFile);
31 | }
32 | }
33 |
34 | /**
35 | * Saves the file when shutting down
36 | */
37 | public function __destruct()
38 | {
39 | $this->save($this->filename);
40 | }
41 |
42 | /**
43 | * Saves the cookies to a file.
44 | *
45 | * @param string $filename File to save
46 | * @throws \RuntimeException if the file cannot be found or created
47 | */
48 | public function save($filename)
49 | {
50 | $json = [];
51 | foreach ($this as $cookie) {
52 | /** @var SetCookie $cookie */
53 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
54 | $json[] = $cookie->toArray();
55 | }
56 | }
57 |
58 | $jsonStr = \GuzzleHttp\json_encode($json);
59 | if (false === file_put_contents($filename, $jsonStr)) {
60 | throw new \RuntimeException("Unable to save file {$filename}");
61 | }
62 | }
63 |
64 | /**
65 | * Load cookies from a JSON formatted file.
66 | *
67 | * Old cookies are kept unless overwritten by newly loaded ones.
68 | *
69 | * @param string $filename Cookie file to load.
70 | * @throws \RuntimeException if the file cannot be loaded.
71 | */
72 | public function load($filename)
73 | {
74 | $json = file_get_contents($filename);
75 | if (false === $json) {
76 | throw new \RuntimeException("Unable to load file {$filename}");
77 | } elseif ($json === '') {
78 | return;
79 | }
80 |
81 | $data = \GuzzleHttp\json_decode($json, true);
82 | if (is_array($data)) {
83 | foreach (json_decode($json, true) as $cookie) {
84 | $this->setCookie(new SetCookie($cookie));
85 | }
86 | } elseif (strlen($data)) {
87 | throw new \RuntimeException("Invalid cookie file: {$filename}");
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:
--------------------------------------------------------------------------------
1 | sessionKey = $sessionKey;
26 | $this->storeSessionCookies = $storeSessionCookies;
27 | $this->load();
28 | }
29 |
30 | /**
31 | * Saves cookies to session when shutting down
32 | */
33 | public function __destruct()
34 | {
35 | $this->save();
36 | }
37 |
38 | /**
39 | * Save cookies to the client session
40 | */
41 | public function save()
42 | {
43 | $json = [];
44 | foreach ($this as $cookie) {
45 | /** @var SetCookie $cookie */
46 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
47 | $json[] = $cookie->toArray();
48 | }
49 | }
50 |
51 | $_SESSION[$this->sessionKey] = json_encode($json);
52 | }
53 |
54 | /**
55 | * Load the contents of the client session into the data array
56 | */
57 | protected function load()
58 | {
59 | if (!isset($_SESSION[$this->sessionKey])) {
60 | return;
61 | }
62 | $data = json_decode($_SESSION[$this->sessionKey], true);
63 | if (is_array($data)) {
64 | foreach ($data as $cookie) {
65 | $this->setCookie(new SetCookie($cookie));
66 | }
67 | } elseif (strlen($data)) {
68 | throw new \RuntimeException("Invalid cookie data");
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Cookie/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Cookie/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:
--------------------------------------------------------------------------------
1 | stream = $stream;
16 | $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
17 | parent::__construct($msg);
18 | }
19 |
20 | /**
21 | * @return StreamInterface
22 | */
23 | public function getStream()
24 | {
25 | return $this->stream;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Exception/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php:
--------------------------------------------------------------------------------
1 | factory = isset($options['handle_factory'])
29 | ? $options['handle_factory']
30 | : new CurlFactory(3);
31 | }
32 |
33 | public function __invoke(RequestInterface $request, array $options)
34 | {
35 | if (isset($options['delay'])) {
36 | usleep($options['delay'] * 1000);
37 | }
38 |
39 | $easy = $this->factory->create($request, $options);
40 | curl_exec($easy->handle);
41 | $easy->errno = curl_errno($easy->handle);
42 |
43 | return CurlFactory::finish($this, $easy, $this->factory);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php:
--------------------------------------------------------------------------------
1 | headers)) {
48 | throw new \RuntimeException('No headers have been received');
49 | }
50 |
51 | // HTTP-version SP status-code SP reason-phrase
52 | $startLine = explode(' ', array_shift($this->headers), 3);
53 | $headers = \GuzzleHttp\headers_from_lines($this->headers);
54 | $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
55 |
56 | if (!empty($this->options['decode_content'])
57 | && isset($normalizedKeys['content-encoding'])
58 | ) {
59 | $headers['x-encoded-content-encoding']
60 | = $headers[$normalizedKeys['content-encoding']];
61 | unset($headers[$normalizedKeys['content-encoding']]);
62 | if (isset($normalizedKeys['content-length'])) {
63 | $headers['x-encoded-content-length']
64 | = $headers[$normalizedKeys['content-length']];
65 |
66 | $bodyLength = (int) $this->sink->getSize();
67 | if ($bodyLength) {
68 | $headers[$normalizedKeys['content-length']] = $bodyLength;
69 | } else {
70 | unset($headers[$normalizedKeys['content-length']]);
71 | }
72 | }
73 | }
74 |
75 | // Attach a response to the easy handle with the parsed headers.
76 | $this->response = new Response(
77 | $startLine[1],
78 | $headers,
79 | $this->sink,
80 | substr($startLine[0], 5),
81 | isset($startLine[2]) ? (string) $startLine[2] : null
82 | );
83 | }
84 |
85 | public function __get($name)
86 | {
87 | $msg = $name === 'handle'
88 | ? 'The EasyHandle has been released'
89 | : 'Invalid property: ' . $name;
90 | throw new \BadMethodCallException($msg);
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/Handler/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:
--------------------------------------------------------------------------------
1 | nextHandler = $nextHandler;
23 | }
24 |
25 | /**
26 | * @param RequestInterface $request
27 | * @param array $options
28 | *
29 | * @return PromiseInterface
30 | */
31 | public function __invoke(RequestInterface $request, array $options)
32 | {
33 | $fn = $this->nextHandler;
34 |
35 | // Don't do anything if the request has no body.
36 | if ($request->getBody()->getSize() === 0) {
37 | return $fn($request, $options);
38 | }
39 |
40 | $modify = [];
41 |
42 | // Add a default content-type if possible.
43 | if (!$request->hasHeader('Content-Type')) {
44 | if ($uri = $request->getBody()->getMetadata('uri')) {
45 | if ($type = Psr7\mimetype_from_filename($uri)) {
46 | $modify['set_headers']['Content-Type'] = $type;
47 | }
48 | }
49 | }
50 |
51 | // Add a default content-length or transfer-encoding header.
52 | if (!$request->hasHeader('Content-Length')
53 | && !$request->hasHeader('Transfer-Encoding')
54 | ) {
55 | $size = $request->getBody()->getSize();
56 | if ($size !== null) {
57 | $modify['set_headers']['Content-Length'] = $size;
58 | } else {
59 | $modify['set_headers']['Transfer-Encoding'] = 'chunked';
60 | }
61 | }
62 |
63 | // Add the expect header if needed.
64 | $this->addExpectHeader($request, $options, $modify);
65 |
66 | return $fn(Psr7\modify_request($request, $modify), $options);
67 | }
68 |
69 | private function addExpectHeader(
70 | RequestInterface $request,
71 | array $options,
72 | array &$modify
73 | ) {
74 | // Determine if the Expect header should be used
75 | if ($request->hasHeader('Expect')) {
76 | return;
77 | }
78 |
79 | $expect = isset($options['expect']) ? $options['expect'] : null;
80 |
81 | // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
82 | if ($expect === false || $request->getProtocolVersion() < 1.1) {
83 | return;
84 | }
85 |
86 | // The expect header is unconditionally enabled
87 | if ($expect === true) {
88 | $modify['set_headers']['Expect'] = '100-Continue';
89 | return;
90 | }
91 |
92 | // By default, send the expect header when the payload is > 1mb
93 | if ($expect === null) {
94 | $expect = 1048576;
95 | }
96 |
97 | // Always add if the body cannot be rewound, the size cannot be
98 | // determined, or the size is greater than the cutoff threshold
99 | $body = $request->getBody();
100 | $size = $body->getSize();
101 |
102 | if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
103 | $modify['set_headers']['Expect'] = '100-Continue';
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php:
--------------------------------------------------------------------------------
1 | decider = $decider;
38 | $this->nextHandler = $nextHandler;
39 | $this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
40 | }
41 |
42 | /**
43 | * Default exponential backoff delay function.
44 | *
45 | * @param $retries
46 | *
47 | * @return int
48 | */
49 | public static function exponentialDelay($retries)
50 | {
51 | return (int) pow(2, $retries - 1);
52 | }
53 |
54 | /**
55 | * @param RequestInterface $request
56 | * @param array $options
57 | *
58 | * @return PromiseInterface
59 | */
60 | public function __invoke(RequestInterface $request, array $options)
61 | {
62 | if (!isset($options['retries'])) {
63 | $options['retries'] = 0;
64 | }
65 |
66 | $fn = $this->nextHandler;
67 | return $fn($request, $options)
68 | ->then(
69 | $this->onFulfilled($request, $options),
70 | $this->onRejected($request, $options)
71 | );
72 | }
73 |
74 | private function onFulfilled(RequestInterface $req, array $options)
75 | {
76 | return function ($value) use ($req, $options) {
77 | if (!call_user_func(
78 | $this->decider,
79 | $options['retries'],
80 | $req,
81 | $value,
82 | null
83 | )) {
84 | return $value;
85 | }
86 | return $this->doRetry($req, $options, $value);
87 | };
88 | }
89 |
90 | private function onRejected(RequestInterface $req, array $options)
91 | {
92 | return function ($reason) use ($req, $options) {
93 | if (!call_user_func(
94 | $this->decider,
95 | $options['retries'],
96 | $req,
97 | null,
98 | $reason
99 | )) {
100 | return \GuzzleHttp\Promise\rejection_for($reason);
101 | }
102 | return $this->doRetry($req, $options);
103 | };
104 | }
105 |
106 | private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
107 | {
108 | $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
109 |
110 | return $this($request, $options);
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/TransferStats.php:
--------------------------------------------------------------------------------
1 | request = $request;
35 | $this->response = $response;
36 | $this->transferTime = $transferTime;
37 | $this->handlerErrorData = $handlerErrorData;
38 | $this->handlerStats = $handlerStats;
39 | }
40 |
41 | /**
42 | * @return RequestInterface
43 | */
44 | public function getRequest()
45 | {
46 | return $this->request;
47 | }
48 |
49 | /**
50 | * Returns the response that was received (if any).
51 | *
52 | * @return ResponseInterface|null
53 | */
54 | public function getResponse()
55 | {
56 | return $this->response;
57 | }
58 |
59 | /**
60 | * Returns true if a response was received.
61 | *
62 | * @return bool
63 | */
64 | public function hasResponse()
65 | {
66 | return $this->response !== null;
67 | }
68 |
69 | /**
70 | * Gets handler specific error data.
71 | *
72 | * This might be an exception, a integer representing an error code, or
73 | * anything else. Relying on this value assumes that you know what handler
74 | * you are using.
75 | *
76 | * @return mixed
77 | */
78 | public function getHandlerErrorData()
79 | {
80 | return $this->handlerErrorData;
81 | }
82 |
83 | /**
84 | * Get the effective URI the request was sent to.
85 | *
86 | * @return UriInterface
87 | */
88 | public function getEffectiveUri()
89 | {
90 | return $this->request->getUri();
91 | }
92 |
93 | /**
94 | * Get the estimated time the request was being transferred by the handler.
95 | *
96 | * @return float Time in seconds.
97 | */
98 | public function getTransferTime()
99 | {
100 | return $this->transferTime;
101 | }
102 |
103 | /**
104 | * Gets an array of all of the handler specific transfer data.
105 | *
106 | * @return array
107 | */
108 | public function getHandlerStats()
109 | {
110 | return $this->handlerStats;
111 | }
112 |
113 | /**
114 | * Get a specific handler statistic from the handler by name.
115 | *
116 | * @param string $stat Handler specific transfer stat to retrieve.
117 | *
118 | * @return mixed|null
119 | */
120 | public function getHandlerStat($stat)
121 | {
122 | return isset($this->handlerStats[$stat])
123 | ? $this->handlerStats[$stat]
124 | : null;
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/functions_include.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/guzzle/src/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/AggregateException.php:
--------------------------------------------------------------------------------
1 | value = $value;
22 | }
23 |
24 | public function then(
25 | callable $onFulfilled = null,
26 | callable $onRejected = null
27 | ) {
28 | // Return itself if there is no onFulfilled function.
29 | if (!$onFulfilled) {
30 | return $this;
31 | }
32 |
33 | $queue = queue();
34 | $p = new Promise([$queue, 'run']);
35 | $value = $this->value;
36 | $queue->add(static function () use ($p, $value, $onFulfilled) {
37 | if ($p->getState() === self::PENDING) {
38 | try {
39 | $p->resolve($onFulfilled($value));
40 | } catch (\Throwable $e) {
41 | $p->reject($e);
42 | } catch (\Exception $e) {
43 | $p->reject($e);
44 | }
45 | }
46 | });
47 |
48 | return $p;
49 | }
50 |
51 | public function otherwise(callable $onRejected)
52 | {
53 | return $this->then(null, $onRejected);
54 | }
55 |
56 | public function wait($unwrap = true, $defaultDelivery = null)
57 | {
58 | return $unwrap ? $this->value : null;
59 | }
60 |
61 | public function getState()
62 | {
63 | return self::FULFILLED;
64 | }
65 |
66 | public function resolve($value)
67 | {
68 | if ($value !== $this->value) {
69 | throw new \LogicException("Cannot resolve a fulfilled promise");
70 | }
71 | }
72 |
73 | public function reject($reason)
74 | {
75 | throw new \LogicException("Cannot reject a fulfilled promise");
76 | }
77 |
78 | public function cancel()
79 | {
80 | // pass
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/PromiseInterface.php:
--------------------------------------------------------------------------------
1 | reason = $reason;
22 | }
23 |
24 | public function then(
25 | callable $onFulfilled = null,
26 | callable $onRejected = null
27 | ) {
28 | // If there's no onRejected callback then just return self.
29 | if (!$onRejected) {
30 | return $this;
31 | }
32 |
33 | $queue = queue();
34 | $reason = $this->reason;
35 | $p = new Promise([$queue, 'run']);
36 | $queue->add(static function () use ($p, $reason, $onRejected) {
37 | if ($p->getState() === self::PENDING) {
38 | try {
39 | // Return a resolved promise if onRejected does not throw.
40 | $p->resolve($onRejected($reason));
41 | } catch (\Throwable $e) {
42 | // onRejected threw, so return a rejected promise.
43 | $p->reject($e);
44 | } catch (\Exception $e) {
45 | // onRejected threw, so return a rejected promise.
46 | $p->reject($e);
47 | }
48 | }
49 | });
50 |
51 | return $p;
52 | }
53 |
54 | public function otherwise(callable $onRejected)
55 | {
56 | return $this->then(null, $onRejected);
57 | }
58 |
59 | public function wait($unwrap = true, $defaultDelivery = null)
60 | {
61 | if ($unwrap) {
62 | throw exception_for($this->reason);
63 | }
64 | }
65 |
66 | public function getState()
67 | {
68 | return self::REJECTED;
69 | }
70 |
71 | public function resolve($value)
72 | {
73 | throw new \LogicException("Cannot resolve a rejected promise");
74 | }
75 |
76 | public function reject($reason)
77 | {
78 | if ($reason !== $this->reason) {
79 | throw new \LogicException("Cannot reject a rejected promise");
80 | }
81 | }
82 |
83 | public function cancel()
84 | {
85 | // pass
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/RejectionException.php:
--------------------------------------------------------------------------------
1 | reason = $reason;
21 |
22 | $message = 'The promise was rejected';
23 |
24 | if ($description) {
25 | $message .= ' with reason: ' . $description;
26 | } elseif (is_string($reason)
27 | || (is_object($reason) && method_exists($reason, '__toString'))
28 | ) {
29 | $message .= ' with reason: ' . $this->reason;
30 | } elseif ($reason instanceof \JsonSerializable) {
31 | $message .= ' with reason: '
32 | . json_encode($this->reason, JSON_PRETTY_PRINT);
33 | }
34 |
35 | parent::__construct($message);
36 | }
37 |
38 | /**
39 | * Returns the rejection reason.
40 | *
41 | * @return mixed
42 | */
43 | public function getReason()
44 | {
45 | return $this->reason;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/TaskQueue.php:
--------------------------------------------------------------------------------
1 | run();
12 | */
13 | class TaskQueue implements TaskQueueInterface
14 | {
15 | private $enableShutdown = true;
16 | private $queue = [];
17 |
18 | public function __construct($withShutdown = true)
19 | {
20 | if ($withShutdown) {
21 | register_shutdown_function(function () {
22 | if ($this->enableShutdown) {
23 | // Only run the tasks if an E_ERROR didn't occur.
24 | $err = error_get_last();
25 | if (!$err || ($err['type'] ^ E_ERROR)) {
26 | $this->run();
27 | }
28 | }
29 | });
30 | }
31 | }
32 |
33 | public function isEmpty()
34 | {
35 | return !$this->queue;
36 | }
37 |
38 | public function add(callable $task)
39 | {
40 | $this->queue[] = $task;
41 | }
42 |
43 | public function run()
44 | {
45 | /** @var callable $task */
46 | while ($task = array_shift($this->queue)) {
47 | $task();
48 | }
49 | }
50 |
51 | /**
52 | * The task queue will be run and exhausted by default when the process
53 | * exits IFF the exit is not the result of a PHP E_ERROR error.
54 | *
55 | * You can disable running the automatic shutdown of the queue by calling
56 | * this function. If you disable the task queue shutdown process, then you
57 | * MUST either run the task queue (as a result of running your event loop
58 | * or manually using the run() method) or wait on each outstanding promise.
59 | *
60 | * Note: This shutdown will occur before any destructors are triggered.
61 | */
62 | public function disableShutdown()
63 | {
64 | $this->enableShutdown = false;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/TaskQueueInterface.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/src/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/promises/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/BufferStream.php:
--------------------------------------------------------------------------------
1 | hwm = $hwm;
29 | }
30 |
31 | public function __toString()
32 | {
33 | return $this->getContents();
34 | }
35 |
36 | public function getContents()
37 | {
38 | $buffer = $this->buffer;
39 | $this->buffer = '';
40 |
41 | return $buffer;
42 | }
43 |
44 | public function close()
45 | {
46 | $this->buffer = '';
47 | }
48 |
49 | public function detach()
50 | {
51 | $this->close();
52 | }
53 |
54 | public function getSize()
55 | {
56 | return strlen($this->buffer);
57 | }
58 |
59 | public function isReadable()
60 | {
61 | return true;
62 | }
63 |
64 | public function isWritable()
65 | {
66 | return true;
67 | }
68 |
69 | public function isSeekable()
70 | {
71 | return false;
72 | }
73 |
74 | public function rewind()
75 | {
76 | $this->seek(0);
77 | }
78 |
79 | public function seek($offset, $whence = SEEK_SET)
80 | {
81 | throw new \RuntimeException('Cannot seek a BufferStream');
82 | }
83 |
84 | public function eof()
85 | {
86 | return strlen($this->buffer) === 0;
87 | }
88 |
89 | public function tell()
90 | {
91 | throw new \RuntimeException('Cannot determine the position of a BufferStream');
92 | }
93 |
94 | /**
95 | * Reads data from the buffer.
96 | */
97 | public function read($length)
98 | {
99 | $currentLength = strlen($this->buffer);
100 |
101 | if ($length >= $currentLength) {
102 | // No need to slice the buffer because we don't have enough data.
103 | $result = $this->buffer;
104 | $this->buffer = '';
105 | } else {
106 | // Slice up the result to provide a subset of the buffer.
107 | $result = substr($this->buffer, 0, $length);
108 | $this->buffer = substr($this->buffer, $length);
109 | }
110 |
111 | return $result;
112 | }
113 |
114 | /**
115 | * Writes data to the buffer.
116 | */
117 | public function write($string)
118 | {
119 | $this->buffer .= $string;
120 |
121 | // TODO: What should happen here?
122 | if (strlen($this->buffer) >= $this->hwm) {
123 | return false;
124 | }
125 |
126 | return strlen($string);
127 | }
128 |
129 | public function getMetadata($key = null)
130 | {
131 | if ($key == 'hwm') {
132 | return $this->hwm;
133 | }
134 |
135 | return $key ? null : [];
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/DroppingStream.php:
--------------------------------------------------------------------------------
1 | stream = $stream;
23 | $this->maxLength = $maxLength;
24 | }
25 |
26 | public function write($string)
27 | {
28 | $diff = $this->maxLength - $this->stream->getSize();
29 |
30 | // Begin returning 0 when the underlying stream is too large.
31 | if ($diff <= 0) {
32 | return 0;
33 | }
34 |
35 | // Write the stream or a subset of the stream if needed.
36 | if (strlen($string) < $diff) {
37 | return $this->stream->write($string);
38 | }
39 |
40 | return $this->stream->write(substr($string, 0, $diff));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/InflateStream.php:
--------------------------------------------------------------------------------
1 | read(10);
25 | $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
26 | // Skip the header, that is 10 + length of filename + 1 (nil) bytes
27 | $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
28 | $resource = StreamWrapper::getResource($stream);
29 | stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
30 | $this->stream = new Stream($resource);
31 | }
32 |
33 | /**
34 | * @param StreamInterface $stream
35 | * @param $header
36 | * @return int
37 | */
38 | private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
39 | {
40 | $filename_header_length = 0;
41 |
42 | if (substr(bin2hex($header), 6, 2) === '08') {
43 | // we have a filename, read until nil
44 | $filename_header_length = 1;
45 | while ($stream->read(1) !== chr(0)) {
46 | $filename_header_length++;
47 | }
48 | }
49 |
50 | return $filename_header_length;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:
--------------------------------------------------------------------------------
1 | filename = $filename;
27 | $this->mode = $mode;
28 | }
29 |
30 | /**
31 | * Creates the underlying stream lazily when required.
32 | *
33 | * @return StreamInterface
34 | */
35 | protected function createStream()
36 | {
37 | return stream_for(try_fopen($this->filename, $this->mode));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/NoSeekStream.php:
--------------------------------------------------------------------------------
1 | isReadable()) {
33 | $mode = $stream->isWritable() ? 'r+' : 'r';
34 | } elseif ($stream->isWritable()) {
35 | $mode = 'w';
36 | } else {
37 | throw new \InvalidArgumentException('The stream must be readable, '
38 | . 'writable, or both.');
39 | }
40 |
41 | return fopen('guzzle://stream', $mode, null, stream_context_create([
42 | 'guzzle' => ['stream' => $stream]
43 | ]));
44 | }
45 |
46 | /**
47 | * Registers the stream wrapper if needed
48 | */
49 | public static function register()
50 | {
51 | if (!in_array('guzzle', stream_get_wrappers())) {
52 | stream_wrapper_register('guzzle', __CLASS__);
53 | }
54 | }
55 |
56 | public function stream_open($path, $mode, $options, &$opened_path)
57 | {
58 | $options = stream_context_get_options($this->context);
59 |
60 | if (!isset($options['guzzle']['stream'])) {
61 | return false;
62 | }
63 |
64 | $this->mode = $mode;
65 | $this->stream = $options['guzzle']['stream'];
66 |
67 | return true;
68 | }
69 |
70 | public function stream_read($count)
71 | {
72 | return $this->stream->read($count);
73 | }
74 |
75 | public function stream_write($data)
76 | {
77 | return (int) $this->stream->write($data);
78 | }
79 |
80 | public function stream_tell()
81 | {
82 | return $this->stream->tell();
83 | }
84 |
85 | public function stream_eof()
86 | {
87 | return $this->stream->eof();
88 | }
89 |
90 | public function stream_seek($offset, $whence)
91 | {
92 | $this->stream->seek($offset, $whence);
93 |
94 | return true;
95 | }
96 |
97 | public function stream_stat()
98 | {
99 | static $modeMap = [
100 | 'r' => 33060,
101 | 'r+' => 33206,
102 | 'w' => 33188
103 | ];
104 |
105 | return [
106 | 'dev' => 0,
107 | 'ino' => 0,
108 | 'mode' => $modeMap[$this->mode],
109 | 'nlink' => 0,
110 | 'uid' => 0,
111 | 'gid' => 0,
112 | 'rdev' => 0,
113 | 'size' => $this->stream->getSize() ?: 0,
114 | 'atime' => 0,
115 | 'mtime' => 0,
116 | 'ctime' => 0,
117 | 'blksize' => 0,
118 | 'blocks' => 0
119 | ];
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/functions_include.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/src/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/psr7/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/guzzlehttp/test:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Exception/InvalidRequestException.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/AbstractResponse.php:
--------------------------------------------------------------------------------
1 | request = $request;
34 | $this->response = $response;
35 |
36 | $this->parseResponse();
37 | }
38 |
39 | /**
40 | * Parse the response after it has been received.
41 | */
42 | protected function parseResponse() {
43 | $data = (string)$this->response->getBody();
44 |
45 | if(strpos(trim($data), '<') !== 0) {
46 | $this->data = null;
47 | } else {
48 | $this->data = $this->xmlToArray((array)simplexml_load_string($data));
49 | }
50 | }
51 |
52 | /**
53 | * Get the response data.
54 | *
55 | * @return array|null
56 | */
57 | public function getData() {
58 | return $this->data;
59 | }
60 |
61 | /**
62 | * Recursively convert a SimpleXMLElement array to regular arrays
63 | *
64 | * @param array $input
65 | * @return array
66 | */
67 | protected function xmlToArray($input) {
68 | foreach($input as $key => $value) {
69 | if($value instanceof \SimpleXMLElement) {
70 | $value = (array)$value;
71 | }
72 |
73 | if(is_array($value)) {
74 | $input[$key] = $this->xmlToArray($value);
75 | }
76 | }
77 |
78 | return $input;
79 | }
80 |
81 | /**
82 | * Get the error message from the response if the call failed.
83 | *
84 | * @return string
85 | */
86 | public function getMessage() {
87 | if(is_array($this->getData()) && is_array($this->getData()['result']['statusmsg'])) {
88 | return empty($this->getData()['result']['status']) ? trim($this->getData()['result']['statusmsg']) : $this->getData()['result']['statusmsg'];
89 | } else {
90 | return (string)trim($this->response->getBody());
91 | }
92 | }
93 |
94 | /**
95 | * Whether the action was successful
96 | *
97 | * @return bool
98 | */
99 | public function isSuccessful() {
100 | if ($this->getData() && isset($this->getData()['result']['status'])) {
101 | return $this->getData()['result']['status'] == 1;
102 | } else {
103 | return false;
104 | }
105 | }
106 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/AvailabilityRequest.php:
--------------------------------------------------------------------------------
1 | getParameter('domain');
7 | }
8 |
9 | public function setDomain($domain) {
10 | return $this->setParameter('domain', $domain);
11 | }
12 |
13 | public function sendData($data) {
14 | $httpResponse = $this->sendRequest('checkavailable', $data);
15 |
16 | return $this->response = new AvailabilityResponse($this, $httpResponse);
17 | }
18 |
19 | public function getData() {
20 | $this->validate('apiUsername', 'apiPassword', 'apiUrl', 'domain');
21 |
22 | return [
23 | 'api_user' => $this->getApiUsername(),
24 | 'api_key' => $this->getApiPassword(),
25 | 'domain' => $this->getDomain(),
26 | ];
27 | }
28 |
29 | protected function sendRequest($function, array $parameters) {
30 | return $this->httpClient->get($this->getApiUrl().$function, [
31 | 'query' => $parameters,
32 | 'verify' => false,
33 | ]);
34 | }
35 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/AvailabilityResponse.php:
--------------------------------------------------------------------------------
1 | data = (string)$this->response->getBody();
8 | }
9 |
10 | public function getMessage() {
11 | return $this->getData();
12 | }
13 |
14 | /**
15 | * Whether the domain name is available for registration.
16 | *
17 | * @return bool
18 | */
19 | public function isSuccessful() {
20 | return $this->data === '1';
21 | }
22 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/CreateAccountRequest.php:
--------------------------------------------------------------------------------
1 | getParameter('password');
7 | }
8 |
9 | public function setPassword($password) {
10 | return $this->setParameter('password', $password);
11 | }
12 |
13 | public function getEmail() {
14 | return $this->getParameter('email');
15 | }
16 |
17 | public function setEmail($email) {
18 | return $this->setParameter('email', $email);
19 | }
20 |
21 | public function getDomain() {
22 | return $this->getParameter('domain');
23 | }
24 |
25 | public function setDomain($domain) {
26 | return $this->setParameter('domain', $domain);
27 | }
28 |
29 | public function getPlan() {
30 | return $this->getParameter('plan');
31 | }
32 |
33 | public function setPlan($plan) {
34 | return $this->setParameter('plan', $plan);
35 | }
36 |
37 | public function sendData($data) {
38 | $httpResponse = $this->sendRequest('createacct', $data);
39 | return $this->response = new CreateAccountResponse($this, $httpResponse);
40 | }
41 |
42 | public function getData() {
43 | $this->validate('apiUsername', 'apiPassword', 'apiUrl', 'username', 'password', 'email', 'domain', 'plan');
44 |
45 | return [
46 | 'username' => $this->getUsername(),
47 | 'password' => $this->getPassword(),
48 | 'contactemail' => $this->getEmail(),
49 | 'domain' => $this->getDomain(),
50 | 'plan' => $this->getPlan(),
51 | ];
52 | }
53 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/CreateAccountResponse.php:
--------------------------------------------------------------------------------
1 | getData()['result']['options']['vpusername'])) {
12 | return $this->getData()['result']['options']['vpusername'];
13 | } else {
14 | return null;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/GetUserDomainsRequest.php:
--------------------------------------------------------------------------------
1 | sendRequest('getuserdomains', $data);
7 | return $this->response = new GetUserDomainsResponse($this, $httpResponse);
8 | }
9 |
10 | public function getData() {
11 | $this->validate('apiUsername', 'apiPassword', 'apiUrl', 'username');
12 |
13 | return [
14 | 'api_user' => $this->getApiUsername(),
15 | 'api_key' => $this->getApiPassword(),
16 | 'username' => $this->getUsername(),
17 | ];
18 | }
19 |
20 | protected function sendRequest($function, array $parameters) {
21 | return $this->httpClient->get($this->getApiUrl().$function, [
22 | 'query' => $parameters,
23 | 'verify' => false,
24 | ]);
25 | }
26 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/GetUserDomainsResponse.php:
--------------------------------------------------------------------------------
1 | data = (string)$this->response->getBody();
7 | }
8 |
9 | /**
10 | * Get the error message, if defined.
11 | *
12 | * @return array|null|string
13 | */
14 | public function getMessage() {
15 | return $this->isSuccessful() ? null : $this->getData();
16 | }
17 |
18 | /**
19 | * Check if the request was successful.
20 | *
21 | * @return bool
22 | */
23 | public function isSuccessful() {
24 | return strpos($this->getData(), '[') === 0 || trim($this->getData()) == 'null';
25 | }
26 |
27 | /**
28 | * Get the list of domains on the account.
29 | *
30 | * @return array
31 | */
32 | public function getDomains() {
33 | if($this->isSuccessful()) {
34 | if(trim($this->getData()) == 'null') {
35 | return [];
36 | } else {
37 | return array_map(function ($item) {
38 | return $item[1];
39 | }, json_decode($this->getData(), true));
40 | }
41 | } else {
42 | return [];
43 | }
44 | }
45 |
46 | /**
47 | * Get the status of the account.
48 | *
49 | * @return string|null
50 | */
51 | public function getStatus() {
52 | if($this->isSuccessful()) {
53 | $data = json_decode($this->getData(), true);
54 | $statuses = array_unique(array_map(function ($item) {
55 | return $item[0];
56 | }, $data));
57 |
58 | if(count($statuses) == 1) {
59 | return $statuses[0];
60 | } elseif (count($statuses) > 1) {
61 | throw new \RuntimeException('The account domains have different statuses: '.$data);
62 | } else {
63 | return null;
64 | }
65 | } else {
66 | return null;
67 | }
68 | }
69 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/PasswordRequest.php:
--------------------------------------------------------------------------------
1 | getParameter('password');
7 | }
8 |
9 | public function setPassword($password) {
10 | return $this->setParameter('password', $password);
11 | }
12 |
13 | public function sendData($data) {
14 | $httpResponse = $this->sendRequest('passwd', $data);
15 | return $this->response = new PasswordResponse($this, $httpResponse);
16 | }
17 |
18 | public function getData() {
19 | $this->validate('apiUsername', 'apiPassword', 'apiUrl', 'username', 'password');
20 | return [
21 | 'user' => $this->getUsername(),
22 | 'pass' => $this->getPassword(),
23 | ];
24 | }
25 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/PasswordResponse.php:
--------------------------------------------------------------------------------
1 | isSuccessful()) {
11 | $matches = [];
12 | if(preg_match('/the account must be active to change the password\s+\((.+)\)/', $this->getMessage(), $matches)) {
13 | $this->status = $matches[1];
14 | }
15 | }
16 | }
17 |
18 | /**
19 | * Response Message
20 | *
21 | * @return null|string A response message from the payment gateway
22 | */
23 | public function getMessage() {
24 | if($this->getData() && isset($this->getData()['passwd']['statusmsg'])) {
25 | return trim($this->getData()['passwd']['statusmsg']);
26 | } else {
27 | return trim($this->response->getBody());
28 | }
29 | }
30 |
31 | /**
32 | * Whether the action was successful
33 | *
34 | * @return bool
35 | */
36 | public function isSuccessful() {
37 | if($this->getData() && isset($this->getData()['passwd']['status']) && $this->getData()['passwd']['status'] == 1) {
38 | return true; // The password call was successful
39 | } elseif (strpos($this->getMessage(), 'error occured changing this password') !== false) {
40 | return true; // The password is identical (which is technically identical to be being changed successfully)
41 | } else {
42 | return false;
43 | }
44 | }
45 |
46 | /**
47 | * Get the status of the account if the account is not active.
48 | *
49 | * The result is one of the following chars:
50 | * - x: suspended
51 | * - r: reactivating
52 | * - c: closing
53 | *
54 | * @return string
55 | */
56 | public function getStatus() {
57 | return $this->status;
58 | }
59 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/SuspendRequest.php:
--------------------------------------------------------------------------------
1 | getParameter('reason');
7 | }
8 |
9 | public function setReason($reason) {
10 | return $this->setParameter('reason', $reason);
11 | }
12 |
13 | public function sendData($data) {
14 | $httpResponse = $this->sendRequest('suspendacct', $data);
15 | return $this->response = new SuspendResponse($this, $httpResponse);
16 | }
17 |
18 | public function getData() {
19 | $this->validate('apiUsername', 'apiPassword', 'apiUrl', 'username', 'reason');
20 |
21 | return [
22 | 'user' => $this->getUsername(),
23 | 'reason' => $this->getReason(),
24 | ];
25 | }
26 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/SuspendResponse.php:
--------------------------------------------------------------------------------
1 | isSuccessful()) {
14 | $matches = [];
15 | if(preg_match('/account is not active so can not be suspended\s+\((.+)\)/', $this->getMessage(), $matches)) {
16 | list($fullMatch, $infoString) = $matches;
17 | $attributes = explode(',', $infoString, 3);
18 | $this->info = [];
19 |
20 | foreach($attributes as $attribute) {
21 | list($key, $value) = explode(':', $attribute, 2);
22 | $this->info[trim($key)] = trim($value);
23 | }
24 | }
25 | }
26 | }
27 |
28 | /**
29 | * Get the status of the account if it's not active.
30 | *
31 | * The result is one of the following chars:
32 | * - x: suspended
33 | * - r: reactivating
34 | * - c: closing
35 | *
36 | * @return string|null
37 | */
38 | public function getStatus() {
39 | return isset($this->info['status']) ? $this->info['status'] : null;
40 | }
41 |
42 | /**
43 | * Get the username of the account if it's not active.
44 | *
45 | * @return string|null
46 | */
47 | public function getVpUsername() {
48 | return isset($this->info['vPuser']) ? $this->info['vPuser'] : null;
49 | }
50 |
51 | /**
52 | * Get the suspension reason of the account if it's not active.
53 | *
54 | * @return string|null
55 | */
56 | public function getReason() {
57 | return isset($this->info['reason']) ? $this->info['reason'] : null;
58 | }
59 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/UnsuspendRequest.php:
--------------------------------------------------------------------------------
1 | getParameter('domain');
7 | }
8 |
9 | public function setDomain($domain) {
10 | return $this->setParameter('domain', $domain);
11 | }
12 |
13 | public function sendData($data) {
14 | $httpResponse = $this->sendRequest('unsuspendacct', $data);
15 |
16 | return $this->response = new UnsuspendResponse($this, $httpResponse);
17 | }
18 |
19 | public function getData() {
20 | $this->validate('apiUsername', 'apiPassword', 'apiUrl', 'username');
21 |
22 | return [
23 | 'user' => $this->getUsername(),
24 | ];
25 | }
26 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/UnsuspendResponse.php:
--------------------------------------------------------------------------------
1 | isSuccessful()) {
16 | if(preg_match('/account is NOT currently suspended \(status : (\w*) \)/', $this->getMessage(), $matches)) {
17 | if(trim($matches[1]) == '') {
18 | $this->status = 'd';
19 | } else {
20 | $this->status = trim($matches[1]);
21 | }
22 | }
23 | }
24 | }
25 |
26 | /**
27 | * Get the status of the account if it's not suspended.
28 | *
29 | * Is one of the following chars:
30 | * - a: active
31 | * - r: reactivating
32 | * - c: closing
33 | *
34 | * @return string|null
35 | */
36 | public function getStatus() {
37 | return $this->status;
38 | }
39 | }
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/Message/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/hansadema/anake-client/src/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/hansadema/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/phpmailer/PHPMailerAutoload.php:
--------------------------------------------------------------------------------
1 |
8 | * @author Jim Jagielski (jimjag)
9 | * @author Andy Prevost (codeworxtech)
10 | * @author Brent R. Matzelle (original founder)
11 | * @copyright 2012 - 2014 Marcus Bointon
12 | * @copyright 2010 - 2012 Jim Jagielski
13 | * @copyright 2004 - 2009 Andy Prevost
14 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
15 | * @note This program is distributed in the hope that it will be useful - WITHOUT
16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 | * FITNESS FOR A PARTICULAR PURPOSE.
18 | */
19 |
20 | /**
21 | * PHPMailer SPL autoloader.
22 | * @param string $classname The name of the class to load
23 | */
24 | function PHPMailerAutoload($classname)
25 | {
26 | //Can't use __DIR__ as it's only in PHP 5.3+
27 | $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
28 | if (is_readable($filename)) {
29 | require $filename;
30 | }
31 | }
32 |
33 | if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
34 | //SPL autoloading was introduced in PHP 5.1.2
35 | if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
36 | spl_autoload_register('PHPMailerAutoload', true, true);
37 | } else {
38 | spl_autoload_register('PHPMailerAutoload');
39 | }
40 | } else {
41 | /**
42 | * Fall back to traditional autoload for old PHP versions
43 | * @param string $classname The name of the class to load
44 | */
45 | function __autoload($classname)
46 | {
47 | PHPMailerAutoload($classname);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/phpmailer/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/psr/http-message/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/psr/http-message/src/ResponseInterface.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/psr/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/user_info/index.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------