3 require_once(dirname(dirname(dirname(__FILE__
)))."/includes.php");
4 require_once('openid_includes.php');
6 $code = optional_param('code');
8 $messages[] = gettext("Your confirmation code appears to be missing. Please check your link and try again.");
9 } elseif ($code{0} == 'a') {
10 // request to activate an account
11 $action = optional_param('action');
13 if ($action && $action == 'submit_form') {
14 $over13 = optional_param('over13');
15 $username = optional_param('username');
17 $messages[] = gettext("You must indicate that you are at least 13 years old to join.");
19 } elseif (!$details = get_record('invitations','code',$code)) {
20 $messages[] = $invalid_code_msg;
22 // OK, everything seems to be in order, so activate this user
23 set_field('users','email',$details->email
,'ident',$details->owner
);
24 set_field('users','name',$details->name
,'ident',$details->owner
);
25 set_field('users','active','yes','ident',$details->owner
);
26 $username = get_field('users','username','ident',$details->owner
);
27 $alias = get_field('users','alias','ident',$details->owner
);
28 $messages[] = gettext("Your account was created! You can now log in using the OpenID ($alias) you supplied.");
33 } elseif ($code{0} == 'c') {
34 // request to change an email address
36 if (!$details = get_record('invitations','code',$code)) {
37 $messages[] = $invalid_code_msg;
39 // OK, everything seems to be in order, so change the email address
40 set_field('users','email',$details->email
,'ident',$details->owner
);
41 $messages[] = gettext("Your email address has been changed to {$details->email} . "
42 ."You can now login using your OpenID if you are not already logged in.");
47 $thankYou = gettext("Thank you for registering for an account with {$CFG->sitename}! "
48 ."Registration is completely free, but before you confirm your details,"
49 ." please take a moment to read the following documents:");
50 $terms = gettext("terms and conditions"); // gettext variable
51 $privacy = gettext("Privacy policy"); // gettext variable
52 $age = gettext("Submitting the form below indicates acceptance of these terms. "
53 ."Please note that currently you must be at least 13 years of age to join the site."); // gettext variable
60 <li
><a href
="{$CFG->wwwroot}content/terms.php" target
="_blank">$sitename $terms</a
></li
>
61 <li
><a href
="{$CFG->wwwroot}content/privacy.php" target
="_blank">$privacy</a
></li
>
67 <form action
="" method
="post">
70 $correctAge = gettext("I am at least thirteen years of age."); // gettext variable
71 $buttonValue = gettext("Join"); // gettext variable
74 <label
for="over13checkbox"><input type
="checkbox" id
="over13checkbox" name
="over13" value
="yes" /> <strong
>$correctAge</strong
></label
>
77 <input type
="hidden" name
="action" value
="submit_form" />
78 <input type
="hidden" name
="invitecode" value
="$code" />
79 <input type
="submit" value
="$buttonValue" />
86 define("context", "OpenID confirmation");
88 templates_page_setup();
90 echo templates_page_draw( array(
94 'title' => gettext("OpenID confirmation"),
95 'context' => 'contentholder'