-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresetpassword.php
More file actions
313 lines (239 loc) · 10.8 KB
/
Copy pathresetpassword.php
File metadata and controls
313 lines (239 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<?php
session_start();
include "mysql_config.php";
$conn = OpenCon();
$error_message = "";
if(isset($_SESSION['web_user']))
{
header("location: index.php");
return;
}
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/Exception.php';
require 'PHPMailer/PHPMailer.php';
require 'PHPMailer/SMTP.php';
/*
$developmentMode = false;
$mailer = new PHPMailer($developmentMode);
$mailer->SMTPDebug = 3;
if ($developmentMode) {
$mailer->SMTPOptions = [
'ssl'=> [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
];
}
$mailer->Host = 'mail.ncode.ge';
$mailer->SMTPAuth = true;
$mailer->Username = 'rfrp@ncode.ge';
$mailer->Password = 'fffff';
$mailer->SMTPSecure = 'tls'; //'tls'
// $mailer->SMTPAutoTLS = false;
$mailer->Port = 587; //587, 465, 25, 2525 have been tested
$mailer->setFrom('rfrp@ncode.ge', 'Sender');
$mailer->addAddress('shanidzenodo0@gmail.com', 'Recipient');
$mailer->Subject = 'PHPMailer GMail SMTP test';
$mailer->msgHTML("test body"); //$mail->msgHTML(file_get_contents('contents.html'), __DIR__); //Read an HTML message body from an external file, convert referenced images to embedded,
$mailer->AltBody = 'HTML messaging not supported';
// $mail->addAttachment('images/phpmailer_mini.png'); //Attach an image file
*/
$SENDED = 0;
if(isset($_POST['submit_verification']) && $_SERVER["REQUEST_METHOD"] == "POST" ){
$sended_code = trim(mysqli_escape_string($conn,$_POST['verification_input']));
if($_SESSION['code_'] == $sended_code)
{
$SENDED = 2;
}
else {
$SENDED = 1;
$error_message = '
<script>
toastr["error"]("არასწორია", "შეცდომა");
</script>
';
}
}
if(isset($_POST['reset_password_user']) && $_SERVER["REQUEST_METHOD"] == "POST" ){
$username = trim(mysqli_escape_string($conn,$_POST['user_name']));
$email = trim(mysqli_escape_string($conn,$_POST['user_email']));
$_SESSION['email'] = $email;
if ( !isset($username , $email)) {
$error_message = '
<script>
toastr["error"]("შეყვანილი მონაცემები არ ემთხვევა", "შეცდომა");
</script>
';
}
else {
$sql = "SELECT Username,pEmail FROM users WHERE Username = '$username' AND pEmail = '$email'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
$verifi_code = substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz", 18)), 0, 18);//random string
$_SESSION['code_'] = $verifi_code;
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com'; // Your SMTP server
$mail->SMTPAuth = true;
$mail->Username = 'lukai3oss@gmail.com';
$mail->Password = 'ffff';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->CharSet = 'UTF-8';
// Sender and recipient settings
$mail->setFrom('lukai3oss@gmail.com', 'Realmforge RolePlay Administration');
$mail->addAddress($email, 'Recipient');
// Email content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Realmforge RolePlay პაროლის აღდგენა";
$mail->Body = "
<center>
<div style='border-radius: 45px; background-color: #921fff; width: 400px; padding: 45px; '>
<a href='https://rfrp.ge' target='_blank'>
<img src='https://i.ibb.co/vmhhKXc/logo-3.png' style='width: 310px;'>
</a>
<h1 style='color:#fff'>პაროლის აღდგენა</h1>
<h3 style='color:#fff'>ვერიფიკაციის კოდი</h3>
<span style=' color: #0dff00;
font-weight: 800;' >
<h1>".$verifi_code."</h1>
</span>
</div></center>
"; // Example HTML body
$mail->AltBody = 'This is the plain text version of the email content';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
$SENDED = 0;
} else {
$SENDED = 1;
}
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
}
else {
$error_message = '
<script>
toastr["error"]("შეყვანილი მონაცემები არ ემთხვევა", "შეცდომა");
</script>
';
}
}
} else {
}
?>
<!doctype html>
<html lang="ka">
<head>
<title>Realmforge RolePlay | Official</title>
<!-- Required meta tags -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="Realmforge RolePlay ქართული SA-MP პროექტი, შექმენი შენი ვირტუალური სამყარო აქ! ">
<meta name="keywords" content="samp, georgian, realmforge role play, ქართული სამპი, SA-MP Georgia, RFRP georgia, Realmforge RP, realmforge role play launcher, rfrp launcher, RFRP Official Website, tamashebi,samp, ქართული, samp ლაუნჩერი, realmforge roleplay, Realmforge, rfrp.ncode.ge">
<meta name="googlebot" content="noarchive" data-rh="true">
<meta name="robots" content="noarchive" data-rh="true">
<meta name="author" content="rfrp.ncode.ge">
<meta property="og:url" content="https://rfrp.ncode.ge/rfrp_shared.png" />
<meta property="og:image" content="https://rfrp.ncode.ge/rfrp_shared.png" />
<meta property="og:title" content="Realmforge RolePlay Official Website">
<meta property="og:description" content="Realmforge RolePlay ქართული SA-MP პროექტი, შექმენი შენი ვირტუალური სამყარო აქ!">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous" />
<link rel="stylesheet" href="stylee/main.css">
<link rel="stylesheet" href="scripts/Toast/toastr.css">
<link rel="icon" type="image/x-icon" href="https://rfrp.ge/images/logo.png">
</head>
<body>
<!-- Navigation -->
<?php
include "navigation.php";
?>
<!-- Page Content -->
<br>
<br>
<section class="mt-7 py-5 login_section">
<form action="" method="post" enctype="multipart/form-data">
<?php if($SENDED == 0) {?>
<div class="form-group">
<div class="text_login_box">
<img src="https://rfrp.ge/images/logo.png" class="rfrp_is_brand_login" alt="Realmforge RolePlay">
<h4>პაროლის აღდგენა</h4>
</div>
<label for="formGroupExampleInput" class="text-light">მოთამაშის სახელი</label>
<input type="text" name="user_name" class="form-control" id="formGroupExampleInput" placeholder="სახელი_გვარი">
</div>
<div class="form-group">
<label for="formGroupExampleInput2" class="text-light mt-1">მოთამაშის ელ.ფოსტა</label>
<input type="email" name="user_email" class="form-control" id="formGroupExampleInput2" placeholder="ელ. ფოსტა">
</div>
<p class="text-light mt-2">იცით პაროლი? <a rel="nofollow" href="login.php" class="text-light">ავტორიზაცია</a></p>
<input type="submit" name='reset_password_user' class="submit_login" value="აღდგენა">
<?php } ?>
<?php if($SENDED == 1) {?>
<div class="form-group">
<div class="text_login_box">
<img src="https://rfrp.ge/images/logo.png" class="rfrp_is_brand_login" alt="Realmforge RolePlay">
<h4>ვერიფიკაცია</h4>
</div>
<label for="formGroupExampleInput" class="text-light">შეიყვანეთ ვერიფიკაციის კოდი</label>
<input type="text" name="verification_input" class="form-control" id="formGroupExampleInput" placeholder="ვერიფიკაციის კოდი">
</div>
<p class="text-light mt-2">ელ.ფოსტა <?php echo $email;?> - გამოგეგზავნათ დადასტურების კოდი <a href="#" class="text-light">ხელახლა გაგზავნა</a></p>
<input type="submit" name='submit_verification' class="submit_login" value="აღდგენა">
<?php } ?>
<?php if($SENDED == 2) {?>
<div class="form-group">
<div class="text_login_box">
<img src="https://rfrp.ge/images/logo.png" class="rfrp_is_brand_login" alt="Realmforge RolePlay">
<h4>პაროლის აღდგენა</h4>
</div>
<label for="formGroupExampleInput" class="text-light">ახალი პაროლი</label>
<input type="text" name="verification_input" class="form-control" id="formGroupExampleInput" placeholder="ახალი პაროლი">
</div>
<label for="formGroupExampleInput1" class="text-light">გაიმეორეთ ახალი პაროლი</label>
<input type="text" name="verification_input" class="form-control" id="formGroupExampleInput1" placeholder="გაიმეორეთ პაროლი">
</div>
<input type="submit" name='submit_verification' class="submit_login" value="შენახვა">
<?php } ?>
</form>
</section>
<br>
<br>
<!-- Footer -->
<?php
include "footer.php";
?>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<!-- Footer END -->
<script src="scripts/Toast/toastr.min.js"></script>
<script>
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": false,
"progressBar": true,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
}
</script>
<span class="error_text"><?php
if($error_message != "")
{
echo $error_message;
}
?></span>
</body>
</html>