5 function regmod_content(&$a) {
8 notice( t('Please login.') . EOL);
9 $o .= '<br /><br />' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
20 $register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1",
25 if(! count($register))
28 $user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
29 intval($register[0]['uid'])
34 $r = q("DELETE FROM `user` WHERE `uid` = %d LIMIT 1",
35 intval($register[0]['uid'])
37 $r = q("DELETE FROM `contact` WHERE `uid` = %d LIMIT 1",
38 intval($register[0]['uid'])
40 $r = q("DELETE FROM `profile` WHERE `uid` = %d LIMIT 1",
41 intval($register[0]['uid'])
44 $r = q("DELETE FROM `register` WHERE `hash` = '%s' LIMIT 1",
45 dbesc($register[0]['hash'])
47 notice( t('Registration revoked for ') . $user[0]['username'] . EOL);
52 if($cmd === 'allow') {
57 $r = q("DELETE FROM `register` WHERE `hash` = '%s' LIMIT 1",
58 dbesc($register[0]['hash'])
62 $r = q("UPDATE `user` SET `blocked` = 0, `verified` = 1 WHERE `uid` = %d LIMIT 1",
63 intval($register[0]['uid'])
66 $email_tpl = load_view_file("view/register_open_eml.tpl");
67 $email_tpl = replace_macros($email_tpl, array(
68 '$sitename' => $a->config['sitename'],
69 '$siteurl' => $a->get_baseurl(),
70 '$username' => $user[0]['username'],
71 '$email' => $user[0]['email'],
72 '$password' => $register[0]['password'],
73 '$uid' => $user[0]['uid']
76 $res = mail($user[0]['email'], t('Registration details for '). $a->config['sitename'],
77 $email_tpl,'From: ' . t('Administrator@') . $_SERVER[SERVER_NAME] );
80 notice( t('Account approved.') . EOL );