X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fregmod.php;h=53e6716f265c7be0cbec9eb6a7a6b18abd635b9e;hb=e54414692e6b302cbd3bee88587d3f12c812bf1a;hp=73bfc597b57f86466cd7ae96bdc60469ed6a200e;hpb=4ab363ed717fc4932b657f64fac4ff033bd6d867;p=friendica.git diff --git a/mod/regmod.php b/mod/regmod.php index 73bfc597b5..53e6716f26 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -1,6 +1,7 @@ get_template_engine(); - get_app()->set_template_engine(); - - $email_tpl = get_intltext_template("register_open_eml.tpl"); - $email_tpl = replace_macros($email_tpl, array( - '$sitename' => $a->config['sitename'], - '$siteurl' => $a->get_baseurl(), - '$username' => $user[0]['username'], - '$email' => $user[0]['email'], - '$password' => $register[0]['password'], - '$uid' => $user[0]['uid'] - )); - - - get_app()->set_template_engine($engine); - - - $res = mail($user[0]['email'], email_header_encode( sprintf(t('Registration details for %s'), $a->config['sitename']), 'UTF-8'), - $email_tpl, - 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n" - . 'Content-type: text/plain; charset=UTF-8' . "\n" - . 'Content-transfer-encoding: 8bit' ); + send_register_open_eml( + $user[0]['email'], + $a->config['sitename'], + $a->get_baseurl(), + $user[0]['username'], + $register[0]['password']); pop_lang(); if($res) { info( t('Account approved.') . EOL ); return true; - } + } } @@ -90,23 +75,23 @@ function user_deny($hash) { $user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($register[0]['uid']) ); - - $r = q("DELETE FROM `user` WHERE `uid` = %d LIMIT 1", + + $r = q("DELETE FROM `user` WHERE `uid` = %d", intval($register[0]['uid']) ); - $r = q("DELETE FROM `contact` WHERE `uid` = %d LIMIT 1", + $r = q("DELETE FROM `contact` WHERE `uid` = %d", intval($register[0]['uid']) - ); - $r = q("DELETE FROM `profile` WHERE `uid` = %d LIMIT 1", + ); + $r = q("DELETE FROM `profile` WHERE `uid` = %d", intval($register[0]['uid']) - ); + ); - $r = q("DELETE FROM `register` WHERE `hash` = '%s' LIMIT 1", + $r = q("DELETE FROM `register` WHERE `hash` = '%s'", dbesc($register[0]['hash']) ); notice( sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL); return true; - + } function regmod_content(&$a) { @@ -135,10 +120,14 @@ function regmod_content(&$a) { if($cmd === 'deny') { - if (!user_deny($hash)) killme(); + user_deny($hash); + goaway("/admin/users/"); + killme(); } if($cmd === 'allow') { - if (!user_allow($hash)) killme(); + user_allow($hash); + goaway("/admin/users/"); + killme(); } }