diff --git a/bug_report.php b/bug_report.php new file mode 100644 index 0000000..e0395b6 --- /dev/null +++ b/bug_report.php @@ -0,0 +1,347 @@ + + + + + + Submitter's address: ".addslashes(strip_tags($_POST['form_address']))."
+ Submitter's name: ".addslashes(strip_tags($_POST['form_name']))."
+ IP: ".addslashes(strip_tags($_POST['ip']))."
+ Problem with: ".addslashes(strip_tags($_POST['form_case']))."
+ Message:
+ ".addslashes(strip_tags($_POST['form_message']))." + + "; + $subject="Bug report from Twittodon.com ".date('d-m-Y H:i'); + $header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n"; + $header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n"; + $address = "support@twittodon.com"; + + mail($address, $subject, $message, $header); + $alert = 2; + } + } + else + { + $alert = 3; + } + } + else { $alert = 4; } + } + + if($_SERVER['HTTP_CLIENT_IP']) + { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } + elseif($_SERVER['HTTP_X_FORWARDED_FOR']) + { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + else + { + $ip = $_SERVER['REMOTE_ADDR']; + } + + mysqli_close($mysqli); + + //Change language + $full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI']; +?> + + + + + + + + + + Report bug - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + +
+ + +
+ + + Message not sent. Invalid CAPTCHA."; + } + elseif($alert==2) + { + echo "

Message sent.

"; + exit; + } + elseif($alert==3) + { + echo "

The message has not been sent. An invalid email address was provided.

"; + } + elseif($alert==4) + { + echo "

The message has not been sent. All fields must be filled.

"; + } + ?> +
+
+ "; + echo ""; + ?> + size="30">
+ size="30">
+
+ Captcha
+
+
+

