identification
This commit is contained in:
.bash_historyREADME.md
.composer
.htaccess
.gitconfig.gitignorecache
.htaccess
files
classpreloader
classpreloader
danielstjules
dnoegel
php-xdg-base-dir
doctrine
inflector
instantiator
ircmaxell
password-compat
jakub-onderka
php-console-color
php-console-highlighter
jeremeamia
superclosure
laravel
framework
laravel
league
monolog
mtdowling
cron-expression
nesbot
nikic
phpdocumentor
reflection-docblock
phpspec
php-diff
phpspec
prophecy
phpunit
php-code-coverage
php-file-iterator
php-text-template
php-timer
php-token-stream
phpunit-mock-objects
phpunit
psr
psy
sebastian
comparator
diff
environment
exporter
global-state
recursion-context
version
swiftmailer
swiftmailer
symfony
console
debug
event-dispatcher
filesystem
finder
http-foundation
http-kernel
process
routing
security-core
translation
var-dumper
yaml
vlucas
repo
https---packagist.org
p-provider-2012.jsonp-provider-2013.jsonp-provider-2014.jsonp-provider-2015-03.jsonp-provider-archived.jsonp-provider-latest.jsonpackages.jsonprovider-classpreloader$classpreloader.jsonprovider-danielstjules$stringy.jsonprovider-dflydev$markdown.jsonprovider-dnoegel$php-xdg-base-dir.jsonprovider-doctrine$inflector.jsonprovider-doctrine$instantiator.jsonprovider-illuminate$auth.jsonprovider-illuminate$bus.jsonprovider-illuminate$cache.jsonprovider-illuminate$config.jsonprovider-illuminate$console.jsonprovider-illuminate$container.jsonprovider-illuminate$contracts.jsonprovider-illuminate$cookie.jsonprovider-illuminate$database.jsonprovider-illuminate$encryption.jsonprovider-illuminate$events.jsonprovider-illuminate$exception.jsonprovider-illuminate$filesystem.jsonprovider-illuminate$foundation.jsonprovider-illuminate$hashing.jsonprovider-illuminate$http.jsonprovider-illuminate$log.jsonprovider-illuminate$mail.jsonprovider-illuminate$pagination.jsonprovider-illuminate$pipeline.jsonprovider-illuminate$queue.jsonprovider-illuminate$redis.jsonprovider-illuminate$routing.jsonprovider-illuminate$session.jsonprovider-illuminate$support.jsonprovider-illuminate$translation.jsonprovider-illuminate$validation.jsonprovider-illuminate$view.jsonprovider-ircmaxell$password-compat.jsonprovider-jakub-onderka$php-console-color.jsonprovider-jakub-onderka$php-console-highlighter.jsonprovider-jeremeamia$superclosure.jsonprovider-laravel$framework.jsonprovider-laravel$laravel.jsonprovider-league$flysystem.jsonprovider-monolog$monolog.jsonprovider-mtdowling$cron-expression.jsonprovider-nesbot$carbon.jsonprovider-nikic$php-parser.jsonprovider-ocramius$instantiator.jsonprovider-ocramius$lazy-map.jsonprovider-phpdocumentor$reflection-docblock.jsonprovider-phpspec$php-diff.jsonprovider-phpspec$phpspec.jsonprovider-phpspec$prophecy.jsonprovider-phpunit$dbunit.jsonprovider-phpunit$php-code-coverage.jsonprovider-phpunit$php-file-iterator.jsonprovider-phpunit$php-text-template.jsonprovider-phpunit$php-timer.jsonprovider-phpunit$php-token-stream.jsonprovider-phpunit$phpunit-mock-objects.jsonprovider-phpunit$phpunit.jsonprovider-psr$log.jsonprovider-psy$psysh.jsonprovider-sebastian$comparator.jsonprovider-sebastian$diff.jsonprovider-sebastian$environment.jsonprovider-sebastian$exporter.jsonprovider-sebastian$global-state.jsonprovider-sebastian$recursion-context.jsonprovider-sebastian$version.jsonprovider-swiftmailer$swiftmailer.jsonprovider-symfony$console.jsonprovider-symfony$debug.jsonprovider-symfony$event-dispatcher.jsonprovider-symfony$filesystem.jsonprovider-symfony$finder.jsonprovider-symfony$http-foundation.jsonprovider-symfony$http-kernel.jsonprovider-symfony$process.jsonprovider-symfony$routing.jsonprovider-symfony$security-core.jsonprovider-symfony$translation.jsonprovider-symfony$var-dumper.jsonprovider-symfony$yaml.jsonprovider-vlucas$phpdotenv.json
DOC
Etude
Maquette
SRC
.env.example.gitattributes.gitignorereadme.mdserver.php
app
Commands
Console
Events
Exceptions
Handlers
Http
Controllers
AdminController.php
Kernel.phpAuth
Controller.phpGameController.phpHomeController.phpLoginController.phpReferentController.phpWelcomeController.phpMiddleware
Requests
routes.phpProviders
AppServiceProvider.phpBusServiceProvider.phpConfigServiceProvider.phpEventServiceProvider.phpRouteServiceProvider.php
Services
User.phpbootstrap
composer.jsoncomposer.lockconfig
app.phpauth.phpcache.phpcompile.phpdatabase.phpfilesystems.phpmail.phpqueue.php~HEADservices.phpsession.phpview.php
database
gulpfile.jspackage.jsonphpspec.ymlphpunit.xmlpublic
fonts
glyphicons-halflings-regular.eotglyphicons-halflings-regular.svgglyphicons-halflings-regular.ttfglyphicons-halflings-regular.woffglyphicons-halflings-regular.woff2
pictures
resources
assets
less
app.less
bootstrap
alerts.lessbadges.lessbootstrap.lessbreadcrumbs.lessbutton-groups.lessbuttons.lesscarousel.lessclose.lesscode.lesscomponent-animations.lessdropdowns.lessforms.lessglyphicons.lessgrid.lessinput-groups.lessjumbotron.lesslabels.lesslist-group.lessmedia.lessmixins.less
mixins
alerts.lessbackground-variant.lessborder-radius.lessbuttons.lesscenter-block.lessclearfix.lessforms.lessgradients.lessgrid-framework.lessgrid.lesshide-text.lessimage.lesslabels.lesslist-group.lessnav-divider.lessnav-vertical-align.lessopacity.lesspagination.lesspanels.lessprogress-bar.lessreset-filter.lessresize.lessresponsive-visibility.lesssize.lesstab-focus.lesstable-row.lesstext-emphasis.lesstext-overflow.lessvendor-prefixes.less
modals.lessnavbar.lessnavs.lessnormalize.lesspager.lesspagination.lesspanels.lesspopovers.lessprint.lessprogress-bars.lessresponsive-embed.lessresponsive-utilities.lessscaffolding.lesstables.lesstheme.lessthumbnails.lesstooltip.lesstype.lessutilities.lessvariables.lesswells.lesslang
views
tests
UML
0
SRC/app/Commands/Command.php
Normal file → Executable file
0
SRC/app/Commands/Command.php
Normal file → Executable file
0
SRC/app/Console/Commands/Inspire.php
Normal file → Executable file
0
SRC/app/Console/Commands/Inspire.php
Normal file → Executable file
0
SRC/app/Console/Kernel.php
Normal file → Executable file
0
SRC/app/Console/Kernel.php
Normal file → Executable file
0
SRC/app/Events/Event.php
Normal file → Executable file
0
SRC/app/Events/Event.php
Normal file → Executable file
0
SRC/app/Exceptions/Handler.php
Normal file → Executable file
0
SRC/app/Exceptions/Handler.php
Normal file → Executable file
0
SRC/app/Handlers/Commands/.gitkeep
Normal file → Executable file
0
SRC/app/Handlers/Commands/.gitkeep
Normal file → Executable file
0
SRC/app/Handlers/Events/.gitkeep
Normal file → Executable file
0
SRC/app/Handlers/Events/.gitkeep
Normal file → Executable file
2
SRC/app/Http/Controllers/AdminController.php
Normal file → Executable file
2
SRC/app/Http/Controllers/AdminController.php
Normal file → Executable file
@ -10,7 +10,7 @@ class AdminController extends Controller {
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
|
52
SRC/app/Http/Controllers/Auth/AuthController.php
Normal file → Executable file
52
SRC/app/Http/Controllers/Auth/AuthController.php
Normal file → Executable file
@ -1,38 +1,30 @@
|
||||
<?php namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Auth;
|
||||
|
||||
class AuthController extends Controller {
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Registration & Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users, as well as the
|
||||
| authentication of existing users. By default, this controller uses
|
||||
| a simple trait to add these behaviors. Why don't you explore it?
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
|
||||
/**
|
||||
* Create a new authentication controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
* Handle an authentication attempt.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function authenticate()
|
||||
{
|
||||
|
||||
if (Auth::attempt(['email' => $email, 'password' => $password]))
|
||||
{
|
||||
return redirect()->intended('/admin');
|
||||
}
|
||||
return redirect('/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?',]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
}
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout();
|
||||
}
|
||||
|
||||
}
|
||||
|
0
SRC/app/Http/Controllers/Auth/PasswordController.php
Normal file → Executable file
0
SRC/app/Http/Controllers/Auth/PasswordController.php
Normal file → Executable file
0
SRC/app/Http/Controllers/Controller.php
Normal file → Executable file
0
SRC/app/Http/Controllers/Controller.php
Normal file → Executable file
2
SRC/app/Http/Controllers/GameController.php
Normal file → Executable file
2
SRC/app/Http/Controllers/GameController.php
Normal file → Executable file
@ -9,7 +9,7 @@ class GameController extends Controller {
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
|
0
SRC/app/Http/Controllers/HomeController.php
Normal file → Executable file
0
SRC/app/Http/Controllers/HomeController.php
Normal file → Executable file
57
SRC/app/Http/Controllers/LoginController.php
Normal file → Executable file
57
SRC/app/Http/Controllers/LoginController.php
Normal file → Executable file
@ -1,4 +1,9 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Validator;
|
||||
use Password;
|
||||
use DB;
|
||||
|
||||
class LoginController extends Controller {
|
||||
|
||||
@ -9,7 +14,7 @@ class LoginController extends Controller {
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
@ -22,4 +27,54 @@ class LoginController extends Controller {
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
public function authenticate()
|
||||
{
|
||||
$credentials = [
|
||||
'email'=>Input::get('email'),
|
||||
'password'=>Input::get('password')
|
||||
];
|
||||
$rules = [
|
||||
'email' => 'required',
|
||||
'password'=>'required'
|
||||
];
|
||||
$validator = Validator::make($credentials,$rules);
|
||||
if($validator->passes())
|
||||
{
|
||||
if(Auth::attempt($credentials))
|
||||
{
|
||||
if (Auth::user()->admin == 1)
|
||||
return redirect()->intended('admin');
|
||||
else
|
||||
return redirect()->intended('referent');
|
||||
}
|
||||
return redirect('login')->withErrors(['erreur' => 'Mail ou mot de passe incorrect!',]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect('login')->withErrors($validator)->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout();
|
||||
return redirect('login');
|
||||
}
|
||||
|
||||
public function forgottenPassword()
|
||||
{
|
||||
return view('auth.password');
|
||||
}
|
||||
|
||||
public function initPassword()
|
||||
{
|
||||
switch ($response = Password::remind(Input::only('email')))
|
||||
{
|
||||
case Password::INVALID_USER:
|
||||
return redirect('oublie')->withErrors($response)->withInput();
|
||||
case Password::REMINDER_SENT:
|
||||
return redirect('oublie')->withStatus($response)->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
0
SRC/app/Http/Controllers/ReferentController.php
Normal file → Executable file
0
SRC/app/Http/Controllers/ReferentController.php
Normal file → Executable file
0
SRC/app/Http/Controllers/WelcomeController.php
Normal file → Executable file
0
SRC/app/Http/Controllers/WelcomeController.php
Normal file → Executable file
1
SRC/app/Http/Kernel.php
Normal file → Executable file
1
SRC/app/Http/Kernel.php
Normal file → Executable file
@ -27,6 +27,7 @@ class Kernel extends HttpKernel {
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'admin' => 'App\Http\Middleware\RedirectIfNotAdmin',
|
||||
];
|
||||
|
||||
}
|
||||
|
2
SRC/app/Http/Middleware/Authenticate.php
Normal file → Executable file
2
SRC/app/Http/Middleware/Authenticate.php
Normal file → Executable file
@ -40,7 +40,7 @@ class Authenticate {
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect()->guest('auth/login');
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
}
|
||||
|
||||
|
2
SRC/app/Http/Middleware/RedirectIfAuthenticated.php
Normal file → Executable file
2
SRC/app/Http/Middleware/RedirectIfAuthenticated.php
Normal file → Executable file
@ -35,7 +35,7 @@ class RedirectIfAuthenticated {
|
||||
{
|
||||
if ($this->auth->check())
|
||||
{
|
||||
return new RedirectResponse(url('/home'));
|
||||
return new RedirectResponse(url('/referent'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
45
SRC/app/Http/Middleware/RedirectIfNotAdmin.php
Normal file
45
SRC/app/Http/Middleware/RedirectIfNotAdmin.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Auth;
|
||||
|
||||
|
||||
class RedirectIfNotAdmin {
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (!$this->auth->check() OR Auth::user()->admin == 0)
|
||||
{
|
||||
return new RedirectResponse(url('/login'));
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
0
SRC/app/Http/Middleware/VerifyCsrfToken.php
Normal file → Executable file
0
SRC/app/Http/Middleware/VerifyCsrfToken.php
Normal file → Executable file
0
SRC/app/Http/Requests/Request.php
Normal file → Executable file
0
SRC/app/Http/Requests/Request.php
Normal file → Executable file
24
SRC/app/Http/routes.php
Normal file → Executable file
24
SRC/app/Http/routes.php
Normal file → Executable file
@ -13,13 +13,23 @@
|
||||
|
||||
Route::get('/', 'GameController@index');
|
||||
|
||||
Route::get('login', 'LoginController@index');
|
||||
Route::group(['middleware' => 'guest'], function ()
|
||||
{
|
||||
Route::get('login', 'LoginController@index');
|
||||
Route::post('login', 'LoginController@authenticate');
|
||||
Route::get('oublie', 'LoginController@forgottenPassword');
|
||||
Route::post('oublie', 'LoginController@initPassword');
|
||||
});
|
||||
|
||||
Route::get('referent', 'ReferentController@index');
|
||||
|
||||
Route::get('admin', 'AdminController@index');
|
||||
Route::group(['middleware' => 'auth'], function ()
|
||||
{
|
||||
Route::get('referent', 'ReferentController@index');
|
||||
Route::get('logout', 'LoginController@logout');
|
||||
});
|
||||
|
||||
Route::group(['middleware' => 'admin'], function ()
|
||||
{
|
||||
Route::get('admin', 'AdminController@index');
|
||||
});
|
||||
|
||||
Route::controllers([
|
||||
'auth' => 'Auth\AuthController',
|
||||
'password' => 'Auth\PasswordController',
|
||||
]);
|
||||
|
0
SRC/app/Providers/AppServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/AppServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/BusServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/BusServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/ConfigServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/ConfigServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/EventServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/EventServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/RouteServiceProvider.php
Normal file → Executable file
0
SRC/app/Providers/RouteServiceProvider.php
Normal file → Executable file
0
SRC/app/Services/Registrar.php
Normal file → Executable file
0
SRC/app/Services/Registrar.php
Normal file → Executable file
0
SRC/app/User.php
Normal file → Executable file
0
SRC/app/User.php
Normal file → Executable file
Reference in New Issue
Block a user