Version Alpine:3.20 Php:8.3

This commit is contained in:
2024-09-10 12:21:39 +02:00
parent fe575b476c
commit e317d44546
90 changed files with 28107 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/app.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./src/app.js":
/*!********************!*\
!*** ./src/app.js ***!
\********************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _assets_js_login_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assets/js/login.js */ \"./src/assets/js/login.js\");\n// Import des autres modules\n\n\n// Exports functions\nwindow.loadMain = loadMain;\nwindow.tryConnect = _assets_js_login_js__WEBPACK_IMPORTED_MODULE_0__[\"tryConnect\"];\nwindow.Quit = Quit;\n\n\n/**\n * loadMain is the main page load\n * \n */\n function loadMain()\n {\n var token='';\n \n token = getCookie('aduc');\n if( token == \"\" )\n {\n console.log('No cookie defined');\n _assets_js_login_js__WEBPACK_IMPORTED_MODULE_0__[\"displayLogin\"]();\n } else {\n console.log(\"Cookie \"+token);\n }\n }\n\n /**\n * getCookie get cookie's content\n * \n * @param {*} cname Cookie's name\n * @returns \n */\nfunction getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for(var i = 0; i <ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n}\n\n\n/**\n * setCookie : set a cookie\n * \n * @param {*} cname Cookie's name to set\n * @param {*} cvalue Cookie's value\n * @param {*} timeOut Cookie's expiration in seconds\n */\nfunction setCookie(cname, cvalue, timeOut) \n{\n var d = new Date();\n d.setTime(d.getTime() + (timeOut*1000));\n var expires = \"expires=\"+ d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n}\n\n/**\n * delCookie()\n * \n * @param {*} cname \n */\nfunction delCookie( cname ) \n{\n document.cookie = cname + \"=;expires=Thu, 01 Jan 1970 00:00:01 GMT\";\n}\n\n\n\n\n/**\n * Exit program (logout)\n * \n */\nfunction Quit()\n{\n delCookie(\"aduc\");\n document.location = \"/index.php\";\n}\n\nfunction doLdap()\n{\n document.location = \"/ldap.php\";\n}\n\nfunction doRedis()\n{\n document.location = \"/redis.php\";\n}\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./src/app.js?");
/***/ }),
/***/ "./src/assets/js/entity.js":
/*!*********************************!*\
!*** ./src/assets/js/entity.js ***!
\*********************************/
/*! exports provided: addEntity, displayRoot */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addEntity\", function() { return addEntity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"displayRoot\", function() { return displayRoot; });\n/**\n * addEntity\n */\n function addEntity()\n {\n alert(\"Ajout d'une entité\");\n }\n \n \n /**\n * displayRoot : display root screen\n */\n function displayRoot()\n {\n var Header='';\n Header = \"<h5 class='modal-title' id='popup-title'>Root</h5>\";\n Header += \"<button type='button' class='close' data-dismiss='modal'>\";\n Header += \"<span aria-hidden='true'>×</span>\";\n Header += \"</button>\";\n $('#popup-header').html(Header);\n $('#popup-body').html(getRootForm());\n $('#popup-footer').css('display','block');\n $('#popup-footer').html(getRootFooter());\n $('#popup').modal('show');\n }\n \n /**\n * \n * @returns \n */\n function getRootFooter()\n {\n var ret='';\n \n ret += '<button type=\"button\" class=\"btn btn-primary\" onClick=\"SaveRoot();\" id=\"cnxButton\">Save</button>';\n return ret;\n }\n \n /**\n * \n * @returns string\n */\n function getRootForm()\n {\n var ret;\n \n ret = \"<div class='form-group'>\\n\";\n ret += \" <label for='sInputEmail'>Account (email form)</label>\\n\";\n ret += \" <div class='fx-relay-email-input-wrapper'>\\n\";\t\t\t\t\t\n ret += \" <input type='email' class='form-control' id='sInputEmail' />\\n\";\t\t\t\t\t\n ret += \"\t</div>\\n\";\n ret += \"</div>\";\n ret += \"<div class='form-group'>\\n\";\n ret += \" <label for='sInputPassword'>Password</label>\\n\";\n ret += \"\t<input type='password' class='form-control' id='sInputPassword' />\\n\";\n ret += \"</div>\";\n return ret;\n }\n \n\n//# sourceURL=webpack:///./src/assets/js/entity.js?");
/***/ }),
/***/ "./src/assets/js/jstree.js":
/*!*********************************!*\
!*** ./src/assets/js/jstree.js ***!
\*********************************/
/*! exports provided: initJsTree */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"initJsTree\", function() { return initJsTree; });\n/* harmony import */ var _entity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./entity.js */ \"./src/assets/js/entity.js\");\n\n\n\n\n/**\n * initJsTree\n */\nfunction initJsTree()\n {\n $('#jsTree')\n .jstree({\n 'core' : {\n \"check_callback\" : true,\n 'data' : {\n 'url' : 'src/ajax.php?Action=get_node',\n 'data' : function (node) {\n console.log(node.id);\n return { 'id' : node.id };\n }\n },\n \"themes\" : {\n \"variant\" : \"large\"\n }\n },\n 'contextmenu' : {\n 'items' : function(node) {\n return contextMenu(node);\n }\n },\n \"types\" : {\n \"#\" : {\n \"max_children\" : 1,\n \"max_depth\" : 4,\n \"valid_children\" : [\"root\"]\n },\n \"root\" : {\n \"icon\" : \"./src/assets/global.png\",\n \"valid_children\" : [\"default\"]\n },\n \"Organizational-Unit\" : {\n \"icon\" : \"./src/assets/folder-blue.png\",\n \"valid_children\" : [\"default\",\"file\"]\n },\n \"Container\" : {\n \"icon\" : \"./src/assets/folder-blue.png\"\n },\n \"Builtin-Domain\" : {\n \"icon\" : \"./src/assets/folder-blue.png\",\n \"valid_children\" : []\n },\n \"Foreign-Security-Principal\" : {\n \"icon\" : \"./src/assets/key.png\"\n },\n \"Group\": {\n \"icon\" : \"./src/assets/users-icon.png\",\n },\n \"Computer\": {\n \"icon\" : \"./src/assets/computer.png\",\n },\n \"Person\": {\n \"icon\" : \"./src/assets/User.png\"\n },\n \"Physical-Location\": {\n \"icon\" : \"./src/assets/building.png\"\n },\n },\n \"plugins\" : [\"contextmenu\",\"dnd\",\"search\",\"types\"]\n });\n }\n \n /**\n * contextMenu\n */\nfunction contextMenu(node)\n{\n console.log(node);\n var tmp = $.jstree.defaults.contextmenu.items();\n console.log(tmp);\n delete tmp.create.action;\n\n switch(node.type)\n { \n case 'root':\n var tmp;\n tmp = {\n \"create\": {\n \"label\": \"Nouvelle entité\",\n \"action\": function(data){\n console.log(data);\n _entity_js__WEBPACK_IMPORTED_MODULE_0__[\"addEntity\"]();\n }\n }\n }\n return tmp;\n }\n\n\n if(node.type === \"demo\") {\n tmp = { 'create': {\n \"label\": \"Ajouter\"\n }};\n return tmp;\n }\n\n tmp.create.label = \"Ajouter\";\n tmp.create.submenu = {\n \"create_folder\" : {\n \"separator_after\"\t: true,\n \"label\"\t\t\t\t: \"Utilisateur\",\n \"action\"\t\t\t: function (data) {\n // console.log(data);\n alert('Ajout user');\n }\n },\n \"create_file\" : {\n \"label\"\t\t\t\t: \"Machine\",\n \"action\"\t\t\t: function (data) {\n alert('Machine');\n }\n }\n };\n return tmp;\n}\n// https://www.jstree.com/demo/\n\n\n\n//# sourceURL=webpack:///./src/assets/js/jstree.js?");
/***/ }),
/***/ "./src/assets/js/login.js":
/*!********************************!*\
!*** ./src/assets/js/login.js ***!
\********************************/
/*! exports provided: displayLogin, tryConnect */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"displayLogin\", function() { return displayLogin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"tryConnect\", function() { return tryConnect; });\n/* harmony import */ var _jstree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jstree.js */ \"./src/assets/js/jstree.js\");\n/* harmony import */ var _entity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entity.js */ \"./src/assets/js/entity.js\");\n/**\n * Login related functions\n */\n\n\n\n\n\n/**\n * displayLogin : display login screen\n */\n function displayLogin()\n {\n $('#popup-header').html(\"<h5>Login</h5>\");\n $('#popup-body').html(getLoginForm());\n $('#popup-footer').css('display','block');\n $('#popup-footer').html(getLoginFooter());\n $('#popup').modal('show');\n }\n \n /**\n * \n * @returns string\n */\n function getLoginForm()\n {\n var ret;\n \n ret = \"<div class='form-group'>\\n\";\n ret += \" <label for='sInputEmail'>Account (email form)</label>\\n\";\n ret += \" <div class='fx-relay-email-input-wrapper'>\\n\";\t\t\t\t\t\n ret += \" <input type='email' class='form-control' id='sInputEmail' />\\n\";\t\t\t\t\t\n ret += \"\t</div>\\n\";\n ret += \"</div>\";\n ret += \"<div class='form-group'>\\n\";\n ret += \" <label for='sInputPassword'>Password</label>\\n\";\n ret += \"\t<input type='password' class='form-control' id='sInputPassword' />\\n\";\n ret += \"</div>\";\n return ret;\n }\n \n\n/**\n * \n * @returns \n */\n function getLoginFooter()\n {\n var ret='';\n \n ret += '<button type=\"button\" class=\"btn btn-primary\" onClick=\"window.tryConnect();\" id=\"cnxButton\">Connect</button>';\n ret += \"<div class='alert alert-danger' style='display: none; margin-top: 5px' id='loginAlert'>\";\n ret += \"<h4>Compte ou login invalide</h4></div>\";\n return ret;\n }\n \n\n /**\n * \n * @returns \n */\nfunction tryConnect()\n{\n var sEmail, sPassword, sAction;\n // $('#cnxButton').fadeOut();\n console.log('try to connect');\n sEmail = document.getElementById(\"sInputEmail\").value;\n sPassword = document.getElementById(\"sInputPassword\").value;\n if( sPassword == \"\" ){\n return;\n }\n if( sEmail == \"\" ){\n return;\n }\n var oData = { Action: 'validLogin', Email: \"\"+sEmail, Password: \"\"+sPassword };\n // Ask server\n $.post(\"src/ajax.php\",oData, function (data, status){\n if( status != \"success\"){\n alert('error');\n }\n if( data.Errno == -1){\n //$('#loginAlert').css('display','block');\n $('#loginAlert').fadeIn();\n setTimeout( function() {$('#loginAlert').fadeOut();} ,3000);\n } else {\n $('#popup').modal('hide');\n $('#navbar').css('display','flex');\n $('#jsTree').css('display','block');\n _jstree_js__WEBPACK_IMPORTED_MODULE_0__[\"initJsTree\"]();\n $(\"#jsTree\").on('select_node.jstree', function(e,data){\n //alert('Selected');\n //var id = $(\"#jsTree\").jstree(true).get_node($(this)).id;\n var id = atob(data.node.id);\n\n console.log(\"ID : \"+ id);\n console.log(\"Type : \"+ data.node.type);\n switch( data.node.type )\n {\n case 'Person':\n alert(\"Edit User\");\n break;\n \n case 'root':\n _entity_js__WEBPACK_IMPORTED_MODULE_1__[\"displayRoot\"]();\n break;\n }\n });\n }\n }); \n}\n\n\n//# sourceURL=webpack:///./src/assets/js/login.js?");
/***/ })
/******/ });

