-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresetpass2.php
346 lines (301 loc) · 15.1 KB
/
resetpass2.php
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<?php
/**
* XMLRPC Functions
*
* (C) 2003-2019 Anope Team
* Contact us at [email protected]
*/
class AnopeXMLRPC
{
private $Host;
function __construct($Host)
{
$this->Host = $Host;
}
/** Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
* $this->RunXMLRPC("checkAuthentication", array("adam", "qwerty"));
* If successful returns back an array of useful information.
*
* Note that $params["id"] is reserved for query ID, you may set it to something if you wish.
* If you do, the same ID will be passed back with the reply from Anope.
*/
function RunXMLRPC($name, $params)
{
$xmlquery = xmlrpc_encode_request($name, $params);
$context = stream_context_create(array("http" => array(
"method" => "POST",
"header" => "Content-Type: text/xml",
"content" => $xmlquery)));
$inbuf = file_get_contents($this->Host, false, $context);
$response = xmlrpc_decode($inbuf);
if (isset($response))
return $response;
return NULL;
}
/** Do Command on Service as User, eg:
* $anope->DoCommand("ChanServ", "Adam", "REGISTER #adam");
* Returns an array of information regarding the command execution, if
* If 'online' is set to yes, then the reply to the command was sent to the user on IRC.
* If 'online' is set to no, then the reply to the command is in the array member 'return'
*/
function DoCommand($Service, $User, $Command)
{
return $this->RunXMLRPC("command", array($Service, $User, $Command));
}
/** Check an account/nick name and password to see if they are valid
* Returns the account display name if valid
*/
function CheckAuthentication($Account, $Pass)
{
$ret = $this->RunXMLRPC("checkAuthentication", array($Account, $Pass));
if ($ret && $ret["result"] == "Success")
return $ret["account"];
return NULL;
}
/* Returns an array of misc stats regarding Anope
*/
function DoStats()
{
return $this->RunXMLRPC("stats", NULL);
}
/* Look up data for a channel
* Returns an array containing channel information, or an array of size one
* (just containing the name) if the channel does not exist
*/
function DoChannel($Channel)
{
return $this->RunXMLRPC("channel", array($Channel));
}
/* Like DoChannel(), but different.
*/
function DoUser($User)
{
return $this->RunXMLRPC("user", array($User));
}
}
$anope = new AnopeXMLRPC("http://IP:8085/xmlrpc");
?>
<?php // Check if form was submitted:
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['recaptcha_response'])) {
// Build POST request:
$recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$recaptcha_secret = '6Ld6Y4AUAAAAAFi3mHJoDQ2Pg2Mb8MduZ5GNwaH_';
$recaptcha_response = $_POST['recaptcha_response'];
// Make and decode POST request:
$recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&response=' . $recaptcha_response);
$recaptcha = json_decode($recaptcha);
// Take action based on the score returned:
if ($recaptcha->score >= 0.5) {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(trim($_POST['login']) == '' || trim($_POST['pass']) == '' || trim($_POST['pass2']) == '') {
$errors = 'Alle velden dienen ingevuld te worden!';
}else{
if($_POST['pass'] == $_POST['pass2']) {
$user = $_POST['login'];
$password = $_POST['pass'];
// $email = $_POST['email'];
$ret = $anope->DoCommand("NickServ", "$user", "SET PASSWORD $password");
$searchword = 'Authencatie';
$matches = array();
foreach($ret as $k=>$v) {
if( preg_match("/\b$searchword\b/i", $v) === 1 ) {
$matches[$k] = $v;
}
}
if ($matches && $matches["return"] != "") { $errors = $matches["return"]; }else{
if ($ret && $ret["result"] == "Success") {
$success = "Succesvol uw wachtwoord gewijzigd.";
// $message = "Beste $user<br />
// Gefeliciteerd, uw account is geregistreerd op uw emailadres <b>$email</b><br />
// Uw gekozen wachtwoord is <b>$password</b><br /><br />
// Uw account is per direct actief en geldt ook als nicknaam voor uw chat.<br />
// U kunt nu inloggen op <a href='https://chameleon.chattersworld.nl/'>Chameleon</a><br />
// Hier kunt u uw chatbox maken en registreren.<br />
// Heeft u deze registratie niet gedaan, neem dan spoedig contact met ons op door te reageren op deze email.<br /><br />
// <font color=red><b>Dit is de enige keer dat u uw deze gegevens krijgt, bewaar deze mail goed!</b></font><br /><br />
// <b>Let op! Uw gebruikersnaam is ook uw nicknaam op de chat!</b><br />U krijgt nog een 2e mail om uw mailadres te bevestigen.<br /><br />
// Met vriendelijke groet,<br />
// Chattersworld";
// $message = wordwrap($message, 70, "\r\n");
// $subject = 'Chattersworld Chameleon registratie voor '.$user;
// $headers = 'From: Chattersworld Chameleon <[email protected]>' . "\r\n" .
// 'Reply-To: [email protected]' . "\r\n" .
// 'MIME-Version: 1.0' . "\r\n" .
// 'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
// 'X-Mailer: PHP/' . phpversion();
// mail($email, $subject, $message, $headers);
// mail('[email protected]', $subject, $message, $headers);
}else{
$errors = "Er is iets fout gegaan!";
}
}
}
}
}
} else {
$errors = 'Captcha not valid!';// Not verified - show form error
}
}
?>
<!DOCTYPE html>
<html>
<head>
<!-- <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> -->
<link rel="shortcut icon" href="img/cwo-chameleon2.png" />
<link href="https://fonts.googleapis.com/css?family=Muli:300,300i,400,400i,600,600i,700,700i%7CComfortaa:300,400,700" rel="stylesheet">
<!-- BEGIN: Vendor CSS-->
<link rel="stylesheet" type="text/css" href="app-assets/vendors/css/vendors.min.css">
<!-- END: Vendor CSS-->
<!-- BEGIN: Theme CSS-->
<link rel="stylesheet" type="text/css" href="app-assets/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="app-assets/css/bootstrap-extended.css">
<link rel="stylesheet" type="text/css" href="app-assets/css/colors.css">
<link rel="stylesheet" type="text/css" href="app-assets/css/components.css">
<!-- END: Theme CSS-->
<!-- BEGIN: Page CSS-->
<link rel="stylesheet" type="text/css" href="app-assets/css/core/menu/menu-types/vertical-menu-modern.css">
<link rel="stylesheet" type="text/css" href="app-assets/css/core/colors/palette-gradient.css">
<link rel="stylesheet" type="text/css" href="app-assets/css/pages/login-register.css">
<!-- END: Page CSS-->
<!-- BEGIN: Custom CSS-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-73408859-2', { 'anonymize_ip': true });
</script>
<script src="https://www.google.com/recaptcha/api.js?render=6Ld6Y4AUAAAAAH6uCWtHPw9psZxn8qZ7Rqy2ysWL"></script>
<script>
grecaptcha.ready(function () {
grecaptcha.execute('6Ld6Y4AUAAAAAH6uCWtHPw9psZxn8qZ7Rqy2ysWL', { action: 'contact' }).then(function (token) {
var recaptchaResponse = document.getElementById('recaptchaResponse');
recaptchaResponse.value = token;
});
});
</script>
<!-- Custom CSS -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
<title>..::Chattersworld Chameleon::.. Wachtwoord wijzigen</title>
</head>
<body class="vertical-layout vertical-menu-modern 1-column bg-full-screen-image blank-page blank-page" data-open="click" data-menu="vertical-menu-modern" data-color="bg-gradient-x-purple-red" data-col="1-column">
<div class="app-content content">
<div class="content-wrapper">
<div class="content-wrapper-before"></div>
<div class="content-header row">
</div>
<div class="content-body">
<section class="flexbox-container">
<div class="col-12 d-flex align-items-center justify-content-center">
<div class="col-lg-4 col-md-6 col-10 box-shadow-2 p-0">
<div class="card border-grey border-lighten-3 px-1 py-1 m-0">
<div class="card-header border-0">
<div class="text-center mb-1">
<img src="img/cwo-chameleon2.png" height="50px" alt="branding logo">
</div>
<div class="font-large-1 text-center">
Uw bevestiging is goed doorgekomen!<br />
Wijzig uw wachtwoord hier!
</div>
</div>
<div class="card-content">
<?php
if(isset($_POST['login'])) {
if(isset($errors)) {
echo '<div class="alert alert-danger alert-dismissable"><strong>' . htmlentities($errors) . '</strong>';
echo '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
}
if(isset($success)) {
echo '<div class="alert alert-success alert-dismissable"><strong>' . htmlentities($success) . '</strong>';
echo '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
echo '<meta http-equiv="refresh" content="5; url=index.php" />';
}
} ?>
<div class="card-body">
<div class="alert alert-success alert-dismissable"><strong>Let op!</strong> Wijzig alleen uw wachtwoord na het invullen van uw bevestigingscode!
</div>
<form class="form-horizontal" method="POST" action="">
<!-- <fieldset class="form-group position-relative has-icon-left">
<input type="email" name="email" class="form-control round" id="user-name" placeholder="E-Mail" required>
<div class="form-control-position">
<i class="ft-at-sign"></i>
</div>
</fieldset> -->
<fieldset class="form-group position-relative has-icon-left">
<script type="text/javascript">
function CheckSpace(event)
{
if(event.which ==32)
{
event.preventDefault();
return false;
}
}
</script>
<input type="text" name="login" class="form-control round" id="user-name" pattern="^[a-zA-Z0-9][a-zA-Z0-9-_]{2,}$" onkeypress="CheckSpace(event)" placeholder="Nicknaam (ook voor de chat)" value="<?php if(!empty($_GET['login'])) : ?><?php echo htmlspecialchars($_GET['login']); ?><?php endif; ?>" required>
<div class="form-control-position">
<i class="ft-user"></i>
</div>
</fieldset>
<fieldset class="form-group position-relative has-icon-left">
<input type="password" class="form-control round" name="pass" id="user-password" placeholder="Wachtwoord" required>
<div class="form-control-position">
<i class="ft-lock"></i>
</div>
</fieldset>
<fieldset class="form-group position-relative has-icon-left">
<input type="password" class="form-control round" name="pass2" id="user-password" placeholder="Wachtwoord" required>
<div class="form-control-position">
<i class="ft-lock"></i>
</div>
</fieldset>
<div class="form-group row">
<div class="col-md-6 col-12 text-center text-sm-left">
</div>
</div>
<div class="form-group text-center">
<!-- <center><div class="g-recaptcha" data-sitekey="6LdZ_nIUAAAAANK_JiB2qsRbSPnldqaYTjFwNj8G"></div></center><br /> -->
<button type="submit" class="btn round btn-block btn-glow btn-bg-gradient-x-purple-blue col-12 mr-1 mb-1">Bevestig</button>
<input type="hidden" name="recaptcha_response" id="recaptchaResponse">
</div>
</form>
</div>
<p class="card-subtitle text-muted text-right font-small-3 mx-2 my-1"><span>Heb je al een account? <a href="/login" class="card-link">Log dan in!</a></span></p>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
<!-- End new style -->
<center>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Chatbottom -->
<ins class="adsbygoogle"
style="display:inline-block;height:90px"
data-ad-client="ca-pub-9106844814451489"
data-ad-slot="2999842055"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
</div>
</div>
<!-- BEGIN: Vendor JS-->
<script src="app-assets/vendors/js/vendors.min.js" type="text/javascript"></script>
<!-- BEGIN Vendor JS-->
<!-- BEGIN: Page Vendor JS-->
<script src="app-assets/vendors/js/forms/validation/jqBootstrapValidation.js" type="text/javascript"></script>
<!-- END: Page Vendor JS-->
<!-- BEGIN: Theme JS-->
<script src="app-assets/js/core/app-menu.js" type="text/javascript"></script>
<script src="app-assets/js/core/app.js" type="text/javascript"></script>
<!-- END: Theme JS-->
<!-- BEGIN: Page JS-->
<script src="app-assets/js/scripts/forms/form-login-register.js" type="text/javascript"></script>
</body>
</html>