function lockr_admin_register_submit in Lockr 7
Same name and namespace in other branches
- 7.2 include/register_form.inc \lockr_admin_register_submit()
Submit the register form.
1 string reference to 'lockr_admin_register_submit'
- lockr_admin_register_form in include/
register_form.inc - Returns the register form.
File
- include/
register_form.inc, line 49 - Form handlers for registration.
Code
function lockr_admin_register_submit($form, &$form_state) {
$values = $form_state['values'];
$next = $form_state['storage']['redirect'];
$name = variable_get('site_name');
try {
lockr_site_client()
->register($values['email'], null, $name);
} catch (ClientException $e) {
drupal_set_message(t('This email is already registered with Lockr. ' . 'Please login to register a new site.'));
drupal_goto('admin/config/system/lockr/login', array(
'query' => array(
'next' => $next,
'email' => $form_state['values']['email'],
),
));
} catch (ServerException $e) {
form_set_error('', t('An unknown error has occurred, please try again later.'));
}
drupal_set_message(t("That's it! You're signed up with Lockr; your keys can now be safely stored off-site."));
$form_state['redirect'] = $next;
}