View File

@@ -0,0 +1 @@
{"version":3,"sources":["webpack:///webpack/bootstrap"],"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"],"mappings":"aACE,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,QAKfF,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,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G","file":"bundle.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 = 0);\n"],"sourceRoot":""}

View File

@@ -0,0 +1,100 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/app2.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./src/app2.js":
/*!*********************!*\
!*** ./src/app2.js ***!
\*********************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("\nwindow.Launch = Launch;\n\nfunction Launch()\n{\n alert('OK');\n}\n\n//# sourceURL=webpack:///./src/app2.js?");
/***/ })
/******/ });

View File

@@ -0,0 +1,104 @@
// Import des autres modules
import * as mLogin from './assets/js/login.js';
import _ from './assets/js/i18n.js';
// Exports functions
window.loadMain = loadMain;
window.tryConnect = mLogin.tryConnect;
window.Quit = Quit;
/**
* loadMain is the main page load
*
*/
function loadMain()
{
var token='';
token = getCookie('aduc');
if( token == "" )
{
console.log('No cookie defined');
mLogin.displayLogin();
} else {
console.log("Cookie "+token);
}
}
/**
* getCookie get cookie's content
*
* @param {*} cname Cookie's name
* @returns
*/
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
/**
* setCookie : set a cookie
*
* @param {*} cname Cookie's name to set
* @param {*} cvalue Cookie's value
* @param {*} timeOut Cookie's expiration in seconds
*/
function setCookie(cname, cvalue, timeOut)
{
var d = new Date();
d.setTime(d.getTime() + (timeOut*1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
/**
* delCookie()
*
* @param {*} cname
*/
function delCookie( cname )
{
document.cookie = cname + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT";
}
/**
* Exit program (logout)
*
*/
function Quit()
{
delCookie("aduc");
document.location = "/index.php";
}
function doLdap()
{
document.location = "/ldap.php";
}
function doRedis()
{
document.location = "/redis.php";
}

View File

@@ -0,0 +1,7 @@
window.Launch = Launch;
function Launch()
{
alert('OK');
}

View File

@@ -0,0 +1,59 @@
/**
* addEntity
*/
export function addEntity()
{
alert("Ajout d'une entité");
}
/**
* displayRoot : display root screen
*/
export function displayRoot()
{
var Header='';
Header = "<h5 class='modal-title' id='popup-title'>Entity</h5>";
Header += "<button type='button' class='close' data-dismiss='modal'>";
Header += "<span aria-hidden='true'>×</span>";
Header += "</button>";
$('#popup-header').html(Header);
$('#popup-body').html(getRootForm());
$('#popup-footer').css('display','block');
$('#popup-footer').html(getRootFooter());
$('#popup').modal('show');
}
/**
*
* @returns
*/
function getRootFooter()
{
var ret='';
ret += '<button type="button" class="btn btn-primary" onClick="SaveRoot();" id="cnxButton">Enregistrer</button>';
return ret;
}
/**
*
* @returns string
*/
function getRootForm()
{
var ret;
ret = "<div class='form-group'>\n";
ret += " <label for='sInputEmail'>Account (email form)</label>\n";
ret += " <div class='fx-relay-email-input-wrapper'>\n";
ret += " <input type='email' class='form-control' id='sInputEmail' />\n";
ret += " </div>\n";
ret += "</div>";
ret += "<div class='form-group'>\n";
ret += " <label for='sInputPassword'>Password</label>\n";
ret += " <input type='password' class='form-control' id='sInputPassword' />\n";
ret += "</div>";
return ret;
}

View File

@@ -0,0 +1,4 @@
export function _(sOrig)
{
return sOrig;
}

View File

@@ -0,0 +1,125 @@
import * as mEntity from './entity.js';
/**
* initJsTree
*/
export function initJsTree()
{
$('#jsTree')
.jstree({
'core' : {
"check_callback" : true,
'data' : {
'url' : 'src/ajax.php?Action=get_node',
'data' : function (node) {
console.log(node.id);
return { 'id' : node.id };
}
},
"themes" : {
"variant" : "large"
}
},
'contextmenu' : {
'items' : function(node) {
return contextMenu(node);
}
},
"types" : {
"#" : {
"max_children" : 1,
"max_depth" : 4,
"valid_children" : ["root"]
},
"root" : {
"icon" : "./src/assets/global.png",
"valid_children" : ["default"]
},
"Organizational-Unit" : {
"icon" : "./src/assets/folder-blue.png",
"valid_children" : ["default","file"]
},
"Container" : {
"icon" : "./src/assets/folder-blue.png"
},
"Builtin-Domain" : {
"icon" : "./src/assets/folder-blue.png",
"valid_children" : []
},
"Foreign-Security-Principal" : {
"icon" : "./src/assets/key.png"
},
"Group": {
"icon" : "./src/assets/users-icon.png",
},
"Computer": {
"icon" : "./src/assets/computer.png",
},
"Person": {
"icon" : "./src/assets/User.png"
},
"Physical-Location": {
"icon" : "./src/assets/building.png"
},
},
"plugins" : ["contextmenu","dnd","search","types"]
});
}
/**
* contextMenu
*/
function contextMenu(node)
{
console.log(node);
var tmp = $.jstree.defaults.contextmenu.items();
console.log(tmp);
delete tmp.create.action;
switch(node.type)
{
case 'root':
var tmp;
tmp = {
"create": {
"label": "Nouvelle entité",
"action": function(data){
console.log(data);
mEntity.addEntity();
}
}
}
return tmp;
}
if(node.type === "demo") {
tmp = { 'create': {
"label": "Ajouter"
}};
return tmp;
}
tmp.create.label = "Ajouter";
tmp.create.submenu = {
"create_folder" : {
"separator_after" : true,
"label" : "Utilisateur",
"action" : function (data) {
// console.log(data);
alert('Ajout user');
}
},
"create_file" : {
"label" : "Machine",
"action" : function (data) {
alert('Machine');
}
}
};
return tmp;
}
// https://www.jstree.com/demo/

View File

@@ -0,0 +1,110 @@
/**
* Login related functions
*/
import * as mTree from './jstree.js';
import * as mEntity from './entity.js';
/**
* displayLogin : display login screen
*/
export function displayLogin()
{
$('#popup-header').html("<h5>Login</h5>");
$('#popup-body').html(getLoginForm());
$('#popup-footer').css('display','block');
$('#popup-footer').html(getLoginFooter());
$('#popup').modal('show');
}
/**
*
* @returns string
*/
function getLoginForm()
{
var ret;
ret = "<div class='form-group'>\n";
ret += " <label for='sInputEmail'>Account (email form)</label>\n";
ret += " <div class='fx-relay-email-input-wrapper'>\n";
ret += " <input type='email' class='form-control' id='sInputEmail' />\n";
ret += " </div>\n";
ret += "</div>";
ret += "<div class='form-group'>\n";
ret += " <label for='sInputPassword'>Password</label>\n";
ret += " <input type='password' class='form-control' id='sInputPassword' />\n";
ret += "</div>";
return ret;
}
/**
*
* @returns
*/
function getLoginFooter()
{
var ret='';
ret += '<button type="button" class="btn btn-primary" onClick="window.tryConnect();" id="cnxButton">Connect</button>';
ret += "<div class='alert alert-danger' style='display: none; margin-top: 5px' id='loginAlert'>";
ret += "<h4>Compte ou login invalide</h4></div>";
return ret;
}
/**
*
* @returns
*/
export function tryConnect()
{
var sEmail, sPassword, sAction;
// $('#cnxButton').fadeOut();
console.log('try to connect');
sEmail = document.getElementById("sInputEmail").value;
sPassword = document.getElementById("sInputPassword").value;
if( sPassword == "" ){
return;
}
if( sEmail == "" ){
return;
}
var oData = { Action: 'validLogin', Email: ""+sEmail, Password: ""+sPassword };
// Ask server
$.post("src/ajax.php",oData, function (data, status){
if( status != "success"){
alert('error');
}
if( data.Errno == -1){
//$('#loginAlert').css('display','block');
$('#loginAlert').fadeIn();
setTimeout( function() {$('#loginAlert').fadeOut();} ,3000);
} else {
$('#popup').modal('hide');
$('#navbar').css('display','flex');
$('#jsTree').css('display','block');
mTree.initJsTree();
$("#jsTree").on('select_node.jstree', function(e,data){
//alert('Selected');
//var id = $("#jsTree").jstree(true).get_node($(this)).id;
var id = atob(data.node.id);
console.log("ID : "+ id);
console.log("Type : "+ data.node.type);
switch( data.node.type )
{
case 'Person':
alert("Edit User");
break;
case 'root':
mEntity.displayRoot();
break;
}
});
}
});
}