diff options
author | Friendika <info@friendika.com> | 2011-07-17 21:12:31 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-17 21:12:31 -0700 |
commit | 1fa2231c20db99c78f0c8681ebae04b6eecf0954 (patch) | |
tree | a56a5a459dae1cfa2bdb8dd1e9cc0e66a48a74d8 /mod/invite.php | |
parent | 43110db749850e49d309ad8b3e72266bd373a2a8 (diff) | |
download | volse-hubzilla-1fa2231c20db99c78f0c8681ebae04b6eecf0954.tar.gz volse-hubzilla-1fa2231c20db99c78f0c8681ebae04b6eecf0954.tar.bz2 volse-hubzilla-1fa2231c20db99c78f0c8681ebae04b6eecf0954.zip |
invite system
Diffstat (limited to 'mod/invite.php')
-rw-r--r-- | mod/invite.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mod/invite.php b/mod/invite.php index 5a6745436..d4eb9c5ef 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -20,7 +20,7 @@ function invite_post(&$a) { $total = 0; - if(get_config('system','invitations_only')) { + if(get_config('system','invitation_only')) { $invonly = true; $x = get_pconfig(local_user(),'system','invites_remaining'); if((! $x) && (! is_site_admin())) @@ -39,12 +39,16 @@ function invite_post(&$a) { if($invonly && ($x || is_site_admin())) { $code = autoname(8) . srand(1000,9999); $nmessage = str_replace('$invite_code',$code,$message); - // store in db + + $r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ", + dbesc($code), + dbesc(datetime_convert()) + ); if(! is_site_admin()) { $x --; if($x >= 0) - set_pconfig(local_user(),'system','invites_remaining,$x); + set_pconfig(local_user(),'system','invites_remaining',$x); else return; } @@ -81,7 +85,7 @@ function invite_content(&$a) { $tpl = get_markup_template('invite.tpl'); $invonly = false; - if(get_config('system','invitations_only')) { + if(get_config('system','invitation_only')) { $invonly = true; $x = get_pconfig(local_user(),'system','invites_remaining'); if((! $x) && (! is_site_admin())) { |