List Info

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




pari: branch asterisknow r2544 - /branches/asterisknow/config/home.html
user name
2008-03-13 09:41:31
Author: pari
Date: Thu Mar 13 09:41:30 2008
New Revision: 2544

URL: http://svn.digium.com/view/asterisk-gui?view=rev&am
p;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(){


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--

asterisk-gui-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-g
ui-commits

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )