mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
merged upstream develop
This commit is contained in:
commit
5bf79971b8
20 changed files with 246 additions and 196 deletions
|
@ -66,8 +66,6 @@ exports.restartServer = function () {
|
|||
|
||||
} else {
|
||||
|
||||
console.log( "SSL -- not enabled!" );
|
||||
|
||||
var http = require('http');
|
||||
server = http.createServer(app);
|
||||
}
|
||||
|
|
|
@ -28,12 +28,6 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
|
||||
//handle import requests
|
||||
args.app.post('/p/:pad/import', function(req, res, next) {
|
||||
//if abiword is disabled, skip handling this request
|
||||
if(settings.abiword == null) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
hasPadAccess(req, res, function() {
|
||||
importHandler.doImport(req, res, req.params.pad);
|
||||
});
|
||||
|
|
|
@ -15,8 +15,8 @@ exports.basicAuth = function (req, res, next) {
|
|||
}
|
||||
|
||||
var authorize = function (cb) {
|
||||
// Do not require auth for static paths...this could be a bit brittle
|
||||
if (req.path.match(/^\/(static|javascripts|pluginfw)/)) return cb(true);
|
||||
// Do not require auth for static paths and the API...this could be a bit brittle
|
||||
if (req.path.match(/^\/(static|javascripts|pluginfw|api)/)) return cb(true);
|
||||
|
||||
if (req.path.indexOf('/admin') != 0) {
|
||||
if (!settings.requireAuthentication) return cb(true);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var languages = require('languages')
|
||||
var languages = require('languages4translatewiki')
|
||||
, fs = require('fs')
|
||||
, path = require('path')
|
||||
, express = require('express')
|
||||
|
@ -8,22 +8,23 @@ var localesPath = __dirname+"/../../locales";
|
|||
// Serve English strings directly with /locales.ini
|
||||
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
|
||||
|
||||
// add language base 'en' to availableLangs
|
||||
exports.availableLangs = {en: languages.getLanguageInfo('en')}
|
||||
exports.availableLangs = {'en': {'nativeName': 'English', 'direction': 'ltr'}};
|
||||
|
||||
fs.readdir(localesPath, function(er, files) {
|
||||
files.forEach(function(locale) {
|
||||
locale = locale.split('.')[0]
|
||||
if(locale.toLowerCase() == 'en') return;
|
||||
var ext = path.extname(locale);
|
||||
locale = path.basename(locale, ext).toLowerCase();
|
||||
if(locale == 'en' || ext != '.ini') return;
|
||||
|
||||
// build locale index
|
||||
localeIndex += '['+locale+']\r\n@import url(locales/'+locale+'.ini)\r\n'
|
||||
|
||||
// add info language {name, nativeName, direction} to availableLangs
|
||||
// add info language {nativeName, direction} to availableLangs
|
||||
exports.availableLangs[locale]=languages.getLanguageInfo(locale);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
exports.expressCreateServer = function(n, args) {
|
||||
|
||||
args.app.use('/locales', express.static(localesPath));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue