aboutsummaryrefslogtreecommitdiffstats
path: root/mod/invite.php
diff options
context:
space:
mode:
authorWave <wave72@users.noreply.github.com>2015-12-20 10:20:36 +0100
committerWave <wave72@users.noreply.github.com>2015-12-20 10:20:36 +0100
commit2aad4c2cf9c17a7532089aadfcc5feff6505ec74 (patch)
tree2082c8dc7ba090f610874b6e33b0f1092a2ff00c /mod/invite.php
parent474a1267d73c1dcf00678dd15ed4e0e37496473d (diff)
parente2692a4baaf031bd0d9c0893c3762637b1f6b201 (diff)
downloadvolse-hubzilla-2aad4c2cf9c17a7532089aadfcc5feff6505ec74.tar.gz
volse-hubzilla-2aad4c2cf9c17a7532089aadfcc5feff6505ec74.tar.bz2
volse-hubzilla-2aad4c2cf9c17a7532089aadfcc5feff6505ec74.zip
Merge pull request #4 from redmatrix/master
Merge master into dev branch
Diffstat (limited to 'mod/invite.php')
-rw-r--r--mod/invite.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/mod/invite.php b/mod/invite.php
index bda808142..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) . srand(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)