Merge pull request #2991 from LokeshN/deactivate-settings
Issue #2960 - deactivate settings.jsonpull/3008/head
commit
b3b17c2190
|
@ -18,6 +18,9 @@
|
|||
"ip": "0.0.0.0",
|
||||
"port" : 9001,
|
||||
|
||||
// Option to hide/show the settings.json in admin page, default option is set to true
|
||||
"showSettingsInAdminPage" : true,
|
||||
|
||||
/*
|
||||
// Node native SSL support
|
||||
// this is disabled by default
|
||||
|
|
|
@ -30,7 +30,13 @@ exports.socketio = function (hook_name, args, cb) {
|
|||
}
|
||||
else
|
||||
{
|
||||
socket.emit("settings", {results: data});
|
||||
//if showSettingsInAdminPage is set to false, then return NOT_ALLOWED in the result
|
||||
if(settings.showSettingsInAdminPage === false) {
|
||||
socket.emit("settings", {results:'NOT_ALLOWED'});
|
||||
}
|
||||
else {
|
||||
socket.emit("settings", {results: data});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -209,6 +209,11 @@ exports.requireAuthentication = false;
|
|||
exports.requireAuthorization = false;
|
||||
exports.users = {};
|
||||
|
||||
/*
|
||||
* Show settings in admin page, by default it is true
|
||||
*/
|
||||
exports.showSettingsInAdminPage = true;
|
||||
|
||||
//checks if abiword is avaiable
|
||||
exports.abiwordAvailable = function()
|
||||
{
|
||||
|
|
|
@ -38,6 +38,12 @@ div.innerwrapper {
|
|||
padding-left: 265px;
|
||||
}
|
||||
|
||||
div.innerwrapper-err {
|
||||
padding: 15px;
|
||||
padding-left: 265px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
background: none repeat scroll 0px 0px #FFFFFF;
|
||||
box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.2);
|
||||
|
|
|
@ -14,6 +14,14 @@ $(document).ready(function () {
|
|||
|
||||
socket.on('settings', function (settings) {
|
||||
|
||||
/* Check whether the settings.json is authorized to be viewed */
|
||||
if(settings.results === 'NOT_ALLOWED') {
|
||||
$('.innerwrapper').hide();
|
||||
$('.innerwrapper-err').show();
|
||||
$('.err-message').html("Settings json is not authorized to be viewed in Admin page!!");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check to make sure the JSON is clean before proceeding */
|
||||
if(isJSONClean(settings.results))
|
||||
{
|
||||
|
|
|
@ -44,6 +44,11 @@
|
|||
<a href='https://github.com/ether/etherpad-lite/wiki/Example-Production-Settings.JSON'>Example production settings template</a>
|
||||
<a href='https://github.com/ether/etherpad-lite/wiki/Example-Development-Settings.JSON'>Example development settings template</a>
|
||||
</div>
|
||||
|
||||
<div class="innerwrapper-err" >
|
||||
<h2 class="err-message"></h2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue