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

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


Author: pari
Date: Tue Aug 19 13:17:18 2008
New Revision: 3682

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


  Also check whether Asterisk can write to the backups 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=3682&r1=3681&r2=3682
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Tue Aug 19 13:17:18 2008
@@ -158,12 +158,31 @@
 
 	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){
-			if( s.contains(rand) ){
-				ASTGUI.dialog.waitWhile('detecting Hardware ..');
-				ASTGUI.systemCmd( ASTGUI.apps.Ztscan, onLogInFunctions.updatePanels4Platform );
+		var rand_1 = Math.round(100000*Math.random());
+		var rand_2 = Math.round(100000*Math.random());
+
+		var tmp_check_perms_guibkps = function(){
+			ASTGUI.dialog.waitWhile('Checking write privileges on backups folder');
+
+			ASTGUI.systemCmd( "touch '"+ ASTGUI.paths['ConfigBkp'] + rand_2 + "'" , function(){
+				ASTGUI.listSystemFiles( ASTGUI.paths['ConfigBkp'], function(a){
+					a = a.join();
+					if( a.contains(rand_2) ){
+						ASTGUI.systemCmd( "rm '"+ ASTGUI.paths['ConfigBkp'] + rand_2 + "'" , function(){
+							ASTGUI.dialog.waitWhile('detecting Hardware ..');
+							ASTGUI.systemCmd( ASTGUI.apps.Ztscan, onLogInFunctions.updatePanels4Platform );
+						});
+					}else{
+						ASTGUI.dialog.alertmsg( 'missing ' + ASTGUI.paths['ConfigBkp'] + '<BR> OR Asterisk does not have write privileges on ' + ASTGUI.paths['ConfigBkp'] );
+						return;
+					}
+				});
+			});
+		};
+
+		ASTGUI.systemCmdWithOutput( "echo '" + rand_1 + "'" , function(s){
+			if( s.contains(rand_1) ){
+				tmp_check_perms_guibkps();
 			}else{
 				ASTGUI.dialog.alertmsg( 'Asterisk needs write privileges on ' + ASTGUI.paths['guiInstall'] );
 				return;




More information about the asterisk-gui-commits mailing list