diff --git a/extend.php b/extend.php index 8387612..6155c61 100644 --- a/extend.php +++ b/extend.php @@ -15,6 +15,6 @@ ->post('/auth/ldap', 'auth.ldap.post', Controllers\LDAPAuthController::class) ->get('/auth/ldap', 'auth.ldap.get', Controllers\LDAPAuthController::class), (new Extend\Settings) - ->serializeToForum('onlyUseLDAP', 'tituspijean-auth-ldap.onlyUse') - ->serializeToForum('LDAP_method_name', 'tituspijean-auth-ldap.method_name'), + ->serializeToForum('tituspijean-auth-ldap.onlyUse', 'tituspijean-auth-ldap.onlyUse', 'boolVal', false) + ->serializeToForum('tituspijean-auth-ldap.method_name', 'tituspijean-auth-ldap.method_name', 'strVal', 'LDAP'), ]; diff --git a/js/dist/admin.js b/js/dist/admin.js index 4317a50..d77d4cd 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}({0:function(t,e){t.exports=flarum.core.compat.app},13:function(t,e,r){"use strict";r.r(e);var n=r(0),a="tituspijean-auth-ldap.",s="tituspijean-auth-ldap.admin.settings.";r.n(n).a.initializers.add("tituspijean-auth-ldap",(function(t){t.extensionData.for("tituspijean-auth-ldap").registerSetting({setting:a+"method_name",label:t.translator.trans(s+"method_name"),type:"text",placeholder:"YunoHost"}).registerSetting({setting:a+"hosts",label:t.translator.trans(s+"hosts"),type:"text",placeholder:"localhost"}).registerSetting({setting:a+"base_dn",label:t.translator.trans(s+"base_dn"),type:"text",placeholder:"ou=users,dc=yunohost,dc=org"}).registerSetting({setting:a+"filter",label:t.translator.trans(s+"filter"),type:"text",placeholder:"(&(objectClass=posixAccount)(permission=cn=flarum.main,ou=permission,dc=yunohost,dc=org)"}).registerSetting({setting:a+"port",label:t.translator.trans(s+"port"),type:"text",placeholder:"389"}).registerSetting({setting:a+"follow_referrals",label:t.translator.trans(s+"follow_referrals"),type:"boolean",default:!1}).registerSetting({setting:a+"use_ssl",label:t.translator.trans(s+"use_ssl"),type:"boolean",default:!0}).registerSetting({setting:a+"use_tls",label:t.translator.trans(s+"use_tls"),type:"boolean",default:!0}).registerSetting({setting:a+"admin_dn",label:t.translator.trans(s+"admin_dn"),type:"text",placeholder:"cn=admin,dc=yunohost,dc=org"}).registerSetting({setting:a+"admin_password",label:t.translator.trans(s+"admin_password"),type:"password",placeholder:"password"}).registerSetting({setting:a+"search_user_fields",label:t.translator.trans(s+"search_user_fields"),type:"text",placeholder:"uid,mail"}).registerSetting({setting:a+"user_mail",label:t.translator.trans(s+"user_mail"),type:"text",placeholder:"mail"}).registerSetting({setting:a+"user_username",label:t.translator.trans(s+"user_username"),type:"text",placeholder:"uid"}).registerSetting({setting:a+"onlyUse",label:t.translator.trans(s+"onlyUse"),type:"boolean",placeholder:!1})}))}}); +module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}({0:function(t,e){t.exports=flarum.core.compat.app},15:function(t,e,r){"use strict";r.r(e);var n=r(0),a="tituspijean-auth-ldap.",s="tituspijean-auth-ldap.admin.settings.";r.n(n).a.initializers.add("tituspijean-auth-ldap",(function(t){t.extensionData.for("tituspijean-auth-ldap").registerSetting({setting:a+"method_name",label:t.translator.trans(s+"method_name"),type:"text",placeholder:"YunoHost"}).registerSetting({setting:a+"hosts",label:t.translator.trans(s+"hosts"),type:"text",placeholder:"localhost"}).registerSetting({setting:a+"base_dn",label:t.translator.trans(s+"base_dn"),type:"text",placeholder:"ou=users,dc=yunohost,dc=org"}).registerSetting({setting:a+"filter",label:t.translator.trans(s+"filter"),type:"text",placeholder:"(&(objectClass=posixAccount)(permission=cn=flarum.main,ou=permission,dc=yunohost,dc=org)"}).registerSetting({setting:a+"port",label:t.translator.trans(s+"port"),type:"text",placeholder:"389"}).registerSetting({setting:a+"follow_referrals",label:t.translator.trans(s+"follow_referrals"),type:"boolean",default:!1}).registerSetting({setting:a+"use_ssl",label:t.translator.trans(s+"use_ssl"),type:"boolean",default:!0}).registerSetting({setting:a+"use_tls",label:t.translator.trans(s+"use_tls"),type:"boolean",default:!0}).registerSetting({setting:a+"admin_dn",label:t.translator.trans(s+"admin_dn"),type:"text",placeholder:"cn=admin,dc=yunohost,dc=org"}).registerSetting({setting:a+"admin_password",label:t.translator.trans(s+"admin_password"),type:"password",placeholder:"password"}).registerSetting({setting:a+"search_user_fields",label:t.translator.trans(s+"search_user_fields"),type:"text",placeholder:"uid,mail"}).registerSetting({setting:a+"user_mail",label:t.translator.trans(s+"user_mail"),type:"text",placeholder:"mail"}).registerSetting({setting:a+"user_username",label:t.translator.trans(s+"user_username"),type:"text",placeholder:"uid"}).registerSetting({setting:a+"onlyUse",label:t.translator.trans(s+"onlyUse"),type:"boolean",default:!1})}))}}); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 10670da..6af9e50 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@tituspijean/auth-ldap/webpack/bootstrap","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['app']\"","webpack://@tituspijean/auth-ldap/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","settingsPrefix","translationPrefix","app","initializers","add","extensionData","registerSetting","setting","label","translator","trans","type","placeholder","default"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM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ChDU,KAAM,OACNC,YAAa,QAGhBN,gBACC,CACEC,QAASP,EAAiB,UAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,WAChDU,KAAM,UACNC,aAAa","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = flarum.core.compat['app'];","import app from 'flarum/app';\n\nconst settingsPrefix = 'tituspijean-auth-ldap.';\nconst translationPrefix = 'tituspijean-auth-ldap.admin.settings.';\n\napp.initializers.add('tituspijean-auth-ldap', function(app) {\n app.extensionData\n .for('tituspijean-auth-ldap')\n .registerSetting(\n {\n setting: settingsPrefix + 'method_name',\n label: app.translator.trans(translationPrefix + 'method_name'),\n type: 'text',\n placeholder: 'YunoHost',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'hosts',\n label: app.translator.trans(translationPrefix + 'hosts'),\n type: 'text',\n placeholder: 'localhost',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'base_dn',\n label: app.translator.trans(translationPrefix + 'base_dn'),\n type: 'text',\n placeholder: 'ou=users,dc=yunohost,dc=org',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'filter',\n label: app.translator.trans(translationPrefix + 'filter'),\n type: 'text',\n placeholder: '(&(objectClass=posixAccount)(permission=cn=flarum.main,ou=permission,dc=yunohost,dc=org)',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'port',\n label: app.translator.trans(translationPrefix + 'port'),\n type: 'text',\n placeholder: '389',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'follow_referrals',\n label: app.translator.trans(translationPrefix + 'follow_referrals'),\n type: 'boolean',\n default: false,\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'use_ssl',\n label: app.translator.trans(translationPrefix + 'use_ssl'),\n type: 'boolean',\n default: true,\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'use_tls',\n label: app.translator.trans(translationPrefix + 'use_tls'),\n type: 'boolean',\n default: true,\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'admin_dn',\n label: app.translator.trans(translationPrefix + 'admin_dn'),\n type: 'text',\n placeholder: 'cn=admin,dc=yunohost,dc=org',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'admin_password',\n label: app.translator.trans(translationPrefix + 'admin_password'),\n type: 'password',\n placeholder: 'password',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'search_user_fields',\n label: app.translator.trans(translationPrefix + 'search_user_fields'),\n type: 'text',\n placeholder: 'uid,mail',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'user_mail',\n label: app.translator.trans(translationPrefix + 'user_mail'),\n type: 'text',\n placeholder: 'mail',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'user_username',\n label: app.translator.trans(translationPrefix + 'user_username'),\n type: 'text',\n placeholder: 'uid',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'onlyUse',\n label: app.translator.trans(translationPrefix + 'onlyUse'),\n type: 'boolean',\n placeholder: false,\n }\n )\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@tituspijean/auth-ldap/webpack/bootstrap","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['app']\"","webpack://@tituspijean/auth-ldap/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","settingsPrefix","translationPrefix","app","initializers","add","extensionData","registerSetting","setting","label","translator","trans","type","placeholder","default"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAA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,WAAWC,MAAMT,EAAoB,WAChDU,KAAM,UACNE,SAAS,IAGZP,gBACC,CACEC,QAASP,EAAiB,WAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,YAChDU,KAAM,OACNC,YAAa,gCAGhBN,gBACC,CACEC,QAASP,EAAiB,iBAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,kBAChDU,KAAM,WACNC,YAAa,aAGhBN,gBACC,CACEC,QAASP,EAAiB,qBAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,sBAChDU,KAAM,OACNC,YAAa,aAGhBN,gBACC,CACEC,QAASP,EAAiB,YAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,aAChDU,KAAM,OACNC,YAAa,SAGhBN,gBACC,CACEC,QAASP,EAAiB,gBAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,iBAChDU,KAAM,OACNC,YAAa,QAGhBN,gBACC,CACEC,QAASP,EAAiB,UAC1BQ,MAAON,EAAIO,WAAWC,MAAMT,EAAoB,WAChDU,KAAM,UACNE,SAAS","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n","module.exports = flarum.core.compat['app'];","import app from 'flarum/app';\n\nconst settingsPrefix = 'tituspijean-auth-ldap.';\nconst translationPrefix = 'tituspijean-auth-ldap.admin.settings.';\n\napp.initializers.add('tituspijean-auth-ldap', function(app) {\n app.extensionData\n .for('tituspijean-auth-ldap')\n .registerSetting(\n {\n setting: settingsPrefix + 'method_name',\n label: app.translator.trans(translationPrefix + 'method_name'),\n type: 'text',\n placeholder: 'YunoHost',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'hosts',\n label: app.translator.trans(translationPrefix + 'hosts'),\n type: 'text',\n placeholder: 'localhost',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'base_dn',\n label: app.translator.trans(translationPrefix + 'base_dn'),\n type: 'text',\n placeholder: 'ou=users,dc=yunohost,dc=org',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'filter',\n label: app.translator.trans(translationPrefix + 'filter'),\n type: 'text',\n placeholder: '(&(objectClass=posixAccount)(permission=cn=flarum.main,ou=permission,dc=yunohost,dc=org)',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'port',\n label: app.translator.trans(translationPrefix + 'port'),\n type: 'text',\n placeholder: '389',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'follow_referrals',\n label: app.translator.trans(translationPrefix + 'follow_referrals'),\n type: 'boolean',\n default: false,\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'use_ssl',\n label: app.translator.trans(translationPrefix + 'use_ssl'),\n type: 'boolean',\n default: true,\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'use_tls',\n label: app.translator.trans(translationPrefix + 'use_tls'),\n type: 'boolean',\n default: true,\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'admin_dn',\n label: app.translator.trans(translationPrefix + 'admin_dn'),\n type: 'text',\n placeholder: 'cn=admin,dc=yunohost,dc=org',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'admin_password',\n label: app.translator.trans(translationPrefix + 'admin_password'),\n type: 'password',\n placeholder: 'password',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'search_user_fields',\n label: app.translator.trans(translationPrefix + 'search_user_fields'),\n type: 'text',\n placeholder: 'uid,mail',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'user_mail',\n label: app.translator.trans(translationPrefix + 'user_mail'),\n type: 'text',\n placeholder: 'mail',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'user_username',\n label: app.translator.trans(translationPrefix + 'user_username'),\n type: 'text',\n placeholder: 'uid',\n }\n )\n .registerSetting(\n {\n setting: settingsPrefix + 'onlyUse',\n label: app.translator.trans(translationPrefix + 'onlyUse'),\n type: 'boolean',\n default: false,\n }\n )\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index d1bd565..e790220 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var o={};function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,o){if(1&o&&(t=e(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var r in t)e.d(n,r,function(o){return t[o]}.bind(null,r));return n},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=12)}([function(t,o){t.exports=flarum.core.compat.app},function(t,o){t.exports=flarum.core.compat["components/LogInModal"]},function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat["utils/Stream"]},function(t,o){t.exports=flarum.core.compat["components/HeaderSecondary"]},function(t,o){t.exports=flarum.core.compat["components/SettingsPage"]},function(t,o){t.exports=flarum.core.compat["utils/extractText"]},function(t,o){t.exports=flarum.core.compat["components/Modal"]},function(t,o){t.exports=flarum.core.compat["utils/ItemList"]},function(t,o){t.exports=flarum.core.compat["components/SignUpModal"]},function(t,o){t.exports=flarum.core.compat["components/LogInButtons"]},function(t,o,e){"use strict";e.r(o);var n=e(2),r=e(0),a=e.n(r),i=e(5),s=e.n(i),c=e(6),u=e.n(c),p=e(3),l=e.n(p),d=e(1),f=e.n(d);function h(t,o){return(h=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}var b=e(8),y=e.n(b),g=(e(10),e(11),e(7)),v=e.n(g),_=e(9),x=e.n(_),w=e(4),j=e.n(w),O=function(t){var o,e;function n(){return t.apply(this,arguments)||this}e=t,(o=n).prototype=Object.create(e.prototype),o.prototype.constructor=o,h(o,e);var r=n.prototype;return r.oninit=function(o){t.prototype.oninit.call(this,o),this.identification=j()(this.attrs.identification||""),this.password=j()(this.attrs.password||""),this.remember=j()(!!this.attrs.remember)},r.className=function(){return"LogInModal Modal--small"},r.title=function(){return a.a.translator.trans("tituspijean-auth-ldap.forum.log_in_with",{server:a.a.forum.attribute("LDAP_method_name")})},r.content=function(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]},r.body=function(){return[m("div",{className:"Form Form--centered"},this.fields().toArray())]},r.fields=function(){var t=new x.a;return t.add("identification",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"identification",type:"text",placeholder:v()(a.a.translator.trans("core.forum.log_in.username_or_email_placeholder")),bidi:this.identification,disabled:this.attrs.loading})),30),t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",placeholder:v()(a.a.translator.trans("core.forum.log_in.password_placeholder")),bidi:this.password,disabled:this.attrs.loading})),20),t.add("submit",m("div",{className:"Form-group"},l.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.attrs.loading},a.a.translator.trans("core.forum.log_in.submit_button"))),-10),t},r.footer=function(){return[]},r.onready=function(){this.$("[name="+(this.identification()?"password":"identification")+"]").select()},r.onsubmit=function(t){t.preventDefault(),this.loading=!0;var o={identification:this.identification(),password:this.password(),remember:this.remember(),csrfToken:a.a.session.csrfToken},e=(this.onerror.bind(this),$(window)),n=a.a.forum.attribute("baseUrl")+"/auth/ldap",r=document.createElement("form");for(var i in r.setAttribute("method","POST"),r.setAttribute("action",n),r.setAttribute("target","ldapauth"),o)if(o.hasOwnProperty(i)){var s=document.createElement("input");s.type="hidden",s.name=i,s.value=o[i],r.appendChild(s)}document.body.appendChild(r),window.open("","ldapauth","width=600,height=400,top="+(e.height()/2-200)+",left="+(e.width()/2-300)+",status=no,scrollbars=no,resizable=no"),r.submit(),document.body.removeChild(r)},r.onerror=function(o){401===o.status&&(o.alert.children=a.a.translator.trans("core.forum.log_in.invalid_login_message")),t.prototype.onerror.call(this,o)},n}(y.a);a.a.initializers.add("tituspijean-auth-ldap",(function(){Object(n.extend)(s.a.prototype,"items",(function(t){t.has("logIn")&&t.add("logInLDAP",l.a.component({className:"Button Button--link",onclick:function(){return a.a.modal.show(O)}},a.a.translator.trans("tituspijean-auth-ldap.forum.log_in_with",{server:a.a.forum.attribute("LDAP_method_name")})),0)})),Object(n.extend)(s.a.prototype,"items",(function(t){a.a.forum.attribute("onlyUseLDAP")&&(t.has("signUp")&&t.remove("signUp"),t.has("logIn")&&t.remove("logIn"))})),Object(n.extend)(f.a.prototype,"content",(function(){a.a.forum.attribute("onlyUseLDAP")&&(f.a.prototype.content=O.prototype.content,f.a.prototype.title=O.prototype.title,f.a.prototype.body=O.prototype.body,f.a.prototype.fields=O.prototype.fields,f.a.prototype.footer=O.prototype.footer,f.a.prototype.onsubmit=O.prototype.onsubmit)})),Object(n.extend)(u.a.prototype,"accountItems",(function(t){t.remove("changeEmail"),t.remove("changePassword")})),Object(n.extend)(u.a.prototype,"settingsItems",(function(t){t.has("account")&&0===t.get("account").children.length&&t.remove("account")}))}))}]); +module.exports=function(t){var o={};function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,o){if(1&o&&(t=e(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var r in t)e.d(n,r,function(o){return t[o]}.bind(null,r));return n},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=14)}([function(t,o){t.exports=flarum.core.compat.app},function(t,o){t.exports=flarum.core.compat["components/LogInModal"]},function(t,o){t.exports=flarum.core.compat["common/app"]},function(t,o){t.exports=flarum.core.compat["common/extend"]},function(t,o){t.exports=flarum.core.compat["components/Button"]},function(t,o){t.exports=flarum.core.compat["utils/Stream"]},function(t,o){t.exports=flarum.core.compat["components/HeaderSecondary"]},function(t,o){t.exports=flarum.core.compat["components/SettingsPage"]},function(t,o){t.exports=flarum.core.compat["utils/extractText"]},function(t,o){t.exports=flarum.core.compat["components/Modal"]},function(t,o){t.exports=flarum.core.compat["utils/ItemList"]},function(t,o){t.exports=flarum.core.compat.extend},function(t,o){t.exports=flarum.core.compat["components/SignUpModal"]},function(t,o){t.exports=flarum.core.compat["components/LogInButtons"]},function(t,o,e){"use strict";e.r(o);var n=e(3),r=e(2),a=e.n(r),i=e(6),s=e.n(i),c=e(7),u=e.n(c),p=e(4),l=e.n(p),d=e(1),f=e.n(d);function h(t,o){return(h=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}e(11);var b=e(0),y=e.n(b),g=e(9),v=e.n(g),x=(e(12),e(13),e(8)),_=e.n(x),w=e(10),j=e.n(w),O=e(5),P=e.n(O),M=function(t){var o,e;function n(){return t.apply(this,arguments)||this}e=t,(o=n).prototype=Object.create(e.prototype),o.prototype.constructor=o,h(o,e);var r=n.prototype;return r.oninit=function(o){t.prototype.oninit.call(this,o),this.identification=P()(this.attrs.identification||""),this.password=P()(this.attrs.password||""),this.remember=P()(!!this.attrs.remember)},r.className=function(){return"LogInModal Modal--small"},r.title=function(){return y.a.translator.trans("tituspijean-auth-ldap.forum.log_in_with",{server:y.a.forum.attribute("LDAP_method_name")})},r.content=function(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]},r.body=function(){return[m("div",{className:"Form Form--centered"},this.fields().toArray())]},r.fields=function(){var t=new j.a;return t.add("identification",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"identification",type:"text",placeholder:_()(y.a.translator.trans("core.forum.log_in.username_or_email_placeholder")),bidi:this.identification,disabled:this.attrs.loading})),30),t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",placeholder:_()(y.a.translator.trans("core.forum.log_in.password_placeholder")),bidi:this.password,disabled:this.attrs.loading})),20),t.add("submit",m("div",{className:"Form-group"},l.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.attrs.loading},y.a.translator.trans("core.forum.log_in.submit_button"))),-10),t},r.footer=function(){return[]},r.onready=function(){this.$("[name="+(this.identification()?"password":"identification")+"]").select()},r.onsubmit=function(t){t.preventDefault(),this.loading=!0;var o={identification:this.identification(),password:this.password(),remember:this.remember(),csrfToken:y.a.session.csrfToken},e=(this.onerror.bind(this),$(window)),n=y.a.forum.attribute("baseUrl")+"/auth/ldap",r=document.createElement("form");for(var a in r.setAttribute("method","POST"),r.setAttribute("action",n),r.setAttribute("target","ldapauth"),o)if(o.hasOwnProperty(a)){var i=document.createElement("input");i.type="hidden",i.name=a,i.value=o[a],r.appendChild(i)}document.body.appendChild(r),window.open("","ldapauth","width=600,height=400,top="+(e.height()/2-200)+",left="+(e.width()/2-300)+",status=no,scrollbars=no,resizable=no"),r.submit(),document.body.removeChild(r)},r.onerror=function(o){401===o.status&&(o.alert.children=y.a.translator.trans("core.forum.log_in.invalid_login_message")),t.prototype.onerror.call(this,o)},n}(v.a);a.a.initializers.add("tituspijean-auth-ldap",(function(){Object(n.extend)(s.a.prototype,"items",(function(t){t.has("logIn")&&t.add("logInLDAP",l.a.component({className:"Button Button--link",onclick:function(){return a.a.modal.show(M)}},a.a.translator.trans("tituspijean-auth-ldap.forum.log_in_with",{server:a.a.forum.attribute("tituspijean-auth-ldap.method_name")})),0)})),Object(n.extend)(s.a.prototype,"items",(function(t){a.a.forum.attribute("tituspijean-auth-ldap.onlyUse")&&(t.has("signUp")&&t.remove("signUp"),t.has("logIn")&&t.remove("logIn"))})),Object(n.extend)(f.a.prototype,"content",(function(){a.a.forum.attribute("tituspijean-auth-ldap.onlyUse")&&(f.a.prototype.content=M.prototype.content,f.a.prototype.title=M.prototype.title,f.a.prototype.body=M.prototype.body,f.a.prototype.fields=M.prototype.fields,f.a.prototype.footer=M.prototype.footer,f.a.prototype.onsubmit=M.prototype.onsubmit)})),Object(n.extend)(u.a.prototype,"accountItems",(function(t){t.remove("changeEmail"),t.remove("changePassword")})),Object(n.extend)(u.a.prototype,"settingsItems",(function(t){t.has("account")&&0===t.get("account").children.length&&t.remove("account")}))}))}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 8b30b66..6b3c734 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@tituspijean/auth-ldap/webpack/bootstrap","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['app']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/LogInModal']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['extend']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/Button']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['utils/Stream']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/HeaderSecondary']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/SettingsPage']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['utils/extractText']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/Modal']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['utils/ItemList']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/SignUpModal']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/LogInButtons']\"","webpack://@tituspijean/auth-ldap/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@tituspijean/auth-ldap/./src/forum/components/LDAPLogInModal.js","webpack://@tituspijean/auth-ldap/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@tituspijean/auth-ldap/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_setPrototypeOf","setPrototypeOf","__proto__","LDAPLogInModal","subClass","superClass","constructor","oninit","vnode","this","identification","Stream","attrs","password","remember","className","title","app","translator","trans","translationPrefix","server","forum","attribute","content","body","footer","fields","toArray","items","ItemList","add","type","placeholder","extractText","bidi","disabled","loading","Button","component","onready","$","select","onsubmit","e","preventDefault","data","csrfToken","session","$window","onerror","window","url","form","document","createElement","setAttribute","input","appendChild","open","height","width","submit","removeChild","error","status","alert","children","Modal","initializers","extend","HeaderSecondary","has","onclick","modal","show","remove","LogInModal","SettingsPage","length"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OA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AAQb,EAAeV,UAAUuB,MACtD6D,IAAWpF,UAAUgC,KAAOtB,EAAeV,UAAUgC,KACrDoD,IAAWpF,UAAUkC,OAASxB,EAAeV,UAAUkC,OACvDkD,IAAWpF,UAAUiC,OAASvB,EAAeV,UAAUiC,OACvDmD,IAAWpF,UAAUkD,SAAWxC,EAAeV,UAAUkD,aAV3D2B,iBAAOQ,IAAarF,UAAW,gBAwC/B,SAA8BoC,GAC7BA,EAAM+C,OAAO,eACb/C,EAAM+C,OAAO,qBAzCdN,iBAAOQ,IAAarF,UAAW,iBA4C/B,SAAmCoC,GAC9BA,EAAM2C,IAAI,YAC4B,IAAzC3C,EAAMnD,IAAI,WAAWyF,SAASY,QAC9BlD,EAAM+C,OAAO","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/LogInModal'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['utils/Stream'];","module.exports = flarum.core.compat['components/HeaderSecondary'];","module.exports = flarum.core.compat['components/SettingsPage'];","module.exports = flarum.core.compat['utils/extractText'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['components/SignUpModal'];","module.exports = flarum.core.compat['components/LogInButtons'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\n\nimport Modal from 'flarum/components/Modal';\nimport SignUpModal from 'flarum/components/SignUpModal';\nimport Button from 'flarum/components/Button';\nimport LogInButtons from 'flarum/components/LogInButtons';\nimport extractText from 'flarum/utils/extractText';\nimport ItemList from 'flarum/utils/ItemList';\nimport Stream from 'flarum/utils/Stream';\n\nconst translationPrefix = 'tituspijean-auth-ldap.forum.';\n\nexport default class LDAPLogInModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n /**\n * The value of the identification input.\n *\n * @type {Function}\n */\n this.identification = Stream(this.attrs.identification || '');\n\n /**\n * The value of the password input.\n *\n * @type {Function}\n */\n this.password = Stream(this.attrs.password || '');\n\n /**\n * The value of the remember me input.\n *\n * @type {Function}\n */\n this.remember = Stream(!!this.attrs.remember);\n }\n\n className() {\n return 'LogInModal Modal--small';\n }\n\n title() {\n return app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('LDAP_method_name')});\n }\n\n content() {\n return [\n
\n {this.body()}\n
,\n
\n {this.footer()}\n
\n ];\n }\n\n body() {\n return [\n //,\n\n
\n {this.fields().toArray()}\n
\n ];\n }\n\n fields() {\n const items = new ItemList();\n\n items.add('identification',
\n \n
, 30);\n\n items.add('password',
\n \n
, 20);\n\n /*items.add('remember',
\n
\n \n
\n
, 10);*/\n\n items.add('submit',
\n {Button.component(\n {\n className: 'Button Button--primary Button--block',\n type: 'submit',\n loading: this.attrs.loading,\n },\n app.translator.trans('core.forum.log_in.submit_button')\n )}\n
, -10);\n\n return items;\n }\n\n footer() {\n return [\n /*

\n {app.translator.trans('core.forum.log_in.forgot_password_link')}\n

,\n\n app.forum.attribute('allowSignUp') ? (\n

\n {app.translator.trans('core.forum.log_in.sign_up_text', {a: })}\n

\n ) : ''*/\n ];\n }\n\n onready() {\n this.$('[name=' + (this.identification() ? 'password' : 'identification') + ']').select();\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const identification = this.identification();\n const password = this.password();\n const remember = this.remember();\n const csrfToken = app.session.csrfToken;\n\n const data = {identification, password, remember, csrfToken};\n const options = {errorHandler: this.onerror.bind(this)};\n\n const width = 600;\n const height = 400;\n const $window = $(window);\n const url = app.forum.attribute('baseUrl') + '/auth/ldap';\n const name = \"ldapauth\";\n\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"POST\");\n form.setAttribute(\"action\", url);\n form.setAttribute(\"target\", name);\n for (var i in data) {\n if (data.hasOwnProperty(i)) {\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = i;\n input.value = data[i];\n form.appendChild(input);\n }\n }\n document.body.appendChild(form);\n\n window.open(\"\", name,\n `width=${width},` +\n `height=${height},` +\n `top=${$window.height() / 2 - height / 2},` +\n `left=${$window.width() / 2 - width / 2},` +\n 'status=no,scrollbars=no,resizable=no');\n\n form.submit();\n document.body.removeChild(form);\n }\n\n onerror(error) {\n if (error.status === 401) {\n error.alert.children = app.translator.trans('core.forum.log_in.invalid_login_message');\n }\n\n super.onerror(error);\n }\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import { extend, override } from 'flarum/extend';\nimport app from 'flarum/app';\n\nimport HeaderSecondary from \"flarum/components/HeaderSecondary\";\nimport SettingsPage from \"flarum/components/SettingsPage\";\nimport Button from 'flarum/components/Button';\n\nimport LogInModal from \"flarum/components/LogInModal\";\nimport LDAPLogInModal from \"./components/LDAPLogInModal\";\n\nconst translationPrefix = 'tituspijean-auth-ldap.forum.';\n\napp.initializers.add('tituspijean-auth-ldap', function() {\n\n\textend(HeaderSecondary.prototype, 'items', addLoginLink);\n\textend(HeaderSecondary.prototype, 'items', removeIfOnlyUse);\n\textend(LogInModal.prototype, 'content', overrideModal);\n\n\textend(SettingsPage.prototype, 'accountItems', removeProfileActions);\n\textend(SettingsPage.prototype, 'settingsItems', checkRemoveAccountSection);\n\n\tfunction overrideModal() {\n\t\tif (app.forum.attribute('onlyUseLDAP')) {\n\t\t\tLogInModal.prototype.content = LDAPLogInModal.prototype.content\n\t\t\tLogInModal.prototype.title = LDAPLogInModal.prototype.title\n\t\t\tLogInModal.prototype.body = LDAPLogInModal.prototype.body\n\t\t\tLogInModal.prototype.fields = LDAPLogInModal.prototype.fields\n\t\t\tLogInModal.prototype.footer = LDAPLogInModal.prototype.footer\n\t\t\tLogInModal.prototype.onsubmit = LDAPLogInModal.prototype.onsubmit\n\t\t}\n\t}\n\n\tfunction addLoginLink(items) {\n\t\tif (items.has('logIn')) {\n\t\t\titems.add('logInLDAP',\n\t\t\t\tButton.component(\n\t\t\t\t {\n className: 'Button Button--link',\n onclick: () => app.modal.show(LDAPLogInModal)\n\t\t\t\t },\n app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('LDAP_method_name')})\n\t\t\t\t),\n 0\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction removeIfOnlyUse(items) {\n\t\tif (app.forum.attribute('onlyUseLDAP')) {\n\t\t\tif (items.has('signUp')) {\n\t\t\t\titems.remove('signUp');\n\t\t\t}\n\t\t\tif (items.has('logIn')) {\n\t\t\t\titems.remove('logIn');\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction removeProfileActions(items) {\n\t\titems.remove('changeEmail');\n\t\titems.remove('changePassword');\n\t}\n\n\tfunction checkRemoveAccountSection(items) {\n\t\tif (items.has('account') &&\n\t\t\titems.get('account').children.length === 0) {\n\t\t\titems.remove('account');\n\t\t}\n\t}\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@tituspijean/auth-ldap/webpack/bootstrap","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['app']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/LogInModal']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['common/app']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['common/extend']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/Button']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['utils/Stream']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/HeaderSecondary']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/SettingsPage']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['utils/extractText']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/Modal']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['utils/ItemList']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['extend']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/SignUpModal']\"","webpack://@tituspijean/auth-ldap/external \"flarum.core.compat['components/LogInButtons']\"","webpack://@tituspijean/auth-ldap/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@tituspijean/auth-ldap/./src/forum/components/LDAPLogInModal.js","webpack://@tituspijean/auth-ldap/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@tituspijean/auth-ldap/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_setPrototypeOf","setPrototypeOf","__proto__","LDAPLogInModal","subClass","superClass","constructor","oninit","vnode","this","identification","Stream","attrs","password","remember","className","title","app","translator","trans","translationPrefix","server","forum","attribute","content","body","footer","fields","toArray","items","ItemList","add","type","placeholder","extractText","bidi","disabled","loading","Button","component","onready","$","select","onsubmit","e","preventDefault","data","csrfToken","session","$window","onerror","window","url","form","document","createElement","setAttribute","input","appendChild","open","height","width","submit","removeChild","error","status","alert","children","Modal","initializers","extend","HeaderSecondary","has","onclick","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3C,EAAM+C,OAAO,UAEV/C,EAAM2C,IAAI,UACb3C,EAAM+C,OAAO,aArChBN,iBAAOO,IAAWpF,UAAW,WAK7B,WACKwB,IAAIK,MAAMC,UAAU,mCACvBsD,IAAWpF,UAAU+B,QAAUrB,EAAeV,UAAU+B,QACxDqD,IAAWpF,UAAUuB,MAAQb,EAAeV,UAAUuB,MACtD6D,IAAWpF,UAAUgC,KAAOtB,EAAeV,UAAUgC,KACrDoD,IAAWpF,UAAUkC,OAASxB,EAAeV,UAAUkC,OACvDkD,IAAWpF,UAAUiC,OAASvB,EAAeV,UAAUiC,OACvDmD,IAAWpF,UAAUkD,SAAWxC,EAAeV,UAAUkD,aAV3D2B,iBAAOQ,IAAarF,UAAW,gBAwC/B,SAA8BoC,GAC7BA,EAAM+C,OAAO,eACb/C,EAAM+C,OAAO,qBAzCdN,iBAAOQ,IAAarF,UAAW,iBA4C/B,SAAmCoC,GAC9BA,EAAM2C,IAAI,YAC4B,IAAzC3C,EAAMnD,IAAI,WAAWyF,SAASY,QAC9BlD,EAAM+C,OAAO","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 14);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/LogInModal'];","module.exports = flarum.core.compat['common/app'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['utils/Stream'];","module.exports = flarum.core.compat['components/HeaderSecondary'];","module.exports = flarum.core.compat['components/SettingsPage'];","module.exports = flarum.core.compat['utils/extractText'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['utils/ItemList'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/SignUpModal'];","module.exports = flarum.core.compat['components/LogInButtons'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\n\nimport Modal from 'flarum/components/Modal';\nimport SignUpModal from 'flarum/components/SignUpModal';\nimport Button from 'flarum/components/Button';\nimport LogInButtons from 'flarum/components/LogInButtons';\nimport extractText from 'flarum/utils/extractText';\nimport ItemList from 'flarum/utils/ItemList';\nimport Stream from 'flarum/utils/Stream';\n\nconst translationPrefix = 'tituspijean-auth-ldap.forum.';\n\nexport default class LDAPLogInModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n /**\n * The value of the identification input.\n *\n * @type {Function}\n */\n this.identification = Stream(this.attrs.identification || '');\n\n /**\n * The value of the password input.\n *\n * @type {Function}\n */\n this.password = Stream(this.attrs.password || '');\n\n /**\n * The value of the remember me input.\n *\n * @type {Function}\n */\n this.remember = Stream(!!this.attrs.remember);\n }\n\n className() {\n return 'LogInModal Modal--small';\n }\n\n title() {\n return app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('LDAP_method_name')});\n }\n\n content() {\n return [\n
\n {this.body()}\n
,\n
\n {this.footer()}\n
\n ];\n }\n\n body() {\n return [\n //,\n\n
\n {this.fields().toArray()}\n
\n ];\n }\n\n fields() {\n const items = new ItemList();\n\n items.add('identification',
\n \n
, 30);\n\n items.add('password',
\n \n
, 20);\n\n /*items.add('remember',
\n
\n \n
\n
, 10);*/\n\n items.add('submit',
\n {Button.component(\n {\n className: 'Button Button--primary Button--block',\n type: 'submit',\n loading: this.attrs.loading,\n },\n app.translator.trans('core.forum.log_in.submit_button')\n )}\n
, -10);\n\n return items;\n }\n\n footer() {\n return [\n /*

\n {app.translator.trans('core.forum.log_in.forgot_password_link')}\n

,\n\n app.forum.attribute('allowSignUp') ? (\n

\n {app.translator.trans('core.forum.log_in.sign_up_text', {a: })}\n

\n ) : ''*/\n ];\n }\n\n onready() {\n this.$('[name=' + (this.identification() ? 'password' : 'identification') + ']').select();\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const identification = this.identification();\n const password = this.password();\n const remember = this.remember();\n const csrfToken = app.session.csrfToken;\n\n const data = {identification, password, remember, csrfToken};\n const options = {errorHandler: this.onerror.bind(this)};\n\n const width = 600;\n const height = 400;\n const $window = $(window);\n const url = app.forum.attribute('baseUrl') + '/auth/ldap';\n const name = \"ldapauth\";\n\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"POST\");\n form.setAttribute(\"action\", url);\n form.setAttribute(\"target\", name);\n for (var i in data) {\n if (data.hasOwnProperty(i)) {\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = i;\n input.value = data[i];\n form.appendChild(input);\n }\n }\n document.body.appendChild(form);\n\n window.open(\"\", name,\n `width=${width},` +\n `height=${height},` +\n `top=${$window.height() / 2 - height / 2},` +\n `left=${$window.width() / 2 - width / 2},` +\n 'status=no,scrollbars=no,resizable=no');\n\n form.submit();\n document.body.removeChild(form);\n }\n\n onerror(error) {\n if (error.status === 401) {\n error.alert.children = app.translator.trans('core.forum.log_in.invalid_login_message');\n }\n\n super.onerror(error);\n }\n}\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import { extend, override } from 'flarum/common/extend';\nimport app from 'flarum/common/app';\n\nimport HeaderSecondary from \"flarum/components/HeaderSecondary\";\nimport SettingsPage from \"flarum/components/SettingsPage\";\nimport Button from 'flarum/components/Button';\n\nimport LogInModal from \"flarum/components/LogInModal\";\nimport LDAPLogInModal from \"./components/LDAPLogInModal\";\n\nconst translationPrefix = 'tituspijean-auth-ldap.forum.';\n\napp.initializers.add('tituspijean-auth-ldap', () => {\n\n\textend(HeaderSecondary.prototype, 'items', addLoginLink);\n\textend(HeaderSecondary.prototype, 'items', removeIfOnlyUse);\n\textend(LogInModal.prototype, 'content', overrideModal);\n\n\textend(SettingsPage.prototype, 'accountItems', removeProfileActions);\n\textend(SettingsPage.prototype, 'settingsItems', checkRemoveAccountSection);\n\n\tfunction overrideModal() {\n\t\tif (app.forum.attribute('tituspijean-auth-ldap.onlyUse')) {\n\t\t\tLogInModal.prototype.content = LDAPLogInModal.prototype.content\n\t\t\tLogInModal.prototype.title = LDAPLogInModal.prototype.title\n\t\t\tLogInModal.prototype.body = LDAPLogInModal.prototype.body\n\t\t\tLogInModal.prototype.fields = LDAPLogInModal.prototype.fields\n\t\t\tLogInModal.prototype.footer = LDAPLogInModal.prototype.footer\n\t\t\tLogInModal.prototype.onsubmit = LDAPLogInModal.prototype.onsubmit\n\t\t}\n\t}\n\n\tfunction addLoginLink(items) {\n\t\tif (items.has('logIn')) {\n\t\t\titems.add('logInLDAP',\n\t\t\t\tButton.component(\n\t\t\t\t {\n className: 'Button Button--link',\n onclick: () => app.modal.show(LDAPLogInModal)\n\t\t\t\t },\n app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('tituspijean-auth-ldap.method_name')})\n\t\t\t\t),\n 0\n\t\t\t);\n\t\t}\n\t}\n\n\tfunction removeIfOnlyUse(items) {\n\t\tif (app.forum.attribute('tituspijean-auth-ldap.onlyUse')) {\n\t\t\tif (items.has('signUp')) {\n\t\t\t\titems.remove('signUp');\n\t\t\t}\n\t\t\tif (items.has('logIn')) {\n\t\t\t\titems.remove('logIn');\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction removeProfileActions(items) {\n\t\titems.remove('changeEmail');\n\t\titems.remove('changePassword');\n\t}\n\n\tfunction checkRemoveAccountSection(items) {\n\t\tif (items.has('account') &&\n\t\t\titems.get('account').children.length === 0) {\n\t\t\titems.remove('account');\n\t\t}\n\t}\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/admin/index.js b/js/src/admin/index.js index bc76a22..fd2798c 100644 --- a/js/src/admin/index.js +++ b/js/src/admin/index.js @@ -115,7 +115,7 @@ app.initializers.add('tituspijean-auth-ldap', function(app) { setting: settingsPrefix + 'onlyUse', label: app.translator.trans(translationPrefix + 'onlyUse'), type: 'boolean', - placeholder: false, + default: false, } ) }); diff --git a/js/src/forum/index.js b/js/src/forum/index.js index 400f161..3807ee6 100644 --- a/js/src/forum/index.js +++ b/js/src/forum/index.js @@ -1,5 +1,5 @@ -import { extend, override } from 'flarum/extend'; -import app from 'flarum/app'; +import { extend, override } from 'flarum/common/extend'; +import app from 'flarum/common/app'; import HeaderSecondary from "flarum/components/HeaderSecondary"; import SettingsPage from "flarum/components/SettingsPage"; @@ -10,7 +10,7 @@ import LDAPLogInModal from "./components/LDAPLogInModal"; const translationPrefix = 'tituspijean-auth-ldap.forum.'; -app.initializers.add('tituspijean-auth-ldap', function() { +app.initializers.add('tituspijean-auth-ldap', () => { extend(HeaderSecondary.prototype, 'items', addLoginLink); extend(HeaderSecondary.prototype, 'items', removeIfOnlyUse); @@ -20,7 +20,7 @@ app.initializers.add('tituspijean-auth-ldap', function() { extend(SettingsPage.prototype, 'settingsItems', checkRemoveAccountSection); function overrideModal() { - if (app.forum.attribute('onlyUseLDAP')) { + if (app.forum.attribute('tituspijean-auth-ldap.onlyUse')) { LogInModal.prototype.content = LDAPLogInModal.prototype.content LogInModal.prototype.title = LDAPLogInModal.prototype.title LogInModal.prototype.body = LDAPLogInModal.prototype.body @@ -38,7 +38,7 @@ app.initializers.add('tituspijean-auth-ldap', function() { className: 'Button Button--link', onclick: () => app.modal.show(LDAPLogInModal) }, - app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('LDAP_method_name')}) + app.translator.trans(translationPrefix + 'log_in_with', {server: app.forum.attribute('tituspijean-auth-ldap.method_name')}) ), 0 ); @@ -46,7 +46,7 @@ app.initializers.add('tituspijean-auth-ldap', function() { } function removeIfOnlyUse(items) { - if (app.forum.attribute('onlyUseLDAP')) { + if (app.forum.attribute('tituspijean-auth-ldap.onlyUse')) { if (items.has('signUp')) { items.remove('signUp'); } diff --git a/src/Extenders/AddForumAttributes.php b/src/Extenders/AddForumAttributes.php deleted file mode 100644 index 230bb9e..0000000 --- a/src/Extenders/AddForumAttributes.php +++ /dev/null @@ -1,24 +0,0 @@ -settings = $settings; - } - - public function __invoke(ForumSerializer $serializer) - { - $attributes['onlyUseLDAP'] = (bool) $this->settings->get('tituspijean-auth-ldap.onlyUse'); - $attributes['LDAP_method_name'] = (string) $this->settings->get('tituspijean-auth-ldap.method_name'); - - return $attributes; - } -}