Elgg  Version 1.11
register.php
Go to the documentation of this file.
1 <?php
15 // check new registration allowed
16 if (elgg_get_config('allow_registration') == false) {
17  register_error(elgg_echo('registerdisabled'));
18  forward();
19 }
20 
21 $friend_guid = (int) get_input('friend_guid', 0);
22 $invitecode = get_input('invitecode');
23 
24 // only logged out people need to register
25 if (elgg_is_logged_in()) {
26  forward();
27 }
28 
29 $title = elgg_echo("register");
30 
31 // create the registration url - including switching to https if configured
32 $register_url = elgg_get_site_url() . 'action/register';
33 if (elgg_get_config('https_login')) {
34  $register_url = str_replace("http:", "https:", $register_url);
35 }
36 $form_params = array(
37  'action' => $register_url,
38  'class' => 'elgg-form-account',
39 );
40 
41 $body_params = array(
42  'friend_guid' => $friend_guid,
43  'invitecode' => $invitecode
44 );
46 
47 $content .= elgg_view('help/register');
48 
49 if (elgg_get_config('walled_garden')) {
50  elgg_load_css('elgg.walled_garden');
51  $body = elgg_view_layout('walled_garden', array('content' => $content));
52  echo elgg_view_page($title, $body, 'walled_garden');
53 } else {
54  $body = elgg_view_layout('one_column', array(
55  'title' => $title,
56  'content' => $content,
57  ));
59 }
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
Definition: sessions.php:51
$body
Definition: register.php:7
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$invitecode
Definition: register.php:18
$friend_guid
Definition: register.php:17
$register_url
Definition: register.php:32
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:419
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:255
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
$body_params
Definition: register.php:41
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
if(elgg_get_config('https_login')) $form_params
Definition: register.php:36
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:622
$content
Definition: register.php:45
if(elgg_is_logged_in()) $title
Definition: register.php:29
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:383
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:437
elgg_view_form($action, $form_vars=array(), $body_vars=array())
Definition: views.php:1313