diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2015-06-25 15:46:39 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-06-27 13:04:03 +0200 |
commit | 3dbaee80b4fcc99cd236f76e60a1572377946123 (patch) | |
tree | f3869fdb4a3774b57f7a1fa817964a8e6d74ef31 /web/html/register.php | |
parent | 6395a5d5b86ce4aca75a4eb246db77cd08ae0ffc (diff) | |
download | aurweb-3dbaee80b4fcc99cd236f76e60a1572377946123.tar.xz |
Move registration code to a separate unit
Until now, we used the same unit to register and edit accounts. Split
these features into separate source files for clarity. This also allows
us to redirect to the home page when a logged-in user tries to access
the registration page.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/html/register.php')
-rw-r--r-- | web/html/register.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/web/html/register.php b/web/html/register.php new file mode 100644 index 0000000..014d802 --- /dev/null +++ b/web/html/register.php @@ -0,0 +1,36 @@ +<?php + +set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); + +include_once('aur.inc.php'); # access AUR common functions +include_once('acctfuncs.inc.php'); # access Account specific functions + +set_lang(); # this sets up the visitor's language +check_sid(); # see if they're still logged in + +if (isset($_COOKIE["AURSID"])) { + header('Location: /'); + exit(); +} + +html_header(__('Register')); + +echo '<div class="box">'; +echo '<h2>' . __('Register') . '</h2>'; + +if (in_request("Action") == "NewAccount") { + process_account_form("new", "NewAccount", in_request("U"), 1, 0, + in_request("E"), '', '', in_request("R"), + in_request("L"), in_request("I"), in_request("K"), + in_request("PK")); + +} else { + print __("Use this form to create an account."); + display_account_form("NewAccount", "", "", "", "", "", "", "", $LANG); +} + +echo '</div>'; + +html_footer(AURWEB_VERSION); + +?> |