diff options
author | jeroenpraat <jeroenpraat@xs4all.nl> | 2015-12-09 01:39:02 +0100 |
---|---|---|
committer | jeroenpraat <jeroenpraat@xs4all.nl> | 2015-12-09 01:39:02 +0100 |
commit | 9d04406f9ae8a91f8ec5f3be7f89471ac5605522 (patch) | |
tree | bdf17751d42cdf6af034a5100ee32672e9cc54d3 | |
parent | b9f5076cfc254fffe708d32aa2752adbc1857675 (diff) | |
download | volse-hubzilla-9d04406f9ae8a91f8ec5f3be7f89471ac5605522.tar.gz volse-hubzilla-9d04406f9ae8a91f8ec5f3be7f89471ac5605522.tar.bz2 volse-hubzilla-9d04406f9ae8a91f8ec5f3be7f89471ac5605522.zip |
First part of fix for issue #109
-rw-r--r-- | mod/invite.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/mod/invite.php b/mod/invite.php index 1af5fc1f8..e8bb74ee2 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -50,23 +50,6 @@ function invite_post(&$a) { continue; } - if($invonly && ($x || is_site_admin())) { - $code = autoname(8) . rand(1000,9999); - $nmessage = str_replace('$invite_code',$code,$message); - - $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_channel(),'system','invites_remaining',$x); - else - return; - } - } else $nmessage = $message; @@ -117,6 +100,23 @@ function invite_content(&$a) { } } + if($invonly && ($x || is_site_admin())) { + $invite_code = autoname(8) . rand(1000,9999); + $nmessage = str_replace('$invite_code',$invite_code,$message); + + $r = q("INSERT INTO `register` (`hash`,`created`) VALUES ('%s', '%s') ", + dbesc($invite_code), + dbesc(datetime_convert()) + ); + + if(! is_site_admin()) { + $x --; + if($x >= 0) + set_pconfig(local_channel(),'system','invites_remaining',$x); + else + return; + } + } $ob = $a->get_observer(); if(! $ob) |