Merged feature/user_management into dev

This commit is contained in:
xdrm-brackets 2016-04-13 15:21:03 +02:00
commit 8c649a7bef
6 changed files with 43 additions and 22 deletions

View File

@ -1,2 +1,2 @@
body{font-family:'Open Sans';font-size:15px}#WRAPPER{display:block;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#e8e8e8;overflow-x:hidden;overflow-y:auto;z-index:1}#WRAPPER>#HEADER{display:block;position:fixed;top:0;left:0;width:100%;height:calc( 4em - 1px );border-bottom:1px solid #cfcfcf;background-color:#fff;z-index:9}#WRAPPER>#MENU-SIDE{display:block;position:fixed;top:4em;left:0;width:15em;height:calc( 100% - 4em );box-shadow:2px 1px 3px #ddd;background-color:#32323a;transition:all .3s;z-index:10}#WRAPPER>#CONTAINER{display:flex;position:absolute;top:4em;left:15em;width:calc( 100% - 15em - 2*1em );min-height:calc( 100% - 4em - 2*1em );padding:1em;flex-direction:row;justify-content:space-between;overflow-x:none;overflow-y:auto}#LOGIN{display:flex;position:fixed;top:0;left:-100%;width:100%;height:100%;flex-direction:row;flex-wrap:nowrap;justify-content:space-around;align-items:center;background-color:#32323a;transition:left .3s ease-in-out;z-index:101}#LOGIN.active{left:0}#LOGIN>#login-icon{width:35em;height:10em;background:url("/f/svg/icon/st") center center no-repeat;background-size:auto 100%}#LOGIN>#login-form{display:block}#LOGIN>#login-form>input[type='text'],#LOGIN>#login-form>input[type='password'],#LOGIN>#login-form>input[type='submit']{display:flex;width:20em;margin:2em 0;padding:1em 2em;flex-direction:column;justify-content:space-around;flex-wrap:nowrap;align-items:middle;border-radius:5px;border:1px solid #6b6b6b;background-color:#32323a;color:#fff;font-weight:bold;letter-spacing:.07em;transition:border .2s ease-in-out;cursor:default}#LOGIN>#login-form>input[type='text']:hover,#LOGIN>#login-form>input[type='text']:focus,#LOGIN>#login-form>input[type='password']:hover,#LOGIN>#login-form>input[type='password']:focus,#LOGIN>#login-form>input[type='submit']:hover,#LOGIN>#login-form>input[type='submit']:focus{border-color:#53d192}#LOGIN>#login-form>input[type='submit']{width:100%;margin:2em 0;border:0;background-color:#53d192;color:#fff;font-weight:bold;cursor:pointer}#LOGIN>#login-form>input[type='submit']:hover{background-color:#33be79;box-shadow:0 0 1em #1a1a1f}#LOGIN>#login-form>#lost-password{color:#ddd;cursor:pointer}#LOGIN>#login-form>#lost-password:hover{color:#53d192;text-decoration:underline}#LOGIN>#login-close{display:block;position:absolute;top:2em;right:2em;min-width:2em;height:2em;background:url("/f/svg/back/st/container/ffffff") right center no-repeat;background-size:1em;color:#fff;padding-right:2em;line-height:2em;font-weight:bold;cursor:pointer}
body{font-family:'Open Sans';font-size:15px}#WRAPPER{display:block;position:fixed;top:0;left:0;width:100%;height:100%;background-color:#e8e8e8;overflow-x:hidden;overflow-y:auto;z-index:1}#WRAPPER>#HEADER{display:block;position:fixed;top:0;left:0;width:100%;height:calc( 4em - 1px );border-bottom:1px solid #cfcfcf;background-color:#fff;z-index:9}#WRAPPER>#MENU-SIDE{display:block;position:fixed;top:4em;left:0;width:15em;height:calc( 100% - 4em );box-shadow:2px 1px 3px #ddd;background-color:#32323a;transition:all .3s;z-index:10}#WRAPPER>#CONTAINER{display:flex;position:absolute;top:4em;left:15em;width:calc( 100% - 15em - 2*1em );min-height:calc( 100% - 4em - 2*1em );padding:1em;flex-direction:row;justify-content:space-between;overflow-x:none;overflow-y:auto}#LOGIN{display:flex;position:fixed;top:0;left:-100%;width:100%;height:100%;flex-direction:row;flex-wrap:nowrap;justify-content:space-around;align-items:center;background-color:#32323a;transition:left .3s ease-in-out;z-index:101}#LOGIN.active{left:0}#LOGIN>#login-icon{width:35em;height:10em;background:url("/f/svg/icon/st") center center no-repeat;background-size:auto 100%}#LOGIN>#login-form{display:block}#LOGIN>#login-form>input[type='text'],#LOGIN>#login-form>input[type='password'],#LOGIN>#login-form>input[type='submit']{display:flex;width:20em;margin:2em 0;padding:1em 2em;flex-direction:column;justify-content:space-around;flex-wrap:nowrap;align-items:middle;border-radius:5px;border:1px solid #6b6b6b;background-color:#32323a;color:#fff;font-weight:bold;letter-spacing:.07em;transition:border .2s ease-in-out;cursor:default}#LOGIN>#login-form>input[type='text']:hover,#LOGIN>#login-form>input[type='text']:focus,#LOGIN>#login-form>input[type='password']:hover,#LOGIN>#login-form>input[type='password']:focus,#LOGIN>#login-form>input[type='submit']:hover,#LOGIN>#login-form>input[type='submit']:focus{border-color:#53d192}#LOGIN>#login-form>input[type='submit']{width:100%;margin:2em 0;border:0;background-color:#53d192;color:#fff;font-weight:bold;text-align:left;cursor:pointer}#LOGIN>#login-form>input[type='submit']:hover{background-color:#33be79;box-shadow:0 0 1em #1a1a1f}#LOGIN>#login-form>#lost-password{color:#ddd;cursor:pointer}#LOGIN>#login-form>#lost-password:hover{color:#53d192;text-decoration:underline}#LOGIN>#login-close{display:block;position:absolute;top:2em;right:2em;min-width:2em;height:2em;background:url("/f/svg/back/st/container/ffffff") right center no-repeat;background-size:1em;color:#fff;padding-right:2em;line-height:2em;font-weight:bold;cursor:pointer}
/*# sourceMappingURL=layout.css.map */

