pari: trunk r106 - in /trunk/config: options.html scripts/astman.js users.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Nov 2 17:23:59 MST 2006


Author: pari
Date: Thu Nov  2 18:23:58 2006
New Revision: 106

URL: http://svn.digium.com/view/asterisk-gui?rev=106&view=rev
Log:
minor bug fixes in Users 

Modified:
    trunk/config/options.html
    trunk/config/scripts/astman.js
    trunk/config/users.html

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?rev=106&r1=105&r2=106&view=diff
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Thu Nov  2 18:23:58 2006
@@ -161,7 +161,10 @@
 
 
 function compare_passwords(){
-	if( $('newpass').value==$('newpass_rep').value && $('newpass').value.length > 3 ){
+	if( $('newpass').value.length < 4 ){
+		$('dopwdsmatch').style.color = "#EE0000";
+		$('dopwdsmatch').innerHTML = "Password should be atleast 4 characters !" ;
+	}else if ( $('newpass').value==$('newpass_rep').value){
 		$('dopwdsmatch').style.color = "#005D2E";
 		$('dopwdsmatch').innerHTML = "Passwords Match !" ;
 	}else{

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=106&r1=105&r2=106&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Thu Nov  2 18:23:58 2006
@@ -704,6 +704,11 @@
 
 
 function save_item(box) {
+	if (box.callbacks.beforeSaving){	 // like for field validations etc.
+		var tmp =	box.callbacks.beforeSaving();
+		if ( tmp == false )
+			return false;
+	}
 	var opt = {
 		method: 'get',
 		asynchronous: true,
@@ -1358,8 +1363,13 @@
 							pattern = this.getAttribute('pattern');
 							if (pattern && check_pattern(pattern, this.oldvalue) && !check_pattern(pattern, this.value)) {
 									this.value = this.oldvalue;
-							} else
+									if (widgets['status']) 
+										widgets['status'].innerHTML = "<font size='-1' color=red>Invalid Character !</font>";
+							} else{
+									if (widgets['status']) 
+										widgets['status'].innerHTML = "";
 								this.savewidget.activateSave();
+							}
 							return true;
 						}
 					}

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?rev=106&r1=105&r2=106&view=diff
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Thu Nov  2 18:23:58 2006
@@ -85,7 +85,17 @@
 		return tmp;
 	}
 	callbacks.identifier = "extension";
-	
+	callbacks.beforeSaving = function(){
+		if(!$('fullname').value.length){
+				alert("Sorry, a User Name must be specified !");
+				$('fullname').focus();
+				return false;
+		}
+
+		return true;
+	}
+
+
 	phonecallbacks.format = function(t) {
 		if (t.fieldbyname['port'] == 'fxo')
 			return "Analog Port #" + t.name;



More information about the asterisk-gui-commits mailing list