This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fixing bugs.

  • Loading branch information...
jung35 committed Nov 2, 2015
1 parent 9f8c8f8 commit 133522f49af688f02e923a4852c056911bc552d3
View
@@ -26,7 +26,7 @@ class Handler extends ExceptionHandler {
*/
public function report(Exception $e)
{
if ($e instanceof \Illuminate\Session\TokenMismatchException) return;
if ($e instanceof Illuminate\Session\TokenMismatchException) return;
return parent::report($e);
}
@@ -40,22 +40,30 @@ public function report(Exception $e)
*/
public function render($request, Exception $e)
{
if ($e instanceof \Illuminate\Session\TokenMismatchException) {
\Log::info('Illuminate\Session\TokenMismatchException', [
'url' => $request->url(),
'inputs' => $request->all(),
'auth' => Auth::check() ? Auth::user()->id : null
]);
}
$this->recordLog($e, Illuminate\Session\TokenMismatchException, function($e) {
return [
'url' => $request->url(),
'inputs' => $request->all(),
'auth' => Auth::check() ? Auth::user()->id : null
];
});
if($e instanceof \GuzzleHttp\Exception\TransferException) {
\Log::info('GuzzleHttp\Exception\TransferException', [
$this->recordLog($e, GuzzleHttp\Exception\TransferException, function($e) {
return [
'request' => $e->getRequest(),
'response' => $e->hasResponse() ? $e->getResponse() : null
]);
}
];
});
return parent::render($request, $e);
}
private function recordLog($e, $exception, $callback)
{
if($e instanceof $exception)
{
\Log::info($exception, $callback($e));
}
}
}
@@ -169,7 +169,11 @@ public function addProfileToList()
if(!$userListProfile->save()) return $this->error('user_save_error');
return $this->get(UserList::where('id', $input['list_id'])->first());
$userList = UserList::where('id', $input['list_id'])->first();
if($userList == null || !isset($userList->id)) return $this->error('invalid_list_error');
return $this->get($userList);
}
public function deleteProfileFromList()
View
@@ -33,7 +33,7 @@
get('/latest', [ 'uses' => 'LatestTrackedController@get' ]);
get('/latest/vac', [ 'uses' => 'LatestVACBannedController@get' ]);
get('/latest/game', [ 'uses' => 'LatestGameBannedController@get' ]);
get('/{userList}', [ 'uses' => 'CustomListController@get' ]);
get('/{UserList}', [ 'uses' => 'CustomListController@get' ]);
Route::group(['middleware' => 'auth'], function()
{
@@ -0,0 +1,57 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveAllForeignKeys extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_list', function(Blueprint $table)
{
$table->dropForeign('user_list_user_id_foreign');
});
Schema::table('user_list_profile', function(Blueprint $table)
{
$table->dropForeign('user_list_profile_profile_id_foreign');
$table->dropForeign('user_list_profile_user_list_id_foreign');
});
Schema::table('profile_ban', function(Blueprint $table)
{
$table->dropForeign('profile_ban_profile_id_foreign');
});
Schema::table('profile_old_alias', function(Blueprint $table)
{
$table->dropForeign('profile_old_alias_profile_id_foreign');
});
Schema::table('user_mail', function(Blueprint $table)
{
$table->dropForeign('user_mail_user_id_foreign');
});
Schema::table('subscription', function(Blueprint $table)
{
$table->dropForeign('subscription_user_id_foreign');
$table->dropForeign('subscription_user_list_id_foreign');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

0 comments on commit 133522f

Please sign in to comment.