' . $error . '
';
+ if (!empty($errors)) {
+ errors_display($errors);
} else {
- print 'Your registration request has been received. An e-mail has been sent to ';
- print $person['email'];
- print ' with further instructions.
';
+ $email=$person['email'];
+ $text="Your registration request has been received. An e-mail has been sent to $email with further instructions.";
+ print html_div($text,"messages status");
}
}
+////////////////////
+if (!empty($person) && check_form ($person))
+ register_person($person);
+
$PLC_NAME = htmlspecialchars(PLC_NAME);
// E-mail address verified, go ahead and notify the PI (and possibly
@@ -155,42 +206,43 @@ $PLC_NAME = htmlspecialchars(PLC_NAME);
if (!empty($_REQUEST['id']) && !empty($_REQUEST['key'])) {
$person_id = intval($_REQUEST['id']);
if ($adm->VerifyPerson($person_id, $_REQUEST['key']) != 1) {
- print '' . $adm->error() . '.
';
+ plc_error($adm->error());
} else {
$persons = $adm->GetPersons(array($person_id));
$person = $persons[0];
// Remove the password field from the form so that it is not
// highlighted as missing.
- unset($form['password']);
+ unset($person_form['password']);
- print '';
- print 'Your e-mail address has been verified. ';
- print 'The PI(s) at your site have been notified of your account registration ';
+ $messages = array();
+ $messages []= 'Your e-mail address has been verified. ';
+ $messages []= 'The PI(s) at your site have been notified of your account registration ';
- if (in_array('pi', $person['roles'])) {
- $support = PLC_MAIL_SUPPORT_ADDRESS;
- print " and should contact
$PLC_NAME Support <$support>. ";
- print " $PLC_NAME Support will enable your account if authorized by your PI(s).";
+ if (! in_array('pi', $person['roles'])) {
+ $messages []= 'They are responsible for enabling your account.';
} else {
- print ' and are responsible for enabling your account.';
+ $support = PLC_MAIL_SUPPORT_ADDRESS;
+ $messages []= "They should contact
$PLC_NAME Support <$support>. ";
+ $messages []= "$PLC_NAME Support will enable your account once authorized by your PI(s).";
}
- print '
';
+ plc_itemize($messages,"messages status");
}
}
-$self = $_SERVER['PHP_SELF'];
-if (!empty($_SERVER['QUERY_STRING'])) {
- $self .= "?" . $_SERVER['QUERY_STRING'];
-}
-
$adm->begin();
// All defined sites
// cannot register with foreign site
-$adm->GetSites(array('is_public' => TRUE, 'peer_id' => NULL,'-SORT'=>'name'),
- array('site_id', 'name','enabled','peer_id'));
+// we also hide sites that are created by sfa
+// as well as the ones that have a disabled_registration tag set
+$adm->GetSites(array('is_public' => TRUE, 'peer_id' => NULL,
+ 'sfa_created' => NULL,
+ 'disabled_registration' => NULL,
+ '-SORT'=>'name'),
+ array('site_id', 'name', 'enabled', 'peer_id',
+ 'sfa_created', 'disabled_registration'));
// All defined roles
$adm->GetRoles();
@@ -211,14 +263,14 @@ function site_option($site) {
$selected = "";
}
- $option = "