use app() instead of App::make()
This commit is contained in:
parent
329f4c86bc
commit
f3e803f57f
@ -14,7 +14,7 @@ class CheckAuthenticated
|
||||
public function handle($request, \Closure $next, $return_user = false)
|
||||
{
|
||||
if (Session::has('uid')) {
|
||||
$user = App::make('users')->get(session('uid'));
|
||||
$user = app('users')->get(session('uid'));
|
||||
|
||||
if (session('token') != $user->getToken())
|
||||
return redirect('auth/login')->with('msg', trans('auth.check.token'));
|
||||
|
@ -22,7 +22,7 @@ class CheckSessionUserValid
|
||||
|
||||
if ($user && $user->getToken() == session('token')) {
|
||||
// push user instance to repository
|
||||
App::make('users')->set($user->uid, $user);
|
||||
app('users')->set($user->uid, $user);
|
||||
} else {
|
||||
// remove sessions & cookies
|
||||
delete_sessions();
|
||||
|
@ -11,7 +11,7 @@ class RedirectIfAuthenticated
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
if (session()->has('uid')) {
|
||||
if (session('token') != App::make('users')->get(session('uid'))->getToken()) {
|
||||
if (session('token') != app('users')->get(session('uid'))->getToken()) {
|
||||
Session::put('msg', trans('auth.check.token'));
|
||||
} else {
|
||||
return redirect('user');
|
||||
|
@ -74,7 +74,7 @@ class User extends Model
|
||||
if (isset($responses[0])) {
|
||||
return (bool) $responses[0];
|
||||
} else {
|
||||
return (App::make('cipher')->encrypt($raw_passwd, config('secure.salt')) == $this->password);
|
||||
return (app('cipher')->encrypt($raw_passwd, config('secure.salt')) == $this->password);
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ class User extends Model
|
||||
if ($user->uid)
|
||||
return false;
|
||||
|
||||
$user->password = App::make('cipher')->encrypt($password, config('secure.salt'));
|
||||
$user->password = app('cipher')->encrypt($password, config('secure.salt'));
|
||||
|
||||
$callback($user);
|
||||
|
||||
@ -110,7 +110,7 @@ class User extends Model
|
||||
*/
|
||||
public function changePasswd($new_passwd)
|
||||
{
|
||||
$this->password = App::make('cipher')->encrypt($new_passwd, config('secure.salt'));
|
||||
$this->password = app('cipher')->encrypt($new_passwd, config('secure.salt'));
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
@yield('style')
|
||||
</head>
|
||||
|
||||
<?php $user = App::make('users')->get(session('uid')); ?>
|
||||
<?php $user = app('users')->get(session('uid')); ?>
|
||||
|
||||
<body class="hold-transition {{ option('color_scheme') }} sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
@ -26,7 +26,7 @@
|
||||
</h1>
|
||||
</section>
|
||||
|
||||
<?php $current_user = App::make('users')->get(session('uid')); ?>
|
||||
<?php $current_user = app('users')->get(session('uid')); ?>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
|
@ -75,7 +75,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ trans('skinlib.show.uploader') }}</td>
|
||||
<?php $uploader = App::make('users')->get($texture->uploader); ?>
|
||||
<?php $uploader = app('users')->get($texture->uploader); ?>
|
||||
<td><a href="{{ url('skinlib?filter=user&uid='.$uploader->uid) }}&sort=time">{{ $uploader->getNickName() }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
Loading…
Reference in New Issue
Block a user