pari: branch 2.0 r4393 - /branches/2.0/config/js/index.js
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Jan 6 09:17:53 CST 2009
Author: pari
Date: Tue Jan 6 09:17:48 2009
New Revision: 4393
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4393
Log:
Critical bug fix
GUI got stuck with 'Checking write permission for gui folder'
problem: Missing 'originate' manager privilege for users upgrading from 1.4 to 1.6
(closes issue #14171)
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=4393&r1=4392&r2=4393
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Tue Jan 6 09:17:48 2009
@@ -208,6 +208,23 @@
u.new_action('delcat', rand , '', '') ;
u.callActions();
ASTGUI.cookies.setCookie( 'rwaccess' , 'yes' );
+
+ if( sessionData.PLATFORM.isAST_1_6 ){
+ // make sure originate privilege is defined in asterisk 1.6
+ // This was introduced in Asterisk 1.6 and users upgrading from 1.4 do not have this
+ var tmp_managerUser = ASTGUI.cookies.getCookie('username') ;
+ var manager_conf = config2json({ filename:'manager.conf', usf:1 });
+ if( manager_conf[tmp_managerUser].hasOwnProperty('write') ){
+ var write_value = manager_conf[tmp_managerUser]['write'];
+ if( !write_value.contains('originate') ){
+ var u = new listOfSynActions('manager.conf');
+ u.new_action( 'update', tmp_managerUser, 'write', write_value + ',originate' , write_value );
+ u.callActions();
+ return 'manager_updated'; // about to reload
+ }
+ }
+ }
+
return true;
},
@@ -287,10 +304,14 @@
ASTGUI.dialog.alertmsg('The GUI does not have necessary privileges. <BR> Please check the manager permissions for the user !');
return;
}
- if( crwp == 'postmappings_updated' ){
+ if( crwp == 'postmappings_updated' || crwp == 'manager_updated' ){
parent.ASTGUI.dialog.waitWhile(' reloading asterisk ... ');
var t = ASTGUI.cliCommand('reload') ;
setTimeout( function(){
+ if( sessionData.PLATFORM.isAST_1_6 ){
+ alert(' Config files updated. '
+ + '\n' + ' Please stop Asterisk and Start over for the changes to take effect' );
+ }
if( sessionData.DEBUG_MODE ){
alert('postmappings updated in http.conf' + '\n' + 'Click OK to reload');
}
More information about the asterisk-gui-commits
mailing list