+
+
+ +
+ + + \ No newline at end of file diff --git a/captcha.php b/captcha.php new file mode 100644 index 0000000..f0a67a6 --- /dev/null +++ b/captcha.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/confirm.php b/confirm.php new file mode 100644 index 0000000..4238ddc --- /dev/null +++ b/confirm.php @@ -0,0 +1,506 @@ +.+?".$mastodon_link.".+?Twittodon.com)is", $site_source_code, $phrase); + + if(!empty($phrase[0])) + { + $update = "UPDATE connections SET twitter_verified='1' WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."'"; + mysqli_query($mysqli, $update) or die('ERROR TD02'); + } + else + { + $twitter_verified_error = true; + } + } + + if(isset($_POST['verify_mastodon'])) + { + $mastodon_rss = $mastodon_link.".rss"; + + $curl = curl_init($mastodon_rss); + curl_setopt($curl, CURLOPT_URL, $mastodon_rss); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36'); + curl_setopt($curl, CURLOPT_TIMEOUT, 30); + curl_setopt($curl, CURLOPT_HEADER, 0); + + $site_source_code = curl_exec($curl); + for($i=1; $i<=5; $i++) + { + if($site_source_code == "") { $site_source_code=curl_exec($curl); } + else { break; } + } + + preg_match("(.+?twitter.com\/".$twitter.".+?Twittodon.com)is", $site_source_code, $phrase); + + if(!empty($phrase[0])) + { + $update = "UPDATE connections SET mastodon_verified='1' WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."'"; + mysqli_query($mysqli, $update) or die('ERROR TD03'); + } + else + { + $mastodon_verified_error = true; + } + } + + $query = "SELECT * FROM connections WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."'"; + $result = mysqli_query($mysqli, $query) or die('ERROR TD04'); + + $fromdb = mysqli_fetch_row($result); + //$fromdb[0] - id + //$fromdb[1] - twitter_login + //$fromdb[2] - twitter_verified + //$fromdb[3] - mastodon_login + //$fromdb[4] - mastodon_verified + //$fromdb[5] - twitter_name + //$fromdb[6] - twitter_img + //$fromdb[7] - mastodon_name + //$fromdb[8] - mastodon_img + //$fromdb[9] - date + + mysqli_close($mysqli); + + //Change language + $full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI']; +?> + + + + + + + + + + Confirm - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + +
+ + +
+ + VERIFICATION PROCESS
"; + echo " Something went wrong!
There is no such connection in the database yet. You need to declare account credentials first.
Complete previous step first:

"; + echo ""; + } + elseif($fromdb[2]==1 AND $fromdb[4]==1) + { + echo "
SUCCESS!
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + echo ""; + echo ""; + echo "
"; + echo ""; + echo ""; + echo ""; + } + else + { + echo "
VERIFICATION PROCESS

"; + echo ""; + echo ""; + echo "
"; + echo ""; + + if($fromdb[2]==1) + { + echo ""; + echo "
"; + echo "SUCCESS!
Your Twitter account has been verified successfully.
You may proceed to verify your Mastodon account.

"; + } + else + { + echo "
"; + echo ""; + echo "
"; + echo ""; + echo ""; + echo ""; + echo "
"; + echo ""; + echo ""; + echo "
"; + echo ""; + echo "
"; + if($twitter_verified_error==true) + { + echo " SOMETHING WENT WRONG!
Check if you did all steps correctly and try again. If further failures occur, report the problem using this form.
"; + } + echo "
"; + } + + echo "
"; + + if($fromdb[4]==1) + { + echo ""; + echo "
"; + echo "SUCCESS!
Your Mastodon account has been verified successfully.
You may proceed to verify your Twitter account.
"; + } + else + { + echo "
"; + echo ""; + echo "
"; + echo ""; + echo ""; + echo ""; + echo "
"; + echo ""; + echo ""; + echo "
"; + echo ""; + echo "
"; + if($mastodon_verified_error==true) + { + echo " SOMETHING WENT WRONG!
Check if you did all steps correctly and try again. If further failures occur, report the problem using this form.
"; + } + echo "
"; + } + } + ?> + +

+ +
+ + + + + + + \ No newline at end of file diff --git a/connect.php b/connect.php new file mode 100644 index 0000000..eab137f --- /dev/null +++ b/connect.php @@ -0,0 +1,348 @@ + Invalid format! Correct it and try again. Format should be: USERNAME without @ (e.g. theto3k).
If further failures occur, report the problem using this form."; + } + + $mastodon = trim(addslashes(strip_tags($_POST['mastodon']))); + $check2 = '/^[a-zA-Z0-9_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]+/'; + if(!preg_match($check2, $mastodon)) + { + $message2 = " Invalid format! Correct it and try again. Format should be: USERNAME@INSTANCE (e.g. to3k@mstdn.social).
If further failures occur, report the problem using this form.

"; + } + + if(empty($message1) AND empty($message2)) + { + $query = "SELECT * FROM connections WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."' LIMIT 1"; + $result = mysqli_query($mysqli, $query) or die('ERROR TD02'); + + if(mysqli_num_rows($result) == false) + { + $nitter_link = "https://nitter.net/".$twitter; + + $curl = curl_init($nitter_link); + curl_setopt($curl, CURLOPT_URL, $nitter_link); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36'); + curl_setopt($curl, CURLOPT_TIMEOUT, 30); + curl_setopt($curl, CURLOPT_HEADER, 0); + + $site_source_code = curl_exec($curl); + for($i=1; $i<=5; $i++) + { + if($site_source_code == "") { $site_source_code=curl_exec($curl); } + else { break; } + } + + preg_match("(class=\"profile-card-fullname\".+?>(.+?))is", $site_source_code, $phrase); + $twitter_name = addslashes(strip_tags($phrase[1])); + + if(empty($twitter_name)) + { + $message1 = " Are you sure that this account exists? Check if entered username is correct.
If further failures occur, report the problem using this form.
"; + } + + $explode = explode("@", $mastodon); + $mastodon_user = $explode[0]; + $mastodon_server = $explode[1]; + $mastodon_link = "https://".$explode[1]."/@".$explode[0]; + $mastodon_rss = $mastodon_link.".rss"; + + $curl = curl_init($mastodon_rss); + curl_setopt($curl, CURLOPT_URL, $mastodon_rss); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36'); + curl_setopt($curl, CURLOPT_TIMEOUT, 30); + curl_setopt($curl, CURLOPT_HEADER, 0); + + $site_source_code = curl_exec($curl); + for($i=1; $i<=5; $i++) + { + if($site_source_code == "") { $site_source_code=curl_exec($curl); } + else { break; } + } + + preg_match("((.+?))is", $site_source_code, $phrase); + $mastodon_name = addslashes(strip_tags($phrase[1])); + + if(empty($mastodon_name)) + { + $message2 = " Are you sure that this account exists? Check if entered username is correct.
If further failures occur, report the problem using this form.

"; + } + + $today = date("Y-m-d"); + if(empty($message1) AND empty($message2)) + { + $add = "INSERT INTO connections (twitter_login, twitter_verified, mastodon_login, mastodon_verified, twitter_name, mastodon_name, date) VALUES ('".$twitter."', '0', '".$mastodon."', '0', '".$twitter_name."', '".$mastodon_name."', '".$today."')"; + mysqli_query($mysqli, $add) or die('ERROR TD03'); + } + } + + if(empty($message1) AND empty($message2)) + { + header("Location: confirm.php?t=".$twitter."&m=".$mastodon); + } + } + } + + mysqli_close($mysqli); + + //Change language + $full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI']; +?> + + + + + + + + + + Connect - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + +
+ + +
+
+ +
"; + ?> + +
+ +
"; + ?> + +
+
+ Next step"; + ?> +

+ + +
+ + + + + \ No newline at end of file diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..963ded2 --- /dev/null +++ b/contact.php @@ -0,0 +1,333 @@ + + + + + + Submitter's address: ".addslashes(strip_tags($_POST['form_address']))."
+ Submitter's name: ".addslashes(strip_tags($_POST['form_name']))."
+ IP: ".addslashes(strip_tags($_POST['ip']))."
+ Message:
+ ".addslashes(strip_tags($_POST['form_message']))." + + "; + $subject="Message from Twittodon.com ".date('d-m-Y H:i'); + $header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n"; + $header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n"; + $address = "contact@twittodon.com"; + + mail($address, $subject, $message, $header); + $alert = 2; + } + } + else + { + $alert = 3; + } + } + else { $alert = 4; } + } + + if($_SERVER['HTTP_CLIENT_IP']) + { + $ip = $_SERVER['HTTP_CLIENT_IP']; + } + elseif($_SERVER['HTTP_X_FORWARDED_FOR']) + { + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + else + { + $ip = $_SERVER['REMOTE_ADDR']; + } + + mysqli_close($mysqli); + + //Change language + $full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI']; +?> + + + + + + + + + + Contact form - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + +
+ + +
+ + + Message not sent. Invalid CAPTCHA."; + } + elseif($alert==2) + { + echo "

Message sent.

"; + exit; + } + elseif($alert==3) + { + echo "

The message has not been sent. An invalid email address was provided.

"; + } + elseif($alert==4) + { + echo "

The message has not been sent. All fields must be filled.

"; + } + ?> +
+
+ "; + ?> + size="30">
+ size="30">
+
+ Captcha
+
+
+

+
+
+ +
+ + + \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..41ea35a Binary files /dev/null and b/favicon.ico differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..be099d7 --- /dev/null +++ b/index.php @@ -0,0 +1,196 @@ + + + + + + + + + + + Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + +
+ +
LOGO
+
+ +
+ + +
+

+ +
+ + + \ No newline at end of file diff --git a/share.php b/share.php new file mode 100644 index 0000000..c3b2633 --- /dev/null +++ b/share.php @@ -0,0 +1,400 @@ + + + + + + + + + + + Shared confirmation - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + +
+ +
LOGO
+
+
+ + HELLO!"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
"; + } + else + { + echo "
VERIFICATION PROCESS

"; + echo ""; + echo ""; + echo ""; + echo ""; + } + ?> + +

+ +
+ + + + + + + \ No newline at end of file diff --git a/stats.php b/stats.php new file mode 100644 index 0000000..2479578 --- /dev/null +++ b/stats.php @@ -0,0 +1,263 @@ + + + + + + + + + + + + Stats - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + + + + +

+
+ +
LOGO +


+
STATISTICS
+ +

+ USERS +
+

+ +

+ PAGE VIEWS +
+

+ +
+
+ + + + + + \ No newline at end of file diff --git a/verified.php b/verified.php new file mode 100644 index 0000000..fa1e1ba --- /dev/null +++ b/verified.php @@ -0,0 +1,340 @@ + + + + + + + + + + + Verified - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it! + + + + + + + + + + + +
+ + +
+
VERIFIED LIST
+ +
+ + + + + + + + + + "; + echo ""; + $explode = explode("@", $fromdb[3]); + $mastodon_user = $explode[0]; + $mastodon_server = $explode[1]; + $mastodon_link = "https://".$explode[1]."/@".$explode[0]; + echo ""; + echo ""; + echo ""; + } + ?> + +
TwitterMastodonAdded
@".$fromdb[1]."
".$fromdb[5]."
".$fromdb[3]."
".$fromdb[7]."
".$fromdb[9]."
+ +

+ +
+ + + + \ No newline at end of file