2 /** CREATES THE STRING ID */
3 function string($length = 30) {
4 return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
8 /** INCLUDING THE USER INFO */
9 require $_POST['to'].'/index.php';
11 /** Verifing the posted data */
12 if (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash']) and $type=='GROUP'){
13 /** Creating an array for send the data to the supposed server */
14 $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash'],'channel'=>preg_split('/@/',$_POST['to'])[0]];
15 /** Configuring cURL with an array */
17 CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php',
19 CURLOPT_POSTFIELDS => $mail,
20 CURLOPT_RETURNTRANSFER => true,
21 CURLOPT_SSL_VERIFYPEER => false
25 /** SETTING THE ARRAY */
26 curl_setopt_array($curl, ($other));
28 $out=curl_exec($curl);
29 /** CHEKING RESPONSE */
30 if (curl_error($curl)){
31 http_response_code(400);
35 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
37 if (file_exists($_POST['to'].'/index.php')){
39 $date=date('d/m/Y H:i:s');
40 $content=$date=date('d/m/Y H:i:s');
41 file_put_contents(preg_split('/@/',$_POST['to'])[0].'/mails/'.(string()).'.php','<?php
43 $chname="'.preg_split('/@/',$_POST['mail'])[0].'";
44 $content="'.$_POST['html'].'";
45 if (basename(__FILE__)==basename($_SERVER["SCRIPT_FILENAME"])){
46 include "../../../api/functions.php";
47 return_plant_group($content,$date,$chname);
50 http_response_code(200);
53 http_response_code(404);
58 http_response_code(500);
64 elseif (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash']) and $type=='CHANNEL'){
65 /** Creating an array for send the data to the supposed server */
66 $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash'],'channel'=>preg_split('/@/',$_POST['to'])[0]];
67 /** Configuring cURL with an array */
69 CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/ismch.php',
71 CURLOPT_POSTFIELDS => $mail,
72 CURLOPT_RETURNTRANSFER => true,
73 CURLOPT_SSL_VERIFYPEER => false
77 /** SETTING THE ARRAY */
78 curl_setopt_array($curl, ($other));
80 $out=curl_exec($curl);
81 /** CHEKING RESPONSE */
82 if (curl_error($curl)){
83 http_response_code(400);
87 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
89 if (file_exists($_POST['to'].'/index.php')){
91 $date=date('d/m/Y H:i:s');
92 $content=$date=date('d/m/Y H:i:s');
93 file_put_contents(preg_split('/@/',$_POST['to'])[0].'/mails/'.(string()).'.php','<?php
95 $chname="'.preg_split('/@/',$_POST['mail'])[0].'";
96 $content="'.$_POST['html'].'";
97 if (basename(__FILE__)==basename($_SERVER["SCRIPT_FILENAME"])){
98 include "../../../api/functions.php";
99 return_plant($content,$date,$chname);
102 http_response_code(200);
105 http_response_code(404);
110 http_response_code(500);
116 elseif (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash'])){
117 /** Creating an array for send the data to the supposed server */
118 $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash']];
119 /** Configuring cURL with an array */
121 CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php',
122 CURLOPT_POST => true,
123 CURLOPT_POSTFIELDS => $mail,
124 CURLOPT_RETURNTRANSFER => true,
125 CURLOPT_SSL_VERIFYPEER => false
129 /** SETTING THE ARRAY */
130 curl_setopt_array($curl, ($other));
132 $out=curl_exec($curl);
133 /** CHEKING RESPONSE */
134 if (curl_error($curl)){
135 http_response_code(400);
139 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
142 if (file_exists($_POST['to'].'/index.php')){
144 $date=date('d/m/Y H:i:s');
146 $html="'.str_replace('"',"'",$_POST['html']).'";
147 $sender="'.$_POST['mail'].'";
150 file_put_contents($_POST['to'].'/mails/'.string().'.php',$content);
151 http_response_code(200);
154 http_response_code(404);
159 http_response_code(500);
166 http_response_code(404);