Commit a1ce3280 authored by Luc Didry's avatar Luc Didry

Add an option to force users to use the first and last name as pad login

This commit is dedicated to Schoumi, who is supporting me on Tipeee.
Many thanks :-)
parent 83e94eef
Pipeline #41197 passed with stage
in 34 seconds
......@@ -486,6 +486,20 @@ module.exports = (function () {
app.delete(confRoute + '/:key', fn.ensureAdmin,
ld.partial(fn.del, conf.del));
/**
* GET method
*
* Return the value of useFirstLastNameInPads configuration setting
*
* Sample URL:
* http://etherpad.ndd/mypads/api/configuration/public/usefirstlastname
*/
app.get(confRoute + '/public/usefirstlastname', function (req, res) {
return res.send({ success: true, usefirstlastname: conf.get('useFirstLastNameInPads') });
});
};
/**
......@@ -1277,7 +1291,6 @@ module.exports = (function () {
* http://etherpad.ndd/mypads/api/pad/ispublic/xxxx
*/
// TODO: + admin, no pass needed...
app.get(padRoute + '/ispublic/:key', function (req, res) {
pad.get(req.params.key, function(err, p) {
if (err) {
......
......@@ -67,7 +67,8 @@ module.exports = (function() {
SMTPEmailFrom: undefined,
SMTPSSL: false,
SMTPTLS: true,
tokenDuration: 60 // in minutes
tokenDuration: 60, // in minutes
useFirstLastNameInPads: false
},
/**
......@@ -227,7 +228,7 @@ module.exports = (function() {
public: function () {
var all = configuration.all();
return ld.pick(all, 'title', 'passwordMin', 'passwordMax', 'languages',
'HTMLExtraHead', 'openRegistration', 'hideHelpBlocks');
'HTMLExtraHead', 'openRegistration', 'hideHelpBlocks', 'useFirstLastNameInPads');
}
};
......
......@@ -64,7 +64,7 @@ module.exports = (function () {
'passwordMin', 'passwordMax', 'defaultLanguage', 'checkMails',
'tokenDuration', 'SMTPHost', 'SMTPPort', 'SMTPSSL', 'SMTPTLS',
'SMTPUser', 'SMTPPass', 'SMTPEmailFrom', 'HTMLExtraHead',
'openRegistration', 'hideHelpBlocks']);
'openRegistration', 'hideHelpBlocks', 'useFirstLastNameInPads']);
c.currentConf = resp.value;
ld.forIn(resp.value, function (v, k) {
c.data[k] = m.prop(v);
......@@ -323,6 +323,23 @@ module.exports = (function () {
var l = m('label', [ f, A.FIELD.HIDE_HELP_BLOCKS, icon ]);
return l;
})(),
useFirstLastNameInPads: (function () {
var icon = form.icon(c, 'useFirstLastNameInPads', A.INFO.USE_FIRST_AND_LAST_NAME_IN_PADS);
var opts = {
name: 'useFirstLastNameInPads',
};
if (c.data.useFirstLastNameInPads) {
opts['checked'] = 'checked';
}
var f = m('input[type="checkbox"]', opts);
ld.assign(f.attrs, {
type: 'checkbox',
checked: c.data.useFirstLastNameInPads(),
onchange: m.withAttr('checked', c.data.useFirstLastNameInPads)
});
var l = m('label', [ f, A.FIELD.USE_FIRST_AND_LAST_NAME_IN_PADS, icon ]);
return l;
})(),
openRegistration: (function () {
var icon = form.icon(c, 'openRegistration', A.INFO.OPEN_REGISTRATION);
var opts = {
......@@ -441,6 +458,7 @@ module.exports = (function () {
m('div.checkbox', [ f.allowEtherPads ]),
m('div.checkbox', [ f.openRegistration ]),
m('div.checkbox', [ f.hideHelpBlocks ]),
m('div.checkbox', [ f.useFirstLastNameInPads ]),
m('div.form-group', [ f.HTMLExtraHead.label, f.HTMLExtraHead.icon, f.HTMLExtraHead.textarea ])
])
]),
......
......@@ -260,7 +260,7 @@ module.exports = (function () {
return memo;
}, [])
);
return { label: label, icon: icon, select: select };
return { label: label, select: select };
};
/**
......@@ -276,12 +276,12 @@ module.exports = (function () {
checked: c.data.useLoginAndColorInPads(),
onchange: m.withAttr('checked', c.data.useLoginAndColorInPads)
}),
conf.LANG.USER.USELOGINANDCOLORINPADS
((conf.SERVER.useFirstLastNameInPads) ? conf.LANG.USER.USECOLORINPADS : conf.LANG.USER.USELOGINANDCOLORINPADS),
m('i',{
class: 'mp-tooltip glyphicon glyphicon-info-sign',
'data-msg': ((conf.SERVER.useFirstLastNameInPads) ? conf.LANG.USER.INFO.USECOLORINPADS : conf.LANG.USER.INFO.USELOGINANDCOLORINPADS)
}),
]),
icon: m('i',{
class: 'mp-tooltip glyphicon glyphicon-info-sign',
'data-msg': conf.LANG.USER.INFO.USELOGINANDCOLORINPADS
}),
};
};
......
......@@ -252,6 +252,11 @@ module.exports = (function () {
var u = auth.fn.getUser(token);
if (u && u.useLoginAndColorInPads) {
var opts = { userName: u.login };
if (conf.get('useFirstLastNameInPads')) {
var firstname = (u.firstname) ? u.firstname : '';
var lastname = (u.lastname) ? u.lastname : '';
opts.userName = firstname+' '+lastname;
}
if (u.color) {
opts.userColor = u.color;
}
......
......@@ -566,6 +566,21 @@
);
});
describe('configuration.public GET usefirstlastname', function () {
it('should return the value of useFirstLastNameInPads',
function (done) {
rq.get(confRoute + '/public/usefirstlastname', function (err, resp, body) {
expect(resp.statusCode).toBe(200);
expect(body.success).toBeTruthy();
expect(body.usefirstlastname).toBeDefined();
done();
});
}
);
});
});
describe('user inactive account limitations', function () {
......
......@@ -548,6 +548,21 @@
);
});
describe('configuration.public GET usefirstlastname', function () {
it('should return the value of useFirstLastNameInPads',
function (done) {
rq.get(confRoute + '/public/usefirstlastname', function (err, resp, body) {
expect(resp.statusCode).toBe(200);
expect(body.success).toBeTruthy();
expect(body.usefirstlastname).toBeDefined();
done();
});
}
);
});
});
describe('user inactive account limitations', function () {
......
......@@ -145,6 +145,7 @@
expect(settings.HTMLExtraHead).toBeDefined();
expect(settings.openRegistration).toBeDefined();
expect(settings.hideHelpBlocks).toBeDefined();
expect(settings.useFirstLastNameInPads).toBeDefined();
done();
});
});
......
......@@ -90,4 +90,18 @@ exports.postToolbarInit = function (hook_name, args) {
}
}
});
/*
* Prevents users from changing their nickname if useFirstLastNameInPads is set
*/
$.ajax({
method: 'GET',
url: baseURL+'/mypads/api/configuration/public/usefirstlastname',
dataType: 'JSON',
success: function(data, textStatus, jqXHR) {
if (data.success && data.usefirstlastname) {
$('#myusernameedit').prop('disabled', true);
}
}
});
}
......@@ -23,7 +23,7 @@ module.exports=function(){var r=require("mithril"),e=require("lodash"),i=require
},{"../auth.js":2,"../configuration.js":3,"../widgets/notification.js":37,"lodash":45,"mithril":46}],12:[function(require,module,exports){
module.exports=function(){var e=require("mithril"),r=require("lodash"),i=require("../configuration.js"),n=require("../auth.js"),t=require("../widgets/notification.js"),o=require("./layout.js"),u=require("./user.js"),s=require("../helpers/form.js"),a={};a.controller=function(){if(!n.isAdmin())return e.route("/admin");document.title=i.LANG.ADMIN.FORM_USERS_SEARCH+" - "+i.SERVER.title;var o={user:e.prop(!1)};return o.fields=["login"],s.initFields(o,o.fields),o.search=function(u){u.preventDefault(),e.request({method:"GET",url:i.URLS.USER+"/"+o.data.login(),data:{auth_token:n.admToken()}}).then(function(e){o.user(e.value),t.info({body:i.LANG.ADMIN.INFO.USER_FOUND})},function(e){o.user(!1),t.error({body:r.result(i.LANG,e.error)})})},o};var l={};return l.form=function(r){var n=u.view.field.login(r);return n.input.attrs.config=s.focusOnInit,n.icon.attrs["data-msg"]=i.LANG.ADMIN.INFO.USERS_SEARCH_LOGIN,e("form.block",{id:"users-form",onsubmit:r.search},[e("fieldset.block-group",[e("legend",i.LANG.ADMIN.USERS_SEARCH_LOGIN),e("div.form-group",[n.label,n.input])]),l.user(r),e("input.block.send",{form:"users-form",type:"submit",class:"btn btn-default",value:i.LANG.ADMIN.FIELD.SEARCH})])},l.user=function(r){var n=r.user();if(n){var t=[e("a",{href:"/admin/users/"+n.login+"/edit",config:e.route,title:i.LANG.GROUP.EDIT},[e("i.glyphicon glyphicon-pencil")]),e("a",{href:"/admin/users/"+n.login+"/remove",config:e.route,title:i.LANG.GROUP.REMOVE},[e("i.glyphicon glyphicon-trash")])],o=n.login;return n.firstname&&(o=[o,"(",n.firstname,n.lastname,")"].join(" ")),e("ul.admin-users",[e("li.block-group",[e("span.block.name",o),e("span.block.actions",t)])])}return e("p.admin-users",i.LANG.ADMIN.INFO.USER_NONE)},l.main=function(r){var n=[e("h2.block",i.LANG.ADMIN.FORM_USERS_SEARCH),l.form(r)];return e("section",{class:"block-group user admin"},n)},l.aside=function(){return e("section.user-aside",[e("h2",i.LANG.ACTIONS.HELP),e("article",e.trust(i.LANG.ADMIN.HELP_USERS))])},a.view=function(e){return o.view(l.main(e),l.aside(e))},a}.call(this);
},{"../auth.js":2,"../configuration.js":3,"../helpers/form.js":5,"../widgets/notification.js":37,"./layout.js":20,"./user.js":32,"lodash":45,"mithril":46}],13:[function(require,module,exports){
module.exports=function(){var e=require("mithril"),t=require("lodash"),a=require("../configuration.js"),r=require("../auth.js"),n=require("../widgets/notification.js"),o=require("./layout.js"),i=require("./user.js"),s=require("../helpers/form.js"),l={};l.controller=function(){document.title=a.LANG.ADMIN.FORM_LOGIN+" - "+a.SERVER.title;var o={};localStorage.removeItem("token"),s.initFields(o,["login","password"]);var i=function(i){i&&localStorage.setItem("admToken",i.token),e.request({url:a.URLS.CONF,method:"GET",data:{auth_token:r.admToken()}}).then(function(r){if(!r.auth)return localStorage.removeItem("admToken");if(s.initFields(o,["title","rootUrl","allowEtherPads","passwordMin","passwordMax","defaultLanguage","checkMails","tokenDuration","SMTPHost","SMTPPort","SMTPSSL","SMTPTLS","SMTPUser","SMTPPass","SMTPEmailFrom","HTMLExtraHead","openRegistration","hideHelpBlocks"]),o.currentConf=r.value,t.forIn(r.value,function(t,a){o.data[a]=e.prop(t)}),0===o.data.rootUrl().length){var i=window.location;o.data.rootUrl(i.protocol+"//"+i.host)}var l=function(e){return e=e||0,function(t){return void 0!==t&&(e=parseInt(t,10)),e}};o.data.passwordMin=l(o.data.passwordMin()),o.data.passwordMax=l(o.data.passwordMax()),o.data.passwordMin.toJSON=function(){return o.data.passwordMin()},o.data.passwordMax.toJSON=function(){return o.data.passwordMax()},document.title=a.LANG.ADMIN.FORM_SETTINGS+" - "+a.SERVER.title,n.success({body:a.LANG.USER.AUTH.SUCCESS})},function(e){n.error({body:t.result(a.LANG,e.error)})})};return r.isAdmin()&&i(),o.login=function(r){r.preventDefault(),e.request({url:a.URLS.AUTH+"/admin/login",method:"POST",data:o.data}).then(i,function(e){n.error({body:t.result(a.LANG,e.error)})})},o.submit=function(i){if(i.preventDefault(),o.data.passwordMin()>o.data.passwordMax())n.warning({body:a.LANG.ADMIN.ERR.PASSWORD_SIZE}),document.querySelector('input[name="passwordMin"]').focus();else{var s=t.reduce(o.data,function(e,t,a){return t()!==o.currentConf[a]&&(e[a]=t),e},{}),l=t.pairs(s),c=function(i){e.request({method:"PUT",url:a.URLS.CONF+"/"+i[0],data:{value:i[1](),auth_token:r.admToken()}}).then(function(e){l.length>0?c(l.pop()):(o.currentConf[e.key]=e.value,a.SERVER[e.key]=e.value,n.success({body:a.LANG.ADMIN.INFO.SUCCESS}))},function(e){n.error({body:t.result(a.LANG,e.error)})})};l.length>0?c(l.pop()):n.info({body:a.LANG.ADMIN.INFO.NOCHANGE})}},o};var c={};return c.form=function(t){var r=i.view.field.login(t);r.input.attrs.config=s.focusOnInit,r.icon.attrs["data-msg"]=a.LANG.ADMIN.INFO.LOGIN;var n=i.view.field.password(t);return n.icon.attrs["data-msg"]=a.LANG.USER.PASSWORD,delete n.input.attrs.pattern,delete n.input.attrs.minlength,delete n.input.attrs.maxlength,r.label.attrs.class="col-sm-4",n.label.attrs.class="col-sm-4",e("form.form-horizontal.col-sm-8.col-sm-offset-2.well",{id:"login-form",onsubmit:t.login},[e("fieldset",[e("legend",a.LANG.ADMIN.ETHERPAD_ACCOUNT),e(".form-group",[r.label,e(".col-sm-7",r.input)]),e(".form-group",[n.label,e(".col-sm-7",n.input)]),e("input.btn.btn-success.pull-right",{form:"login-form",type:"submit",value:a.LANG.USER.LOGIN})])])},c.settings=function(r){var n=a.LANG.ADMIN,o={title:function(){var e=s.icon(r,"title",n.INFO.TITLE,n.ERR.TITLE),a=s.field(r,"title",n.FIELD.TITLE,e);return t.assign(a.input.attrs,{required:!0}),a}(),rootUrl:function(){var e=s.icon(r,"rootUrl",n.INFO.ROOTURL,n.ERR.ROOTURL),a=s.field(r,"rootUrl",n.FIELD.ROOTURL,e);return t.assign(a.input.attrs,{type:"url"}),a}(),HTMLExtraHead:function(){return{label:e("label",{for:"HTMLExtraHead"},a.LANG.ADMIN.FIELD.HTMLEXTRA_HEAD),icon:e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":a.LANG.ADMIN.INFO.HTMLEXTRA_HEAD}),textarea:e("textarea.form-control",{name:"HTMLExtraHead",value:r.data.HTMLExtraHead(),onchange:e.withAttr("value",r.data.HTMLExtraHead)},r.data.HTMLExtraHead())}}(),passwordMin:function(){var e=s.icon(r,"passwordMin",n.INFO.PASSWORD_MIN,n.ERR.PASSWORD_MIN),a=s.field(r,"passwordMin",n.FIELD.PASSWORD_MIN,e);return t.assign(a.input.attrs,{type:"number",min:"1",required:!0}),a}(),passwordMax:function(){var e=s.icon(r,"passwordMax",n.INFO.PASSWORD_MAX,n.ERR.PASSWORD_MAX),a=s.field(r,"passwordMax",n.FIELD.PASSWORD_MAX,e);return t.assign(a.input.attrs,{type:"number",min:"1",required:!0}),a}(),defaultLanguage:function(){var n=e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":a.LANG.ADMIN.INFO.LANGUAGE_DEFAULT});return{label:e("label",{for:"defaultLanguage"},[a.LANG.ADMIN.FIELD.LANGUAGE_DEFAULT,n]),icon:n,select:e("select.form-control",{name:"defaultLanguage",required:!0,value:r.data.defaultLanguage(),onchange:e.withAttr("value",r.data.defaultLanguage)},t.reduce(a.SERVER.languages,function(t,a,r){return t.push(e("option",{value:r},a)),t},[]))}}(),allowEtherPads:function(){var a=s.icon(r,"allowEtherPads",n.INFO.ALLOW_ETHERPADS),o={name:"allowEtherPads"};r.data.allowEtherPads&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.allowEtherPads(),onchange:e.withAttr("checked",r.data.allowEtherPads)}),e("label",[i,n.FIELD.ALLOW_ETHERPADS,a])}(),hideHelpBlocks:function(){var a=s.icon(r,"hideHelpBlocks",n.INFO.HIDE_HELP_BLOCKS),o={name:"hideHelpBlocks"};r.data.hideHelpBlocks&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.hideHelpBlocks(),onchange:e.withAttr("checked",r.data.hideHelpBlocks)}),e("label",[i,n.FIELD.HIDE_HELP_BLOCKS,a])}(),openRegistration:function(){var a=s.icon(r,"openRegistration",n.INFO.OPEN_REGISTRATION),o={name:"openRegistration"};r.data.openRegistration&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.openRegistration(),onchange:e.withAttr("checked",r.data.openRegistration)}),e("label",[i,n.FIELD.OPEN_REGISTRATION,a])}(),checkMails:function(){var a=s.icon(r,"checkMails",n.INFO.CHECKMAILS),o={name:"checkMails"};r.data.checkMails&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.checkMails(),onchange:e.withAttr("checked",r.data.checkMails)}),e("label",[i,n.FIELD.CHECKMAILS,a])}(),tokenDuration:function(){var e=s.icon(r,"tokenDuration",n.INFO.TOKEN_DURATION),a=s.field(r,"tokenDuration",n.FIELD.TOKEN_DURATION,e);return t.assign(a.label.attrs,{style:"clear: left;"}),t.assign(a.input.attrs,{type:"number"}),a}(),SMTPHost:function(){var e=s.icon(r,"SMTPHost",n.INFO.SMTP_HOST);return s.field(r,"SMTPHost",n.FIELD.SMTP_HOST,e)}(),SMTPPort:function(){var e=s.icon(r,"SMTPPort",n.INFO.SMTP_PORT),a=s.field(r,"SMTPPort",n.FIELD.SMTP_PORT,e);return t.assign(a.input.attrs,{type:"number",min:1}),a}(),SMTPSSL:function(){var a=s.icon(r,"SMTPSSL",n.INFO.SMTP_SSL),o={name:"SMTPSSL"};r.data.SMTPSSL&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.SMTPSSL(),onchange:e.withAttr("checked",r.data.SMTPSSL)}),e("label",[i,n.FIELD.SMTP_SSL,a])}(),SMTPTLS:function(){var a=s.icon(r,"SMTPTLS",n.INFO.SMTP_TLS),o={name:"SMTPTLS"};r.data.SMTPTLS&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.SMTPTLS(),onchange:e.withAttr("checked",r.data.SMTPTLS)}),e("label",[i,n.FIELD.SMTP_TLS,a])}(),SMTPUser:function(){var e=s.icon(r,"SMTPUser",n.INFO.SMTP_USER),a=s.field(r,"SMTPUser",n.FIELD.SMTP_USER,e);return t.assign(a.label.attrs,{style:"clear: left;"}),a}(),SMTPPass:function(){var e=s.icon(r,"SMTPPass",n.INFO.SMTP_PASS),a=s.field(r,"SMTPPass",n.FIELD.SMTP_PASS,e);return t.assign(a.input.attrs,{type:"password"}),a}(),SMTPEmailFrom:function(){var e=s.icon(r,"SMTPEmailFrom",n.INFO.SMTP_EMAILFROM,n.ERR.SMTP_EMAILFROM),a=s.field(r,"SMTPEmailFrom",n.FIELD.SMTP_EMAILFROM,e);return t.assign(a.input.attrs,{type:"email"}),a}()};return e("form",{id:"settings-form",onsubmit:r.submit},[e("fieldset",[e("legend",a.LANG.ADMIN.SETTINGS_GENERAL),e("div",[e("div.form-group",[o.title.label,o.title.input]),e("div.form-group",[o.rootUrl.label,o.rootUrl.input]),e("div.form-group",[o.defaultLanguage.label,o.defaultLanguage.select]),e("div.checkbox",[o.allowEtherPads]),e("div.checkbox",[o.openRegistration]),e("div.checkbox",[o.hideHelpBlocks]),e("div.form-group",[o.HTMLExtraHead.label,o.HTMLExtraHead.icon,o.HTMLExtraHead.textarea])])]),e("fieldset",[e("legend",a.LANG.ADMIN.SETTINGS_PASSWORD),e("div",[e("div.form-group",[o.passwordMin.label,o.passwordMin.input]),e("div.form-group",[o.passwordMax.label,o.passwordMax.input])])]),e("fieldset",[e("legend",a.LANG.ADMIN.SETTINGS_MAIL),e("div",[e("div.checkbox",[o.checkMails]),e("div.form-group",[o.tokenDuration.label,o.tokenDuration.input]),e("div.form-group",[o.SMTPHost.label,o.SMTPHost.input]),e("div.form-group",[o.SMTPPort.label,o.SMTPPort.input]),e("div.checkbox",[o.SMTPSSL]),e("div.checkbox",[o.SMTPTLS]),e("div.form-group",[o.SMTPUser.label,o.SMTPUser.input]),e("div.form-group",[o.SMTPPass.label,o.SMTPPass.input]),e("div.form-group",[o.SMTPEmailFrom.label,o.SMTPEmailFrom.input])])]),e("input.btn.btn-success",{form:"settings-form",type:"submit",value:a.LANG.ADMIN.FIELD.APPLY})])},c.main=function(t){var n=function(){return r.isAdmin()?[e("h2",a.LANG.ADMIN.FORM_SETTINGS),c.settings(t)]:[e("h2",a.LANG.ADMIN.FORM_LOGIN),c.form(t)]}();return e("section",{class:"block-group user admin"},n)},c.aside=function(){var t=r.isAdmin()?"HELP_SETTINGS":"HELP_LOGIN";return e("section.user-aside",[e("h2",a.LANG.ACTIONS.HELP),e("article.well",e.trust(a.LANG.ADMIN[t]))])},l.view=function(e){return o.view(c.main(e),c.aside(e))},l}.call(this);
module.exports=function(){var e=require("mithril"),t=require("lodash"),a=require("../configuration.js"),r=require("../auth.js"),n=require("../widgets/notification.js"),o=require("./layout.js"),i=require("./user.js"),s=require("../helpers/form.js"),c={};c.controller=function(){document.title=a.LANG.ADMIN.FORM_LOGIN+" - "+a.SERVER.title;var o={};localStorage.removeItem("token"),s.initFields(o,["login","password"]);var i=function(i){i&&localStorage.setItem("admToken",i.token),e.request({url:a.URLS.CONF,method:"GET",data:{auth_token:r.admToken()}}).then(function(r){if(!r.auth)return localStorage.removeItem("admToken");if(s.initFields(o,["title","rootUrl","allowEtherPads","passwordMin","passwordMax","defaultLanguage","checkMails","tokenDuration","SMTPHost","SMTPPort","SMTPSSL","SMTPTLS","SMTPUser","SMTPPass","SMTPEmailFrom","HTMLExtraHead","openRegistration","hideHelpBlocks","useFirstLastNameInPads"]),o.currentConf=r.value,t.forIn(r.value,function(t,a){o.data[a]=e.prop(t)}),0===o.data.rootUrl().length){var i=window.location;o.data.rootUrl(i.protocol+"//"+i.host)}var c=function(e){return e=e||0,function(t){return void 0!==t&&(e=parseInt(t,10)),e}};o.data.passwordMin=c(o.data.passwordMin()),o.data.passwordMax=c(o.data.passwordMax()),o.data.passwordMin.toJSON=function(){return o.data.passwordMin()},o.data.passwordMax.toJSON=function(){return o.data.passwordMax()},document.title=a.LANG.ADMIN.FORM_SETTINGS+" - "+a.SERVER.title,n.success({body:a.LANG.USER.AUTH.SUCCESS})},function(e){n.error({body:t.result(a.LANG,e.error)})})};return r.isAdmin()&&i(),o.login=function(r){r.preventDefault(),e.request({url:a.URLS.AUTH+"/admin/login",method:"POST",data:o.data}).then(i,function(e){n.error({body:t.result(a.LANG,e.error)})})},o.submit=function(i){if(i.preventDefault(),o.data.passwordMin()>o.data.passwordMax())n.warning({body:a.LANG.ADMIN.ERR.PASSWORD_SIZE}),document.querySelector('input[name="passwordMin"]').focus();else{var s=t.reduce(o.data,function(e,t,a){return t()!==o.currentConf[a]&&(e[a]=t),e},{}),c=t.pairs(s),l=function(i){e.request({method:"PUT",url:a.URLS.CONF+"/"+i[0],data:{value:i[1](),auth_token:r.admToken()}}).then(function(e){c.length>0?l(c.pop()):(o.currentConf[e.key]=e.value,a.SERVER[e.key]=e.value,n.success({body:a.LANG.ADMIN.INFO.SUCCESS}))},function(e){n.error({body:t.result(a.LANG,e.error)})})};c.length>0?l(c.pop()):n.info({body:a.LANG.ADMIN.INFO.NOCHANGE})}},o};var l={};return l.form=function(t){var r=i.view.field.login(t);r.input.attrs.config=s.focusOnInit,r.icon.attrs["data-msg"]=a.LANG.ADMIN.INFO.LOGIN;var n=i.view.field.password(t);return n.icon.attrs["data-msg"]=a.LANG.USER.PASSWORD,delete n.input.attrs.pattern,delete n.input.attrs.minlength,delete n.input.attrs.maxlength,r.label.attrs.class="col-sm-4",n.label.attrs.class="col-sm-4",e("form.form-horizontal.col-sm-8.col-sm-offset-2.well",{id:"login-form",onsubmit:t.login},[e("fieldset",[e("legend",a.LANG.ADMIN.ETHERPAD_ACCOUNT),e(".form-group",[r.label,e(".col-sm-7",r.input)]),e(".form-group",[n.label,e(".col-sm-7",n.input)]),e("input.btn.btn-success.pull-right",{form:"login-form",type:"submit",value:a.LANG.USER.LOGIN})])])},l.settings=function(r){var n=a.LANG.ADMIN,o={title:function(){var e=s.icon(r,"title",n.INFO.TITLE,n.ERR.TITLE),a=s.field(r,"title",n.FIELD.TITLE,e);return t.assign(a.input.attrs,{required:!0}),a}(),rootUrl:function(){var e=s.icon(r,"rootUrl",n.INFO.ROOTURL,n.ERR.ROOTURL),a=s.field(r,"rootUrl",n.FIELD.ROOTURL,e);return t.assign(a.input.attrs,{type:"url"}),a}(),HTMLExtraHead:function(){return{label:e("label",{for:"HTMLExtraHead"},a.LANG.ADMIN.FIELD.HTMLEXTRA_HEAD),icon:e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":a.LANG.ADMIN.INFO.HTMLEXTRA_HEAD}),textarea:e("textarea.form-control",{name:"HTMLExtraHead",value:r.data.HTMLExtraHead(),onchange:e.withAttr("value",r.data.HTMLExtraHead)},r.data.HTMLExtraHead())}}(),passwordMin:function(){var e=s.icon(r,"passwordMin",n.INFO.PASSWORD_MIN,n.ERR.PASSWORD_MIN),a=s.field(r,"passwordMin",n.FIELD.PASSWORD_MIN,e);return t.assign(a.input.attrs,{type:"number",min:"1",required:!0}),a}(),passwordMax:function(){var e=s.icon(r,"passwordMax",n.INFO.PASSWORD_MAX,n.ERR.PASSWORD_MAX),a=s.field(r,"passwordMax",n.FIELD.PASSWORD_MAX,e);return t.assign(a.input.attrs,{type:"number",min:"1",required:!0}),a}(),defaultLanguage:function(){var n=e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":a.LANG.ADMIN.INFO.LANGUAGE_DEFAULT});return{label:e("label",{for:"defaultLanguage"},[a.LANG.ADMIN.FIELD.LANGUAGE_DEFAULT,n]),icon:n,select:e("select.form-control",{name:"defaultLanguage",required:!0,value:r.data.defaultLanguage(),onchange:e.withAttr("value",r.data.defaultLanguage)},t.reduce(a.SERVER.languages,function(t,a,r){return t.push(e("option",{value:r},a)),t},[]))}}(),allowEtherPads:function(){var a=s.icon(r,"allowEtherPads",n.INFO.ALLOW_ETHERPADS),o={name:"allowEtherPads"};r.data.allowEtherPads&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.allowEtherPads(),onchange:e.withAttr("checked",r.data.allowEtherPads)}),e("label",[i,n.FIELD.ALLOW_ETHERPADS,a])}(),hideHelpBlocks:function(){var a=s.icon(r,"hideHelpBlocks",n.INFO.HIDE_HELP_BLOCKS),o={name:"hideHelpBlocks"};r.data.hideHelpBlocks&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.hideHelpBlocks(),onchange:e.withAttr("checked",r.data.hideHelpBlocks)}),e("label",[i,n.FIELD.HIDE_HELP_BLOCKS,a])}(),useFirstLastNameInPads:function(){var a=s.icon(r,"useFirstLastNameInPads",n.INFO.USE_FIRST_AND_LAST_NAME_IN_PADS),o={name:"useFirstLastNameInPads"};r.data.useFirstLastNameInPads&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.useFirstLastNameInPads(),onchange:e.withAttr("checked",r.data.useFirstLastNameInPads)}),e("label",[i,n.FIELD.USE_FIRST_AND_LAST_NAME_IN_PADS,a])}(),openRegistration:function(){var a=s.icon(r,"openRegistration",n.INFO.OPEN_REGISTRATION),o={name:"openRegistration"};r.data.openRegistration&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.openRegistration(),onchange:e.withAttr("checked",r.data.openRegistration)}),e("label",[i,n.FIELD.OPEN_REGISTRATION,a])}(),checkMails:function(){var a=s.icon(r,"checkMails",n.INFO.CHECKMAILS),o={name:"checkMails"};r.data.checkMails&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.checkMails(),onchange:e.withAttr("checked",r.data.checkMails)}),e("label",[i,n.FIELD.CHECKMAILS,a])}(),tokenDuration:function(){var e=s.icon(r,"tokenDuration",n.INFO.TOKEN_DURATION),a=s.field(r,"tokenDuration",n.FIELD.TOKEN_DURATION,e);return t.assign(a.label.attrs,{style:"clear: left;"}),t.assign(a.input.attrs,{type:"number"}),a}(),SMTPHost:function(){var e=s.icon(r,"SMTPHost",n.INFO.SMTP_HOST);return s.field(r,"SMTPHost",n.FIELD.SMTP_HOST,e)}(),SMTPPort:function(){var e=s.icon(r,"SMTPPort",n.INFO.SMTP_PORT),a=s.field(r,"SMTPPort",n.FIELD.SMTP_PORT,e);return t.assign(a.input.attrs,{type:"number",min:1}),a}(),SMTPSSL:function(){var a=s.icon(r,"SMTPSSL",n.INFO.SMTP_SSL),o={name:"SMTPSSL"};r.data.SMTPSSL&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.SMTPSSL(),onchange:e.withAttr("checked",r.data.SMTPSSL)}),e("label",[i,n.FIELD.SMTP_SSL,a])}(),SMTPTLS:function(){var a=s.icon(r,"SMTPTLS",n.INFO.SMTP_TLS),o={name:"SMTPTLS"};r.data.SMTPTLS&&(o.checked="checked");var i=e('input[type="checkbox"]',o);return t.assign(i.attrs,{type:"checkbox",checked:r.data.SMTPTLS(),onchange:e.withAttr("checked",r.data.SMTPTLS)}),e("label",[i,n.FIELD.SMTP_TLS,a])}(),SMTPUser:function(){var e=s.icon(r,"SMTPUser",n.INFO.SMTP_USER),a=s.field(r,"SMTPUser",n.FIELD.SMTP_USER,e);return t.assign(a.label.attrs,{style:"clear: left;"}),a}(),SMTPPass:function(){var e=s.icon(r,"SMTPPass",n.INFO.SMTP_PASS),a=s.field(r,"SMTPPass",n.FIELD.SMTP_PASS,e);return t.assign(a.input.attrs,{type:"password"}),a}(),SMTPEmailFrom:function(){var e=s.icon(r,"SMTPEmailFrom",n.INFO.SMTP_EMAILFROM,n.ERR.SMTP_EMAILFROM),a=s.field(r,"SMTPEmailFrom",n.FIELD.SMTP_EMAILFROM,e);return t.assign(a.input.attrs,{type:"email"}),a}()};return e("form",{id:"settings-form",onsubmit:r.submit},[e("fieldset",[e("legend",a.LANG.ADMIN.SETTINGS_GENERAL),e("div",[e("div.form-group",[o.title.label,o.title.input]),e("div.form-group",[o.rootUrl.label,o.rootUrl.input]),e("div.form-group",[o.defaultLanguage.label,o.defaultLanguage.select]),e("div.checkbox",[o.allowEtherPads]),e("div.checkbox",[o.openRegistration]),e("div.checkbox",[o.hideHelpBlocks]),e("div.checkbox",[o.useFirstLastNameInPads]),e("div.form-group",[o.HTMLExtraHead.label,o.HTMLExtraHead.icon,o.HTMLExtraHead.textarea])])]),e("fieldset",[e("legend",a.LANG.ADMIN.SETTINGS_PASSWORD),e("div",[e("div.form-group",[o.passwordMin.label,o.passwordMin.input]),e("div.form-group",[o.passwordMax.label,o.passwordMax.input])])]),e("fieldset",[e("legend",a.LANG.ADMIN.SETTINGS_MAIL),e("div",[e("div.checkbox",[o.checkMails]),e("div.form-group",[o.tokenDuration.label,o.tokenDuration.input]),e("div.form-group",[o.SMTPHost.label,o.SMTPHost.input]),e("div.form-group",[o.SMTPPort.label,o.SMTPPort.input]),e("div.checkbox",[o.SMTPSSL]),e("div.checkbox",[o.SMTPTLS]),e("div.form-group",[o.SMTPUser.label,o.SMTPUser.input]),e("div.form-group",[o.SMTPPass.label,o.SMTPPass.input]),e("div.form-group",[o.SMTPEmailFrom.label,o.SMTPEmailFrom.input])])]),e("input.btn.btn-success",{form:"settings-form",type:"submit",value:a.LANG.ADMIN.FIELD.APPLY})])},l.main=function(t){var n=function(){return r.isAdmin()?[e("h2",a.LANG.ADMIN.FORM_SETTINGS),l.settings(t)]:[e("h2",a.LANG.ADMIN.FORM_LOGIN),l.form(t)]}();return e("section",{class:"block-group user admin"},n)},l.aside=function(){var t=r.isAdmin()?"HELP_SETTINGS":"HELP_LOGIN";return e("section.user-aside",[e("h2",a.LANG.ACTIONS.HELP),e("article.well",e.trust(a.LANG.ADMIN[t]))])},c.view=function(e){return o.view(l.main(e),l.aside(e))},c}.call(this);
},{"../auth.js":2,"../configuration.js":3,"../helpers/form.js":5,"../widgets/notification.js":37,"./layout.js":20,"./user.js":32,"lodash":45,"mithril":46}],14:[function(require,module,exports){
module.exports=function(){"use strict";var r=require("mithril"),e=require("lodash"),t=require("../configuration.js"),i=require("../auth.js"),n=i.userInfo,o=require("./layout.js"),u=require("./group.js").mark,a=require("./pad-mark.js"),s=require("../model/group.js"),p={};p.controller=function(){if(!i.isAuthenticated())return t.unauthUrl(!0),r.route("/login");document.title=t.LANG.BOOKMARK.TITLE+" - "+t.SERVER.title;var o={};return o.computeBookmarks=function(){var r=n().bookmarks,t=function(r,t){return e(r).values().filter(function(r){return e.includes(t,r._id)}).sortBy("name").value()};o.bookmarks={groups:t(s.groups(),r.groups),pads:t(s.pads(),r.pads)}},o.unmark=function(r,e){("groups"===e?u:a)(r,o.computeBookmarks)},e.isEmpty(s.groups())?s.fetch(o.computeBookmarks):o.computeBookmarks(),o};var l={};return l._items=function(i,n,o){return 0===e.size(i.bookmarks[n])?r("p",o):r("ul.list-unstyled",e.map(i.bookmarks[n],function(o){var u;return u="groups"===n?"/mypads/group/"+o._id+"/view":"/mypads/group/"+o.group+"/pad/view/"+o._id,r("li",[r("button.btn.btn-link.btn-lg",{title:t.LANG.GROUP.UNMARK,onclick:e.partial(i.unmark,o._id,n)},[r("i.glyphicon glyphicon-star")]),r("a",{href:u,config:r.route},o.name)])}))},l.groups=e.partialRight(l._items,"groups",t.LANG.GROUP.NONE),l.pads=e.partialRight(l._items,"pads",t.LANG.GROUP.PAD.NONE),l.aside=function(){return r("section.user-aside",[r("h2",t.LANG.ACTIONS.HELP),r("article.well",r.trust(t.LANG.BOOKMARK.HELP))])},l.main=function(e){return r("section",[r("h2",t.LANG.BOOKMARK.TITLE),r("section.panel.panel-primary",[r(".panel-heading",r("h3.panel-title",t.LANG.GROUP.GROUPS)),r(".panel-body",l.groups(e))]),r("section.panel.panel-info",[r(".panel-heading",r("h3.panel-title",t.LANG.GROUP.PAD.PADS)),r(".panel-body",l.pads(e))])])},p.view=function(r){return o.view(l.main(r),l.aside(r))},p}.call(this);
},{"../auth.js":2,"../configuration.js":3,"../model/group.js":7,"./group.js":18,"./layout.js":20,"./pad-mark.js":24,"lodash":45,"mithril":46}],15:[function(require,module,exports){
......@@ -61,7 +61,7 @@ module.exports=function(){var e=require("lodash"),o=require("mithril"),r=require
},{"../auth.js":2,"../configuration.js":3,"../helpers/form.js":5,"../helpers/ready.js":6,"../model/group.js":7,"../widgets/notification.js":37,"./layout.js":20,"./user.js":32,"lodash":45,"mithril":46}],31:[function(require,module,exports){
module.exports=function(){"use strict";var e=require("mithril"),t=require("lodash"),i=require("../configuration.js"),n=require("../auth.js"),r=require("../model/group.js"),o=require("./layout.js"),u=require("../widgets/notification.js"),s=require("../widgets/tag.js"),l=require("../helpers/form.js"),a={};a.invite=function(o,s){var l={invite:o.isInvite,gid:o.group._id,loginsOrEmails:o.tag.current,auth_token:n.token()};e.request({method:"POST",url:i.URLS.GROUP+"/invite",data:l}).then(function(e){var t,n=o.isInvite?"INVITE_USER":"ADMIN_SHARE";e.present.length>0&&(t=i.LANG.GROUP[n].SUCCESS+e.present.join(", "),u.success({body:t})),e.absent.length>0&&(t=i.LANG.GROUP[n].FAILURE+e.absent.join(", "),u.warning({body:t})),0===e.absent.length&&0===e.present.length&&u.success({body:i.LANG.NOTIFICATION.SUCCESS_GENERIC}),r.fetch(function(){s&&s(e)})},function(e){u.error({body:t.result(i.LANG,e.error)})})},a.controller=function(){if(!n.isAuthenticated())return i.unauthUrl(!0),e.route("/login");var o=n.userInfo(),u={};u.isInvite="invite"===e.route.param("action");var l=function(){var n=e.route.param("group");u.group=r.groups()[n];var l=r.users();l=t.reduce(l,function(e,t){return e.byId[t._id]=t,e.byLogin[t.login]=t,e.byEmail[t.email]=t,e},{byId:{},byLogin:{},byEmail:{}}),u.users=t.merge(l.byLogin,l.byEmail);var a=t(l.byId).pick(u.isInvite?u.group.users:u.group.admins).values().pluck("login").value();u.tag=new s.controller({name:"user-invite",label:i.LANG.GROUP.INVITE_USER.USERS_SELECTION,current:a,placeholder:i.LANG.GROUP.INVITE_USER.PLACEHOLDER,tags:t.pull(t.keys(u.users),o.login,o.email)})};return t.isEmpty(r.groups())?r.fetch(l):l(),u.userlistAdd=function(e){var i=o.userlists[e];u.tag.current=t.union(u.tag.current,t.pluck(i.users,"login"))},u.submit=function(t){t.preventDefault();var i=function(t){e.route("/mypads/group/"+t.value._id+"/view")};a.invite(u,i)},u};var c={};return c.userlistField=function(r){return e("div",[e(".form-group",[e("label.col-sm-4",{for:"userlists"},i.LANG.MENU.USERLIST),e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":i.LANG.USERLIST.INFO.USER_INVITE}),e(".col-sm-7",e("select.form-control",{name:"userlists",onchange:e.withAttr("value",r.userlistAdd)},t.map(t.pairs(n.userInfo().userlists),function(t){return e("option",{value:t[0]},t[1].name)}).concat(e("option",{selected:!0,disabled:!0,hidden:!0,value:""}))))])])},c.userField=function(t){var n=s.views.input(t);return n.attrs.config=l.focusOnInit,e("div.tag",[e(".form-group",[e("label.col-sm-4",{for:t.name},t.label),e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign tag","data-msg":i.LANG.GROUP.INVITE_USER.INPUT_HELP}),e(".col-sm-7",[e(".input-group",[n,e("span.input-group-btn",e("button.btn.btn-default",{type:"button",onclick:function(){t.add(document.getElementById(t.name+"-input"))}},i.LANG.USER.OK))]),s.views.datalist(t)])]),e(".form-group",[e("label.col-sm-4",i.LANG.GLOBAL.OR),e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign tag","data-msg":i.LANG.USERLIST.FIELD.USERSAREA_HELP}),e(".col-sm-7",[e("textarea.form-control",{name:"usersArea",placeholder:i.LANG.USERLIST.FIELD.USERSAREA_PLACEHOLDER}),e("button.btn.btn-default.pull-right",{type:"button",onclick:function(){t.addMultiple(document.querySelector("textarea[name=usersArea]"))}},i.LANG.USER.OK)])])])},c.form=function(t){var n=i.LANG.GROUP;return e("form.form-horizontal",{id:"group-form",onsubmit:t.submit},[e("fieldset",[e("legend",n.INVITE_USERLIST),e("div",c.userlistField(t))]),e("fieldset",[e("legend",t.isInvite?n.INVITE_USER.IU:n.ADMIN_SHARE.AS),e("div",c.userField(t.tag))]),e("fieldset",[e("legend",i.LANG.GROUP.INVITE_USER.USERS_SELECTED),e("div",s.views.tagslist(t.tag))]),e("input.btn.btn-success.pull-right",{form:"group-form",type:"submit",value:i.LANG.ACTIONS.SAVE})])},c.main=function(t){return e("section",{class:"user group-form"},[e("h2",i.LANG.GROUP.GROUP+" "+t.group.name),c.form(t)])},c.aside=function(t){var n=i.LANG.GROUP;return e("section.user-aside",[e("h2",i.LANG.ACTIONS.HELP),e("article.well",[e("h3",t.isInvite?n.INVITE_USER.IU:n.ADMIN_SHARE.AS),e("section",e.trust(i.LANG.GROUP.INVITE_USER.HELP))])])},a.view=function(e){return o.view(c.main(e),c.aside(e))},a}.call(this);
},{"../auth.js":2,"../configuration.js":3,"../helpers/form.js":5,"../model/group.js":7,"../widgets/notification.js":37,"../widgets/tag.js":38,"./layout.js":20,"lodash":45,"mithril":46}],32:[function(require,module,exports){
module.exports=function(){var i=require("lodash"),n=require("mithril"),e=require("../configuration.js"),o=require("../helpers/form.js"),a={};return a.view={},a.view.icon={},a.view.icon.optional=function(){return n("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":e.LANG.USER.INFO.OPTIONAL})},a.view.icon.firstname=a.view.icon.optional,a.view.icon.lastname=a.view.icon.optional,a.view.icon.organization=a.view.icon.optional,a.view.icon.login=function(i){return o.icon(i,"login",e.LANG.USER.INFO.LOGIN,e.LANG.USER.ERR.LOGIN)},a.view.icon.password=function(i,o){var a={password:e.LANG.USER.INFO.PASSWORD_BEGIN+e.SERVER.passwordMin+" "+e.LANG.GLOBAL.AND+" "+e.SERVER.passwordMax+e.LANG.USER.INFO.PASSWORD_END,passwordConfirm:e.LANG.USER.INFO.PASSWORD_CHECK,passwordCurrent:e.LANG.USER.INFO.PASSWORD_CURRENT},r=["glyphicon glyphicon-exclamation-sign"];return i.valid[o]()&&(r=["glyphicon glyphicon-info-sign"]),r.push("mp-tooltip"),n("i",{class:r.join(" "),"data-msg":a[o]})},a.view.icon.email=function(i){return o.icon(i,"email",e.LANG.USER.INFO.EMAIL,e.LANG.USER.ERR.EMAIL)},a.view.icon.color=function(i){return o.icon(i,"color",e.LANG.USER.INFO.COLOR,e.LANG.USER.ERR.COLOR)},a.view.field={},a.view.field.login=function(n){var r=o.field(n,"login",e.LANG.USER.USERNAME,a.view.icon.login(n));return i.assign(r.input.attrs,{type:"text",placeholder:e.LANG.USER.USERNAME,required:!0}),r},a.view.field._pass=function(i,r,t,l){var s=e.SERVER.passwordMin,c=e.SERVER.passwordMax,u={type:"password",name:r,placeholder:e.LANG.USER.UNDEF,required:!i.profileView||!i.profileView(),oninput:o.handleField.bind(null,i,l)};e.SERVER.useLdap||(u.minlength=s,u.maxlength=c,u.pattern=".{"+s+","+c+"}");var d=a.view.icon.password(i,r);return{label:n("label.col-sm-4",{for:r},[t,d]),input:n("input.form-control",u),icon:d}},a.view.field.password=function(i){return a.view.field._pass(i,"password",e.LANG.USER.PASSWORD)},a.view.field.passwordConfirm=function(i){var n=function(i){return i.data.password()===i.data.passwordConfirm()};return a.view.field._pass(i,"passwordConfirm",e.LANG.USER.PASSCHECK,n)},a.view.field.passwordCurrent=function(n){var o=a.view.field._pass(n,"passwordCurrent",e.LANG.USER.PASSCURRENT);return i.assign(o.label.attrs,{style:{fontWeight:"bold"}}),i.assign(o.input.attrs,{required:!0}),o},a.view.field.email=function(n){var r=o.field(n,"email",e.LANG.USER.EMAIL,a.view.icon.email(n));return i.assign(r.input.attrs,{type:"email",placeholder:e.LANG.USER.EMAIL_SAMPLE,required:!0,value:n.data.email()||""}),r},a.view.field.lang=function(o){var a=n("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":e.LANG.USER.INFO.LANG});return{label:n("label.col-sm-4",{for:"lang"},[e.LANG.USER.LANG,a]),icon:a,select:n("select.form-control",{name:"lang",required:!0,value:o.data.lang(),onchange:n.withAttr("value",o.data.lang)},i.reduce(e.SERVER.languages,function(i,e,o){return i.push(n("option",{value:o},e)),i},[]))}},a.view.field.useLoginAndColorInPads=function(i){return{label:n("label",[n("input",{type:"checkbox",name:"useLoginAndColorInPads",checked:i.data.useLoginAndColorInPads(),onchange:n.withAttr("checked",i.data.useLoginAndColorInPads)}),e.LANG.USER.USELOGINANDCOLORINPADS]),icon:n("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":e.LANG.USER.INFO.USELOGINANDCOLORINPADS})}},a.view.field.firstname=function(n){var r=o.field(n,"firstname",e.LANG.USER.FIRSTNAME,a.view.icon.firstname(n));return i.assign(r.input.attrs,{type:"text",placeholder:e.LANG.USER.FIRSTNAME}),r},a.view.field.lastname=function(n){var r=o.field(n,"lastname",e.LANG.USER.LASTNAME,a.view.icon.lastname(n));return i.assign(r.input.attrs,{type:"text",placeholder:e.LANG.USER.LASTNAME}),r},a.view.field.organization=function(n){var r=o.field(n,"organization",e.LANG.USER.ORGANIZATION,a.view.icon.organization(n));return i.assign(r.input.attrs,{type:"text",placeholder:e.LANG.USER.ORGANIZATION}),r},a.view.field.color=function(n){var r=o.field(n,"color",e.LANG.USER.COLOR,a.view.icon.color(n));return i.assign(r.input.attrs,{type:"color",placeholder:e.LANG.USER.COLOR_SAMPLE,maxlength:7,pattern:"#[0-9,a-f]{6}"}),r},a.view.aside={common:function(){return n("section.user-aside",[n("h2",e.SERVER.title),n("article.well",n.trust(e.LANG.GLOBAL.DESCRIPTION))])},profile:function(){return n("section.user-aside",[n("h2",e.LANG.ACTIONS.HELP),n("article.well",n.trust(e.LANG.USER.HELP.PROFILE))])}},a}.call(this);
module.exports=function(){var i=require("lodash"),e=require("mithril"),n=require("../configuration.js"),o=require("../helpers/form.js"),a={};return a.view={},a.view.icon={},a.view.icon.optional=function(){return e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":n.LANG.USER.INFO.OPTIONAL})},a.view.icon.firstname=a.view.icon.optional,a.view.icon.lastname=a.view.icon.optional,a.view.icon.organization=a.view.icon.optional,a.view.icon.login=function(i){return o.icon(i,"login",n.LANG.USER.INFO.LOGIN,n.LANG.USER.ERR.LOGIN)},a.view.icon.password=function(i,o){var a={password:n.LANG.USER.INFO.PASSWORD_BEGIN+n.SERVER.passwordMin+" "+n.LANG.GLOBAL.AND+" "+n.SERVER.passwordMax+n.LANG.USER.INFO.PASSWORD_END,passwordConfirm:n.LANG.USER.INFO.PASSWORD_CHECK,passwordCurrent:n.LANG.USER.INFO.PASSWORD_CURRENT},t=["glyphicon glyphicon-exclamation-sign"];return i.valid[o]()&&(t=["glyphicon glyphicon-info-sign"]),t.push("mp-tooltip"),e("i",{class:t.join(" "),"data-msg":a[o]})},a.view.icon.email=function(i){return o.icon(i,"email",n.LANG.USER.INFO.EMAIL,n.LANG.USER.ERR.EMAIL)},a.view.icon.color=function(i){return o.icon(i,"color",n.LANG.USER.INFO.COLOR,n.LANG.USER.ERR.COLOR)},a.view.field={},a.view.field.login=function(e){var t=o.field(e,"login",n.LANG.USER.USERNAME,a.view.icon.login(e));return i.assign(t.input.attrs,{type:"text",placeholder:n.LANG.USER.USERNAME,required:!0}),t},a.view.field._pass=function(i,t,r,l){var s=n.SERVER.passwordMin,c=n.SERVER.passwordMax,u={type:"password",name:t,placeholder:n.LANG.USER.UNDEF,required:!i.profileView||!i.profileView(),oninput:o.handleField.bind(null,i,l)};n.SERVER.useLdap||(u.minlength=s,u.maxlength=c,u.pattern=".{"+s+","+c+"}");var d=a.view.icon.password(i,t);return{label:e("label.col-sm-4",{for:t},[r,d]),input:e("input.form-control",u),icon:d}},a.view.field.password=function(i){return a.view.field._pass(i,"password",n.LANG.USER.PASSWORD)},a.view.field.passwordConfirm=function(i){var e=function(i){return i.data.password()===i.data.passwordConfirm()};return a.view.field._pass(i,"passwordConfirm",n.LANG.USER.PASSCHECK,e)},a.view.field.passwordCurrent=function(e){var o=a.view.field._pass(e,"passwordCurrent",n.LANG.USER.PASSCURRENT);return i.assign(o.label.attrs,{style:{fontWeight:"bold"}}),i.assign(o.input.attrs,{required:!0}),o},a.view.field.email=function(e){var t=o.field(e,"email",n.LANG.USER.EMAIL,a.view.icon.email(e));return i.assign(t.input.attrs,{type:"email",placeholder:n.LANG.USER.EMAIL_SAMPLE,required:!0,value:e.data.email()||""}),t},a.view.field.lang=function(o){var a=e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":n.LANG.USER.INFO.LANG});return{label:e("label.col-sm-4",{for:"lang"},[n.LANG.USER.LANG,a]),select:e("select.form-control",{name:"lang",required:!0,value:o.data.lang(),onchange:e.withAttr("value",o.data.lang)},i.reduce(n.SERVER.languages,function(i,n,o){return i.push(e("option",{value:o},n)),i},[]))}},a.view.field.useLoginAndColorInPads=function(i){return{label:e("label",[e("input",{type:"checkbox",name:"useLoginAndColorInPads",checked:i.data.useLoginAndColorInPads(),onchange:e.withAttr("checked",i.data.useLoginAndColorInPads)}),n.SERVER.useFirstLastNameInPads?n.LANG.USER.USECOLORINPADS:n.LANG.USER.USELOGINANDCOLORINPADS,e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign","data-msg":n.SERVER.useFirstLastNameInPads?n.LANG.USER.INFO.USECOLORINPADS:n.LANG.USER.INFO.USELOGINANDCOLORINPADS})])}},a.view.field.firstname=function(e){var t=o.field(e,"firstname",n.LANG.USER.FIRSTNAME,a.view.icon.firstname(e));return i.assign(t.input.attrs,{type:"text",placeholder:n.LANG.USER.FIRSTNAME}),t},a.view.field.lastname=function(e){var t=o.field(e,"lastname",n.LANG.USER.LASTNAME,a.view.icon.lastname(e));return i.assign(t.input.attrs,{type:"text",placeholder:n.LANG.USER.LASTNAME}),t},a.view.field.organization=function(e){var t=o.field(e,"organization",n.LANG.USER.ORGANIZATION,a.view.icon.organization(e));return i.assign(t.input.attrs,{type:"text",placeholder:n.LANG.USER.ORGANIZATION}),t},a.view.field.color=function(e){var t=o.field(e,"color",n.LANG.USER.COLOR,a.view.icon.color(e));return i.assign(t.input.attrs,{type:"color",placeholder:n.LANG.USER.COLOR_SAMPLE,maxlength:7,pattern:"#[0-9,a-f]{6}"}),t},a.view.aside={common:function(){return e("section.user-aside",[e("h2",n.SERVER.title),e("article.well",e.trust(n.LANG.GLOBAL.DESCRIPTION))])},profile:function(){return e("section.user-aside",[e("h2",n.LANG.ACTIONS.HELP),e("article.well",e.trust(n.LANG.USER.HELP.PROFILE))])}},a}.call(this);
},{"../configuration.js":3,"../helpers/form.js":5,"lodash":45,"mithril":46}],33:[function(require,module,exports){
module.exports=function(){"use strict";var e=require("mithril"),t=require("lodash"),r=require("../configuration.js"),n=require("../auth.js"),i=require("./layout.js"),s=require("../widgets/notification.js"),u=require("../widgets/tag.js"),o=require("../helpers/form.js"),l=require("../model/group.js"),a={};a.controller=function(){if(!n.isAuthenticated())return r.unauthUrl(!0),e.route("/login");var i={};i.addView=e.prop("/myuserlists/add"===e.route()),i.fields=["name"],o.initFields(i,i.fields);var a=function(){var s=n.userInfo(),o=[];i.addView()||(i.key=e.route.param("key"),i.userlist=s.userlists[i.key],o=t.pluck(i.userlist.users,"login"),i.data.name(i.userlist.name));var l=t.reduce(s.userlists,function(e,r){return t.each(r.users,function(r){t.includes(e,r.login)||(e.push(r.login),e.push(r.email))}),e},[]);i.tag=new u.controller({name:"users",label:r.LANG.GROUP.INVITE_USER.USERS_SELECTION,current:o,placeholder:r.LANG.GROUP.INVITE_USER.PLACEHOLDER,tags:l}),document.title=i.addView()?r.LANG.USERLIST.ADD:r.LANG.USERLIST.EDIT,document.title+=" - "+r.SERVER.title};return t.isEmpty(l.groups())?l.fetch(a):a(),i.submit=function(u){u.preventDefault();var o={method:"POST",url:r.URLS.USERLIST,data:{name:i.data.name(),loginsOrEmails:i.tag.current,auth_token:n.token()}},l=r.LANG.USERLIST.INFO.ADD_SUCCESS;i.addView()||(o.method="PUT",o.url+="/"+i.key,o.data.ulistid=i.key,l=r.LANG.USERLIST.INFO.EDIT_SUCCESS),e.request(o).then(function(t){var i=n.userInfo();i.userlists=t.value,n.userInfo(i),s.success({body:l});var u;t.present.length>0&&(u=r.LANG.USERLIST.INFO.USER_SUCCESS+t.present.join(", "),s.success({body:u})),t.absent.length>0&&(u=r.LANG.USERLIST.INFO.USER_FAILURE+t.absent.join(", "),s.warning({body:u})),e.route("/myuserlists")},function(e){s.error({body:t.result(r.LANG,e.error)})})},i};var S={};return S.field={},S.field.name=function(e){var n=o.field(e,"name",r.LANG.USERLIST.FIELD.NAME,o.icon(e,"name",r.LANG.USERLIST.INFO.NAME,r.LANG.GROUP.ERR.NAME));return t.assign(n.input.attrs,{placeholder:r.LANG.USERLIST.INFO.NAME,required:!0,maxlength:40,config:o.focusOnInit}),n},S.field.users=function(t){return e("div.tag",[e(".form-group",[e("label.col-sm-4",{for:t.name},[t.label,e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign tag","data-msg":r.LANG.USERLIST.FIELD.USERS_HELP})]),e(".col-sm-7",[e(".input-group",[u.views.input(t),e("span.input-group-btn",e("button.btn.btn-default",{type:"button",onclick:function(){t.add(document.getElementById(t.name+"-input"))}},r.LANG.USER.OK))]),u.views.datalist(t)])]),e(".form-group",[e("label.col-sm-4",[r.LANG.GLOBAL.OR,e("i",{class:"mp-tooltip glyphicon glyphicon-info-sign tag","data-msg":r.LANG.USERLIST.FIELD.USERSAREA_HELP})]),e(".col-sm-7",[e("textarea.form-control",{name:"usersArea",placeholder:r.LANG.USERLIST.FIELD.USERSAREA_PLACEHOLDER}),e("button.btn.btn-default.pull-right",{type:"button",onclick:function(){t.addMultiple(document.querySelector("textarea[name=usersArea]"))}},r.LANG.USER.OK)])])])},S.form=function(t){var n=S.field.name(t);n.label.attrs.class="col-sm-4";var i=[e(".form-group",[n.label,e(".col-sm-7",n.input)])];return e("form.form-horizontal",{id:"ulist-form",onsubmit:t.submit},[e("fieldset",[e("legend",r.LANG.USERLIST.USERLIST),e("div",i)]),e("fieldset",[e("legend",r.LANG.USERLIST.FIELD.USERS),e("div",S.field.users(t.tag))]),e("fieldset",[e("legend",r.LANG.GROUP.INVITE_USER.USERS_SELECTED),e("div",u.views.tagslist(t.tag))]),e("input.btn.btn-success.pull-right",{form:"ulist-form",type:"submit",value:r.LANG.ACTIONS.SAVE})])},S.main=function(t){return e("section",[e("h2",t.addView()?r.LANG.USERLIST.ADD:r.LANG.USERLIST.EDIT),S.form(t)])},S.aside=function(){return e("section.user-aside",[e("h2",r.LANG.ACTIONS.HELP),e("article.well",e.trust(r.LANG.USERLIST.FORM_HELP))])},a.view=function(e){return i.view(S.main(e),S.aside(e))},a}.call(this);
},{"../auth.js":2,"../configuration.js":3,"../helpers/form.js":5,"../model/group.js":7,"../widgets/notification.js":37,"../widgets/tag.js":38,"./layout.js":20,"lodash":45,"mithril":46}],34:[function(require,module,exports){
......@@ -98,7 +98,7 @@ exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-
},{}],46:[function(require,module,exports){
var m=function e(t,n){function r(e){j=e.document,A=e.location,R=e.cancelAnimationFrame||e.clearTimeout,S=e.requestAnimationFrame||e.setTimeout}function o(){var e,t=[].slice.call(arguments),n=!(null==t[1]||I.call(t[1])!==M||"tag"in t[1]||"subtree"in t[1]),r=n?t[1]:{},o="class"in r?"class":"className",a={tag:"div",attrs:{}},i=[];if(I.call(t[0])!=B)throw new Error("selector in m(selector, attrs, children) should be a string");for(;e=U.exec(t[0]);)if(""===e[1]&&e[2])a.tag=e[2];else if("#"===e[1])a.attrs.id=e[2];else if("."===e[1])i.push(e[2]);else if("["===e[3][0]){var l=q.exec(e[3]);a.attrs[l[1]]=l[3]||!l[2]||""}i.length>0&&(a.attrs[o]=i.join(" "));var s=n?t.slice(2):t.slice(1);1===s.length&&I.call(s[0])===L?a.children=s[0]:a.children=s;for(var c in r)if(c===o){var u=a.attrs[c];a.attrs[c]=(u&&r[c]?u+" ":u||"")+r[c]}else a.attrs[c]=r[c];return a}function a(e,t,r,c,d,f,h,p,g,m,v){try{null!=d&&null!=d.toString()||(d="")}catch(e){d=""}if("retain"===d.subtree)return f;var y=I.call(f),w=I.call(d);if(null==f||y!==w){if(null!=f)if(r&&r.nodes){var x=p-c,C=x+(w===L?d:f.nodes).length;s(r.nodes.slice(x,C),r.slice(x,C))}else f.nodes&&s(f.nodes,f);f=new d.constructor,f.tag&&(f={}),f.nodes=[]}if(w===L){for(var E=0,b=d.length;E<b;E++)I.call(d[E])===L&&(d=d.concat.apply([],d),E--,b=d.length);for(var N=[],k=f.length===d.length,T=0,O={},A=!1,E=0;E<f.length;E++)f[E]&&f[E].attrs&&null!=f[E].attrs.key&&(A=!0,O[f[E].attrs.key]={action:1,index:E});for(var S=0,E=0,b=d.length;E<b;E++)if(d[E]&&d[E].attrs&&null!=d[E].attrs.key){for(var R=0,b=d.length;R<b;R++)d[R]&&d[R].attrs&&null==d[R].attrs.key&&(d[R].attrs.key="__mithril__"+S++);break}if(A){var U=!1;if(d.length!=f.length)U=!0;else for(var q,H,E=0;q=f[E],H=d[E];E++)if(q.attrs&&H.attrs&&q.attrs.key!=H.attrs.key){U=!0;break}if(U){for(var E=0,b=d.length;E<b;E++)if(d[E]&&d[E].attrs&&null!=d[E].attrs.key){var J=d[E].attrs.key;O[J]?O[J]={action:3,index:E,from:O[J].index,element:f.nodes[O[J].index]||j.createElement("div")}:O[J]={action:2,index:E}}var K=[];for(var _ in O)K.push(O[_]);var $=K.sort(i),F=new Array(f.length);F.nodes=f.nodes.slice();for(var G,E=0;G=$[E];E++){if(1===G.action&&(s(f[G.index].nodes,f[G.index]),F.splice(G.index,1)),2===G.action){var P=j.createElement("div");P.key=d[G.index].attrs.key,e.insertBefore(P,e.childNodes[G.index]||null),F.splice(G.index,0,{attrs:{key:d[G.index].attrs.key},nodes:[P]}),F.nodes[G.index]=P}3===G.action&&(e.childNodes[G.index]!==G.element&&null!==G.element&&e.insertBefore(G.element,e.childNodes[G.index]||null),F[G.index]=f[G.from],F.nodes[G.index]=G.element)}f=F}}for(var E=0,V=0,b=d.length;E<b;E++){var Q=a(e,t,f,p,d[E],f[V],h,p+T||T,g,m,v);Q!==n&&(Q.nodes.intact||(k=!1),Q.$trusted?T+=(Q.match(/<[^\/]|\>\s*[^<]/g)||[0]).length:T+=I.call(Q)===L?Q.length:1,f[V++]=Q)}if(!k){for(var E=0,b=d.length;E<b;E++)null!=f[E]&&N.push.apply(N,f[E].nodes);for(var Y,E=0;Y=f.nodes[E];E++)null!=Y.parentNode&&N.indexOf(Y)<0&&s([Y],[f[E]]);d.length<f.length&&(f.length=d.length),f.nodes=N}}else if(null!=d&&w===M){d.attrs||(d.attrs={}),f.attrs||(f.attrs={});var W=Object.keys(d.attrs),X=W.length>("key"in d.attrs?1:0);if((d.tag!=f.tag||W.join()!=Object.keys(f.attrs).join()||d.attrs.id!=f.attrs.id||"all"==o.redraw.strategy()&&f.configContext&&!0!==f.configContext.retain||"diff"==o.redraw.strategy()&&f.configContext&&!1===f.configContext.retain)&&(f.nodes.length&&s(f.nodes),f.configContext&&typeof f.configContext.onunload===D&&f.configContext.onunload()),I.call(d.tag)!=B)return;var Y,Z=0===f.nodes.length;if(d.attrs.xmlns?m=d.attrs.xmlns:"svg"===d.tag?m="http://www.w3.org/2000/svg":"math"===d.tag&&(m="http://www.w3.org/1998/Math/MathML"),Z?(Y=d.attrs.is?m===n?j.createElement(d.tag,d.attrs.is):j.createElementNS(m,d.tag,d.attrs.is):m===n?j.createElement(d.tag):j.createElementNS(m,d.tag),f={tag:d.tag,attrs:X?l(Y,d.tag,d.attrs,{},m):d.attrs,children:null!=d.children&&d.children.length>0?a(Y,d.tag,n,n,d.children,f.children,!0,0,d.attrs.contenteditable?Y:g,m,v):d.children,nodes:[Y]},f.children&&!f.children.nodes&&(f.children.nodes=[]),"select"===d.tag&&d.attrs.value&&l(Y,d.tag,{value:d.attrs.value},{},m),e.insertBefore(Y,e.childNodes[p]||null)):(Y=f.nodes[0],X&&l(Y,d.tag,d.attrs,f.attrs,m),f.children=a(Y,d.tag,n,n,d.children,f.children,!1,0,d.attrs.contenteditable?Y:g,m,v),f.nodes.intact=!0,!0===h&&null!=Y&&e.insertBefore(Y,e.childNodes[p]||null)),typeof d.attrs.config===D){var ee=f.configContext=f.configContext||{retain:"diff"==o.redraw.strategy()||n};v.push(function(e,t){return function(){return e.attrs.config.apply(e,t)}}(d,[Y,!Z,ee,f]))}}else if(typeof d!=D){var N;0===f.nodes.length?(d.$trusted?N=u(e,p,d):(N=[j.createTextNode(d)],e.nodeName.match(z)||e.insertBefore(N[0],e.childNodes[p]||null)),f="string number boolean".indexOf(typeof d)>-1?new d.constructor(d):d,f.nodes=N):f.valueOf()!==d.valueOf()||!0===h?(N=f.nodes,g&&g===j.activeElement||(d.$trusted?(s(N,f),N=u(e,p,d)):"textarea"===t?e.value=d:g?g.innerHTML=d:((1===N[0].nodeType||N.length>1)&&(s(f.nodes,f),N=[j.createTextNode(d)]),e.insertBefore(N[0],e.childNodes[p]||null),N[0].nodeValue=d)),f=new d.constructor(d),f.nodes=N):f.nodes.intact=!0}return f}function i(e,t){return e.action-t.action||e.index-t.index}function l(e,t,n,r,o){for(var a in n){var i=n[a],l=r[a];if(a in r&&l===i)"value"===a&&"input"===t&&e.value!=i&&(e.value=i);else{r[a]=i;try{if("config"===a||"key"==a)continue;if(typeof i===D&&0===a.indexOf("on"))e[a]=d(i,e);else if("style"===a&&null!=i&&I.call(i)===M){for(var s in i)null!=l&&l[s]===i[s]||(e.style[s]=i[s]);for(var s in l)s in i||(e.style[s]="")}else null!=o?"href"===a?e.setAttributeNS("http://www.w3.org/1999/xlink","href",i):"className"===a?e.setAttribute("class",i):e.setAttribute(a,i):a in e&&"list"!==a&&"style"!==a&&"form"!==a&&"type"!==a&&"width"!==a&&"height"!==a?"input"===t&&e[a]===i||(e[a]=i):e.setAttribute(a,i)}catch(e){if(e.message.indexOf("Invalid argument")<0)throw e}}}return r}function s(e,t){for(var n=e.length-1;n>-1;n--)if(e[n]&&e[n].parentNode){try{e[n].parentNode.removeChild(e[n])}catch(e){}t=[].concat(t),t[n]&&c(t[n])}0!=e.length&&(e.length=0)}function c(e){if(e.configContext&&typeof e.configContext.onunload===D&&(e.configContext.onunload(),e.configContext.onunload=null),e.children)if(I.call(e.children)===L)for(var t,n=0;t=e.children[n];n++)c(t);else e.children.tag&&c(e.children)}function u(e,t,n){var r=e.childNodes[t];if(r){var o=1!=r.nodeType,a=j.createElement("span");o?(e.insertBefore(a,r||null),a.insertAdjacentHTML("beforebegin",n),e.removeChild(a)):r.insertAdjacentHTML("beforebegin",n)}else e.insertAdjacentHTML("beforeend",n);for(var i=[];e.childNodes[t]!==r;)i.push(e.childNodes[t]),t++;return i}function d(e,t){return function(n){n=n||event,o.redraw.strategy("diff"),o.startComputation();try{return e.call(t,n)}finally{Z()}}}function f(e){var t=K.indexOf(e);return t<0?K.push(e)-1:t}function h(e){var t=function(){return arguments.length&&(e=arguments[0]),e};return t.toJSON=function(){return e},t}function p(){for(var e,t=0;e=F[t];t++)P[t]&&o.render(e,G[t].view?G[t].view(P[t]):W());Y&&(Y(),Y=null),V=null,Q=new Date,o.redraw.strategy("diff")}function g(e){return e.slice(ne[o.route.mode].length)}function m(e,t,n){ee={};var r=n.indexOf("?");-1!==r&&(ee=x(n.substr(r+1,n.length)),n=n.substr(0,r));var a=Object.keys(t),i=a.indexOf(n);if(-1!==i)return o.module(e,t[a[i]]),!0;for(var l in t){if(l===n)return o.module(e,t[l]),!0;var s=new RegExp("^"+l.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(s.test(n))return n.replace(s,function(){for(var n=l.match(/:[^\/]+/g)||[],r=[].slice.call(arguments,1,-2),a=0,i=n.length;a<i;a++)ee[n[a].replace(/:|\./g,"")]=decodeURIComponent(r[a]);o.module(e,t[l])}),!0}}function v(e){if(e=e||event,!e.ctrlKey&&!e.metaKey&&2!==e.which){e.preventDefault?e.preventDefault():e.returnValue=!1;for(var t=e.currentTarget||e.srcElement,n="pathname"===o.route.mode&&t.search?x(t.search.slice(1)):{};t&&"A"!=t.nodeName.toUpperCase();)t=t.parentNode;o.route(t[o.route.mode].slice(ne[o.route.mode].length),n)}}function y(){"hash"!=o.route.mode&&A.hash?A.hash=A.hash:t.scrollTo(0,0)}function w(e,t){var r={},o=[];for(var a in e){var i=t?t+"["+a+"]":a,l=e[a],s=I.call(l),c=null===l?encodeURIComponent(i):s===M?w(l,i):s===L?l.reduce(function(e,t){return r[i]||(r[i]={}),r[i][t]?e:(r[i][t]=!0,e.concat(encodeURIComponent(i)+"="+encodeURIComponent(t)))},[]).join("&"):encodeURIComponent(i)+"="+encodeURIComponent(l);l!==n&&o.push(c)}return o.join("&")}function x(e){for(var t=e.split("&"),n={},r=0,o=t.length;r<o;r++){var a=t[r].split("="),i=decodeURIComponent(a[0]),l=2==a.length?decodeURIComponent(a[1]):null;null!=n[i]?(I.call(n[i])!==L&&(n[i]=[n[i]]),n[i].push(l)):n[i]=l}return n}function C(e){var t=f(e);s(e.childNodes,_[t]),_[t]=n}function E(e,t){var n=o.prop(t);return e.then(n),n.then=function(n,r){return E(e.then(n,r),t)},n}function b(e,t){function n(e){d=e||c,h.map(function(e){d===s&&e.resolve(f)||e.reject(f)})}function r(e,t,n,r){if((null!=f&&I.call(f)===M||typeof f===D)&&typeof e===D)try{var a=0;e.call(f,function(e){a++||(f=e,t())},function(e){a++||(f=e,n())})}catch(e){o.deferred.onerror(e),f=e,n()}else r()}function a(){var c;try{c=f&&f.then}catch(e){return o.deferred.onerror(e),f=e,d=l,a()}r(c,function(){d=i,a()},function(){d=l,a()},function(){try{d===i&&typeof e===D?f=e(f):d===l&&"function"==typeof t&&(f=t(f),d=i)}catch(e){return o.deferred.onerror(e),f=e,n()}f===u?(f=TypeError(),n()):r(c,function(){n(s)},n,function(){n(d===i&&s)})})}var i=1,l=2,s=3,c=4,u=this,d=0,f=0,h=[];u.promise={},u.resolve=function(e){return d||(f=e,d=i,a()),this},u.reject=function(e){return d||(f=e,d=l,a()),this},u.promise.then=function(e,t){var n=new b(e,t);return d===s?n.resolve(f):d===c?n.reject(f):h.push(n),n.promise}}function N(e){return e}function k(e){if(!e.dataType||"jsonp"!==e.dataType.toLowerCase()){var r=new t.XMLHttpRequest;if(r.open(e.method,e.url,!0,e.user,e.password),r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?e.onload({type:"load",target:r}):e.onerror({type:"error",target:r}))},e.serialize===JSON.stringify&&e.data&&"GET"!==e.method&&r.setRequestHeader("Content-Type","application/json; charset=utf-8"),e.deserialize===JSON.parse&&r.setRequestHeader("Accept","application/json, text/*"),typeof e.config===D){var o=e.config(r,e);null!=o&&(r=o)}var a="GET"!==e.method&&e.data?e.data:"";if(a&&I.call(a)!=B&&a.constructor!=t.FormData)throw"Request data should be either be a string or FormData. Check the `serialize` option in `m.request`";return r.send(a),r}var i="mithril_callback_"+(new Date).getTime()+"_"+Math.round(1e16*Math.random()).toString(36),l=j.createElement("script");t[i]=function(r){l.parentNode.removeChild(l),e.onload({type:"load",target:{responseText:r}}),t[i]=n},l.onerror=function(r){return l.parentNode.removeChild(l),e.onerror({type:"error",target:{status:500,responseText:JSON.stringify({error:"Error making jsonp request"})}}),t[i]=n,!1},l.onload=function(e){return!1},l.src=e.url+(e.url.indexOf("?")>0?"&":"?")+(e.callbackKey?e.callbackKey:"callback")+"="+i+"&"+w(e.data||{}),j.body.appendChild(l)}function T(e,t,n){if("GET"===e.method&&"jsonp"!=e.dataType){var r=e.url.indexOf("?")<0?"?":"&",o=w(t);e.url=e.url+(o?r+o:"")}else e.data=n(t);return e}function O(e,t){var n=e.match(/:[a-z]\w+/gi);if(n&&t)for(var r=0;r<n.length;r++){var o=n[r].slice(1);e=e.replace(n[r],t[o]),delete t[o]}return e}var j,A,S,R,M="[object Object]",L="[object Array]",B="[object String]",D="function",I={}.toString,U=/(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g,q=/\[(.+?)(?:=("|'|)(.*?)\2)?\]/,z=/^(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|KEYGEN|LINK|META|PARAM|SOURCE|TRACK|WBR)$/;r(t);var H,J={appendChild:function(e){H===n&&(H=j.createElement("html")),j.documentElement&&j.documentElement!==e?j.replaceChild(e,j.documentElement):j.appendChild(e),this.childNodes=j.childNodes},insertBefore:function(e){this.appendChild(e)},childNodes:[]},K=[],_={};o.render=function(e,t,r){var o=[];if(!e)throw new Error("Please ensure the DOM element exists before rendering a template into it.");var i=f(e),l=e===j,c=l||e===j.documentElement?J:e;l&&"html"!=t.tag&&(t={tag:"html",attrs:{},children:t}),_[i]===n&&s(c.childNodes),!0===r&&C(e),_[i]=a(c,null,n,n,t,_[i],!1,0,null,n,o);for(var u=0,d=o.length;u<d;u++)o[u]()},o.trust=function(e){return e=new String(e),e.$trusted=!0,e},o.prop=function(e){return(null!=e&&I.call(e)===M||typeof e===D)&&typeof e.then===D?E(e):h(e)};var $,F=[],G=[],P=[],V=null,Q=0,Y=null;o.module=function(e,t){if(!e)throw new Error("Please ensure the DOM element exists before rendering a template into it.");var n=F.indexOf(e);n<0&&(n=F.length);var r=!1;if(P[n]&&typeof P[n].onunload===D){var a={preventDefault:function(){r=!0}};P[n].onunload(a)}if(!r){o.redraw.strategy("all"),o.startComputation(),F[n]=e;var i=$=t=t||{},l=new(t.controller||function(){});return i===$&&(P[n]=l,G[n]=t),Z(),P[n]}},o.redraw=function(e){V&&!0!==e?(new Date-Q>16||S===t.requestAnimationFrame)&&(V>0&&R(V),V=S(p,16)):(p(),V=S(function(){V=null},16))},o.redraw.strategy=o.prop();var W=function(){return""},X=0;o.startComputation=function(){X++},o.endComputation=function(){0===(X=Math.max(X-1,0))&&o.redraw()};var Z=function(){"none"==o.redraw.strategy()?(X--,o.redraw.strategy("diff")):o.endComputation()};o.withAttr=function(e,t){return function(n){n=n||event;var r=n.currentTarget||this;t(e in r?r[e]:r.getAttribute(e))}};var ee,te,ne={pathname:"",hash:"#",search:"?"},re=function(){};return o.route=function(){if(0===arguments.length)return te;if(3===arguments.length&&I.call(arguments[1])===B){var e=arguments[0],n=arguments[1],r=arguments[2];re=function(t){var a=te=g(t);m(e,r,a)||o.route(n,!0)};var a="hash"===o.route.mode?"onhashchange":"onpopstate";t[a]=function(){var e=A[o.route.mode];"pathname"===o.route.mode&&(e+=A.search),te!=g(e)&&re(e)},Y=y,t[a]()}else if(arguments[0].addEventListener||arguments[0].attachEvent){var i=arguments[0];arguments[1],arguments[2];i.href=("pathname"!==o.route.mode?A.pathname:"")+ne[o.route.mode]+this.attrs.href,i.addEventListener?(i.removeEventListener("click",v),i.addEventListener("click",v)):(i.detachEvent("onclick",v),i.attachEvent("onclick",v))}else if(I.call(arguments[0])===B){var l=te;te=arguments[0];var s=arguments[1]||{},c=te.indexOf("?"),u=c>-1?x(te.slice(c+1)):{};for(var d in s)u[d]=s[d];var f=w(u),h=c>-1?te.slice(0,c):te;f&&(te=h+(-1===h.indexOf("?")?"?":"&")+f);var p=!0===(3===arguments.length?arguments[2]:arguments[1])||l===arguments[0];t.history.pushState?(Y=function(){t.history[p?"replaceState":"pushState"](null,j.title,ne[o.route.mode]+te),y()},re(ne[o.route.mode]+te)):(A[o.route.mode]=te,re(ne[o.route.mode]+te))}},o.route.param=function(e){if(!ee)throw new Error("You must call m.route(element, defaultRoute, routes) before calling m.route.param()");return ee[e]},o.route.mode="search",o.route.buildQueryString=w,o.route.parseQueryString=x,o.deferred=function(){var e=new b;return e.promise=E(e.promise),e},o.deferred.onerror=function(e){if("[object Error]"===I.call(e)&&!e.constructor.toString().match(/ Error/))throw e},o.sync=function(e){function t(e,t){return function(o){return i[e]=o,t||(n="reject"),0==--a&&(r.promise(i),r[n](i)),o}}var n="resolve",r=o.deferred(),a=e.length,i=new Array(a);if(e.length>0)for(var l=0;l<e.length;l++)e[l].then(t(l,!0),t(l,!1));else r.resolve([]);return r.promise},o.request=function(e){!0!==e.background&&o.startComputation();var t=new b,n=e.dataType&&"jsonp"===e.dataType.toLowerCase(),r=e.serialize=n?N:e.serialize||JSON.stringify,a=e.deserialize=n?N:e.deserialize||JSON.parse,i=e.extract||function(e){return 0===e.responseText.length&&a===JSON.parse?null:e.responseText};return e.url=O(e.url,e.data),e=T(e,e.data,r),e.onload=e.onerror=function(n){try{n=n||event;var r=("load"===n.type?e.unwrapSuccess:e.unwrapError)||N,l=r(a(i(n.target,e)),n.target);if("load"===n.type)if(I.call(l)===L&&e.type)for(var s=0;s<l.length;s++)l[s]=new e.type(l[s]);else e.type&&(l=new e.type(l));t["load"===n.type?"resolve":"reject"](l)}catch(n){o.deferred.onerror(n),t.reject(n)}!0!==e.background&&o.endComputation()},k(e),t.promise=E(t.promise,e.initialValue),t.promise},o.deps=function(e){return r(t=e||t),t},o.deps.factory=e,o}("undefined"!=typeof window?window:{});"undefined"!=typeof module&&null!==module&&module.exports?module.exports=m:"function"==typeof define&&define.amd&&define(function(){return m});
},{}],47:[function(require,module,exports){
module.exports={"BACKEND":{"ERROR":{"TYPE":{"PARAMS_REQUIRED":"Parameters are mandatory","PARAM_STR":"Some parameter must be a string","STR_100":"String can't be more than 100 characters","CALLBACK_FN":"Callback must be a function","KEY_STR":"Key must be a string","VALUE_REQUIRED":"Value is mandatory","LOGIN_STR":"Login must be a string","LOGIN_REQUIRED":"Login is required","PASSWORD_STR":"Password must be a string","PASSWORD_MISSING":"Missing password","PASSWORD_SIZE":"Password size is too short or too long","MAIL":"Email is invalid","ID_STR":"_id, when defined, must be a string","USER_INVALID":"User is invalid","WITHEXTRA_BOOL":"withExtra must be a boolean","INVITE_BOOL":"Invite must be a boolean","GID_STR":"gid must be a string","LOGINS_ARR":"logins must be an array","TYPE_PADSORGROUPS":"Type must be either pads or folders","USERLIST_CRUD":"crud must be add, set or del","USERLIST_ID":"In set and del modes, ulistid is mandatory","USERLIST_NAME":"In add mode, name of the userlist is mandatory","USERLIST_SET_PARAMS":"In set mode, name or uids is madantory","SMTP_CONFIG":"Your SMTP server configuration is invalid","TO_MAIL":"to must be an email address","SUBJECT_STR":"subject must be a string","MSG_STR":"message must be a string"},"CONFIGURATION":{"LANG_PROBLEM":"Language update cannot be done. The default language will be used.","CANTGET":"Configuration loading has failed. Please contact your administrator.","KEY_NOT_FOUND":"The record has not been found","MAIL_NOT_CONFIGURED":"Mail settings have not been done on this server. Please contact its administrator.","ROOTURL_NOT_CONFIGURED":"Root Url setting has not been entered on this server. Please contact its administrator."},"AUTHENTICATION":{"MUST_BE":"You must be authenticated","ACTIVATION_NEEDED":"Your account has not been confirmed","NOT_AUTH":"Not authenticated","PASSWORD_INCORRECT":"Password is not correct","TOKEN_INCORRECT":"Your security token is invalid","ADMIN":"Access denied : you must be an authenticated Etherpad instance admin.","DENIED":"Access denied","DENIED_RECORD":"You're not allowed to get this record","DENIED_RECORD_EDIT":"You're not allowed to edit this record","NO_REGISTRATION":"Sorry, registration is disabled","NO_RECOVER":"Sorry, you can't recover you password from here"},"PERMISSION":{"UNEXPECTED":"Sorry, an unexpected has error has occurred","UNAUTHORIZED":"You are not allowed to access to this record"},"GROUP":{"INEXISTENT":"Folder does not exist","CASCADE_REMOVAL_PROBLEM":"Something goes wrong with cascade pads removal","ITEMS_NOT_FOUND":"Some users, admins or pads have not been found","NOT_USER":"You are not an user of this folder","RESIGN_UNIQUE_ADMIN":"You can't resign the unique administrator"},"USER":{"ALREADY_EXISTS":"User already exists, please choose another login","EMAIL_ALREADY_EXISTS":"This user email has already been used, please choose another one","NOT_FOUND":"User not found","BOOKMARK_NOT_FOUND":"Bookmark not found","USERLIST_NOT_FOUND":"Userlist not found"},"PAD":{"INEXISTENT":"Pad does not exist","ITEMS_NOT_FOUND":"Pad folder or at least one of the users are not found"},"TOKEN":{"INCORRECT":"Used token contains incorrect data for this request.","EXPIRED":"Token has expired. Please make a new request."}}},"GLOBAL":{"LANG":"English","DESCRIPTION":"MyPads is an <a href='http://etherpad.org/'>Etherpad</a> plugin which have been founded in 2014 on Ulule by <a href='http://ulule.com/etherpad-framapad/supporters/'>413 backers</a> and organized by the non-profit organization <a href='http://framasoft.org'>Framasoft</a>. It handles :<ul><li>users and their authentication; </li><li>folders of pads per user, unlimited, sharable;</li><li>attached pads, with choice between invite known users to use them, making them private with password or letting them public.</li></ul>","FOOTER":"Powered by <a href='https://git.framasoft.org/framasoft/ep_mypads'>MyPads</a><br>Published under Apache License 2.0","AND":"and","OR":"or","YES":"yes","NO":"no"},"ACTIONS":{"ACTIONS":"Actions","HELP":"Help","SAVE":"Save","CANCEL":"Cancel"},"MENU":{"PAD":"My Folders & Pads","BOOKMARK":"My Bookmarks","USERLIST":"My Userlists","PROFILE":"My Profile","ADMIN":"Administration","CONFIG":"Configuration","USERS":"Users","LOGOUT":"Logout"},"ADMIN":{"FORM_LOGIN":"Administration login","FORM_SETTINGS":"MyPads configuration","FORM_USERS_SEARCH":"Search user","FORM_USER_EDIT":"Profile user edition","SETTINGS_GENERAL":"General settings","SETTINGS_PASSWORD":"Password settings","SETTINGS_MAIL":"Mail settings","USERS_SEARCH_LOGIN":"Search by login","ETHERPAD_ACCOUNT":"Etherpad account","HELP_LOGIN":"<p>MyPads administration is tied to Etherpad administration. Please enter an authorized login and password, as fixed into Etherpad <em>settings.json</em> to be able to update MyPads settings.</p>","HELP_SETTINGS":"<h3>Settings</h3><p>Only Etherpad admins have access this page. You can edit the global settings here and apply them. Changes will be effective directly.</p><h3>Passwords</h3><p>Be careful about password sizes : if you have existing accounts and raise minimum size or decrease maximum size, some user passwords may become unseizable.</p><h3>Mail configuration</h3><p>MyPads can verify the mails of subscribed users by sending them an email which will be used by them to confirm their address. Moreover, MyPads need email sending for password recovery.</p><p>Be cautious with SMTP configuration: bad parameters can lead to an Etherpad crash.</p><p>Please note that, unlike other parameters, SMTP settings are only applied after Etherpad reboot.</p>","HELP_USERS":"<p>This admin reserved page helps you to find users by entering their login. Once found, you will be able to edit or remove user.</p><p>For simplicity and performance reasons, we don't offer here a full listing of subscribed users.</p>","HELP_USER_EDIT":"<p>Here you can update all data associated to an existing user.</p><p>Please note that by default, leaving password empty means keeping the current password. If you want to change it, you have to fill password field and its confirmation.</p>","FIELD":{"TITLE":"Title","ROOTURL":"Root Web URL","HTMLEXTRA_HEAD":"Extra HTML for <head>","PASSWORD_MIN":"Minimum size","PASSWORD_MAX":"Maximum size","LANGUAGE_DEFAULT":"Default language","ALLOW_ETHERPADS":"Anonymous pads","OPEN_REGISTRATION":"Open registration","HIDE_HELP_BLOCKS":"Hide help blocks","CHECKMAILS":"Check user mails","TOKEN_DURATION":"Token validity","SMTP_HOST":"SMTP Host","SMTP_PORT":"SMTP Port","SMTP_SSL":"Encryption via SSL","SMTP_TLS":"Encryption via TLS","SMTP_USER":"User","SMTP_PASS":"Password","SMTP_EMAILFROM":"Email to send from","APPLY":"Apply","SEARCH":"Search"},"INFO":{"LOGIN":"The etherpad settings.json fixed admin login","TITLE":"Global title displayed on your MyPads instance","ROOTURL":"The root Web address used to access to Etherpad","HTMLEXTRA_HEAD":"Custom HTML Code appended to tag <head>","PASSWORD_MIN":"Password minimum number of characters","PASSWORD_MAX":"Password maximum number of characters","LANGUAGE_DEFAULT":"Default language for guest MyPads users","ALLOW_ETHERPADS":"Allow classic anonymous pads from on the Etherpad instance, created from the root URL of the server","OPEN_REGISTRATION":"Allow anyone to create an account (no effect if the LDAP authentication is set)","HIDE_HELP_BLOCKS":"Help blocks shows in multiple MyPads pages, you can hide them with this setting","CHECKMAILS":"Check user mail given at subscription","TOKEN_DURATION":"The time, in minutes, generated tokens are valid until users confirm their subscription","SMTP_HOST":"Domain name where the SMTP Server belongs to","SMTP_PORT":"SMTP Port to use","SMTP_SSL":"Check it if you want to use an encrypted SSL connexion between MyPads and your SMTP Server","SMTP_TLS":"Check it if you want to use an encrypted TLS connexion between MyPads and your SMTP Server","SMTP_USER":"Optional: if authentication to the SMTP server is required, username","SMTP_PASS":"Optional: if authentication to the SMTP server is required, password","SMTP_EMAILFROM":"Email address to use to send emails from MyPads","SUCCESS":"Configuration has been updated successfully","NOCHANGE":"Configuration have not changed, so no update has been sent","USERS_SEARCH_LOGIN":"Please enter a login to search around database users","USER_FOUND":"User found, please see options inside the form","USER_NONE":"No user for this login","USER_REMOVE_SURE":"You are on the verge of removing definitively this account and all the folders and pads on which the user is the unique administrator. If you are really sure about what you are doing, please click on the OK button."},"ERR":{"TITLE":"Title is mandatory","ROOTURL":"Must be a valid URL","PASSWORD_MIN":"Minimum password size is mandatory","PASSWORD_MAX":"Maximum password size is mandatory","PASSWORD_SIZE":"Min size can't be higher than max size. Please check your numbers.","LANGUAGE_DEFAULT":"A default language must be selected","SMTP_EMAILFROM":"Must be a valid email"}},"NOTIFICATION":{"SUCCESS":"Success","SUCCESS_GENERIC":"Action has been successfully achieved","INFO":"Info","ERROR":"Error","ERROR_UNEXPECTED":"An unexpected error has been raised. Please contact the administrator.","WARNING":"Warning"},"TAG":{"TAGS":"Tags","PLACEHOLDER":"Enter your tag","HELP":"You can associate to this element as many tags as you wish"},"USER":{"FORM":"Login","ORSUB":" (or subscribe)","MANDATORY_FIELDS":"Mandatory fields","OPTIONAL_FIELDS":"Optional fields","MYPADS_ACCOUNT":"MyPads account","SUBSCRIBE":"Subscribe","PROFILE":"Profile","PASSRECOVER":"Password recovery","USERNAME":"Username","LOGIN":"Login","PASSWORD":"Password","PASSWORD_LOST":"Lost your password?","PASSCHECK":"Password Confirmation","PASSCURRENT":"Current password","EMAIL":"Email","EMAIL_SAMPLE":"username@example.org","LANG":"Language","USELOGINANDCOLORINPADS":"Use login and color in pads?","FIRSTNAME":"Firstname","LASTNAME":"Lastname","ORGANIZATION":"Organization","COLOR":"Customized color for pads","COLOR_SAMPLE":"#00cc00","UNDEF":"********","OK":"Ok","REGISTER":"Register","REMOVE_ACCOUNT":"Remove my account","PLEASE_WAIT":"Please wait, the service is currently loading.","INFO":{"LOGIN":"The unique login you choose when you have subscribed","EMAIL":"The email is required for password recovery","COLOR":"The hexademical code for color you want to be used by default in pads","LANG":"Your default browser configuration, depending on available languages on MyPads","USELOGINANDCOLORINPADS":"Use login and chosen color in pads by default ?","PASSWORD_BEGIN":"Must be between ","PASSWORD_END":" characters","PASSWORD_CHECK":"For verification : must be the same as password","PASSWORD_CURRENT":"Security check : required for all profile changes","OPTIONAL":"Optional field","REMOVE_ACCOUNT":"Remove definitively your account and all the folders and pads on which you are the unique administrator","REMOVE_ACCOUNT_SURE":"You are on the verge of removing definitively your account and all the folders and pads on which you are the unique administrator. If you are really sure about what you are doing, please enter your current password and click OK","REMOVE_ACCOUNT_SUCCESS":"Account removed with success","PASSRECOVER_SUCCESS":"You should have received an email to the address you have used when you subscribe. This email contains a Web address that is temporary valid. Please follow this url to change your password.","CHANGEPASS_SUCCESS":"Your password has been successfully updated.","ACCOUNT_CONFIRMATION_SUCCESS":"Your account has been successfully confirmed. You can now login."},"ERR":{"LOGIN":"Login is required","EMAIL":"The email is required and should be valid","COLOR":"The hexadecimal code must be like #000000","LOGOUT":"Log out error : you were not authenticated.","PASSWORD_MISMATCH":"The entered passwords do not match."},"AUTH":{"SUCCESS":"Successful authentication ! Welcome.","SUCCESS_OUT":"You have been successfully disconnected.","SUBSCRIBE_SUCCESS":"Successful subscription ! Welcome.","SUBSCRIBE_CONFIRM_SUCCESS":"Successful subscription. An email has been sent to you in order to confirm your email address before you can login.","PROFILE_SUCCESS":"Profile successfully updated.","WELCOME":"Welcome"},"HELP":{"PROFILE":"<p>Every change into your profile needs the current password field to be correctly filled. Please note that :</p><ul><li>you can change everything by updating the appropriate field;</li><li>leaving password and password confirmation empty won't affect your current password;</li><li>you can't change your login at the moment but it will be possible in the future;</li><li>if you want to change your password, please enter the new one into the password field and confirm it with the password confirmation.</li></ul>"}},"GROUP":{"MYGROUPS":"My Folders","HELP":"Folders can contain pads. Here are your folders : those you have created, those you have been explicitly invited","GROUP":"Folder","GROUPS":"Folders","NONE":"No folder","BOOKMARKED":"Bookmarked folders","ARCHIVED":"Archived folders","ADD":"Add a new folder","ADD_HELP":"<h3>Visibility</h3><p>You have the choice between three levels of visibility. It will impact all linked pads:<ul><li><em>restricted</em>, default choice: access of the pads are limited to a list of invited users you have chosen;</li><li><em>private</em>: in this mode, you have to enter a password and access to the pads will be checked against this password;</li><li><em>public</em>: in this mode, all pads are public, users just need to have the URL address.</li></ul></p><h3>Readonly</h3><p>If you check <em>readonly</em>, all attached pads will stay in their state, and can not be edited. Note that visibility still works in readonly mode.</p><h3>Tags</h3><p>You can attach tags to this element by clicking on the corresponding input field and selecting them one by one.</p><p>To create a new tag, fill it and type ENTER key or click on the 'Ok' button. Once the tag has been added, it will automatically been selected on this form.</p><p>You can remove a tag by clicking on the cross located on the right of it.</p>","EDIT":"Edit","EDIT_GROUP":"Edit a folder","VIEW":"View","VIEW_MANAGE":"View and manage folder and its pads","VIEW_HELP":"<p>The details of the folder show you :<ul><li>options defined when folder has been created or updated;</li><li>list of pads created for this folder;</li><li>and list of admins and users of the folder.</li></ul></p><p>From there, you can : <ul><li>create new pads, edit them, remove or mark them;</li><li>share administration of your folder with other users;</li><li>invite other users to view and edit pads of the folder.</li></ul></p>","SHARE":"Share","SHARE_LINK":"Please share this URL to your guests","SHARE_PASSWORD":"Please enter the password to be able to share","REMOVE":"Remove","BOOKMARK":"Bookmark","UNMARK":"Unmark","MARK_SUCCESS":"Marking successfully","SHARE_ADMIN":"Share administration","QUIT_GROUP":"Unsubscribe from the folder","INVITE_USER":{"IU":"Invite and manage users","HELP":"<h4>Userlists</h4><p>You can select one or more userlists. Each click will add all members of the selected userlist to invited users.</p><h4>Invite users</h4><p>This field accepts one email or login at a time. When ENTER is typed, or OK is clicked, the filled data is added to the list of invited users. A list of known users helps you to fill the input.</p><h4>Users</h4><p>This list contains all selected users. You can remove one by clicking the sign after each item.</p><h4>Note</h4><p>Please note that, for instance, registered users will be automatically added to your folder. In short term, external users will receive a mail for creating an account.</p>","USERS_SELECTION":"Users selection","USERS_SELECTED":"Selected users","PLACEHOLDER":"Email or login","INPUT_HELP":"You can invite as many users as you want","SUCCESS":"User invitation has been successfully achieved for ","FAILURE":"You can't invite users who have no account in this instance : "},"INVITE_USERLIST":"Invite a list of users","ADMIN_SHARE":{"AS":"Administration sharing","SUCCESS":"Administration sharing has been successfully achieved for ","FAILURE":"You can't share administration with users who have no account in this instance : "},"SORT":{"TITLE":"Sort by","HELP":"By default, folders are ordered by creation date, older first. You can choose to use another orders. Click again to reverse order."},"SEARCH":{"TITLE":"Search","TYPE":"Type here","HELP":"Search on common fields with at least 2 characters"},"PROPERTIES":"Properties","FIELD":{"NAME":"Name","DESCRIPTION":"Description","VISIBILITY":"Visibility","PRIVATE":"Private","RESTRICTED":"Restricted","PUBLIC":"Public","READONLY":"Readonly","GROUP_PARAMS":"Folder parameters ?"},"FILTERS":{"TITLE":"Filters","ADMIN":"Folders I am admin","USER":"Folders I have been invited","HELP":"You can select one or several filters, click again on it to deactivate"},"TAGS":{"TITLE":"Tags","HELP":"You can filter by one or more tags. Click again to deactivate if wanted"},"PAD":{"TITLE":"Title","ADMINS":"Admins","USERS":"Users","USERS_NONE":"No user","PUBLIC_DENIED":"Public access: you are not allowed to see this data.","VISIBILITY":"Visibility","PAD":"Pad","PADS":"Pads","NONE":"No pad linked","ADD":"Create a new pad","ADD_PROMPT":"Enter the name of the new pad","EDIT":"Edit a pad","EDIT_PROMPT":"Enter the new name of the pad","SORT_BY":"Sort pads by","SORT_BY_CREATION":"creation date","SORT_BY_NAME":"name","SORT_BY_UPDATE":"last update","MOVE":"Move all pads to another folder","MOVE_TITLE":"Pads migration of the folder ","MOVE_HELP":"<p>Please select the wanted folder for your migration. Only folders on which you are admin are listed.</p><p>Once chosen, click on the submit button and wait for a moment.</p>","FROM_GROUP":"folder :","VIEW_HELP":"<p>Here is the main interface of the current pad.</p><p>If the folder or the pad is private, you need to enter the password to be able to access to it.</p><p>If you want to show the folder and if you have the permission to, you can click on the folder name.</p>","OPEN_TAB":"Open in a new tab","EXPAND":"Expand","REDUCE":"Reduce"},"INFO":{"NAME":"Name","DESCRIPTION":"An optional long text to describe your folder","VISIBILITY":"Required, restricted by default to invited users or admins","READONLY":"If checked, linked pads will be in readonly mode","PASSWORD":"Required in private mode","GROUP_PARAMS":"By default, pad inherits from parameters of the folder they belong to. You can overwrite them if you want","ADD_SUCCESS":"Folder has been successfully created","EDIT_SUCCESS":"Folder has been successfully updated","REMOVE_SUCCESS":"Folder has been successfully removed","REMOVE_SURE":"Are you sure you want to remove this folder ?","RESIGN":"Are you sure you want to resign from this folder ?","RESIGN_SUCCESS":"You have left the folder successfully","PAD_REMOVE_SUCCESS":"Pad has been successfully removed","PAD_REMOVE_SURE":"Are you sure you want to remove this pad ?","PAD_ADD_SUCCESS":"Pad has been successfully created","PAD_EDIT_SUCCESS":"Pad has been successfully updated","PAD_MOVE":"Select the wanted folder for your migration","PAD_MOVE_NOGROUP":"Sorry but no other folder is available. You should create one before.","PAD_MOVE_SUCCESS":"All pads have been successfully moved"},"ERR":{"NAME":"The name of the folder is required"}},"BOOKMARK":{"TITLE":"My Bookmarks","HELP":"<p>Bookmark page offers you the ability to see all your bookmarked elements from MyPads. You can remove them from bookmarks if you want to.</p>"},"USERLIST":{"USERLIST":"Userlist","ADD":"Create a new userlist","EDIT":"Edit userlist ","HELP":"<p>Here you can find all your userlists, ordered by creation date. Summary information are available with the name of each userlist and the number of users linked.</p><p>Through action icons, located on top right of each userlist, you can edit or remove lists. Details are available in the form view, via edit action.</p>","FORM_HELP":"<h3>Name</h3><p>You must give a name to the userlist, in order to be able to identify it.</p><h3>Users</h3><p>You can add as many users as you want. To do it, please enter the email or login and click on the 'OK' button. Note that already known users can be selected from the input.</p><p>To remove users, click on the cross located at the right of each user.</p>","FIELD":{"NAME":"Name","USERS":"Users","USERS_HELP":"Add as many users as you want","USERSAREA_PLACEHOLDER":"One email or login per line","USERSAREA_HELP":"You can add as many emails or logins you want"},"INFO":{"NAME":"Name of the userlist","ADD_SUCCESS":"Userlist has been successfully created","EDIT_SUCCESS":"Userlist has been successfully updated","REMOVE_SURE":"Are you sure you want to remove this userlist?","REMOVE_SUCCESS":"Userlist has been successfully removed","USER_INVITE":"By selecting a userlist, you will invite all its users at the same time","USER_SUCCESS":"User adding has been successfull for ","USER_FAILURE":"You can't add users who have no account in this instance : "},"ERR":{"NAME":"The name of the userlist is required"}}}
module.exports={"BACKEND":{"ERROR":{"TYPE":{"PARAMS_REQUIRED":"Parameters are mandatory","PARAM_STR":"Some parameter must be a string","STR_100":"String can't be more than 100 characters","CALLBACK_FN":"Callback must be a function","KEY_STR":"Key must be a string","VALUE_REQUIRED":"Value is mandatory","LOGIN_STR":"Login must be a string","LOGIN_REQUIRED":"Login is required","PASSWORD_STR":"Password must be a string","PASSWORD_MISSING":"Missing password","PASSWORD_SIZE":"Password size is too short or too long","MAIL":"Email is invalid","ID_STR":"_id, when defined, must be a string","USER_INVALID":"User is invalid","WITHEXTRA_BOOL":"withExtra must be a boolean","INVITE_BOOL":"Invite must be a boolean","GID_STR":"gid must be a string","LOGINS_ARR":"logins must be an array","TYPE_PADSORGROUPS":"Type must be either pads or folders","USERLIST_CRUD":"crud must be add, set or del","USERLIST_ID":"In set and del modes, ulistid is mandatory","USERLIST_NAME":"In add mode, name of the userlist is mandatory","USERLIST_SET_PARAMS":"In set mode, name or uids is madantory","SMTP_CONFIG":"Your SMTP server configuration is invalid","TO_MAIL":"to must be an email address","SUBJECT_STR":"subject must be a string","MSG_STR":"message must be a string"},"CONFIGURATION":{"LANG_PROBLEM":"Language update cannot be done. The default language will be used.","CANTGET":"Configuration loading has failed. Please contact your administrator.","KEY_NOT_FOUND":"The record has not been found","MAIL_NOT_CONFIGURED":"Mail settings have not been done on this server. Please contact its administrator.","ROOTURL_NOT_CONFIGURED":"Root Url setting has not been entered on this server. Please contact its administrator."},"AUTHENTICATION":{"MUST_BE":"You must be authenticated","ACTIVATION_NEEDED":"Your account has not been confirmed","NOT_AUTH":"Not authenticated","PASSWORD_INCORRECT":"Password is not correct","TOKEN_INCORRECT":"Your security token is invalid","ADMIN":"Access denied : you must be an authenticated Etherpad instance admin.","DENIED":"Access denied","DENIED_RECORD":"You're not allowed to get this record","DENIED_RECORD_EDIT":"You're not allowed to edit this record","NO_REGISTRATION":"Sorry, registration is disabled","NO_RECOVER":"Sorry, you can't recover you password from here"},"PERMISSION":{"UNEXPECTED":"Sorry, an unexpected has error has occurred","UNAUTHORIZED":"You are not allowed to access to this record"},"GROUP":{"INEXISTENT":"Folder does not exist","CASCADE_REMOVAL_PROBLEM":"Something goes wrong with cascade pads removal","ITEMS_NOT_FOUND":"Some users, admins or pads have not been found","NOT_USER":"You are not an user of this folder","RESIGN_UNIQUE_ADMIN":"You can't resign the unique administrator"},"USER":{"ALREADY_EXISTS":"User already exists, please choose another login","EMAIL_ALREADY_EXISTS":"This user email has already been used, please choose another one","NOT_FOUND":"User not found","BOOKMARK_NOT_FOUND":"Bookmark not found","USERLIST_NOT_FOUND":"Userlist not found"},"PAD":{"INEXISTENT":"Pad does not exist","ITEMS_NOT_FOUND":"Pad folder or at least one of the users are not found"},"TOKEN":{"INCORRECT":"Used token contains incorrect data for this request.","EXPIRED":"Token has expired. Please make a new request."}}},"GLOBAL":{"LANG":"English","DESCRIPTION":"MyPads is an <a href='http://etherpad.org/'>Etherpad</a> plugin which have been founded in 2014 on Ulule by <a href='http://ulule.com/etherpad-framapad/supporters/'>413 backers</a> and organized by the non-profit organization <a href='http://framasoft.org'>Framasoft</a>. It handles :<ul><li>users and their authentication; </li><li>folders of pads per user, unlimited, sharable;</li><li>attached pads, with choice between invite known users to use them, making them private with password or letting them public.</li></ul>","FOOTER":"Powered by <a href='https://git.framasoft.org/framasoft/ep_mypads'>MyPads</a><br>Published under Apache License 2.0","AND":"and","OR":"or","YES":"yes","NO":"no"},"ACTIONS":{"ACTIONS":"Actions","HELP":"Help","SAVE":"Save","CANCEL":"Cancel"},"MENU":{"PAD":"My Folders & Pads","BOOKMARK":"My Bookmarks","USERLIST":"My Userlists","PROFILE":"My Profile","ADMIN":"Administration","CONFIG":"Configuration","USERS":"Users","LOGOUT":"Logout"},"ADMIN":{"FORM_LOGIN":"Administration login","FORM_SETTINGS":"MyPads configuration","FORM_USERS_SEARCH":"Search user","FORM_USER_EDIT":"Profile user edition","SETTINGS_GENERAL":"General settings","SETTINGS_PASSWORD":"Password settings","SETTINGS_MAIL":"Mail settings","USERS_SEARCH_LOGIN":"Search by login","ETHERPAD_ACCOUNT":"Etherpad account","HELP_LOGIN":"<p>MyPads administration is tied to Etherpad administration. Please enter an authorized login and password, as fixed into Etherpad <em>settings.json</em> to be able to update MyPads settings.</p>","HELP_SETTINGS":"<h3>Settings</h3><p>Only Etherpad admins have access this page. You can edit the global settings here and apply them. Changes will be effective directly.</p><h3>Passwords</h3><p>Be careful about password sizes : if you have existing accounts and raise minimum size or decrease maximum size, some user passwords may become unseizable.</p><h3>Mail configuration</h3><p>MyPads can verify the mails of subscribed users by sending them an email which will be used by them to confirm their address. Moreover, MyPads need email sending for password recovery.</p><p>Be cautious with SMTP configuration: bad parameters can lead to an Etherpad crash.</p><p>Please note that, unlike other parameters, SMTP settings are only applied after Etherpad reboot.</p>","HELP_USERS":"<p>This admin reserved page helps you to find users by entering their login. Once found, you will be able to edit or remove user.</p><p>For simplicity and performance reasons, we don't offer here a full listing of subscribed users.</p>","HELP_USER_EDIT":"<p>Here you can update all data associated to an existing user.</p><p>Please note that by default, leaving password empty means keeping the current password. If you want to change it, you have to fill password field and its confirmation.</p>","FIELD":{"TITLE":"Title","ROOTURL":"Root Web URL","HTMLEXTRA_HEAD":"Extra HTML for <head>","PASSWORD_MIN":"Minimum size","PASSWORD_MAX":"Maximum size","LANGUAGE_DEFAULT":"Default language","ALLOW_ETHERPADS":"Anonymous pads","OPEN_REGISTRATION":"Open registration","HIDE_HELP_BLOCKS":"Hide help blocks","USE_FIRST_AND_LAST_NAME_IN_PADS":"Use first and last name of users as nickname in pads","CHECKMAILS":"Check user mails","TOKEN_DURATION":"Token validity","SMTP_HOST":"SMTP Host","SMTP_PORT":"SMTP Port","SMTP_SSL":"Encryption via SSL","SMTP_TLS":"Encryption via TLS","SMTP_USER":"User","SMTP_PASS":"Password","SMTP_EMAILFROM":"Email to send from","APPLY":"Apply","SEARCH":"Search"},"INFO":{"LOGIN":"The etherpad settings.json fixed admin login","TITLE":"Global title displayed on your MyPads instance","ROOTURL":"The root Web address used to access to Etherpad","HTMLEXTRA_HEAD":"Custom HTML Code appended to tag <head>","PASSWORD_MIN":"Password minimum number of characters","PASSWORD_MAX":"Password maximum number of characters","LANGUAGE_DEFAULT":"Default language for guest MyPads users","ALLOW_ETHERPADS":"Allow classic anonymous pads from on the Etherpad instance, created from the root URL of the server","OPEN_REGISTRATION":"Allow anyone to create an account (no effect if the LDAP authentication is set)","HIDE_HELP_BLOCKS":"Help blocks shows in multiple MyPads pages, you can hide them with this setting","USE_FIRST_AND_LAST_NAME_IN_PADS":"Force the use of first and last name as nickname in pads","CHECKMAILS":"Check user mail given at subscription","TOKEN_DURATION":"The time, in minutes, generated tokens are valid until users confirm their subscription","SMTP_HOST":"Domain name where the SMTP Server belongs to","SMTP_PORT":"SMTP Port to use","SMTP_SSL":"Check it if you want to use an encrypted SSL connexion between MyPads and your SMTP Server","SMTP_TLS":"Check it if you want to use an encrypted TLS connexion between MyPads and your SMTP Server","SMTP_USER":"Optional: if authentication to the SMTP server is required, username","SMTP_PASS":"Optional: if authentication to the SMTP server is required, password","SMTP_EMAILFROM":"Email address to use to send emails from MyPads","SUCCESS":"Configuration has been updated successfully","NOCHANGE":"Configuration have not changed, so no update has been sent","USERS_SEARCH_LOGIN":"Please enter a login to search around database users","USER_FOUND":"User found, please see options inside the form","USER_NONE":"No user for this login","USER_REMOVE_SURE":"You are on the verge of removing definitively this account and all the folders and pads on which the user is the unique administrator. If you are really sure about what you are doing, please click on the OK button."},"ERR":{"TITLE":"Title is mandatory","ROOTURL":"Must be a valid URL","PASSWORD_MIN":"Minimum password size is mandatory","PASSWORD_MAX":"Maximum password size is mandatory","PASSWORD_SIZE":"Min size can't be higher than max size. Please check your numbers."