diff options
author | cash <cash.costello@gmail.com> | 2011-12-17 17:16:38 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-12-17 17:16:38 -0500 |
commit | aa9ed6f3eb46fb9508692d1b5d92c717c3648527 (patch) | |
tree | c5078f952b2ff8c362f3ab07e6208fcc2243e59f /views/default/forms/openid_client | |
parent | de76ce685a8bb37a4fc7daa621b496a3bbae3878 (diff) | |
download | elgg-aa9ed6f3eb46fb9508692d1b5d92c717c3648527.tar.gz elgg-aa9ed6f3eb46fb9508692d1b5d92c717c3648527.tar.bz2 |
added warnings for email/usernames
Diffstat (limited to 'views/default/forms/openid_client')
-rw-r--r-- | views/default/forms/openid_client/register.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/views/default/forms/openid_client/register.php b/views/default/forms/openid_client/register.php index 63d5ba04e..279d298c4 100644 --- a/views/default/forms/openid_client/register.php +++ b/views/default/forms/openid_client/register.php @@ -7,10 +7,19 @@ * @uses $vars['is_username_available'] * @uses $vars['is_username_valid'] * @uses $vars['email'] + * @uses $vars['is_email_available'] * @uses $vars['name'] */ $username_label = elgg_echo('username'); +$username_warning = ''; +if (!elgg_extract('is_username_available', $vars, true)) { + $username_warning = elgg_echo('openid_client:warning:username_not_available', array($vars['username'])); + $username_warning = "($username_warning)"; +} else if (!elgg_extract('is_username_valid', $vars, true)) { + $username_warning = elgg_echo('openid_client:warning:username_valid', array($vars['username'])); + $username_warning = "($username_warning)"; +} $username_input = elgg_view('input/text', array( 'name' => 'username', 'value' => $vars['username'], @@ -23,9 +32,16 @@ $name_input = elgg_view('input/text', array( )); $email_label = elgg_echo('email'); +$email_available = elgg_extract('is_email_available', $vars, true); +$email_warning = ''; +if (!$email_available) { + $email_warning = elgg_echo('openid_client:warning:email_not_available', array($vars['email'])); + $email_warning = "($email_warning)"; +} $email_input = elgg_view('input/email', array( 'name' => 'email', 'value' => $vars['email'], + 'disabled' => !$email_available, )); $openid_input = elgg_view('input/hidden', array( @@ -36,7 +52,7 @@ $button = elgg_view('input/submit', array('value' => elgg_echo('save'))); echo <<<HTML <div> - <label>$username_label</label> + <label>$username_label</label> $username_warning $username_input </div> <div> @@ -44,7 +60,7 @@ echo <<<HTML $name_input </div> <div> - <label>$email_label</label> + <label>$email_label</label> $email_warning $email_input </div> <div class="elgg-foot"> |