From f255bdb6a1004af0e73523540e659993d9c28a1b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 16:23:08 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20d'utilisateur=20(interface)=20e?= =?UTF-8?q?n=20cours.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/container.css | 2 +- css/container.css.map | 2 +- css/container.scss | 1 - css/global.css | 2 +- css/global.css.map | 4 +- css/global.scss | 48 ++++++++++--- manager/Database.php | 6 +- src/static/container/user.svg | 54 +++++++++++++++ view/js/settings.js | 122 +++++++++++++++++++++++++++++----- view/settings.php | 111 +++++++++++++++++++++++++------ 10 files changed, 301 insertions(+), 51 deletions(-) create mode 100644 src/static/container/user.svg diff --git a/css/container.css b/css/container.css index 62cb674..2411aa1 100755 --- a/css/container.css +++ b/css/container.css @@ -1,2 +1,2 @@ -#WRAPPER>#CONTAINER>section{display:none;position:relative;flex-grow:1;padding:1em;border-radius:3px;background-color:#fff;color:#000;font-size:1em;border:1px solid #ddd}#WRAPPER>#CONTAINER>section.active{display:block}#WRAPPER>#CONTAINER>section h6{color:#848484;font-size:1.2em;text-transform:uppercase;font-weight:300;letter-spacing:.2em;margin:0;padding:0}#WRAPPER>#CONTAINER>section h6:before{content:'- '}#WRAPPER>#CONTAINER>section h6:after{content:' -'}#WRAPPER>#CONTAINER>section h6.center{text-align:center}#WRAPPER>#CONTAINER>section input[type="radio"],#WRAPPER>#CONTAINER>section input[type="checkbox"]{display:none}#WRAPPER>#CONTAINER>section input[type="radio"]+label[for],#WRAPPER>#CONTAINER>section input[type="checkbox"]+label[for]{padding-left:.8em;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#WRAPPER>#CONTAINER>section input[type="radio"]+label[for]:before,#WRAPPER>#CONTAINER>section input[type="checkbox"]+label[for]:before{content:'';display:inline-block;position:relative;top:.1em;left:-.8em;width:calc( 1em - 2*.15em );height:calc( 1em - 2*.15em );border-radius:50% / 50%;border:0.15em solid #399ced;background:#fff center center no-repeat;background-image:none;background-size:70% auto;transition:background .2s ease-in-out;cursor:pointer}#WRAPPER>#CONTAINER>section input[type="radio"]:checked+label[for]:before,#WRAPPER>#CONTAINER>section input[type="checkbox"]:checked+label[for]:before{background-color:#399ced;background-image:url("/f/svg/checked/st/container")}#WRAPPER>#CONTAINER>section input[type="checkbox"]+label[for]:before{border-radius:3px}#WRAPPER>#CONTAINER>section input[type="submit"],#WRAPPER>#CONTAINER>section input[type="button"]{margin:.5em 0;padding:.3em .5em;border-radius:3px;border:1px solid #515151;font-weight:bold;color:#515151;background-color:#fff;transition:background .1s ease-in-out, color .1s ease-in-out}#WRAPPER>#CONTAINER>section input[type="submit"]:hover,#WRAPPER>#CONTAINER>section input[type="button"]:hover{background-color:#515151;color:#fff}#WRAPPER>#CONTAINER>section input[type="submit"].primary,#WRAPPER>#CONTAINER>section input[type="button"].primary{border-color:#399ced;color:#399ced;background-color:#fff}#WRAPPER>#CONTAINER>section input[type="submit"].primary:hover,#WRAPPER>#CONTAINER>section input[type="button"].primary:hover{background-color:#399ced;color:#fff}#WRAPPER>#CONTAINER>section img{margin:1em;height:3em}#WRAPPER>#CONTAINER>section .flag{margin:0 .8em;padding:.2em .8em;border-radius:5px;border:1px solid #b5b5b5;color:#555;font-family:'Inconsolata'} +#WRAPPER>#CONTAINER>section{display:none;position:relative;flex-grow:1;padding:1em;border-radius:3px;background-color:#fff;color:#000;font-size:1em;border:1px solid #ddd}#WRAPPER>#CONTAINER>section.active{display:block}#WRAPPER>#CONTAINER>section h6{color:#848484;font-size:1.2em;text-transform:uppercase;font-weight:300;letter-spacing:.2em;margin:0;padding:0}#WRAPPER>#CONTAINER>section h6:before{content:'- '}#WRAPPER>#CONTAINER>section h6:after{content:' -'}#WRAPPER>#CONTAINER>section h6.center{text-align:center}#WRAPPER>#CONTAINER>section input[type="radio"],#WRAPPER>#CONTAINER>section input[type="checkbox"]{display:none}#WRAPPER>#CONTAINER>section input[type="radio"]+label[for],#WRAPPER>#CONTAINER>section input[type="checkbox"]+label[for]{padding-left:.8em;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#WRAPPER>#CONTAINER>section input[type="radio"]+label[for]:before,#WRAPPER>#CONTAINER>section input[type="checkbox"]+label[for]:before{content:'';display:inline-block;position:relative;top:.1em;left:-.8em;width:calc( 1em - 2*.15em );height:calc( 1em - 2*.15em );border-radius:50% / 50%;border:0.15em solid #399ced;background:#fff center center no-repeat;background-image:none;background-size:70% auto;transition:background .2s ease-in-out;cursor:pointer}#WRAPPER>#CONTAINER>section input[type="radio"]:checked+label[for]:before,#WRAPPER>#CONTAINER>section input[type="checkbox"]:checked+label[for]:before{background-color:#399ced;background-image:url("/f/svg/checked/st/container")}#WRAPPER>#CONTAINER>section input[type="checkbox"]+label[for]:before{border-radius:3px}#WRAPPER>#CONTAINER>section input[type="submit"],#WRAPPER>#CONTAINER>section input[type="button"]{margin:.5em 0;padding:.3em .5em;border-radius:3px;border:1px solid #515151;color:#515151;background-color:#fff;transition:background .1s ease-in-out, color .1s ease-in-out}#WRAPPER>#CONTAINER>section input[type="submit"]:hover,#WRAPPER>#CONTAINER>section input[type="button"]:hover{background-color:#515151;color:#fff}#WRAPPER>#CONTAINER>section input[type="submit"].primary,#WRAPPER>#CONTAINER>section input[type="button"].primary{border-color:#399ced;color:#399ced;background-color:#fff}#WRAPPER>#CONTAINER>section input[type="submit"].primary:hover,#WRAPPER>#CONTAINER>section input[type="button"].primary:hover{background-color:#399ced;color:#fff}#WRAPPER>#CONTAINER>section img{margin:1em;height:3em}#WRAPPER>#CONTAINER>section .flag{margin:0 .8em;padding:.2em .8em;border-radius:5px;border:1px solid #b5b5b5;color:#555;font-family:'Inconsolata'} /*# sourceMappingURL=container.css.map */ diff --git a/css/container.css.map b/css/container.css.map index 8d5b811..2f301a1 100755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gBAAgB,CC5IF,OAAO,CD6IrB,KAAK,CAAE,IAAI,CASd,+BAAK,CACJ,MAAM,CAAE,GAAG,CACX,MAAM,CAAE,GAAG,CAKZ,iCAAO,CACN,MAAM,CAAE,MAAM,CACd,OAAO,CAAE,SAAS,CAElB,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,iBAAiB,CAEzB,KAAK,CAAE,IAAI,CACX,WAAW,CAAE,aAAa", "sources": ["container.scss","constants.scss"], "names": [], "file": "container.css" diff --git a/css/container.scss b/css/container.scss index cff4171..b16c8dc 100755 --- a/css/container.scss +++ b/css/container.scss @@ -122,7 +122,6 @@ border-radius: 3px; border: 1px solid $theme-fg; - font-weight: bold; color: $theme-fg; background-color: #fff; diff --git a/css/global.css b/css/global.css index 77e0694..edd65fc 100755 --- a/css/global.css +++ b/css/global.css @@ -1,2 +1,2 @@ -section[data-panel-list]{display:block;position:relative;border-radius:3px;border:1px solid #ccc;background-color:#fff;font-size:.8em;color:#000}section[data-panel-list]>div[data-header]{display:flex;position:relative;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;padding:.5em .7em;border-radius:3px 3px 0 0;border-bottom:1px solid #ccc;background-color:#f5f5f5;box-shadow:inset 0 0 5px #eee}section[data-panel-list]>div[data-header]>span,section[data-panel-list]>div[data-header]>button{color:#333;font-weight:bold;line-height:2em}section[data-panel-list]>div[data-header]>button{padding:.1em .7em;border-radius:3px;border:1px solid #555;background:#f5f5f5;transition:all .2s ease-in-out}section[data-panel-list]>div[data-header]>button:hover{background:#333;color:#fff}section[data-panel-list]>div[data-description]{display:block;position:relative;border-bottom:1px solid #ccc;padding:.7em .7em;color:#555}section[data-panel-list]>ul[data-list]{display:flex;position:relative;flex-direction:column;justify-content:flex-start;flex-wrap:nowrap;margin:0;padding:0;list-style:none}section[data-panel-list]>ul[data-list]>li[data-element]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:nowrap;padding:1em}section[data-panel-list]>ul[data-list]>li[data-element]:not(:last-child){border-bottom:1px solid #ccc}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1){display:flex;width:10em;height:6em;flex-direction:column;justify-content:flex-end;align-items:center;background:url("/f/svg/token/st/container/666666") center 1em no-repeat;background-size:auto 50%}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1).active{background-image:url("/f/svg/token/st/container/399ced")}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1)>span{display:block;padding:0 .4em;border-radius:3px;border:1px solid #ddd;font-size:.8em;color:#555;text-transform:uppercase;font-weight:bold}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(n+2){display:flex;position:relative;flex:10em;padding:1em;flex-direction:column;justify-content:flex-start;align-items:flex-start;font-size:1em;color:#000;font-weight:bold}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(n+2)>span[data-prefix]:before{content:attr(data-prefix) ": ";font-weight:normal}section[data-panel-list]>ul[data-list]>li[data-element]>button{padding:.1em .7em;height:2em;border-radius:3px;border:1px solid #de2b08;background:#fff;color:#de2b08;font-weight:bold;transition:all .2s ease-in-out}section[data-panel-list]>ul[data-list]>li[data-element]>button:hover{background:#de2b08;color:#fff}section[data-panel-list]>div[data-add]{display:none;position:relative;padding:1em;border-bottom:1px solid #ccc;background-color:#f5f5f5;font-weight:bold}section[data-panel-list]>div[data-add].active{display:block}section[data-panel-list]>div[data-add]>input[type='text']{margin:1em 0;padding:.3em .5em;border-radius:3px;border:1px solid #999;background-color:#fff;color:#000;font-weight:normal} +section[data-panel-list]{display:block;position:relative;border-radius:3px;border:1px solid #ccc;background-color:#fff;font-size:.8em;color:#000}section[data-panel-list]>div[data-header]{display:flex;position:relative;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;align-items:center;padding:.5em .7em;border-radius:3px 3px 0 0;border-bottom:1px solid #ccc;background-color:#f5f5f5;box-shadow:inset 0 0 5px #eee}section[data-panel-list]>div[data-header]>span,section[data-panel-list]>div[data-header]>button{color:#333;font-weight:bold;line-height:2em}section[data-panel-list]>div[data-header]>button{padding:.1em .7em;border-radius:3px;border:1px solid #555;background:#f5f5f5;transition:all .2s ease-in-out}section[data-panel-list]>div[data-header]>button:hover{background:#333;color:#fff}section[data-panel-list]>div[data-description]{display:block;position:relative;border-bottom:1px solid #ccc;padding:.7em .7em;color:#555}section[data-panel-list]>ul[data-list]{display:flex;position:relative;flex-direction:column;justify-content:flex-start;flex-wrap:nowrap;margin:0;padding:0;list-style:none}section[data-panel-list]>ul[data-list]>li[data-element]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:nowrap;padding:1em}section[data-panel-list]>ul[data-list]>li[data-element]:not(:last-child){border-bottom:1px solid #ccc}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1){display:flex;width:10em;height:6em;flex-direction:column;justify-content:flex-end;align-items:center;background-size:auto 50%}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1)[data-token]{background:url("/f/svg/token/st/container/666666") center 1em no-repeat}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1)[data-token].active{background-image:url("/f/svg/token/st/container/399ced")}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1)[data-user]{background:url("/f/svg/user/st/container/666666") center 1em no-repeat}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1)[data-user].active{background-image:url("/f/svg/user/st/container/399ced")}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(1)>span{display:block;padding:0 .4em;border-radius:3px;border:1px solid #ddd;font-size:.8em;color:#555;text-transform:uppercase;font-weight:bold}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(n+2){display:flex;position:relative;flex:10em;padding:1em;flex-direction:column;justify-content:flex-start;align-items:flex-start;font-size:1em;color:#000;font-weight:bold}section[data-panel-list]>ul[data-list]>li[data-element]>div:nth-child(n+2)>span[data-prefix]:before{content:attr(data-prefix) ": ";font-weight:normal}section[data-panel-list]>ul[data-list]>li[data-element]>button{padding:.1em .7em;height:2em;border-radius:3px;border:1px solid #de2b08;background:#fff;color:#de2b08;font-weight:bold;transition:all .2s ease-in-out}section[data-panel-list]>ul[data-list]>li[data-element]>button:hover{background:#de2b08;color:#fff}section[data-panel-list]>div[data-add]{display:none;position:relative;padding:1em;border-bottom:1px solid #ccc;background-color:#f5f5f5}section[data-panel-list]>div[data-add].active{display:block}section[data-panel-list]>div[data-add]>.label{display:inline-block;width:18em;padding-right:2em;text-align:right}section[data-panel-list]>div[data-add]>input[type='text'],section[data-panel-list]>div[data-add]>input[type='email'],section[data-panel-list]>div[data-add]>input[type='password']{margin:1em 0;padding:.3em .5em;border-radius:3px;border:1px solid #999;background-color:#fff;color:#000;font-weight:normal}section[data-panel-list]>div[data-add]>input[type='text']:focus,section[data-panel-list]>div[data-add]>input[type='email']:focus,section[data-panel-list]>div[data-add]>input[type='password']:focus{border-color:#399ced} /*# sourceMappingURL=global.css.map */ diff --git a/css/global.css.map b/css/global.css.map index 243d961..40f2bf5 100755 --- a/css/global.css.map +++ b/css/global.css.map @@ -1,7 +1,7 @@ { "version": 3, -"mappings": "AAEA,wBAAwB,CACvB,OAAO,CAAE,KAAK,CACd,QAAQ,CAAE,QAAQ,CAElB,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,cAAc,CAEtB,gBAAgB,CAAE,IAAI,CAEtB,SAAS,CAAE,IAAI,CACf,KAAK,CAAE,IAAI,CAIX,yCAAoB,CACnB,OAAO,CAAE,IAAI,CACb,QAAQ,CAAE,QAAQ,CAGlB,cAAc,CAAE,GAAG,CACnB,SAAS,CAAE,MAAM,CACjB,eAAe,CAAE,aAAa,CAC9B,WAAW,CAAE,MAAM,CAEnB,OAAO,CAAE,SAAS,CAElB,aAAa,CAAE,WAAW,CAC1B,aAAa,CAAE,cAAc,CAE7B,gBAAgB,CAAE,OAAO,CACzB,UAAU,CAAE,kBAAkB,CAG9B,+FACU,CACT,KAAK,CAAE,IAAI,CACX,WAAW,CAAE,IAAI,CACjB,WAAW,CAAE,GAAG,CA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AK,CAAE,IAAI,CACX,aAAa,CAAE,GAAG,CAClB,UAAU,CAAE,KAAK,CAKlB,kLAE0B,CACzB,MAAM,CAAE,KAAK,CACb,OAAO,CAAE,SAAS,CAElB,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,cAAc,CAEtB,gBAAgB,CAAE,IAAI,CAEtB,KAAK,CAAE,IAAI,CACX,WAAW,CAAE,MAAM,CAGnB,oMAAO,CACN,YAAY,CC9PG,OAAO", +"sources": ["global.scss","constants.scss"], "names": [], "file": "global.css" } \ No newline at end of file diff --git a/css/global.scss b/css/global.scss index 85f248c..0fce983 100755 --- a/css/global.scss +++ b/css/global.scss @@ -1,3 +1,6 @@ +@import 'constants'; + + /* [1] Panneau d'ajout/suppression d'elements =========================================================*/ section[data-panel-list]{ @@ -118,14 +121,28 @@ section[data-panel-list]{ flex-direction: column; justify-content: flex-end; align-items: center; + + // Image pour token + &[data-token]{ + background: url('/f/svg/token/st/container/666666') center 1em no-repeat; + // Si le token est actif + &.active{ + background-image: url('/f/svg/token/st/container/399ced'); + } + } - background: url('/f/svg/token/st/container/666666') center 1em no-repeat; + + // Image pour utilisateur + &[data-user]{ + background: url('/f/svg/user/st/container/666666') center 1em no-repeat; + // Si le token est actif + &.active{ + background-image: url('/f/svg/user/st/container/399ced'); + } + } + background-size: auto 50%; - // Si le token est actif - &.active{ - background-image: url('/f/svg/token/st/container/399ced'); - } // Texte pour le type d'element @@ -213,11 +230,21 @@ section[data-panel-list]{ background-color: #f5f5f5; - font-weight: bold; + // font-weight: bold; + + /* (5.1) Description du champ de texte */ + & > .label{ + display: inline-block; + width: 18em; + padding-right: 2em; + text-align: right; + } - /* (5.1) Champs de texte */ - & > input[type='text']{ + /* (5.2) Champs de texte */ + & > input[type='text'], + & > input[type='email'], + & > input[type='password']{ margin: 1em 0; padding: .3em .5em; @@ -228,6 +255,11 @@ section[data-panel-list]{ color: #000; font-weight: normal; + + // Animation de @focus + &:focus{ + border-color: $theme-fg-primary; + } } } diff --git a/manager/Database.php b/manager/Database.php index e889d69..41e138c 100755 --- a/manager/Database.php +++ b/manager/Database.php @@ -196,15 +196,15 @@ break; case 'varchar(255)': - return $checker && is_string($value) && strlen($value) <= 255; + return $checker && is_string($value) && strlen($value) <= 255 && strlen($value) > 0; break; case 'varchar(50)': - return $checker && is_string($value) && strlen($value) <= 50; + return $checker && is_string($value) && strlen($value) <= 50 && strlen($value) > 0; break; case 'varchar(30)': - return $checker && is_string($value) && strlen($value) <= 30; + return $checker && is_string($value) && strlen($value) <= 30 && strlen($value) > 0; break; case 'text': diff --git a/src/static/container/user.svg b/src/static/container/user.svg new file mode 100644 index 0000000..cdbac5c --- /dev/null +++ b/src/static/container/user.svg @@ -0,0 +1,54 @@ + +image/svg+xml \ No newline at end of file diff --git a/view/js/settings.js b/view/js/settings.js index 1726e25..95b12ba 100644 --- a/view/js/settings.js +++ b/view/js/settings.js @@ -3,13 +3,13 @@ =========================================================*/ var TOKEN = { add: { // Tout ce qui attrait a l'ajout - toggle: document.getElementById('add-token'), // bouton de toggle pour l'affichage du panel - panel: document.querySelector('div[data-add]'), // formulaire de creation - state: true, // etat (visible ou non) du panel + toggle: document.getElementById('add-token'), // bouton de toggle pour l'affichage du panel + panel: document.querySelector("[data-sublink='tokens'] div[data-add]"), // formulaire de creation + state: true, // etat (visible ou non) du panel - name: document.getElementById('add-name'), // nom du token a creer - duration: document.getElementById('add-duration'), // duree du token a creer (en jours) - submit: document.getElementById('add-submit') // validation de la creation + name: document.querySelector("[data-sublink='tokens'] div[data-add] #add-name"), // nom du token a creer + duration: document.querySelector("[data-sublink='tokens'] div[data-add] #add-duration"), // duree du token a creer (en jours) + submit: document.querySelector("[data-sublink='tokens'] div[data-add] #add-submit") // validation de la creation }, @@ -37,8 +37,8 @@ var TOKEN = { TOKEN.add.submit.addEventListener('click', function(e){ // On redige la requete var request = { // on ecrit la requete - 'path': 'token/generate', - 'name': TOKEN.add.name.value, + 'path': 'token/generate', + 'name': TOKEN.add.name.value, 'duration': TOKEN.add.duration.value }; @@ -52,13 +52,7 @@ var TOKEN = { }, false); - - - - - - -/* (2) Gestion de la suppression de token */ +/* (2) Gestion de la suppression d'un token */ for( var i = 0 ; i < TOKEN.remove.buttons.length ; i++ ){ /* (2.0) Pour chaque bouton supprimer, on attache un evenement */ @@ -76,6 +70,104 @@ for( var i = 0 ; i < TOKEN.remove.buttons.length ; i++ ){ // On lance la requete api.send(request, function(answer){ + console.log(answer); + // Si la suppression effectuee, on recharge la page + if( answer.ModuleError == 0 ) + reload(); + + }); + + }, false); + +} + + + +/* [2] Gestion des utilisateurs +=========================================================*/ +var USERS = { + add: { // Tout ce qui attrait a l'ajout + toggle: document.getElementById('add-user'), // bouton de toggle pour l'affichage du panel + panel: document.querySelector("[data-sublink='users'] div[data-add]"), // formulaire de creation + state: true, // etat (visible ou non) du panel + + login: document.querySelector("[data-sublink='users'] div[data-add] #add-login"), // identifiant de l'utilisateur + password: document.querySelector("[data-sublink='users'] div[data-add] #add-password"), // password de l'utilisateur + mail: document.querySelector("[data-sublink='users'] div[data-add] #add-mail"), // adresse mail de l'utilisateur + permissions: document.querySelector("[data-sublink='users'] div[data-add] #add-permissions"), // permissions de l'utilisateur + reference: document.querySelector("[data-sublink='users'] div[data-add] #add-reference"), // reference de l'utilisateur + submit: document.querySelector("[data-sublink='users'] div[data-add] #add-submit") // validation de la creation + }, + + + remove: { + buttons: document.querySelectorAll('.remove-user') + } +}; + + + + + +/* (1) Gestion de la creation d'utilisateur */ + + /* (1.1) Gestion du toggle pour le panel de creation */ + USERS.add.toggle.addEventListener('click', function(e){ + // Gestion du toggle + if( USERS.add.state ) USERS.add.panel.addClass('active'); + else USERS.add.panel.remClass('active'); + + USERS.add.state = !USERS.add.state; // switch de l'etat pour le toggle + }, false); + + /* (1.2) Gestion de la creation */ + USERS.add.submit.addEventListener('click', function(e){ + // On redige la requete + var request = { // on ecrit la requete + 'path': 'user/create', + 'login': USERS.add.login.value, + 'password': USERS.add.password.value, + 'mail': USERS.add.mail.value, + 'reference': USERS.add.reference.value, + 'permissions': USERS.add.permissions.value + }; + + // On lance la requete + api.send(request, function(answer){ + console.log(answer); + // Si la generation effectuee, on recharge la page + if( answer.ModuleError == 0 ) + reload(); + + }); + }, false); + + + + + + + + +/* (2) Gestion de la suppression d'utilisateur */ +for( var i = 0 ; i < USERS.remove.buttons.length ; i++ ){ + + /* (2.0) Pour chaque bouton supprimer, on attache un evenement */ + USERS.remove.buttons[i].addEventListener('click', function(e){ + var user_id = e.target.parentNode.getData('id'); + + /* (2.1) Si on ne trouve pas l'id, on retourne une erreur */ + if( user_id == false ){ console.warn('id de l\'utilisateur non trouvee'); return; } + + /* (2.2) On lance la suppression */ + var request = { // on ecrit la requete + 'path': 'user/remove', + 'user_id': user_id + }; + + // On lance la requete + api.send(request, function(answer){ + console.log(answer); // Si la suppression effectuee, on recharge la page if( answer.ModuleError == 0 ) reload(); diff --git a/view/settings.php b/view/settings.php index f7db903..841cad7 100755 --- a/view/settings.php +++ b/view/settings.php @@ -6,23 +6,25 @@ use \manager\ResourceDispatcher; use \manager\Database; +debug(); -/* [1] Gestion des tokens -=========================================================*/ -// permission: admin -//=======================================================// -/* (1) On recupere la liste des tokens */ -$req_tokens = new Repo('token/getAll'); -$tokens = $req_tokens->answer(); +/* (1) Gestion des droits */ +if( permission('admin') ){ + + /* [1] Gestion des tokens + =========================================================*/ + // permission: admin + //=======================================================// + + /* (2) On recupere la liste des tokens */ + $req_tokens = new Repo('token/getAll'); + $tokens = $req_tokens->answer(); -/* (2) Gestion des droits */ -if( permission('admin') ){ ?> - -
+ ?>
Gestion des accès distants

@@ -38,8 +40,8 @@ if( permission('admin') ){ ?>
Liste des accès distants actifs. Ils seront automatiquement désactivés a la date d'expiration. Veuillez toutefois les supprimer.
-

-

+ Nom de l'accès
+ Duree de vie (jours)
@@ -52,9 +54,9 @@ if( permission('admin') ){ ?> echo "
  • "; // Si token actif if( !$token['expired'] ) - echo "
    actif
    "; + echo "
    actif
    "; else - echo "
    Expiré
    "; + echo "
    Expiré
    "; echo "
    "; @@ -76,8 +78,79 @@ if( permission('admin') ){ ?>
  • - + dispatch(); + // Si erreur de requete + if( $answer_users->error != ManagerError::Success ) + var_dump( ManagerError::explicit($answer_users->error) ); + // On recupere la liste des utilisateurs + $users = $answer_users->get('users'); -
    - Gestion des utilisateurs -
    + + ?>
    +
    Gestion des utilisateurs

    + + +
    + +
    + Gestion des utilisateurs + +
    + + +
    Liste des utilisateurs de la plateforme. Un administrateur peut tout faire. Un sujet peut compléter ses données et les consulter.
    + +
    + Identifiant
    + Adresse mail
    + Mot de passe
    + Vérification du mot de passe
    + Droits + +
    + +
    + + +
      + + + "; + // Si user actif + if( in_array('admin', $user['permission']) ) + echo "
      Administrateur
      "; + else + echo "
      Sujet
      "; + + + echo "
      "; + echo "".$user['login'].""; + echo "".$user['mail'].""; + echo "".implode(", ", $user['permission']).""; + echo "
      "; + + echo ""; + echo ""; + } + ?> + + + +
    + +
    +
    + + + + \ No newline at end of file