pari: branch asterisknow r2544 - /branches/asterisknow/config/home.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Mar 13 09:41:31 CDT 2008


Author: pari
Date: Thu Mar 13 09:41:30 2008
New Revision: 2544

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

* Fix for BE-416
 Gui assumes write privilege but does not actually check for the write access




Modified:
    branches/asterisknow/config/home.html

Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/home.html?view=diff&rev=2544&r1=2543&r2=2544
==============================================================================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Thu Mar 13 09:41:30 2008
@@ -85,7 +85,7 @@
 	}
 
 	if( parent.asterisk_guitools_inextconf == 0){
-		checkessentials();
+		checkWritePermissions();
 	}
 
 	setTimeout( function(){
@@ -164,6 +164,33 @@
 		doLogin();
 		return false;
 	}
+}
+
+
+function checkWritePermissions(){
+	// check if gui has write permissions
+		var rand = 'test_' + Math.round(100000*Math.random());
+		var wa = 'writeaccess';
+
+		var chs = new listOfActions(); 
+		chs.filename('http.conf'); var c = 0;
+		chs.build_action ( 'newcat', c , rand, '', '');
+		chs.build_action ( 'append', c , rand, wa, 'yes');
+		var after = function(){
+			var httpconfloaded = function(op){
+				if( op.hasOwnProperty(rand) ){ // has write permissions
+					var uri = build_action('delcat', 0, rand , '', '') ;
+					makerequest('u', 'http.conf', uri, function(t) { 
+						checkessentials();
+					});
+				}else{ // no write permissions
+					parent.gui_feedback("GUI does not have write access !! <BR> Please check manager.conf",'default',6000);
+					alert("GUI does not have write access !! \n Please check manager.conf");
+				}
+			}
+			config2json('http.conf',0,httpconfloaded);
+		}
+		chs.callActions(after);
 }
 
 function checkessentials(){




More information about the asterisk-gui-commits mailing list