Hotfix for Layout 2 regarding display of sfw variable and other minor improvements and or changes
This commit is contained in:
@@ -74,9 +74,14 @@ class CategoryController extends Controller
|
||||
return redirect()->back()->with('error', 'Category is empty.');
|
||||
}
|
||||
|
||||
$sfw = $video->tags->contains(function($key, $tag) {
|
||||
return $tag->normalized === 'sfw';
|
||||
});
|
||||
|
||||
return view('video', [
|
||||
'video' => $video,
|
||||
'related' => $category,
|
||||
'related' => $category,
|
||||
'sfw' => $sfw,
|
||||
'banner' => Banner::getRandom($video->isSfw())]);
|
||||
}
|
||||
|
||||
|
@@ -9,6 +9,8 @@ use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\ModeratorLog;
|
||||
use App\Models\Banner;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Toddish\Verify\Helpers\Verify;
|
||||
@@ -131,8 +133,8 @@ class UserController extends Controller
|
||||
$validator = \Validator::make($request->all(), [
|
||||
'username' => 'required|unique:users|min:3|max:25|alpha_num',
|
||||
'email' => 'required|email|unique:users|confirmed',
|
||||
'password' => 'required|min:6|confirmed',
|
||||
'g-recaptcha-response' => 'required|recaptcha'
|
||||
'password' => 'required|min:6|confirmed'
|
||||
//'g-recaptcha-response' => 'required|recaptcha'
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
@@ -140,7 +142,7 @@ class UserController extends Controller
|
||||
->withInput($request->except(['password', 'password_confirmation']));
|
||||
}
|
||||
|
||||
//$activation_token = str_random(8) . md5($request->get('email')) . str_random(10);
|
||||
$activation_token = str_random(8) . md5($request->get('email')) . str_random(10);
|
||||
|
||||
$user = new User();
|
||||
$user->username = $request->get('username');
|
||||
@@ -148,7 +150,7 @@ class UserController extends Controller
|
||||
$user->password = $request->get('password');
|
||||
$user->activation_token = $activation_token;
|
||||
$user->disabled = 0;
|
||||
$user->verified = 1;
|
||||
$user->verified = 0;
|
||||
$user->categories = [];
|
||||
if($user->save()) {
|
||||
$data = [
|
||||
@@ -162,7 +164,7 @@ class UserController extends Controller
|
||||
$message->to($user->email, $user->username)->subject('Welcome to w0bm. Activate your account');
|
||||
});
|
||||
|
||||
return redirect('/')->with('info', 'Congratulations! You can now login!');
|
||||
return redirect('/login')->with('info', 'Congratulations! Your Account was successful created, please verify your email');
|
||||
} else {
|
||||
return redirect()->back()->with('error', 'Account could not be created')->withInput($request->except(['password', 'password_confirmation']));
|
||||
}
|
||||
@@ -413,5 +415,4 @@ class UserController extends Controller
|
||||
//return Response::create("success mothafukka, you can now go back and fap your dick", 200);
|
||||
return redirect()->back()->with('success', 'Jesus Scriptus is with you' );
|
||||
}
|
||||
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 117 KiB |
@@ -58,6 +58,8 @@ Route::group(['prefix' => 'api'], function() {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Route::get('latest', function(\Illuminate\Http\Request $req) {
|
||||
if ($req->has('filtered') && $req->get('filtered')) {
|
||||
return \App\Models\Video::filtered()->orderBy('id', 'DESC')->first();
|
||||
@@ -81,9 +83,14 @@ Route::group(['prefix' => 'api'], function() {
|
||||
});
|
||||
|
||||
Route::post('upload', 'VideoController@store');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::group(["middleware" => "theme"], function() {
|
||||
Route::get('uim', 'uimgController@index');
|
||||
Route::post('uim/add', 'UserController@speichern');
|
||||
Route::post('report/{id}', 'ReportController@report')->middleware('auth'); // added by klee
|
||||
Route::get('messages', 'MessageController@page')->middleware('auth');
|
||||
Route::get('user/{username}', 'UserController@show')->middleware('auth');
|
||||
@@ -96,7 +103,7 @@ Route::group(["middleware" => "theme"], function() {
|
||||
Route::get('logout', 'UserController@logout');
|
||||
Route::post('login', 'UserController@login');
|
||||
Route::get('register', 'UserController@create');
|
||||
Route::post('register', 'UserController@store');
|
||||
//Route::post('register', 'UserController@store');
|
||||
Route::get('activate/{token}', 'UserController@activate');
|
||||
Route::get('index', 'VideoController@index')->middleware('auth');
|
||||
Route::get('main', 'VideoController@main')->middleware('auth');
|
||||
@@ -107,6 +114,7 @@ Route::group(["middleware" => "theme"], function() {
|
||||
Route::get('about', function() { return view('about'); })->middleware('auth');
|
||||
Route::get('irc', function() { return view('irc'); });
|
||||
Route::get('rules', function() { return view('rules'); })->middleware('auth');
|
||||
Route::get('todo', function() { return view('todo'); })->middleware('auth');
|
||||
Route::get('contact', function() { return view('contact'); });
|
||||
Route::get('terms', function() { return view('tos'); })->middleware('auth');
|
||||
Route::get('privacy', function() { return view('privacy'); })->middleware('auth');
|
||||
@@ -119,8 +127,9 @@ Route::group(["middleware" => "theme"], function() {
|
||||
'latest_video' => \App\Models\Video::getLastId(),
|
||||
'newest_user' => \App\Models\User::orderBy('id', 'DESC')->first()->username,
|
||||
'dirsize' => shell_exec("(du -sh " . public_path() . "/b | cut -f1)")
|
||||
]);
|
||||
]);
|
||||
})->middleware('auth');
|
||||
|
||||
Route::get('/latest', function () {
|
||||
Session::reflash();
|
||||
|
||||
|
Reference in New Issue
Block a user