From 6469a4e793d4e14247ab1cf2ea449e802098b234 Mon Sep 17 00:00:00 2001 From: www Date: Tue, 17 Feb 2015 22:19:10 +0100 Subject: [PATCH 1/3] modified: SRC/app/Http/Middleware/RedirectIfNotAdmin.php --- .bash_history | 12 ++++++++++++ SRC/app/Http/Middleware/RedirectIfNotAdmin.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.bash_history b/.bash_history index 8d15836..af6040f 100755 --- a/.bash_history +++ b/.bash_history @@ -68,3 +68,15 @@ git pull exit git pull exit +git pull +git status +git add . +git commit -m "admin view & navbar_signed" +git push +git pull +exit +git pull +exit +cd .. +ls +nano loadCSVAugustin2014.py diff --git a/SRC/app/Http/Middleware/RedirectIfNotAdmin.php b/SRC/app/Http/Middleware/RedirectIfNotAdmin.php index f63267a..f1c7ece 100644 --- a/SRC/app/Http/Middleware/RedirectIfNotAdmin.php +++ b/SRC/app/Http/Middleware/RedirectIfNotAdmin.php @@ -35,7 +35,7 @@ class RedirectIfNotAdmin { */ public function handle($request, Closure $next) { - if (!$this->auth->check() OR Auth::user()->admin == 0) + if (!$this->auth->check() OR Auth::user()->droit == 0) { return new RedirectResponse(url('/login')); } From 6ee394dc204e67f23837f48aa54cc80f96f2c8e3 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Tue, 17 Feb 2015 22:19:47 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20SRC/init/table.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SRC/init/table.sql | 49 +++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/SRC/init/table.sql b/SRC/init/table.sql index 749aae3..2a2d71d 100644 --- a/SRC/init/table.sql +++ b/SRC/init/table.sql @@ -39,43 +39,48 @@ CREATE TABLE niveau ( CREATE TABLE users ( id INT NOT NULL AUTO_INCREMENT, firstname VARCHAR(50), - lastnanme VARCHAR(50), - city VARCHAR(50), + lastname VARCHAR(50), + city VARCHAR(50), password VARCHAR(255), email VARCHAR(50), image VARCHAR(255), remember_token VARCHAR(100), - admin INT(1) DEFAULT 0, + droit INT DEFAULT 0, PRIMARY KEY (id) ); CREATE TABLE designation ( + iddesignation INT NOT NULL AUTO_INCREMENT, nom VARCHAR(255) NOT NULL, urldesignation VARCHAR(255), - PRIMARY KEY (nom) + PRIMARY KEY (iddesignation) ); CREATE TABLE auteur ( + idauteur INT NOT NULL AUTO_INCREMENT, nom VARCHAR(50) NOT NULL, anecdote VARCHAR(255), - PRIMARY KEY (nom) + PRIMARY KEY (idauteur) ); CREATE TABLE technique ( + idtechnique INT NOT NULL AUTO_INCREMENT, nom VARCHAR(50) NOT NULL, urltechnique VARCHAR(255), - PRIMARY KEY (nom) + PRIMARY KEY (idtechnique) ); CREATE TABLE domaine ( + iddomaine INT NOT NULL AUTO_INCREMENT, nom VARCHAR(50) NOT NULL, - PRIMARY KEY (nom) + PRIMARY KEY (iddomaine) ); CREATE TABLE matiere ( + idmatiere INT NOT NULL AUTO_INCREMENT, nom VARCHAR(50) NOT NULL, - PRIMARY KEY (nom) + PRIMARY KEY (idmatiere) ); CREATE TABLE datation ( @@ -88,32 +93,32 @@ CREATE TABLE datation ( CREATE TABLE oeuvre ( idoeuvre INT NOT NULL AUTO_INCREMENT, - iddate INT NOT NULL, - idtechnique VARCHAR(50), - iddomaine VARCHAR(50), - idmatiere VARCHAR(50), - titre VARCHAR(50), - urlPhoto VARCHAR(255), + iddate INT, + idtechnique INT, + iddomaine INT, + idmatiere INT, + titre INT, + urlPhoto INT, PRIMARY KEY (idoeuvre), - FOREIGN KEY (idtechnique) REFERENCES technique(nom), - FOREIGN KEY (iddomaine) REFERENCES domaine(nom), - FOREIGN KEY (idmatiere) REFERENCES matiere(nom), + FOREIGN KEY (idtechnique) REFERENCES technique(idtechnique), + FOREIGN KEY (iddomaine) REFERENCES domaine(iddomaine), + FOREIGN KEY (idmatiere) REFERENCES matiere(idmatiere), FOREIGN KEY (iddate) REFERENCES datation(iddate) ); CREATE TABLE assodesignationaoeuvre ( idoeuvre INT NOT NULL, - idesignation VARCHAR(255), - PRIMARY KEY (idesignation,idoeuvre), - FOREIGN KEY (idesignation) REFERENCES designation(nom), + iddesignation INT NOT NULL, + PRIMARY KEY (iddesignation,idoeuvre), + FOREIGN KEY (iddesignation) REFERENCES designation(iddesignation), FOREIGN KEY (idoeuvre) REFERENCES oeuvre(idoeuvre) ); CREATE TABLE assoauteuraoeuvre ( idoeuvre INT NOT NULL, - idauteur VARCHAR(50), + idauteur INT NOT NULL, PRIMARY KEY (idauteur,idoeuvre), - FOREIGN KEY (idauteur) REFERENCES auteur(nom), + FOREIGN KEY (idauteur) REFERENCES auteur(idauteur), FOREIGN KEY (idoeuvre) REFERENCES oeuvre(idoeuvre) ); From 74b69bc1595671a8658c0602c478e391854fdc58 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Tue, 17 Feb 2015 22:24:10 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20SRC/app/Http/Middleware/RedirectIfNotAdmin.php=20=09modif?= =?UTF-8?q?i=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20SRC/init/table.sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SRC/app/Http/Middleware/RedirectIfNotAdmin.php | 2 +- SRC/init/table.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SRC/app/Http/Middleware/RedirectIfNotAdmin.php b/SRC/app/Http/Middleware/RedirectIfNotAdmin.php index f1c7ece..6854a90 100644 --- a/SRC/app/Http/Middleware/RedirectIfNotAdmin.php +++ b/SRC/app/Http/Middleware/RedirectIfNotAdmin.php @@ -35,7 +35,7 @@ class RedirectIfNotAdmin { */ public function handle($request, Closure $next) { - if (!$this->auth->check() OR Auth::user()->droit == 0) + if (!$this->auth->check() OR Auth::user()->droits == 0) { return new RedirectResponse(url('/login')); } diff --git a/SRC/init/table.sql b/SRC/init/table.sql index 2a2d71d..fc9a51e 100644 --- a/SRC/init/table.sql +++ b/SRC/init/table.sql @@ -45,7 +45,7 @@ CREATE TABLE users ( email VARCHAR(50), image VARCHAR(255), remember_token VARCHAR(100), - droit INT DEFAULT 0, + droits INT DEFAULT 0, PRIMARY KEY (id) );