X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fregmod.php;h=eabbec090b92ef9d445f58951f8b1fbd058db786;hb=bf8dadb9700fd0600a38116bf03588883350aab1;hp=373180ba2704b0a50e15716c95a3aaa38b1c61b2;hpb=d5a13b1e4c0f35445aa539ff6b3779062907a9cb;p=friendica.git diff --git a/mod/regmod.php b/mod/regmod.php index 373180ba27..eabbec090b 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -4,16 +4,23 @@ function regmod_content(&$a) { + $_SESSION['return_url'] = $a->cmd; + if(! local_user()) { notice( t('Please login.') . EOL); $o .= '

' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1); return $o; } + if((! (x($a->config,'admin_email'))) || ($a->config['admin_email'] !== $a->user['email'])) { + notice( t('Permission denied.') . EOL); + return ''; + } + if($a->argc != 3) killme(); - $cmd = $a->argv[1]; + $cmd = $a->argv[1]; $hash = $a->argv[2]; @@ -29,7 +36,7 @@ function regmod_content(&$a) { intval($register[0]['uid']) ); - if($cmd == 'deny') { + if($cmd === 'deny') { $r = q("DELETE FROM `user` WHERE `uid` = %d LIMIT 1", intval($register[0]['uid']) @@ -49,7 +56,7 @@ function regmod_content(&$a) { } - if($cmd == 'allow') { + if($cmd === 'allow') { if(! count($user)) killme(); @@ -74,7 +81,7 @@ function regmod_content(&$a) { )); $res = mail($user[0]['email'], t('Registration details for '). $a->config['sitename'], - $email_tpl,'From: ' . t('Administrator@') . $_SERVER[SERVER_NAME] ); + $email_tpl,'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] ); if($res) { notice( t('Account approved.') . EOL );