From d6eef611b44a2428622e0d9609aa4c13f60b9030 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 12:23:17 +0200 Subject: [PATCH 1/9] Modification de la couleur du logo --- src/static/icon.svg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/static/icon.svg b/src/static/icon.svg index 2e081eb..bf66e52 100755 --- a/src/static/icon.svg +++ b/src/static/icon.svg @@ -25,9 +25,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="15.839192" - inkscape:cx="44.32972" - inkscape:cy="7.3003018" + inkscape:zoom="5.6" + inkscape:cx="5.5586754" + inkscape:cy="1.5580102" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" @@ -48,7 +48,7 @@ image/svg+xml - + @@ -91,16 +91,16 @@ id="path4154" transform="translate(-0.06313452,0.09470178)" d="m 117.97656,356.31055 -5.06445,18.90234 8.18945,0 0,-3.95508 -3.125,0 0,-14.94726 z" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:25px;font-family:Impact;-inkscape-font-specification:'Impact Condensed';fill:#53d192;fill-opacity:1" /> + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:condensed;font-size:25px;font-family:Impact;-inkscape-font-specification:'Impact Condensed';fill:#399ced;fill-opacity:1" /> From fae96b0fe5f0f652db9a1274235c3d0663b8b097 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 12:45:54 +0200 Subject: [PATCH 2/9] =?UTF-8?q?Correction=20nom=20de=20repo+module=20'user?= =?UTF-8?q?s'=20>=20'user'.=20Correction=20token=20local=20plus=20utile=20?= =?UTF-8?q?(car=20m=C3=AAme=20session=20php/js)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/modules.json | 9 +++++- config/repositories.json | 8 ++++-- index.php | 4 +-- manager/ModuleRequest.php | 1 + manager/module/{users.php => user.php} | 39 +++++++++++++++++++++++--- manager/repo/token.php | 9 ++---- manager/repo/{users.php => user.php} | 35 +++++++++++++++++++++-- 7 files changed, 87 insertions(+), 18 deletions(-) rename manager/module/{users.php => user.php} (57%) rename manager/repo/{users.php => user.php} (57%) diff --git a/config/modules.json b/config/modules.json index 6118761..7f0ca33 100755 --- a/config/modules.json +++ b/config/modules.json @@ -1,6 +1,6 @@ { - "users": { + "user": { "login": { "description": "Connexion avec un login (identifiant ou adresse mail) et un mot de passe.", "permissions": [], @@ -14,6 +14,13 @@ "description": "Deconnexion", "permissions": [], "parameters": {} + }, + + + "getById": { + "description": "Retourne les informations d'un utilisateur d'id donne.", + "permissions": ["admin"], + "parameters": { "id_user" : "id" } } }, diff --git a/config/repositories.json b/config/repositories.json index 3ec46b9..fa0fae3 100755 --- a/config/repositories.json +++ b/config/repositories.json @@ -1,7 +1,11 @@ { - "users": [ - "login" + "user": [ + "login", + "getById", + "getAll", + "create", + "remove" ], "Personnes": [ diff --git a/index.php b/index.php index 0569d3a..fb35d00 100755 --- a/index.php +++ b/index.php @@ -40,7 +40,7 @@ // Si les parametres de connection, on essaie de connecter if( $login_vars ){ - $login = new ModuleRequest('users/login', array( 'login' => $_POST['login'], 'password' => $_POST['password'] )); + $login = new ModuleRequest('user/login', array( 'login' => $_POST['login'], 'password' => $_POST['password'] )); $login_ans = $login->dispatch(); // Si aucune erreur, on dit qu'on vient de se connecter @@ -56,7 +56,7 @@ // Si on se deconnecte if( $logout_vars ){ - $logout = new ModuleRequest('users/logout'); + $logout = new ModuleRequest('user/logout'); $logout_ans = $logout->dispatch(); // Si aucune erreur, on dit qu'on vient de se deconnecter diff --git a/manager/ModuleRequest.php b/manager/ModuleRequest.php index 43fac03..7e3f03e 100755 --- a/manager/ModuleRequest.php +++ b/manager/ModuleRequest.php @@ -194,6 +194,7 @@ =========================================================*/ // Si variable n'existe pas, on cree un tableau vide $params = $post; + // On retire le @path de @params unset($params['path']); diff --git a/manager/module/users.php b/manager/module/user.php similarity index 57% rename from manager/module/users.php rename to manager/module/user.php index 7a80c37..42a0e13 100755 --- a/manager/module/users.php +++ b/manager/module/user.php @@ -6,7 +6,7 @@ use \manager\ManagerError; use \manager\Repo; - class users{ + class user{ /* VERIFICATION DES LOGINS D'UN UTILISATEUR @@ -20,7 +20,7 @@ public static function login($login, $password){ /* [1] On verifie les logins =========================================================*/ - $check = new Repo('users/login', array($login, $password)); + $check = new Repo('user/login', array($login, $password)); $user = $check->answer(); // Si le login/password est incorrect, on retourne une erreur @@ -54,13 +54,44 @@ $_SESSION['permission'] = array(); } + + + + /* RETOURNE L'UTILISATEUR D'ID DONNE + * + * @id_user UID de l'utilisateur en question + * + * @return user Tableau contenant les informations de l'utilisateur + * + */ + public static function getById($user_id){ + /* [1] On recupere les donnees de l'utilisateur + =========================================================*/ + $getUser = new Repo('user/getById', array($user_id)); + $user_data = $getUser->answer(); + + // Si aucun utilisateur n'est trouve + if( $user_data === false ) return array('ModuleError' => ManagerError::ModuleError); + + + /* [2] On met les permissions au bon format (string -> array) + =========================================================*/ + $user_data['permission'] = explode( ',', str_replace(' ', '', $user_data['permission']) ); + + /* [3] Gestion du retour + =========================================================*/ + return array( + 'ModuleError' => ManagerError::Success, + 'user' => $user_data + ); + } + // [x] "login", // [x] "logout", - // [ ] "getById", + // [x] "getById", // [ ] "getAll", // [ ] "create", - // [ ] "edit", // [ ] "remove", } diff --git a/manager/repo/token.php b/manager/repo/token.php index e867dc5..3e967ac 100644 --- a/manager/repo/token.php +++ b/manager/repo/token.php @@ -85,12 +85,7 @@ if( !Database::check('sha1', $token) ) return false; - /* [1] Verification du token local - =========================================================*/ - if( substr($_SESSION['session_token'], 0, 40) == $token ) return true; - - - /* [2] Verification dans la base de donnees + /* [1] Verification dans la base de donnees =========================================================*/ $check = Database::getPDO()->prepare("SELECT id_token, permission FROM api_token @@ -104,7 +99,7 @@ if( $token_info === false ) return false; - /* [3] On retourne le resultat (les permissions du token) + /* [2] On retourne le resultat (les permissions du token) =========================================================*/ return explode( ',', str_replace(' ', '', $token_info['permission']) ); } diff --git a/manager/repo/users.php b/manager/repo/user.php similarity index 57% rename from manager/repo/users.php rename to manager/repo/user.php index 13e8e53..4a60545 100755 --- a/manager/repo/users.php +++ b/manager/repo/user.php @@ -3,7 +3,7 @@ namespace manager\repo; use \manager\Database; - class users{ + class user{ /* VERIFICATION DU LOGIN/PASSWORD D'UN UTILISATEUR @@ -43,10 +43,41 @@ // On retourne le resultat - return $result; + return Database::delNumeric( $result ); } + + + + /* RETOURNE LES DONNEES D'UN UTILISATEUR D'ID DONNE + * + * @id_user UID de l'utilisateur en question + * + * @return user Tableau contenant les donnees de l'utilisateur s'il existe sinon retourne FALSE + * + */ + public static function getById($id_user){ + /* [1] On effectue la requete + =========================================================*/ + $getUser = Database::getPDO()->prepare("SELECT id_user, login, mail, permission + FROM users + WHERE id_user = :id_user"); + $getUser->execute(array( ':id_user' => $id_user )); + + + /* [2] On recupere le resultat de la requete + =========================================================*/ + $userData = $getUser->fetch(); + + // Si l'utilisateur n'existe pas, on retourne FALSE + if( $userData === false ) return false; + + /* [3] Gestion du retour + =========================================================*/ + return Database::delNumeric( $userData ); + } + } From 1887be36cd5905de80de2c211845b091cc143d57 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 12:50:34 +0200 Subject: [PATCH 3/9] Suppression des tokens locaux, utilisation de la connexion courante. --- manager/ModuleRequest.php | 9 ++++++--- manager/ResourceDispatcher.php | 11 ----------- view/js/settings.js | 4 ++-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/manager/ModuleRequest.php b/manager/ModuleRequest.php index 7e3f03e..3caa037 100755 --- a/manager/ModuleRequest.php +++ b/manager/ModuleRequest.php @@ -177,13 +177,16 @@ public static function fromPost($post){ /* [0] Verification de l'authentification =========================================================*/ - /* (1) Si le token n'est pas dans le header */ - if( !isset($_SERVER['PHP_AUTH_DIGEST']) ){ + /* (1) Si le token n'est pas dans le header ET qu'on est pas connecte */ + if( !isset($_SERVER['PHP_AUTH_DIGEST']) && !connected() ){ $tmp = new ModuleRequest(); $tmp->error = ManagerError::TokenError; return $tmp; } + // On definit le token + $token = isset($_SERVER['PHP_AUTH_DIGEST']) ? $_SERVER['PHP_AUTH_DIGEST'] : null; + /* [1] On verifie que le @path est renseigne =========================================================*/ @@ -202,7 +205,7 @@ /* [3] On retourne une instance de =========================================================*/ // On cree notre requete avec le token - return new ModuleRequest($post['path'], $params, $_SERVER['PHP_AUTH_DIGEST']); + return new ModuleRequest($post['path'], $params, $token); } diff --git a/manager/ResourceDispatcher.php b/manager/ResourceDispatcher.php index 1999236..e88e52d 100755 --- a/manager/ResourceDispatcher.php +++ b/manager/ResourceDispatcher.php @@ -249,17 +249,6 @@ // On recupere le contenu $content = file_get_contents($this->path); - - - //////////////////////////////////////// - ///////////// SI FICHIER JS //////////// - //////////////////////////////////////// - if( $this->flags['extension'] == 'js' ) - $content = 'var js_access_token = "'. substr(session_id(), 0, 23) .'";' . "\n\n" . $content; - - - - // On affiche tout echo str_replace( '', $this->stylesheet.'', $content ); } diff --git a/view/js/settings.js b/view/js/settings.js index c7d8b36..1726e25 100644 --- a/view/js/settings.js +++ b/view/js/settings.js @@ -48,7 +48,7 @@ var TOKEN = { if( answer.ModuleError == 0 ) reload(); - }, js_access_token); + }); }, false); @@ -80,7 +80,7 @@ for( var i = 0 ; i < TOKEN.remove.buttons.length ; i++ ){ if( answer.ModuleError == 0 ) reload(); - }, js_access_token); + }); }, false); From d54086c049bc8610de1390df72ee4d38d0c8ca38 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 14:59:21 +0200 Subject: [PATCH 4/9] =?UTF-8?q?Cr=C3=A9ation=20d'utilisateur=20fonctionnel?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Création des utilisateurs avec login/mail/password/reference/permission. Gestion de l'unicité du login, du mail, de la reference. Vérification de création. --- automate.php | 1 - config/modules.json | 28 +++++++- config/repositories.json | 1 + manager/Database.php | 6 +- manager/ModuleRequest.php | 2 +- manager/module/user.php | 68 +++++++++++++++++++ manager/repo/user.php | 137 +++++++++++++++++++++++++++++++++++++- 7 files changed, 233 insertions(+), 10 deletions(-) diff --git a/automate.php b/automate.php index a9b1327..0853128 100755 --- a/automate.php +++ b/automate.php @@ -79,6 +79,5 @@ // )); // var_dump($response); - ?> \ No newline at end of file diff --git a/config/modules.json b/config/modules.json index 7f0ca33..e11fcde 100755 --- a/config/modules.json +++ b/config/modules.json @@ -5,8 +5,8 @@ "description": "Connexion avec un login (identifiant ou adresse mail) et un mot de passe.", "permissions": [], "parameters": { - "login": { "description": "Identifiant ou adresse mail", "type": "varchar(255)" }, - "password": { "description": "Mot de passe", "type":"text" } + "login": { "description": "Identifiant ou adresse mail", "type": "varchar(255)" }, + "password": { "description": "Mot de passe", "type":"text" } } }, @@ -20,7 +20,29 @@ "getById": { "description": "Retourne les informations d'un utilisateur d'id donne.", "permissions": ["admin"], - "parameters": { "id_user" : "id" } + "parameters": { + "id_user": { "description": "UID de l'utilisateur recherche.", "type": "id" } + } + }, + + + "getAll": { + "description": "Retourne les informations de tous les utilisateurs.", + "permissions": ["admin"], + "parameters": {} + }, + + + "create": { + "description": "Creation d'un nouvel utilisateur.", + "permissions": ["admin"], + "parameters": { + "login" : { "description": "Login de l'utilisateur, 30 caracteres maximum.", "type": "varchar(30)" }, + "password" : { "description": "Mot de passe de l'utilisateur.", "type": "text" }, + "mail" : { "description": "Adresse mail de l'utilisateur.", "type": "mail" }, + "reference" : { "description": "UID d'une personne d'un sondage, peut etre vide.", "type": "text" }, + "permissions": { "description": "Liste des permissions de l'utilisateur.", "type": "text" } + } } }, diff --git a/config/repositories.json b/config/repositories.json index fa0fae3..8ac9f7a 100755 --- a/config/repositories.json +++ b/config/repositories.json @@ -4,6 +4,7 @@ "login", "getById", "getAll", + "checkUnique", "create", "remove" ], diff --git a/manager/Database.php b/manager/Database.php index f50a475..e889d69 100755 --- a/manager/Database.php +++ b/manager/Database.php @@ -218,9 +218,9 @@ case 'sha1': return $checker && is_string($value) && preg_match('/^[\da-f]{40}$/i', $value); break; - - case 'user.status': - return $checker && is_numeric($value) && floor($value) == $value && $value >= 0 && $value <= 100; + + case 'array': + return $checker && is_array($value); break; } diff --git a/manager/ModuleRequest.php b/manager/ModuleRequest.php index 3caa037..775d2b5 100755 --- a/manager/ModuleRequest.php +++ b/manager/ModuleRequest.php @@ -350,7 +350,7 @@ // Si le type n'est pas defini, on reboucle if( !isset($paramsdata['type']) ) continue; - + // Si la verification est fausse, on retourne faux if( !Database::check($paramsdata['type'], $params[$name]) ) return false; } diff --git a/manager/module/user.php b/manager/module/user.php index 42a0e13..38145f5 100755 --- a/manager/module/user.php +++ b/manager/module/user.php @@ -86,6 +86,74 @@ ); } + + + + /* RETOURNE LA LISTE DE TOUS LES UTILISATEURS + * + * @return users Tableau contenant les informations de tous les utilisateurs + * + */ + public static function getAll(){ + /* [1] On recupere les donnees des utilisateurs + =========================================================*/ + $getUsers = new Repo('user/getAll'); + $users_data = $getUsers->answer(); + + // Si aucun utilisateur n'est trouve + if( $users_data === false ) return array('ModuleError' => ManagerError::ModuleError); + + /* [2] On met les permissions au bon format (string -> array) + =========================================================*/ + foreach($users_data as $i=>$user) + $users_data[$i]['permission'] = explode( ',', str_replace(' ', '', $user['permission']) ); + + /* [3] Gestion du retour + =========================================================*/ + return array( + 'ModuleError' => ManagerError::Success, + 'users' => $users_data + ); + } + + + + + + /* CREE UN UTILISATEUR + * + * @login Login (identifiant) de l'utilisateur + * @password Password de l'utilisateur + * @mail Adresse mail de l'utilisateur + * @reference Reference vers une Personne (sinon NULL) + * @permissions Liste des permissions de l'utilisateur + * + * @return id_user Renvoie l'id de l'utilisateur cree + * + */ + public static function create($login, $password, $mail, $reference, $permissions){ + /* [0] Verification et formattage des INPUT + =========================================================*/ + $password = sessionManager::sha1($password); + $reference = (is_numeric($reference)) ? (int) $reference : null; + $permissions = explode( ',', str_replace(' ', '', $permissions) ); + + /* [1] Creation de l'utilisateur + =========================================================*/ + $create = new Repo('user/create', array($login, $password, $mail, $reference, $permissions)); + $created_id = $create->answer(); + + // Si erreur de creation, on retourne une erreur + if( $created_id === false ) return array( 'ModuleError' => ManagerError::ModuleError ); + + /* [2] Gestion du retour + =========================================================*/ + return array( + 'ModuleError' => ManagerError::Success, + 'id_user' => $created_id + ); + } + // [x] "login", // [x] "logout", // [x] "getById", diff --git a/manager/repo/user.php b/manager/repo/user.php index 4a60545..6b32bec 100755 --- a/manager/repo/user.php +++ b/manager/repo/user.php @@ -2,6 +2,7 @@ namespace manager\repo; use \manager\Database; + use \manager\sessionManager; class user{ @@ -32,7 +33,7 @@ $check->execute(array( ':username' => $login, ':mail' => $login, - ':password' => sha1($password) + ':password' => sessionManager::sha1($password) )); $result = $check->fetch(); @@ -75,7 +76,139 @@ /* [3] Gestion du retour =========================================================*/ - return Database::delNumeric( $userData ); + return Database::delNumeric( $userData, true ); + } + + + + + + /* RETOURNE LES DONNEES DE TOUS LES UTILISATEURS + * + * @return users Tableau contenant les donnees des utilisateurs, retourne FALSE si erreur + * + */ + public static function getAll(){ + /* [1] On effectue la requete + =========================================================*/ + $getUsers = Database::getPDO()->query("SELECT id_user, login, mail, permission + FROM users + ORDER BY login ASC"); + + + /* [2] On recupere le resultat de la requete + =========================================================*/ + $usersData = $getUsers->fetchAll(); + + // Si l'utilisateur n'existe pas, on retourne FALSE + if( $usersData === false ) return false; + + /* [3] Gestion du retour + =========================================================*/ + return Database::delNumeric( $usersData ); + } + + + + + /* CREE UN UTILISATEUR + * + * @login Login (identifiant) de l'utilisateur + * @password Password de l'utilisateur + * @mail Adresse mail de l'utilisateur + * @reference Reference vers une Personne (sinon NULL) + * @permissions Liste des permissions de l'utilisateur + * + * @return id_user Renvoie l'id de l'utilisateur cree ou FALSE si erreur + * + */ + public static function create($login, $password, $mail, $reference, $permissions){ + /* [0] Verification et formattage des INPUT + =========================================================*/ + $checkInput = Database::check('sha1', $password); + $checkInput = $checkInput && ( Database::check('int', $reference) || $reference === null ); + $checkInput = $checkInput && Database::check('array', $permissions); + + // Si erreur en entree, on retourne FAUX + if( !$checkInput ) return false; + + // On formatte les permissions (array -> string) + $permissions = implode(',', $permissions); + + + /* [1] On verifie que le login/mail et reference sont uniques + =========================================================*/ + $checkUnique = Database::getPDO()->prepare("SELECT id_user + FROM users + WHERE login = :login + OR mail = :mail + OR ( reference = :reference AND reference is not NULL )"); + $checkUnique->execute(array( + ':login' => $login, + ':mail' => $mail, + ':reference' => $reference + )); + $unique = $checkUnique->fetch() === false; + + // Si un utilisateur a le meme LOGIN/MAIL ou REFERENCE, on retourne une erreur + if( !$unique ) return false; + + + /* [2] Creation de l'utilisateur + =========================================================*/ + /* (1) Si reference NULL */ + if( $reference == null ){ + + $create = Database::getPDO()->prepare("INSERT INTO users(id_user, login, password, mail, reference, permission) + VALUES(DEFAULT, :login, :password, :mail, NULL, :permission)"); + $create->execute(array( + ':login' => $login, + ':password' => $password, + ':mail' => $mail, + ':permission' => $permissions + )); + + /* (2) Si reference est defini */ + }else{ + + $create = Database::getPDO()->prepare("INSERT INTO users(id_user, login, password, mail, reference, permission) + VALUES(DEFAULT, :login, :password, :mail, :reference, :permission)"); + $create->execute(array( + ':login' => $login, + ':password' => $password, + ':mail' => $mail, + ':reference' => (int) $reference, + ':permission' => $permissions + )); + + } + + /* [3] Verification de la creation + recuperation id + =========================================================*/ + $checkCreate = Database::getPDO()->prepare("SELECT id_user + FROM users + WHERE login = :login + AND password = :password + AND mail = :mail + AND ( reference = :reference OR reference is NULL ) + AND permission = :permission"); + $checkCreate->execute(array( + ':login' => $login, + ':password' => $password, + ':mail' => $mail, + ':reference' => (int) $reference, + ':permission' => $permissions + )); + + // On recupere l'id de l'utilisateur + $id_user = $checkCreate->fetch(); + + // Si erreur, on retourne FALSE + if( $id_user === false ) return false; + + /* [4] Gestion du retour + =========================================================*/ + return $id_user['id_user']; } } From 11edcc60e1d724a838764bf5ab7dbab712cfae9f Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 15:05:23 +0200 Subject: [PATCH 5/9] minmod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correction design @hover du menu quand déjà .active. Affichage du chart. --- css/menu-side.css | 2 +- css/menu-side.css.map | 2 +- css/menu-side.scss | 4 ++-- view/charts.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/css/menu-side.css b/css/menu-side.css index ba9d15e..342b193 100755 --- a/css/menu-side.css +++ b/css/menu-side.css @@ -1,2 +1,2 @@ -#WRAPPER>#MENU-SIDE>span{display:block;position:relative;width:calc( 100% - 2*1em - 2*1.5em );padding:.8em 1.5em;padding-left:calc( 1.5em + 2*1em );border-bottom:1px solid transparent;background:url("/f/svg/circle/st/menu-side/29282e") 1em center no-repeat,url("/f/svg/sub/st/menu-side/aaaaaa") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em;color:#666;font-size:.85em;transition:color .2s ease-in-out, background .2s ease-in-out, box-shadow .2s ease-in-out, border .2s ease-in-out;cursor:pointer}#WRAPPER>#MENU-SIDE>span.active{background:url("/f/svg/circle/st/menu-side/399ced") 1em center no-repeat,url("/f/svg/sub-active/st/menu-side/ffffff") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em}#WRAPPER>#MENU-SIDE>span:hover{background:url("/f/svg/circle/st/menu-side/29282e") 1em center no-repeat,url("/f/svg/sub/st/menu-side/ffffff") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em}#WRAPPER>#MENU-SIDE>span>svg,#WRAPPER>#MENU-SIDE>span>svg *{position:absolute;top:calc( 50% - 1em/2 );left:1.5em;width:1em;height:1em;fill:#939393 !important;transition:fill .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:hover,#WRAPPER>#MENU-SIDE>span.active{border-bottom-color:#2290eb;background-color:#399ced;color:#fff}#WRAPPER>#MENU-SIDE>span:hover>svg,#WRAPPER>#MENU-SIDE>span:hover>svg *,#WRAPPER>#MENU-SIDE>span.active>svg,#WRAPPER>#MENU-SIDE>span.active>svg *{fill:#fff !important}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span{display:block;position:relative;width:calc( 100% - 1.5em - 2.5em );padding:.5em 1.5em;padding-left:2.5em;background:#313541 url("/f/svg/sub/st/menu-side/888888") 1.5em center no-repeat;background-size:.5em;color:#7a7a7a;font-size:.85em;cursor:pointer;transition:color .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span:hover,#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span.active{color:#fff;background-image:url("/f/svg/sub/st/menu-side/ffffff")}#WRAPPER>#MENU-SIDE>span:not(.icon):not(.active)+div.sub>span{display:none} +#WRAPPER>#MENU-SIDE>span{display:block;position:relative;width:calc( 100% - 2*1em - 2*1.5em );padding:.8em 1.5em;padding-left:calc( 1.5em + 2*1em );border-bottom:1px solid transparent;background:url("/f/svg/circle/st/menu-side/29282e") 1em center no-repeat,url("/f/svg/sub/st/menu-side/aaaaaa") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em;color:#666;font-size:.85em;transition:color .2s ease-in-out, background .2s ease-in-out, box-shadow .2s ease-in-out, border .2s ease-in-out;cursor:pointer}#WRAPPER>#MENU-SIDE>span.active{background:url("/f/svg/circle/st/menu-side/399ced") 1em center no-repeat,url("/f/svg/sub-active/st/menu-side/ffffff") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em}#WRAPPER>#MENU-SIDE>span:not(.active):hover{background:url("/f/svg/circle/st/menu-side/29282e") 1em center no-repeat,url("/f/svg/sub/st/menu-side/ffffff") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em}#WRAPPER>#MENU-SIDE>span>svg,#WRAPPER>#MENU-SIDE>span>svg *{position:absolute;top:calc( 50% - 1em/2 );left:1.5em;width:1em;height:1em;fill:#939393 !important;transition:fill .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.active):hover,#WRAPPER>#MENU-SIDE>span.active{border-bottom-color:#2290eb;background-color:#399ced;color:#fff}#WRAPPER>#MENU-SIDE>span:not(.active):hover>svg,#WRAPPER>#MENU-SIDE>span:not(.active):hover>svg *,#WRAPPER>#MENU-SIDE>span.active>svg,#WRAPPER>#MENU-SIDE>span.active>svg *{fill:#fff !important}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span{display:block;position:relative;width:calc( 100% - 1.5em - 2.5em );padding:.5em 1.5em;padding-left:2.5em;background:#313541 url("/f/svg/sub/st/menu-side/888888") 1.5em center no-repeat;background-size:.5em;color:#7a7a7a;font-size:.85em;cursor:pointer;transition:color .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span:hover,#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span.active{color:#fff;background-image:url("/f/svg/sub/st/menu-side/ffffff")}#WRAPPER>#MENU-SIDE>span:not(.icon):not(.active)+div.sub>span{display:none} /*# sourceMappingURL=menu-side.css.map */ diff --git a/css/menu-side.css.map b/css/menu-side.css.map index 80389e8..20922bd 100755 --- a/css/menu-side.css.map +++ b/css/menu-side.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAMC,wBAAQ,CACP,OAAO,CAAE,KAAK,CACd,QAAQ,CAAE,QAAQ,CACjB,KAAK,CAAE,8BAA8B,CAEtC,OAAO,CAAE,UAAU,CACnB,YAAY,CAAE,qBAAqB,CAEnC,aAAa,CAAE,qBAAqB,CAEpC,UAAU,CAAE,gIAC4D,CACxE,eAAe,CAAE,kBAAkB,CAiBnC,KAAK,CAAE,IAAI,CACX,SAAS,CAAE,KAAK,CAEhB,UAAU,CAAE,qGAAqG,CAEjH,MAAM,CAAE,OAAO,CAlBf,+BAAQ,CACP,UAAU,CAAE,uIACkE,CAC9E,eAAe,CAAE,kBAAkB,CAIpC,8BAAO,CACN,UAAU,CAAE,gIAC2D,CACvE,eAAe,CAAE,kBAAkB,CA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AAE,QAAQ,CACjB,GAAG,CAAE,mBAAmB,CACxB,IAAI,CAAE,KAAK,CACX,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,GAAG,CAEZ,IAAI,CAAE,kBAAmB,CACzB,UAAU,CAAE,oBAAoB,CAKjC,2EACQ,CACP,mBAAmB,CAAE,OAA4B,CAGjD,gBAAgB,CCvDA,OAAO,CDwDvB,KAAK,CClDU,IAAO,CDoDtB,2KAAkB,CACjB,IAAI,CAAE,eAAe,CAYxB,gDAAkC,CACjC,OAAO,CAAE,KAAK,CACd,QAAQ,CAAE,QAAQ,CACjB,KAAK,CAAE,4BAA4B,CAEpC,OAAO,CAAE,UAAU,CACnB,YAAY,CAAE,KAAK,CAEnB,UAAU,CAAE,oEAAqE,CACjF,eAAe,CAAE,IAAI,CAErB,KAAK,CAAE,OAAoB,CAC3B,SAAS,CAAE,KAAK,CAEhB,MAAM,CAAE,OAAO,CAEf,UAAU,CAAE,qBAAqB,CAGjC,8GACQ,CACP,KAAK,CCtFU,IAAO,CDuFtB,gBAAgB,CAAE,qCAAqC,CAKzD,6DAA+C,CAC9C,OAAO,CAAE,IAAI", "sources": ["menu-side.scss","constants.scss"], "names": [], "file": "menu-side.css" diff --git a/css/menu-side.scss b/css/menu-side.scss index bd63dcf..c31c8ea 100755 --- a/css/menu-side.scss +++ b/css/menu-side.scss @@ -27,7 +27,7 @@ } // Modification de la couleur de la fleche pour @hover - &:hover{ + &:not(.active):hover{ background: url('/f/svg/circle/st/menu-side/29282e') 1em center no-repeat, url('/f/svg/sub/st/menu-side/ffffff') right 1.5em center no-repeat; background-size: 2em 2em, .5em .5em; @@ -54,7 +54,7 @@ /* (2) @hover ou .active -> survol souris ou active */ - &:hover, + &:not(.active):hover, &.active{ border-bottom-color: darken($theme-fg-primary, 5); // box-shadow: inset 0 0 1em darken($dark-bg-primary, 1); diff --git a/view/charts.php b/view/charts.php index be65c22..dcf6e26 100755 --- a/view/charts.php +++ b/view/charts.php @@ -39,7 +39,7 @@ $render = $answer->get('render'); ?> -
+
CERCLE DES RELATIONS
\ No newline at end of file From f255bdb6a1004af0e73523540e659993d9c28a1b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 16:23:08 +0200 Subject: [PATCH 6/9] =?UTF-8?q?Cr=C3=A9ation=20d'utilisateur=20(interface)?= =?UTF-8?q?=20en=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 --- a/css/container.css.map +++ b/css/container.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAMC,2BAAW,CACV,OAAO,CAAE,IAAI,CAKb,QAAQ,CAAE,QAAQ,CAClB,SAAS,CAAE,CAAC,CAEZ,OAAO,CAAE,GAAG,CAEZ,aAAa,CAAE,GAAG,CAElB,gBAAgB,CAAE,IAAI,CAEtB,KAAK,CAAE,IAAI,CACX,SAAS,CAAE,GAAG,CAEd,MAAM,CAAE,cAAc,CAdtB,kCAAQ,CAAE,OAAO,CAAE,KAAK,CAoBxB,8BAAI,CACH,KAAK,CAAE,OAAsB,CAC7B,SAAS,CAAE,KAAK,CAChB,cAAc,CAAE,SAAS,CACzB,WAAW,CAAE,GAAG,CAChB,cAAc,CAAE,IAAI,CAEpB,MAAM,CAAE,CAAC,CACT,OAAO,CAAE,CAAC,CAEV,qCAAQ,CAAC,OAAO,CAAC,IAAI,CACrB,oCAAO,CAAC,OAAO,CAAC,IAAI,CAGpB,qCAAQ,CACP,UAAU,CAAE,MAAM,CAUpB,kGACwB,CACvB,OAAO,CAAE,IAAI,CAId,wHACqC,CACpC,YAAY,CAAE,IAAI,CAGlB,qBAAqB,CAAE,IAAI,CAC3B,mBAAmB,CAAI,IAAI,CAC3B,kBAAkB,CAAK,IAAI,CAC3B,gBAAgB,CAAO,IAAI,CAC3B,eAAe,CAAQ,IAAI,CAC3B,WAAW,CAAY,IAAI,CAI3B,sIAAQ,CACP,OAAO,CAAE,EAAE,CACX,OAAO,CAAE,YAAY,CACrB,QAAQ,CAAE,QAAQ,CACjB,GAAG,CAAE,IAAI,CACT,IAAI,CAAE,KAAK,CACX,KAAK,CAAE,qBAAqB,CAC5B,MAAM,CAAE,qBAAqB,CAE9B,aAAa,CAAE,SAAS,CACxB,MAAM,CAAE,oBAA6B,CAErC,UAAU,CAAE,4BAA4B,CACxC,gBAAgB,CAAE,IAAI,CACtB,e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IU,OAAO,CDuItB,gBAAgB,CAAE,IAAI,CAItB,6HAAO,CACN,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,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AAE,KAAK,CAcf,6CAAU,CACT,OAAO,CAAE,YAAY,CACrB,KAAK,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 From 53d66b812d7f28b9067a52dea77610cb5d21bb3c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 18:33:04 +0200 Subject: [PATCH 7/9] =?UTF-8?q?Gestion=20de=20la=20couleur=20de=20@hover?= =?UTF-8?q?=20diff=C3=A9rente=20de=20.active.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/menu-side.css | 2 +- css/menu-side.css.map | 2 +- css/menu-side.scss | 33 ++++++++++++++------------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/css/menu-side.css b/css/menu-side.css index 342b193..c75e07a 100755 --- a/css/menu-side.css +++ b/css/menu-side.css @@ -1,2 +1,2 @@ -#WRAPPER>#MENU-SIDE>span{display:block;position:relative;width:calc( 100% - 2*1em - 2*1.5em );padding:.8em 1.5em;padding-left:calc( 1.5em + 2*1em );border-bottom:1px solid transparent;background:url("/f/svg/circle/st/menu-side/29282e") 1em center no-repeat,url("/f/svg/sub/st/menu-side/aaaaaa") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em;color:#666;font-size:.85em;transition:color .2s ease-in-out, background .2s ease-in-out, box-shadow .2s ease-in-out, border .2s ease-in-out;cursor:pointer}#WRAPPER>#MENU-SIDE>span.active{background:url("/f/svg/circle/st/menu-side/399ced") 1em center no-repeat,url("/f/svg/sub-active/st/menu-side/ffffff") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em}#WRAPPER>#MENU-SIDE>span:not(.active):hover{background:url("/f/svg/circle/st/menu-side/29282e") 1em center no-repeat,url("/f/svg/sub/st/menu-side/ffffff") right 1.5em center no-repeat;background-size:2em 2em, .5em .5em}#WRAPPER>#MENU-SIDE>span>svg,#WRAPPER>#MENU-SIDE>span>svg *{position:absolute;top:calc( 50% - 1em/2 );left:1.5em;width:1em;height:1em;fill:#939393 !important;transition:fill .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.active):hover,#WRAPPER>#MENU-SIDE>span.active{border-bottom-color:#2290eb;background-color:#399ced;color:#fff}#WRAPPER>#MENU-SIDE>span:not(.active):hover>svg,#WRAPPER>#MENU-SIDE>span:not(.active):hover>svg *,#WRAPPER>#MENU-SIDE>span.active>svg,#WRAPPER>#MENU-SIDE>span.active>svg *{fill:#fff !important}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span{display:block;position:relative;width:calc( 100% - 1.5em - 2.5em );padding:.5em 1.5em;padding-left:2.5em;background:#313541 url("/f/svg/sub/st/menu-side/888888") 1.5em center no-repeat;background-size:.5em;color:#7a7a7a;font-size:.85em;cursor:pointer;transition:color .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span:hover,#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span.active{color:#fff;background-image:url("/f/svg/sub/st/menu-side/ffffff")}#WRAPPER>#MENU-SIDE>span:not(.icon):not(.active)+div.sub>span{display:none} +#WRAPPER>#MENU-SIDE>span{display:block;position:relative;width:calc( 100% - 2*1em - 2*1.5em );padding:.8em 1.5em;padding-left:calc( 1.5em + 2*1em );border-bottom:1px solid transparent;background:url("/f/svg/sub/st/menu-side/aaaaaa") right 1.5em center no-repeat;background-size:.5em .5em;color:#666;font-size:.85em;transition:color .2s ease-in-out, background .2s ease-in-out, box-shadow .2s ease-in-out, border .2s ease-in-out;cursor:pointer}#WRAPPER>#MENU-SIDE>span>svg,#WRAPPER>#MENU-SIDE>span>svg *{position:absolute;top:calc( 50% - 1em/2 );left:1.5em;width:1em;height:1em;fill:#939393 !important;transition:fill .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.active):hover{background-image:url("/f/svg/sub/st/menu-side/000000");color:#000}#WRAPPER>#MENU-SIDE>span:not(.active):hover>svg,#WRAPPER>#MENU-SIDE>span:not(.active):hover>svg *{fill:#000 !important}#WRAPPER>#MENU-SIDE>span.active{border-bottom-color:#2290eb;background-color:#399ced;background-image:url("/f/svg/sub-active/st/menu-side/ffffff");color:#fff}#WRAPPER>#MENU-SIDE>span.active>svg,#WRAPPER>#MENU-SIDE>span.active>svg *{fill:#fff !important}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span{display:block;position:relative;width:calc( 100% - 1.5em - 2.5em );padding:.5em 1.5em;padding-left:2.5em;background:#313541 url("/f/svg/sub/st/menu-side/888888") 1.5em center no-repeat;background-size:.5em;color:#7a7a7a;font-size:.85em;cursor:pointer;transition:color .2s ease-in-out}#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span:hover,#WRAPPER>#MENU-SIDE>span:not(.icon)+div.sub>span.active{color:#fff;background-image:url("/f/svg/sub/st/menu-side/ffffff")}#WRAPPER>#MENU-SIDE>span:not(.icon):not(.active)+div.sub>span{display:none} /*# sourceMappingURL=menu-side.css.map */ diff --git a/css/menu-side.css.map b/css/menu-side.css.map index 20922bd..29f0c20 100755 --- a/css/menu-side.css.map +++ b/css/menu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scss"], "names": [], "file": "menu-side.css" diff --git a/css/menu-side.scss b/css/menu-side.scss index c31c8ea..768f87f 100755 --- a/css/menu-side.scss +++ b/css/menu-side.scss @@ -14,24 +14,9 @@ border-bottom: 1px solid transparent; - background: url('/f/svg/circle/st/menu-side/29282e') 1em center no-repeat, - url('/f/svg/sub/st/menu-side/aaaaaa') right 1.5em center no-repeat; - background-size: 2em 2em, .5em .5em; + background: url('/f/svg/sub/st/menu-side/aaaaaa') right 1.5em center no-repeat; + background-size: .5em .5em; - - // Modification du sens de la fleche quand le sous-menu est deroule - &.active{ - background: url('/f/svg/circle/st/menu-side/399ced') 1em center no-repeat, - url('/f/svg/sub-active/st/menu-side/ffffff') right 1.5em center no-repeat; - background-size: 2em 2em, .5em .5em; - } - - // Modification de la couleur de la fleche pour @hover - &:not(.active):hover{ - background: url('/f/svg/circle/st/menu-side/29282e') 1em center no-repeat, - url('/f/svg/sub/st/menu-side/ffffff') right 1.5em center no-repeat; - background-size: 2em 2em, .5em .5em; - } color: #666; font-size: .85em; @@ -53,13 +38,23 @@ } - /* (2) @hover ou .active -> survol souris ou active */ - &:not(.active):hover, + /* (2) Animation de @hover */ + &:not(.active):hover{ + background-image: url('/f/svg/sub/st/menu-side/000000'); + color: #000; + + & > svg, & > svg *{ + fill: #000 !important; + } + } + + /* (3) Animation quand .active */ &.active{ border-bottom-color: darken($theme-fg-primary, 5); // box-shadow: inset 0 0 1em darken($dark-bg-primary, 1); background-color: $theme-fg-primary; + background-image: url('/f/svg/sub-active/st/menu-side/ffffff'); color: $dark-fg-primary; & > svg, & > svg *{ From ba96f05563eab546c4514e6af23c9f233a0f49ee Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 18:38:37 +0200 Subject: [PATCH 8/9] =?UTF-8?q?Cr=C3=A9ation=20d'utilisateur=20v1=20niveau?= =?UTF-8?q?=20interface=20ok.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/global.css | 2 +- css/global.css.map | 2 +- css/global.scss | 31 +++++++++---- src/static/container/token.svg | 44 +++++++++++------- src/static/container/user.svg | 85 ++++++++++++++++++++++++---------- view/dashboard.php | 22 ++------- view/js/settings.js | 25 ++++++---- view/settings.php | 11 +++-- 8 files changed, 138 insertions(+), 84 deletions(-) diff --git a/css/global.css b/css/global.css index edd65fc..3be91e5 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-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} +#WRAPPER>#CONTAINER section[data-panel-list]{display:block;position:relative;border-radius:3px;border:1px solid #ccc;background-color:#fff;font-size:.9em;color:#000}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-header]>span,#WRAPPER>#CONTAINER section[data-panel-list]>div[data-header]>button{color:#333;font-weight:bold;line-height:2em}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-header]>button{padding:.1em .7em;border-radius:3px;border:1px solid #777;background:#ecf0f1;transition:all .1s ease-in-out;color:#777}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-header]>button:hover{background:#399ced;border-color:#1484df;color:#fff}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-description]{display:block;position:relative;border-bottom:1px solid #ccc;padding:.7em .7em;color:#555}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER section[data-panel-list]>ul[data-list]>li[data-element]:not(:last-child){border-bottom:1px solid #ccc}#WRAPPER>#CONTAINER 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%}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER 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")}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER 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")}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER 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}#WRAPPER>#CONTAINER section[data-panel-list]>ul[data-list]>li[data-element]>button:hover{background:#de2b08;color:#fff}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]{display:none;position:relative;padding:1em;border-bottom:1px solid #ccc;background-color:#ecf0f1}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add].active{display:block}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>.label{display:inline-block;width:18em;padding-right:2em;text-align:right;color:#3b494c}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='text'],#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='email'],#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='password']{margin:1em 0;padding:.5em .7em;border-radius:3px;border:1px solid #ddd;background-color:#fff;color:#000;font-weight:normal}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='text']:focus,#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='email']:focus,#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='password']:focus{border-color:#399ced;box-shadow:inset 0 0 2px #ddd}#WRAPPER>#CONTAINER section[data-panel-list]>div[data-add]>input[type='submit']:hover{background:#399ced;border-color:#1484df;color:#fff} /*# sourceMappingURL=global.css.map */ diff --git a/css/global.css.map b/css/global.css.map index 40f2bf5..00de1c8 100755 --- a/css/global.css.map +++ b/css/global.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "AAKA,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,CAIjB,gDAAU,CACT,OAAO,CAAE,SAAS,CAElB,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,cAAc,CAEtB,UAAU,CAAE,OAAO,CAEnB,UAAU,CAAE,mBAAmB,CAG/B,sDAAO,CACN,UAAU,CAAE,IAAI,CAChB,KAAK,CAAE,IAAI,CAQd,8CAAyB,CACxB,OAAO,CAAE,KAAK,CACd,QAAQ,CAAE,QAAQ,CAElB,aAAa,CAAE,cAAc,CAE7B,OAAO,CAAE,SAAS,CAElB,KAAK,CAAE,IAAI,CAMZ,sCAAiB,CAChB,OAAO,CAAE,IAAI,CACb,QAAQ,CAAE,QAA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,CAAE,SAAS,CAElB,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,cAAc,CAEtB,gBAAgB,CAAE,IAAI,CAEtB,KAAK,CAAE,IAAI,CACX,WAAW,CAAE,MAAM,CAGnB,gQAAO,CACN,YAAY,CClQG,OAAO,CDmQtB,UAAU,CAAE,kBAAkB,CAMhC,qFAA8B,CAC7B,UAAU,CC1QM,OAAO,CD2QvB,YAAY,CAAE,OAA6B,CAC3C,KAAK,CAAE,IAAI", "sources": ["global.scss","constants.scss"], "names": [], "file": "global.css" diff --git a/css/global.scss b/css/global.scss index 0fce983..d583c1e 100755 --- a/css/global.scss +++ b/css/global.scss @@ -3,7 +3,7 @@ /* [1] Panneau d'ajout/suppression d'elements =========================================================*/ -section[data-panel-list]{ +#WRAPPER > #CONTAINER section[data-panel-list]{ display: block; position: relative; @@ -12,7 +12,7 @@ section[data-panel-list]{ background-color: #fff; - font-size: .8em; + font-size: .9em; color: #000; @@ -48,15 +48,18 @@ section[data-panel-list]{ padding: .1em .7em; border-radius: 3px; - border: 1px solid #555; + border: 1px solid #777; - background: #f5f5f5; + background: #ecf0f1; - transition: all .2s ease-in-out; + transition: all .1s ease-in-out; + + color: #777; // Animation de @hover &:hover{ - background: #333; + background: $theme-fg-primary; + border-color: darken($theme-fg-primary, 10); color: #fff; } } @@ -228,7 +231,7 @@ section[data-panel-list]{ border-bottom: 1px solid #ccc; - background-color: #f5f5f5; + background-color: #ecf0f1; // font-weight: bold; @@ -238,6 +241,7 @@ section[data-panel-list]{ width: 18em; padding-right: 2em; text-align: right; + color: #3b494c; } @@ -246,10 +250,10 @@ section[data-panel-list]{ & > input[type='email'], & > input[type='password']{ margin: 1em 0; - padding: .3em .5em; + padding: .5em .7em; border-radius: 3px; - border: 1px solid #999; + border: 1px solid #ddd; background-color: #fff; @@ -259,8 +263,17 @@ section[data-panel-list]{ // Animation de @focus &:focus{ border-color: $theme-fg-primary; + box-shadow: inset 0 0 2px #ddd; } } + + + /* (5.3) Bouton de creation animation de @hover*/ + & > input[type='submit']:hover{ + background: $theme-fg-primary; + border-color: darken($theme-fg-primary, 10); + color: #fff; + } } } \ No newline at end of file diff --git a/src/static/container/token.svg b/src/static/container/token.svg index 5866d52..9ddd1f6 100644 --- a/src/static/container/token.svg +++ b/src/static/container/token.svg @@ -7,19 +7,27 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - enable-background="new 0 0 139 139" height="32" - id="Safety" - version="1.1" - viewBox="0 0 32.000001 32" width="32" - xml:space="preserve" + id="svg4200" + version="1.1" inkscape:version="0.91 r13725" - sodipodi:docname="token.svg">image/svg+xml + + + + image/svg+xml + + + + + + + + \ No newline at end of file + inkscape:connector-curvature="0" /> + diff --git a/src/static/container/user.svg b/src/static/container/user.svg index cdbac5c..324fe57 100644 --- a/src/static/container/user.svg +++ b/src/static/container/user.svg @@ -7,19 +7,27 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - enable-background="new 0 0 24 24" - id="Layer_1" - version="1.0" - viewBox="0 0 32 32" - xml:space="preserve" - inkscape:version="0.91 r13725" - sodipodi:docname="user.svg" + height="32" + version="1.1" width="32" - height="32">image/svg+xml + + + + image/svg+xml + + + + + + + + + + + \ No newline at end of file + inkscape:connector-curvature="0" + style="fill:#e67e22" /> + + + + + diff --git a/view/dashboard.php b/view/dashboard.php index 26f9813..1c2ee32 100755 --- a/view/dashboard.php +++ b/view/dashboard.php @@ -29,25 +29,11 @@ -

    Bienvenue sur la Web Application dévéloppée par des chercheurs du CNRS appartenant au LabEx SMS (Structuration des Mondes Sociaux) de l'université de Toulouse.

    -

    Cette application va vous permettre de cartographier le réseau de vos amis et des relations sociales avec lesquels vous communiquez depuis votre téléphone, facebook, ou hors-ligne.

    -

    Cette recherche est entièrement à but non lucratif, les informations que vous communiquez ne seront pas exploitées à des fins commerciales.

    +

    Bienvenue sur la Web Application dévéloppée par des chercheurs du CNRS appartenant au LabEx SMS (Structuration des Mondes Sociaux) de l'université de Toulouse.

    +

    Cette application va vous permettre de cartographier le réseau de vos amis et des relations sociales avec lesquels vous communiquez depuis votre téléphone, facebook, ou hors-ligne.

    +

    Cette recherche est entièrement à but non lucratif, les informations que vous communiquez ne seront pas exploitées à des fins commerciales.

    -

    Vous pourrez accéder a la plateforme si vous avez été sondé afin de compléter, consulter et modifier vos informations.

    -
    sexe
    -
    -
    - -
    -
    diplomes
    -
    -
    -
    - -
    -
    validation
    -
    -
    +

    Vous pourrez accéder a la plateforme si vous avez été sondé afin de compléter, consulter et modifier vos informations.

    diff --git a/view/js/settings.js b/view/js/settings.js index 95b12ba..c451fe1 100644 --- a/view/js/settings.js +++ b/view/js/settings.js @@ -9,7 +9,7 @@ var TOKEN = { 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 + submit: document.querySelector("[data-sublink='tokens'] div[data-add] #add-token-submit") // validation de la creation }, @@ -91,12 +91,14 @@ var USERS = { 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 + 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 + password2: document.querySelector("[data-sublink='users'] div[data-add] #add-password2"), // verification du password de l'utilisateur + mail: document.querySelector("[data-sublink='users'] div[data-add] #add-mail"), // adresse mail de l'utilisateur + isAdmin: document.querySelector("[data-sublink='users'] div[data-add] #add-admin"), // Bouton radio si l'utilisateur est admin + isSubject: document.querySelector("[data-sublink='users'] div[data-add] #add-subject"), // Bouton radio si l'utilisateur est sujet + 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-user-submit") // validation de la creation }, @@ -122,6 +124,11 @@ var USERS = { /* (1.2) Gestion de la creation */ USERS.add.submit.addEventListener('click', function(e){ + // On verifie que les 2 mots de passe sont identiques + if( USERS.add.password.value != USERS.add.password2.value ){ + return; + } + // On redige la requete var request = { // on ecrit la requete 'path': 'user/create', @@ -129,7 +136,7 @@ var USERS = { 'password': USERS.add.password.value, 'mail': USERS.add.mail.value, 'reference': USERS.add.reference.value, - 'permissions': USERS.add.permissions.value + 'permissions': (USERS.add.isAdmin.checked) ? 'admin' : 'subject' }; // On lance la requete @@ -138,8 +145,8 @@ var USERS = { // Si la generation effectuee, on recharge la page if( answer.ModuleError == 0 ) reload(); - }); + }, false); diff --git a/view/settings.php b/view/settings.php index 841cad7..a1baa08 100755 --- a/view/settings.php +++ b/view/settings.php @@ -42,7 +42,7 @@ if( permission('admin') ){
    Nom de l'accès
    Duree de vie (jours)
    - +
    @@ -108,15 +108,16 @@ if( permission('admin') ){
    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 - -
    - +    +
    + Identifiant d'étude (optionnel)
    +
    From f56033eabc383dbc34f02aa56116a083a71d45d9 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 14 Apr 2016 18:49:07 +0200 Subject: [PATCH 9/9] Gestion de la suppression v1 sur l'interface ok. --- config/modules.json | 11 +++++++++- manager/module/token.php | 2 -- manager/module/user.php | 45 ++++++++++++++++++++++++++++++++++++---- manager/repo/user.php | 20 ++++++++++++++++++ view/js/settings.js | 3 +-- view/settings.php | 1 - 6 files changed, 72 insertions(+), 10 deletions(-) diff --git a/config/modules.json b/config/modules.json index e11fcde..03e662f 100755 --- a/config/modules.json +++ b/config/modules.json @@ -18,7 +18,7 @@ "getById": { - "description": "Retourne les informations d'un utilisateur d'id donne.", + "description": "Retourne les informations d'un utilisateur.", "permissions": ["admin"], "parameters": { "id_user": { "description": "UID de l'utilisateur recherche.", "type": "id" } @@ -43,6 +43,15 @@ "reference" : { "description": "UID d'une personne d'un sondage, peut etre vide.", "type": "text" }, "permissions": { "description": "Liste des permissions de l'utilisateur.", "type": "text" } } + }, + + + "remove": { + "description": "Suppression d'un utilisateur.", + "permissions": ["admin"], + "parameters": { + "id_user": { "description": "UID de l'utilisateur", "type": "id" } + } } }, diff --git a/manager/module/token.php b/manager/module/token.php index 2141293..6f96a38 100755 --- a/manager/module/token.php +++ b/manager/module/token.php @@ -16,8 +16,6 @@ * * @id_token UID du token en question * - * @return status Retourne l'etat de la suppression (VRAI -> fait/FAUX -> erreur) - * */ public static function remove($id_token){ /* [1] Suppression du token diff --git a/manager/module/user.php b/manager/module/user.php index 38145f5..606e256 100755 --- a/manager/module/user.php +++ b/manager/module/user.php @@ -120,7 +120,7 @@ - /* CREE UN UTILISATEUR + /* CREATION D'UN UTILISATEUR * * @login Login (identifiant) de l'utilisateur * @password Password de l'utilisateur @@ -154,12 +154,49 @@ ); } + + + + + /* SUPPRESSION D'UN UTILISATEUR + * + * @id_user UID de l'utilisateur en question + * + */ + public static function remove($id_user){ + /* [1] On verifie que l'utilisateur existe + =========================================================*/ + $exists = new Repo('user/getById', array($id_user)); + $exists_status = $exists->answer(); + + // Si l'utilisateur n'existe pas, on retourne une erreur + if( $exists_status === false ) return array( 'ModuleError' => ManagerError::ModuleError ); + + /* [2] Suppression de l'utilisateur + =========================================================*/ + $remove = new Repo('user/remove', array($id_user)); + $remove_status = $remove->answer(); + + + /* [3] On verifie que l'utilisateur est bien supprime + =========================================================*/ + $removed = new Repo('user/getById', array($id_user)); + $removed_status = $removed->answer(); + + // Si l'utilisateur n'existe pas, on retourne une erreur + if( $removed_status !== false ) return array( 'ModuleError' => ManagerError::ModuleError ); + + + /* [4] Gestion du retour + =========================================================*/ + return array( 'ModuleError' => ManagerError::Success ); + } + // [x] "login", // [x] "logout", // [x] "getById", - // [ ] "getAll", - - // [ ] "create", + // [x] "getAll", + // [x] "create", // [ ] "remove", } diff --git a/manager/repo/user.php b/manager/repo/user.php index 6b32bec..b7e04d0 100755 --- a/manager/repo/user.php +++ b/manager/repo/user.php @@ -211,6 +211,26 @@ return $id_user['id_user']; } + + + + + + + + + /* SUPRESSION D'UN UTILISATEUR D'ID DONNE + * + * @id_user UID de l'utilisateur en question + * + */ + public static function remove($id_user){ + /* [1] On effectue la suppression + =========================================================*/ + $getUser = Database::getPDO()->prepare("DELETE FROM users WHERE id_user = :id_user"); + $getUser->execute(array( ':id_user' => $id_user )); + } + } diff --git a/view/js/settings.js b/view/js/settings.js index c451fe1..77c79bb 100644 --- a/view/js/settings.js +++ b/view/js/settings.js @@ -169,12 +169,11 @@ for( var i = 0 ; i < USERS.remove.buttons.length ; i++ ){ /* (2.2) On lance la suppression */ var request = { // on ecrit la requete 'path': 'user/remove', - 'user_id': user_id + 'id_user': 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 a1baa08..f5b46cb 100755 --- a/view/settings.php +++ b/view/settings.php @@ -137,7 +137,6 @@ if( permission('admin') ){ echo "
    "; echo "".$user['login'].""; echo "".$user['mail'].""; - echo "".implode(", ", $user['permission']).""; echo "
    "; echo "";