aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-02-28 21:15:26 -0800
committerzotlabs <mike@macgirvin.com>2018-02-28 21:15:26 -0800
commit01015bc0d54343831189ce1b09a69b70a6371fd5 (patch)
treeb9b832c6f06865511c360da25a9893762f5af5c3
parent2b910eb5aa204e1914c8c73afe369c443bd1ff49 (diff)
downloadvolse-hubzilla-01015bc0d54343831189ce1b09a69b70a6371fd5.tar.gz
volse-hubzilla-01015bc0d54343831189ce1b09a69b70a6371fd5.tar.bz2
volse-hubzilla-01015bc0d54343831189ce1b09a69b70a6371fd5.zip
several email validation issues
-rw-r--r--Zotlabs/Module/Email_validation.php11
-rw-r--r--include/account.php2
-rw-r--r--view/tpl/email_validation.tpl10
3 files changed, 12 insertions, 11 deletions
diff --git a/Zotlabs/Module/Email_validation.php b/Zotlabs/Module/Email_validation.php
index b8bb720cd..c1ba9a01a 100644
--- a/Zotlabs/Module/Email_validation.php
+++ b/Zotlabs/Module/Email_validation.php
@@ -7,12 +7,11 @@ class Email_validation extends \Zotlabs\Web\Controller {
function post() {
+ $success = false;
if($_POST['token']) {
// This will redirect internally on success unless the channel is auto_created
- if(! account_approve(trim(basename($_POST['token'])))) {
- notice('Token verification failed.');
- }
- else {
+ if(account_approve(trim(basename($_POST['token'])))) {
+ $success = true;
if(get_config('system','auto_channel_create')) {
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
}
@@ -21,7 +20,9 @@ class Email_validation extends \Zotlabs\Web\Controller {
}
}
}
-
+ if(! $success) {
+ notice( t('Token verification failed.') . EOL);
+ }
}
diff --git a/include/account.php b/include/account.php
index 3ac485974..40cf281c3 100644
--- a/include/account.php
+++ b/include/account.php
@@ -530,7 +530,7 @@ function account_deny($hash) {
function account_approve($hash) {
- $ret = array('success' => false);
+ $ret = false;
// Note: when the password in the register table is 'verify', the uid actually contains the account_id
diff --git a/view/tpl/email_validation.tpl b/view/tpl/email_validation.tpl
index f049a040f..9913e0971 100644
--- a/view/tpl/email_validation.tpl
+++ b/view/tpl/email_validation.tpl
@@ -2,15 +2,15 @@
<div class="descriptive-paragraph" style="font-size: 1.2em;"><p>{{$desc}}</p></div>
-<form action="email_validation" method="post">
+<form action="email_validation/{{$email}}" method="post">
{{include file="field_input.tpl" field=$token}}
-<div class="pull-right">
- <a href="email_resend/{{$email}}" class="btn btn-warning">{{$resend}}</a>
-</div>
-<div class="submit-wrapper" >
+<div class="pull-right submit-wrapper">
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
</div>
+<div class="resend-email" >
+ <a href="email_resend/{{$email}}" class="btn btn-warning">{{$resend}}</a>
+</div>
</form>
<div class="clear"></div>