X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Finvite.php;h=d4eb9c5ef17b59cd539d56913d7278af01107076;hb=a2073bcfc05abadc3e967f40c66d1fa674bba0d3;hp=5a67454361c1f315b7508d1dfd9cee23117d4fbf;hpb=43110db749850e49d309ad8b3e72266bd373a2a8;p=friendica.git diff --git a/mod/invite.php b/mod/invite.php old mode 100644 new mode 100755 index 5a67454361..d4eb9c5ef1 --- 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())) {