pari: trunk r365 - /trunk/config/scripts/astman.js

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Feb 19 11:47:40 MST 2007


Author: pari
Date: Mon Feb 19 12:47:40 2007
New Revision: 365

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=365
Log:
if contactinfo.conf or zapscan.conf are not found .. create those files without throwing an error at the user 

Modified:
    trunk/config/scripts/astman.js

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=365&r1=364&r2=365
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Mon Feb 19 12:47:40 2007
@@ -1551,16 +1551,15 @@
 			widgets['status'].innerHTML = "";
 	};
 	this.doConfig = function(t, box) {
-		if(t[0].headers['message']){
-			if( box.config_file == "zapscan.conf" ){
-				//alert( "Note: Unable to find /etc/asterisk/zapscan.conf\nPlease run Zapscan manually ! \n\n Click 'OK' to try loading the rest of the page." );
-				parent.astmanEngine.run_tool("/bin/touch /etc/asterisk/zapscan.conf",	function(){	  window.location.href = window.location.href ; } );
-				return ;
-			} else if( t[0].headers['message'] == "Config file not found" && box.config_file != "zapscan.conf"){
-				alert( "Asterisk says it cannot find a required config file (" + box.config_file + ") \n You will be now redirected to the main page !" );
-				parent.window.location.href = parent.window.location.href ;
-				return ;
-			}
+		if( t[0].headers['message'] && t[0].headers['message'] == "Config file not found" ){
+					if( box.config_file == "zapscan.conf" || box.config_file == "contactinfo.conf" ){
+						parent.astmanEngine.run_tool("/bin/touch /etc/asterisk/"+box.config_file,	function(){	  window.location.href = window.location.href ; } );
+						return ;
+					} else {
+						alert( "Asterisk says it cannot find a required config file (" + box.config_file + ") \n You will be now redirected to the main page !" );
+						parent.window.location.href = parent.window.location.href ;
+						return ;
+					}
 		}
 		var x,y=0;
 		var cfg = new Object;



More information about the asterisk-gui-commits mailing list