5 function regmod_content(&$a) {
8 notice( t('Please login.') . EOL);
9 $o = login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
20 $register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1",
25 if(! count($register))
30 $r = q("DELETE FROM `user` WHERE `uid` = %d LIMIT 1",
31 intval($register[0]['uid'])
33 $r = q("DELETE FROM `contact` WHERE `uid` = %d",
34 intval($register[0]['uid'])
36 $r = q("DELETE FROM `profile` WHERE `uid` = %d",
37 intval($register[0]['uid'])
40 $r = q("DELETE FROM `register` WHERE `hash` = '%s' LIMIT 1",
41 dbesc($register[0]['hash'])
43 notice( t('Registration revoked.') . EOL);
50 $user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
51 intval($register[0]['uid'])
56 $r = q("DELETE FROM `register` WHERE `hash` = '%s' LIMIT 1",
57 dbesc($register[0]['hash'])
61 $r = q("UPDATE `user` SET `blocked` = 0, `verified` = 1 WHERE `uid` = %d LIMIT 1",
62 intval($register[0]['uid'])
65 $email_tpl = file_get_contents("view/register_open_eml.tpl");
66 $email_tpl = replace_macros($email_tpl, array(
67 '$sitename' => $a->config['sitename'],
68 '$siteurl' => $a->get_baseurl(),
69 '$username' => $user[0]['username'],
70 '$email' => $user[0]['email'],
71 '$password' => $register[0]['password'],
72 '$uid' => $user[0]['uid']
75 $res = mail($user[0]['email'], t('Registration details for '). $a->config['sitename'],
76 $email_tpl,'From: ' . t('Administrator@') . $_SERVER[SERVER_NAME] );
80 notice( t('Account approved.') . EOL );