[icinga-checkins] icinga.org: icinga-web/next: Avoid red username field at first login ( for shroud and formorer) (refs #1558)

git at icinga.org git at icinga.org
Thu Mar 28 11:24:11 CET 2013


Module: icinga-web
Branch: next
Commit: dd5a4ee76423c574956974945f23f1071a612bf6
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=dd5a4ee76423c574956974945f23f1071a612bf6

Author: Markus Frosch <markus at lazyfrosch.de>
Date:   Thu Mar 28 11:13:19 2013 +0100

Avoid red username field at first login (for shroud and formorer) (refs #1558)

---

 .../AppKit/templates/Login/AjaxLoginSuccess.php    |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/modules/AppKit/templates/Login/AjaxLoginSuccess.php b/app/modules/AppKit/templates/Login/AjaxLoginSuccess.php
index f0724c2..b0438c9 100644
--- a/app/modules/AppKit/templates/Login/AjaxLoginSuccess.php
+++ b/app/modules/AppKit/templates/Login/AjaxLoginSuccess.php
@@ -59,7 +59,7 @@ Ext.onReady(function() {
                 fieldLabel: '<?php echo $tm->_("User"); ?>',
                 name: 'username',
                 id: 'username',
-                allowBlank: false
+                allowBlank: true
             }, {
                 fieldLabel: '<?php echo $tm->_("Password"); ?>',
                 inputType: 'password',
@@ -71,7 +71,9 @@ Ext.onReady(function() {
             listeners: {
                 afterrender: function(p) {
                     pub.resetForm(true);
-                    oFormPanel.getForm().findField('username').setValue('<?php echo $username; ?>');
+                    var old_username = '<?php echo $username; ?>';
+                    if(old_username)
+                        oFormPanel.getForm().findField('username').setValue(old_username);
                     
                     Ext.getCmp('menu').destroy();
                     
@@ -167,6 +169,8 @@ Ext.onReady(function() {
             },
             
             failure: function(f, a) {
+                oFormPanel.getForm().findField('username').allowBlank = false;
+                oFormPanel.getForm().findField('password').allowBlank = false;
                 
                 if (a.failureType != Ext.form.Action.CLIENT_INVALID) {
                     var c = {





More information about the icinga-checkins mailing list