streams/Zotlabs/Module/Email_resend.php

51 lines
1 KiB
PHP
Raw Normal View History

<?php
namespace Zotlabs\Module;
2021-12-02 22:33:36 +00:00
use Zotlabs\Web\Controller;
2021-12-02 23:02:31 +00:00
class Email_resend extends Controller
{
2021-12-02 23:02:31 +00:00
public function post()
{
2021-12-02 23:02:31 +00:00
if ($_POST['token']) {
if (!account_approve(trim($_POST['token']))) {
notice(t('Token verification failed.'));
}
}
2021-12-02 23:02:31 +00:00
}
2021-12-02 23:02:31 +00:00
public function get()
{
2021-12-02 23:02:31 +00:00
if (argc() > 1) {
$result = false;
$email = hex2bin(argv(1));
2021-12-02 23:02:31 +00:00
if ($email) {
$result = verify_email_address(['resend' => true, 'email' => $email]);
}
2021-12-02 23:02:31 +00:00
if ($result) {
notice(t('Email verification resent'));
} else {
notice(t('Unable to resend email verification message.'));
}
2021-12-02 23:02:31 +00:00
goaway(z_root() . '/email_validation/' . bin2hex($email));
2021-12-02 23:02:31 +00:00
}
2021-12-02 23:02:31 +00:00
// @todo - one can provide a form here to resend the mail
// after directing to here if a succesful login was attempted from an unverified address.
2021-12-02 23:02:31 +00:00
}
2018-01-27 22:55:44 +00:00
}