[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [ocs-webserver/dev] application/modules/default: register
From: Ronald von Schlegell <null () kde ! org>
Date: 2018-09-13 9:45:26
Message-ID: E1g0OBi-0008Ck-De () code ! kde ! org
[Download RAW message or body]
Git commit dd858e5e69fdea450a0463cab69a309acc55748d by Ronald von Schlegell.
Committed on 13/09/2018 at 09:45.
Pushed by ronaldv into branch 'dev'.
register
M +2 -0 application/modules/default/forms/Register.php
M +15 -1 application/modules/default/views/scripts/authorization/register.phtml
https://commits.kde.org/ocs-webserver/dd858e5e69fdea450a0463cab69a309acc55748d
diff --git a/application/modules/default/forms/Register.php \
b/application/modules/default/forms/Register.php index fced9fb9..dfb7667f 100644
--- a/application/modules/default/forms/Register.php
+++ b/application/modules/default/forms/Register.php
@@ -41,6 +41,7 @@ class Default_Form_Register extends Zend_Form
$usernameValidChars = new \
Zend_Validate_Regex('/^(?=.{4,40}$)(?![-])(?!.*[-]{2})[a-z0-9-]+(?<![-])$/'); \
$userExistCheck = new Local_Validate_UsernameExists();
$userExistCheck->setMessage('This username already exists.', \
Local_Validate_UsernameExists::EXISTS); + $userExistCheck->setMessage('This \
username already exists.'); $userEmptyCheck = new Zend_Validate_NotEmpty();
$userEmptyCheck->setMessage('RegisterFormUsernameErr', \
Zend_Validate_NotEmpty::IS_EMPTY);
$userNameLength = new Zend_Validate_StringLength(array('min' => 4, 'max' => \
40)); @@ -99,6 +100,7 @@ class Default_Form_Register extends Zend_Form
->setDecorators(array('ViewHelper', 'Errors'))
->setAttrib('placeholder', 'Password')
->addValidator('stringLength', true, array(6, 200))
+ ->setAttrib('placeholder', 'Password (6 chars minimum)')
->setAttrib('class', 'form-control')
;
diff --git a/application/modules/default/views/scripts/authorization/register.phtml \
b/application/modules/default/views/scripts/authorization/register.phtml index \
d31b116d..806c1557 100644
--- a/application/modules/default/views/scripts/authorization/register.phtml
+++ b/application/modules/default/views/scripts/authorization/register.phtml
@@ -130,7 +130,21 @@ $('document').ready(function(){
if (response[id]) {
$('#'+id).parent().append('<i class="glyphicon \
glyphicon-remove form-control-feedback"></i>'); \
$('#'+id).parent().find('.errors').remove();
- $('#'+id).parent().append('<ul class="errors" \
style="text-align: left;"><li>Not valid</li></ul>'); +
+ $msgArray = response[id];
+ $msgString = "";
+ $msgString += '<ul class="errors" style="text-align: \
left;">'; +
+ $.each($msgArray, function( key, value ) {
+
+ $msgString += '<li class="errors">' + value + '</li>';
+ });
+ $msgString += '</ul>';
+ $('#'+id).parent().append($msgString);
+
+ if($msgString == '<ul class="errors" style="text-align: \
left;"></ul>') { + $('#'+id).parent().append('<ul \
class="errors" style="text-align: left;"><li>'+id+' is already taken</li></ul>'); + \
} }
} else {
ValidateAjax.isClean[id] = true;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic