From 48b03938fc817d4ec96ed0d1fa2fb3a4fc16115c Mon Sep 17 00:00:00 2001 From: Sudarshan Phule Date: Fri, 29 Jul 2011 16:25:43 +0530 Subject: [PATCH] Committed user_admin.php and usergroup_admin_add.php for bug where creation of new user without first and last name doesn't get access control --- interface/usergroup/user_admin.php | 28 ++++++++++++++++-- interface/usergroup/usergroup_admin_add.php | 44 +++++++++++++++++++++++++---- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/interface/usergroup/user_admin.php b/interface/usergroup/user_admin.php index 7944fb3c3..02917b053 100644 --- a/interface/usergroup/user_admin.php +++ b/interface/usergroup/user_admin.php @@ -189,6 +189,30 @@ function checkChange() function submitform() { top.restoreSession(); var flag=0; + function trimAll(sString) + { + while (sString.substring(0,1) == ' ') + { + sString = sString.substring(1, sString.length); + } + while (sString.substring(sString.length-1, sString.length) == ' ') + { + sString = sString.substring(0,sString.length-1); + } + return sString; + } + if(trimAll(document.getElementById('fname').value) == ""){ + alert(""); + document.getElementById('fname').style.backgroundColor="red"; + document.getElementById('fname').focus(); + return false; + } + if(trimAll(document.getElementById('lname').value) == ""){ + alert(""); + document.getElementById('lname').style.backgroundColor="red"; + document.getElementById('lname').focus(); + return false; + } if(document.forms[0].clearPass.value!="") { //Checking for the strong password if the 'secure password' feature is enabled @@ -367,12 +391,12 @@ $bg_count=count($acl_name); : -"> +"> * : "> -: "> +: "> * :