-
Notifications
You must be signed in to change notification settings - Fork 0
/
resend_activation_mail.php
35 lines (33 loc) · 1.22 KB
/
resend_activation_mail.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
<?php
require_once('runtime.php');
require_once('lib/core/helper.class.php');
require_once('lib/core/register.class.php');
require_once('lib/core/user.class.php');
$register = new register;
if (empty($_POST['email'])) {
$smarty->assign('message', Message::getMessage());
$smarty->display("header.tpl.html");
$smarty->display("resend_activation_mail.tpl.html");
$smarty->display("footer.tpl.html");
} else {
$user = User_old::getUserByEmail($_POST['email']);
if ($user) {
if ($user['activated']!="0") {
if(empty($user['openid'])) {
$new_password = Helper::randomPassword(8);
$register->setNewPassword($new_password, $user['id']);
}
$register->sendRegistrationEmail($user['email'], $user['nickname'], $new_password, $user['activated'], strtotime($user['create_date']), $user['openid']);
header('Location: ./login.php');
} else {
$message[] = array("Der Benutzer mit der Emailadresse $_POST[email] wurde bereits freigeschaltet!", 2);
Message::setMessage($message);
header('Location: ./login.php');
}
} else {
$message[] = array("Der Benutzer mit der Emailadresse $_POST[email] existiert nicht!", 2);
Message::setMessage($message);
header('Location: ./login.php');
}
}
?>