View File

@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAEA,IAAI,CAEH,WAAW,CAAE,WAAW,CACxB,SAAS,CAAE,IAAI,CAKhB,QAAQ,CACP,OAAO,CAAE,KAAK,CACd,QAAQ,CAAE,KAAK,CACd,GAAG,CAAE,CAAC,CACN,IAAI,CAAE,CAAC,CACP,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,IAAI,CAEb,gBAAgB,CCfE,OAAO,CDiBzB,UAAU,CAAE,MAAM,CAClB,UAAU,CAAE,IAAI,CAEhB,OAAO,CAAE,CAAC,CAKV,gBAAW,CACV,OAAO,CAAE,KAAK,CACd,QAAQ,CAAE,KAAK,CACd,GAAG,CAAE,CAAC,CACN,IAAI,CAAE,CAAC,CACP,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,iBAA+B,CAExC,aAAa,CAAE,iBAA+B,CAE9C,gBAAgB,CClCC,IAAO,CDoCxB,OAAO,CAAE,CAAC,CAQX,mBAAc,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E,eAAe,CAAE,GAAG,CAEpB,KAAK,CAAE,IAAI,CACX,aAAa,CAAE,GAAG,CAClB,WAAW,CAAE,GAAG,CAChB,WAAW,CAAE,IAAI,CAEjB,MAAM,CAAE,OAAO",
"sources": ["layout.scss","constants.scss"],
"names": [],
"file": "layout.css"

View File

