pari: branch 2.0 r3679 - /branches/2.0/config/js/index.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Aug 19 12:46:39 CDT 2008


Author: pari
Date: Tue Aug 19 12:46:39 2008
New Revision: 3679

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3679
Log:

 Check whether Asterisk has write permissions to the gui folder



Modified:
    branches/2.0/config/js/index.js

Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=3679&r1=3678&r2=3679
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Tue Aug 19 12:46:39 2008
@@ -156,6 +156,21 @@
 		return true;
 	},
 
+	check_WritePermissionsFor_GUI_Folder : function(){
+		ASTGUI.dialog.waitWhile('Checking write permission for gui folder');
+		var rand = Math.round(100000*Math.random());
+
+		ASTGUI.systemCmdWithOutput( "echo '" + rand + "'" , function(s){ // run 'misdn-init scan'
+			if( s.contains(rand) ){
+				ASTGUI.dialog.waitWhile('detecting Hardware ..');
+				ASTGUI.systemCmd( ASTGUI.apps.Ztscan, onLogInFunctions.updatePanels4Platform );
+			}else{
+				ASTGUI.dialog.alertmsg( 'Asterisk needs write privileges on ' + ASTGUI.paths['guiInstall'] );
+				return;
+			}
+		});
+	},
+
 	checkifLoggedIn: function(){
 		var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=ping', async: false });
 		var resp = s.getResponseHeader("Server");
@@ -268,12 +283,8 @@
 			}
 
 			sessionData.finishedParsing = true;
-			ASTGUI.dialog.waitWhile('detecting Hardware ..');
-			ASTGUI.systemCmd( ASTGUI.apps.Ztscan, onLogInFunctions.updatePanels4Platform ) ;
-		}
-	},
-
-	runZtscan : function(){
+			onLogInFunctions.check_WritePermissionsFor_GUI_Folder();
+		}
 	},
 
 	updatePanels4Platform: function(){




More information about the asterisk-gui-commits mailing list