aboutsummaryrefslogtreecommitdiffstats
path: root/mod/register.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-09 21:10:56 -0700
committerfriendica <info@friendica.com>2014-07-09 21:10:56 -0700
commitfa706c8e860d4057f401b3ca0dff04fb8aa47363 (patch)
tree780ae79755a79d2bc33ca3b042884b4eac30296c /mod/register.php
parentc59cd91836ce4f487b84fbfb2d155385de63791e (diff)
downloadvolse-hubzilla-fa706c8e860d4057f401b3ca0dff04fb8aa47363.tar.gz
volse-hubzilla-fa706c8e860d4057f401b3ca0dff04fb8aa47363.tar.bz2
volse-hubzilla-fa706c8e860d4057f401b3ca0dff04fb8aa47363.zip
finish implementing email verification. Currently it only applies if REGISTER_OPEN is in effect.
Diffstat (limited to 'mod/register.php')
-rw-r--r--mod/register.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/mod/register.php b/mod/register.php
index 990cce2ed..2a6e16a6d 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -52,14 +52,17 @@ function register_post(&$a) {
$policy = get_config('system','register_policy');
+ $email_verify = get_config('system','verify_email');
+
+
switch($policy) {
case REGISTER_OPEN:
- $flags = ACCOUNT_UNVERIFIED;
+ $flags = ACCOUNT_OK;
break;
case REGISTER_APPROVE:
- $flags = ACCOUNT_UNVERIFIED | ACCOUNT_BLOCKED | ACCOUNT_PENDING;
+ $flags = ACCOUNT_BLOCKED | ACCOUNT_PENDING;
break;
default:
@@ -68,10 +71,13 @@ function register_post(&$a) {
notice( t('Permission denied.') . EOL );
return;
}
- $flags = ACCOUNT_UNVERIFIED | ACCOUNT_BLOCKED;
+ $flags = ACCOUNT_BLOCKED;
break;
}
+ if($email_verify)
+ $flags = $flags | ACCOUNT_UNVERIFIED;
+
if((! $_POST['password']) || ($_POST['password'] !== $_POST['password2'])) {
notice( t('Passwords do not match.') . EOL);
@@ -100,7 +106,12 @@ function register_post(&$a) {
}
if($policy == REGISTER_OPEN ) {
- $res = send_verification_email($result['email'],$result['password']);
+ if($email_verify) {
+ $res = verify_email_address($result);
+ }
+ else {
+ $res = send_verification_email($result['email'],$result['password']);
+ }
if($res) {
info( t('Registration successful. Please check your email for validation instructions.') . EOL ) ;
}
@@ -116,6 +127,10 @@ function register_post(&$a) {
goaway(z_root());
}
+ if($email_verify) {
+ goaway(z_root());
+ }
+
authenticate_success($result['account'],true,false,true);
if(! strlen($next_page = get_config('system','workflow_register_next')))