various changes, fixes to css etc
This commit is contained in:
@@ -126,7 +126,7 @@ class UserController extends Controller
|
||||
\Session::flash('info', 'Cannot register when logged in');
|
||||
return redirect('/');
|
||||
}
|
||||
return view('apply');
|
||||
return view('apply_open');
|
||||
}
|
||||
|
||||
public function loggain()
|
||||
|
@@ -142,6 +142,7 @@ class VideoController extends Controller
|
||||
$video->tag($video->category->name);
|
||||
|
||||
// TODO: outsource to different process (async)
|
||||
// sirx: Why? since the cpu clocks at more than 800mhz its fast, thinking of the 100mb filesize limit, it wont take long to create a thumbnail
|
||||
$video->createThumbnail();
|
||||
$video->tesThumb();
|
||||
|
||||
@@ -163,6 +164,25 @@ class VideoController extends Controller
|
||||
exec("curl -H \"Content-Type: application/json; charset=UTF-8\" -X POST -d '$payload' '$url' > /dev/null &");
|
||||
}
|
||||
|
||||
if (config('matrix.enabled') && config('matrix.roomid')) {
|
||||
$nsfw = in_array('nsfw', $video->getTagArrayNormalizedAttribute());
|
||||
$nsfw = $nsfw ? ' :exclamation: **NSFW** :exclamation:' : '';
|
||||
$message = config('matrix.message');
|
||||
$message = str_replace(
|
||||
['<USER>', '<ID>', '<NSFW>'],
|
||||
[$user->username, $video->id, $nsfw],
|
||||
$message
|
||||
);
|
||||
$room = "DBWMqijxlNIUIjBNdM:f0ck.it";
|
||||
$url = "https://f0ck.it/_matrix/client/r0/rooms/%21DBWMqijxlNIUIjBNdM:f0ck.it/send/m.room.message?access_token=syt_bml4Yw_yIqaTxnQHQBzeYnHusNi_3Th9Pn";
|
||||
|
||||
$payload = json_encode([
|
||||
'content' => $message,
|
||||
]);
|
||||
|
||||
exec("curl -X POST -d '{ 'msgtype : m.text', 'body: $payload'}' '$url' > /dev/null &");
|
||||
}
|
||||
|
||||
return new JsonResponse([
|
||||
'error' => 'null',
|
||||
'video_id' => $video->id
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 1.3 MiB |
@@ -130,7 +130,7 @@ Route::group(["middleware" => "theme"], function() {
|
||||
Route::get('upload', 'VideoController@create')->middleware('auth');
|
||||
Route::get('categories', 'CategoryController@index')->middleware('auth');
|
||||
Route::get('webm', function() { return view('webm'); })->middleware('auth');
|
||||
Route::get('settings', function() { return 404; })->middleware('auth');
|
||||
Route::get('settings', function() { return view('settings'); })->middleware('auth');
|
||||
Route::get('matrix', function() { return view('matrix'); })->middleware('auth');
|
||||
#Route::get('about', function() { return view('about'); })->middleware('auth');
|
||||
Route::get('about', 'aboutController@index')->middleware('auth');
|
||||
@@ -181,26 +181,4 @@ Route::group(["middleware" => "theme"], function() {
|
||||
##Category View
|
||||
Route::get('{shortname}', 'CategoryController@showVideo')->where('shortname', '[a-z][a-z0-9]+');
|
||||
Route::get('{shortname}/{id}', 'CategoryController@showVideo')->where(['shortname' => '[a-z][a-z0-9]+', 'id' => '[0-9]+']);
|
||||
|
||||
|
||||
Route::any('captcha-test', function() {
|
||||
if (request()->getMethod() == 'POST') {
|
||||
$rules = ['captcha' => 'required|captcha'];
|
||||
$validator = validator()->make(request()->all(), $rules);
|
||||
if ($validator->fails()) {
|
||||
echo '<p style="color: #ff0000;">Incorrect!</p>';
|
||||
} else {
|
||||
echo '<p style="color: #00ff30;">Matched :)</p>';
|
||||
}
|
||||
}
|
||||
|
||||
$form = '<form method="post" action="captcha-test">';
|
||||
$form .= '<input type="hidden" name="_token" value="' . csrf_token() . '">';
|
||||
$form .= '<p>' . captcha_img() . '</p>';
|
||||
$form .= '<p><input type="text" name="captcha"></p>';
|
||||
$form .= '<p><button type="submit" name="check">Check</button></p>';
|
||||
$form .= '</form>';
|
||||
return $form;
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user