diff --git a/app/controllers/AuthController.php b/app/controllers/AuthController.php index 018640ea90f7..d3c309b075e4 100755 --- a/app/controllers/AuthController.php +++ b/app/controllers/AuthController.php @@ -338,7 +338,7 @@ public function getLogout() Sentry::logout(); // Redirect to the users page - return Redirect::route('assets')->with('success', 'You have successfully logged out!'); + return Redirect::route('home')->with('success', 'You have successfully logged out!'); } } diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index 8e1bdfb76f2c..da033bb89fe9 100644 --- a/app/controllers/admin/LicensesController.php +++ b/app/controllers/admin/LicensesController.php @@ -344,6 +344,7 @@ public function postCheckin($seatId) // Declare the rules for the form validation $rules = array( 'note' => 'alpha_space', + 'notes' => 'alpha_space', ); // Create a new validator instance from our validation rules diff --git a/app/controllers/admin/UsersController.php b/app/controllers/admin/UsersController.php index f57f8086a978..90023c4a9109 100755 --- a/app/controllers/admin/UsersController.php +++ b/app/controllers/admin/UsersController.php @@ -27,11 +27,11 @@ class UsersController extends AdminController { * @var array */ protected $validationRules = array( - 'first_name' => 'required|alpha_space|min:3', - 'last_name' => 'required|alpha_space|min:3', + 'first_name' => 'required|alpha_space|min:2', + 'last_name' => 'required|alpha_space|min:2', 'email' => 'required|email|unique:users,email', - 'password' => 'required|between:3,32', - 'password_confirm' => 'required|between:3,32|same:password', + 'password' => 'required|between:10,32', + 'password_confirm' => 'required|between:10,32|same:password', ); /** diff --git a/app/models/Asset.php b/app/models/Asset.php index 64dd2fe5f650..9ffe50744b19 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -58,7 +58,7 @@ public function assigneduser() **/ public function assetloc() { - return $this->assigneduser->hasOne('Location'); + return $this->assigneduser->userloc(); } /** diff --git a/app/models/License.php b/app/models/License.php index 8a6e7a1aef46..577a16662e72 100644 --- a/app/models/License.php +++ b/app/models/License.php @@ -17,6 +17,7 @@ class License extends Elegant { 'seats' => 'required|min:1|integer', 'license_email' => 'email', 'note' => 'alpha_space', + 'notes' => 'alpha_space', ); public function assignedusers() @@ -25,13 +26,6 @@ public function assignedusers() } - /** - * Get the asset's location based on the assigned user - **/ - public function assetloc() - { - return $this->assignedusers->hasOne('Location'); - } /** * Get asset logs for this asset diff --git a/app/models/User.php b/app/models/User.php index 5a3311c266a3..d1e4fae82bae 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -44,7 +44,7 @@ public function assets() public function licenses() { - return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withTrashed(); + return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withTrashed()->withPivot('id'); } @@ -62,7 +62,7 @@ public function userlog() **/ public function userloc() { - return $this->hasOne('Location','id')->withTrashed(); + return $this->belongsTo('Location','location_id')->withTrashed(); } } diff --git a/app/routes.php b/app/routes.php index 59db888558d7..71cebb330795 100755 --- a/app/routes.php +++ b/app/routes.php @@ -18,6 +18,7 @@ { Route::get('/', array('as' => '', 'uses' => 'Controllers\Admin\AssetsController@getIndex')); + Route::get('/', array('as' => 'hardware', 'uses' => 'Controllers\Admin\AssetsController@getIndex')); Route::get('create', array('as' => 'create/hardware', 'uses' => 'Controllers\Admin\AssetsController@getCreate')); Route::post('create', 'Controllers\Admin\AssetsController@postCreate'); Route::get('{assetId}/edit', array('as' => 'update/hardware', 'uses' => 'Controllers\Admin\AssetsController@getEdit')); diff --git a/app/validators.php b/app/validators.php index e8aef4ec601b..db1ff768cd7f 100644 --- a/app/validators.php +++ b/app/validators.php @@ -2,5 +2,5 @@ Validator::extend('alpha_space', function($attribute,$value,$parameters) { - return preg_match("/^[-+:?()_,!. a-zA-Z0-9]+$/",$value); + return preg_match("/^[-+:?'()_,!. a-zA-Z0-9]+$/",$value); }); diff --git a/app/views/backend/hardware/checkin.blade.php b/app/views/backend/hardware/checkin.blade.php index 3eee74af63c7..0985b49ca62d 100644 --- a/app/views/backend/hardware/checkin.blade.php +++ b/app/views/backend/hardware/checkin.blade.php @@ -13,13 +13,10 @@ {{-- Page content --}} @section('content')