aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/forms')
-rw-r--r--views/default/forms/openid_client/register.php20
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">