diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-12-08 18:32:05 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-12-08 18:32:05 -0800 |
commit | 648f972cf04660139810329e777259e254537bc1 (patch) | |
tree | 5f63da9f6da10d7191001688a54f564efaf36b1f | |
parent | baab9b6fbc45a30dc4cce5b3c85d7c94e8e6a84c (diff) | |
parent | 60b0f9af909b6f944edd913cb96915cc8c3b7ec3 (diff) | |
download | volse-hubzilla-648f972cf04660139810329e777259e254537bc1.tar.gz volse-hubzilla-648f972cf04660139810329e777259e254537bc1.tar.bz2 volse-hubzilla-648f972cf04660139810329e777259e254537bc1.zip |
Merge https://github.com/redmatrix/hubzilla into pending_merge
-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) |