diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-08-26 20:19:27 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-08-26 20:19:27 -0400 |
commit | e248066b74aa697a1dfd99153b1e8c2e18f32831 (patch) | |
tree | 38be118593b899768755da8b74efdb6738dd44fd /lib/util.php | |
parent | c2839a80f00991fa4fe6ec3d3fd654bcc27840f4 (diff) |
updates for invitations
Add the code to registration to handle invitation codes.
Some edge cases on invitations: is the user already subbed to this
person? Tell them. Is the person already on the system? Sub the user
to them, then, and tell the user.
Add some code to User to auto-sub invitees whenever the email address
changes. Call it from a new registration with an invite code, and also
from confirmaddress.
Some whitespace cleanup in the files touched.
darcs-hash:20080827001927-84dde-b50e5d921ca3f2fb894821730ff93cac09d2ba66.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php index 0b463b211..eeb2d7f64 100644 --- a/lib/util.php +++ b/lib/util.php @@ -136,7 +136,7 @@ function common_init_language() { $language = common_language(); # So we don't have to make people install the gettext locales putenv('LANGUAGE='.$language); - putenv('LANG='.$language); + putenv('LANG='.$language); $locale_set = setlocale(LC_ALL, $language . ".utf8", $language . ".UTF8", $language . ".utf-8", @@ -816,11 +816,16 @@ function common_fancy_url($action, $args=NULL) { return common_path('doc/'.$args['title']); case 'login': case 'logout': - case 'register': case 'subscribe': case 'unsubscribe': case 'invite': return common_path('main/'.$action); + case 'register': + if ($args && $args['code']) { + return common_path('main/register/'.$args['code']); + } else { + return common_path('main/register'); + } case 'remotesubscribe': if ($args && $args['nickname']) { return common_path('main/remote?nickname=' . $args['nickname']); |