@ -183,6 +183,7 @@ body{
color: $dark-fg-primary;
font-weight: bold;
text-align: left;
cursor: pointer;

View File

@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 12, 2016 at 05:32 PM
-- Generation Time: Apr 13, 2016 at 02:54 PM
-- Server version: 5.6.28-0ubuntu0.15.10.1
-- PHP Version: 5.6.11-1ubuntu3.1
@ -30,17 +30,19 @@ CREATE TABLE IF NOT EXISTS `api_token` (
`id_token` int(11) NOT NULL,
`token` varchar(40) NOT NULL,
`name` varchar(50) NOT NULL,
`expires` date NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=latin1;
`expires` date NOT NULL,
`permission` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `api_token`
--
INSERT INTO `api_token` (`id_token`, `token`, `name`, `expires`) VALUES
(38, '48e701d4e72e4e35bc37c9a800b49d5400734d7b', 'test', '2016-04-11'),
(39, '935fe104d0e64d36e466c7a0a1c9773e3d7521c5', 'user#1', '2016-04-22'),
(48, 'bba06e9b01f5ac00798d6cf241d8bf105da0f25a', 'user#2', '2016-05-02');
INSERT INTO `api_token` (`id_token`, `token`, `name`, `expires`, `permission`) VALUES
(38, '48e701d4e72e4e35bc37c9a800b49d5400734d7b', 'test', '2016-04-11', 'admin,token'),
(39, '935fe104d0e64d36e466c7a0a1c9773e3d7521c5', 'user#1', '2016-04-22', 'admin,token'),
(48, 'bba06e9b01f5ac00798d6cf241d8bf105da0f25a', 'user#2', '2016-05-02', 'admin,token'),
(49, '5ac2c74474ea4b1279b4dacb538da8a0bd1e2adb', 'acces romain', '2016-07-22', '');
-- --------------------------------------------------------
@ -171,14 +173,15 @@ CREATE TABLE IF NOT EXISTS `users` (
`mail` varchar(255) NOT NULL,
`reference` int(11) DEFAULT NULL,
`permission` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id_user`, `login`, `password`, `mail`, `reference`, `permission`) VALUES
(1, 'xdrm', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'xdrm@xdrm.io', NULL, 'admin,user');
(1, 'xdrm', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', 'xdrm@xdrm.io', NULL, 'admin,user'),
(3, 'test', 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 'test', NULL, 'user');
--
-- Indexes for dumped tables
@ -265,7 +268,7 @@ ALTER TABLE `users`
-- AUTO_INCREMENT for table `api_token`
--
ALTER TABLE `api_token`
MODIFY `id_token` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=49;
MODIFY `id_token` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=50;
--
-- AUTO_INCREMENT for table `Categories`
--
@ -300,7 +303,7 @@ ALTER TABLE `ReponsesUtilisateurs`
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--

View File

@ -30,7 +30,8 @@
/* (2) Gestion de la connection */
$login_vars = isset($_POST['login']) && Database::check('varchar(255)', $_POST['login']);
$login_vars = isset($_POST['login-sub']);
$login_vars = $login_vars && isset($_POST['login']) && Database::check('varchar(255)', $_POST['login']);
$login_vars = $login_vars && isset($_POST['password']) && Database::check('text', $_POST['password']);
// Status de login
@ -50,7 +51,17 @@
/* (3) Gestion de le deconnexion */
$logout_vars = isset($_POST['logout-sub']);
// Si on se deconnecte
if( $logout_vars ){
$logout = new ModuleRequest('users/logout');
$logout_ans = $logout->dispatch();
// Si aucune erreur, on dit qu'on vient de se deconnecter
if( $logout_ans->error == ManagerError::Success )
$_SESSION['login_status'] = 'unlogged';
}

View File

@ -41,14 +41,20 @@
<div id='login-close'>Accéder à la plateforme</div>
<form method='POST' action='' id='login-form'>
<!-- SI ON EST PAS CONNECTE -> FORMULAIRE DE LOGIN -->
<?php if( !connected() ){ ?>
<input type='text' placeholder='Identifiant ou adresse mail' name='login' id='login-login'>
<input type='password' placeholder='Mot de passe' name='password' id='login-password'>
<input type='submit' value='Connexion' id='login-submit'>
<!-- Si on a de mauvais logins -->
<?php if( $_SESSION['login_status'] == 'error '){ echo "<span id='login-error'>Votre identifiant/mot de passe est incorrect.</span>"; } ?>
<input type='submit' value='Connexion' name='login-sub'>
<span id='lost-password'>Mot de passe oublié ?</span>
<!-- SI ON EST CONNECTE -> FORMULAIRE DE LOGOUT -->
<?php }else{ ?>
<input type='submit' value='Déconnexion' name='logout-sub'>
<?php } ?>
</form>
</div>