From d13a377ff79d24088ec69e715115bb3fe5b90c7e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 9 Mar 2015 17:15:28 +0200 Subject: [PATCH] Added ip to activities table --- app/controllers/PaymentController.php | 1 - .../2015_03_09_151011_add_ip_to_activity.php | 34 +++++++++++++++++++ app/filters.php | 2 +- app/models/Activity.php | 1 + 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app/database/migrations/2015_03_09_151011_add_ip_to_activity.php diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index 9cef3a375895..c0241a8979fe 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -291,7 +291,6 @@ class PaymentController extends \BaseController 'returnUrl' => URL::to('complete'), 'cancelUrl' => $invitation->getLink(), 'description' => trans('texts.' . $invoice->getEntityType()) . " {$invoice->invoice_number}", - 'transactionId' => $invoice->invoice_number, ]; } else { return $data; diff --git a/app/database/migrations/2015_03_09_151011_add_ip_to_activity.php b/app/database/migrations/2015_03_09_151011_add_ip_to_activity.php new file mode 100644 index 000000000000..552f75dfa808 --- /dev/null +++ b/app/database/migrations/2015_03_09_151011_add_ip_to_activity.php @@ -0,0 +1,34 @@ +string('ip')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('activities', function($table) + { + $table->dropColumn('ip'); + }); + } + +} diff --git a/app/filters.php b/app/filters.php index 8dddcf16f908..7aa8d6cbd11f 100755 --- a/app/filters.php +++ b/app/filters.php @@ -264,7 +264,7 @@ Route::filter('csrf', function() if (Session::token() != $token) { - Session::flash('warning', trans('texts.session_expired')); + Session::flash('warning', trans('texts.session_expired')); return Redirect::to('/'); //throw new Illuminate\Session\TokenMismatchException; diff --git a/app/models/Activity.php b/app/models/Activity.php index 912aa554be7f..9fe82178c612 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -35,6 +35,7 @@ class Activity extends Eloquent } $activity->token_id = Session::get('token_id', null); + $activity->ip = Request::getClientIp(); return $activity; }