From fd73bee8505b766d102cb2003ae6bb6e0437dc92 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:38:05 -0800 Subject: [PATCH 01/26] Fixed hardcoded string and added new checkout count to accessory view Signed-off-by: snipe --- resources/views/accessories/view.blade.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/views/accessories/view.blade.php b/resources/views/accessories/view.blade.php index 82d7c8201a..59ff1b9c80 100644 --- a/resources/views/accessories/view.blade.php +++ b/resources/views/accessories/view.blade.php @@ -327,13 +327,22 @@
- Number remaining + {{ trans('admin/accessories/general.remaining') }}
{{ $accessory->numRemaining() }}
+
+
+ {{ trans('general.checked_out') }} +
+
+ {{ $accessory->users_count }} +
+
+ @can('checkout', \App\Models\Accessory::class) From 56090bc64534f73d9e2cab10ff4f70e4d97d65ef Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:38:35 -0800 Subject: [PATCH 02/26] Re-ordered notes to be more consistent, fixed missing iCheck class Signed-off-by: snipe --- resources/views/accessories/edit.blade.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.php index d6233d4e5a..c16e57cb22 100755 --- a/resources/views/accessories/edit.blade.php +++ b/resources/views/accessories/edit.blade.php @@ -21,22 +21,24 @@ @include ('partials.forms.edit.purchase_cost') @include ('partials.forms.edit.quantity') @include ('partials.forms.edit.minimum_quantity') - +@include ('partials.forms.edit.notes') @if ($item->image)
- {{ Form::checkbox('image_delete') }} - - {!! $errors->first('image_delete', '') !!} + +
+ +
@endif -@include ('partials.forms.edit.notes') - @include ('partials.forms.edit.image-upload') @stop From 46e3e8a3dd9b80e1c33b0a3af951ec547f8b638c Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:39:53 -0800 Subject: [PATCH 03/26] Added new users_count field to API Signed-off-by: snipe --- app/Presenters/AccessoryPresenter.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/Presenters/AccessoryPresenter.php b/app/Presenters/AccessoryPresenter.php index 7d77acc8d7..cc4f9badfc 100644 --- a/app/Presenters/AccessoryPresenter.php +++ b/app/Presenters/AccessoryPresenter.php @@ -80,19 +80,25 @@ class AccessoryPresenter extends Presenter ], [ 'field' => 'qty', 'searchable' => false, - 'sortable' => false, - 'title' => trans('admin/accessories/general.total'), - ], [ - 'field' => 'min_qty', - 'searchable' => false, 'sortable' => true, - 'title' => trans('general.min_amt'), + 'title' => trans('admin/accessories/general.total'), ], [ 'field' => 'remaining_qty', 'searchable' => false, 'sortable' => false, 'visible' => false, 'title' => trans('admin/accessories/general.remaining'), + ],[ + 'field' => 'users_count', + 'searchable' => false, + 'sortable' => true, + 'visible' => true, + 'title' => trans('general.checked_out'), + ], [ + 'field' => 'min_qty', + 'searchable' => false, + 'sortable' => true, + 'title' => trans('general.min_amt'), ], [ 'field' => 'purchase_date', 'searchable' => true, From dceb77d4d4a70df6a1ab0b4a70b1bf0ad500e64a Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:40:20 -0800 Subject: [PATCH 04/26] Refactored numRemaining, removed unnecessary numCheckout Signed-off-by: snipe --- app/Models/Accessory.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/app/Models/Accessory.php b/app/Models/Accessory.php index 3f2004b047..d39d653382 100755 --- a/app/Models/Accessory.php +++ b/app/Models/Accessory.php @@ -327,20 +327,6 @@ class Accessory extends SnipeModel return null; } - /** - * Check how many items within an accessory are checked out - * - * @author [A. Gianotto] [] - * @since [v5.0] - * @return int - */ - public function numCheckedOut() - { - $checkedout = 0; - $checkedout = $this->users->count(); - - return $checkedout; - } /** * Check how many items of an accessory remain @@ -351,11 +337,11 @@ class Accessory extends SnipeModel */ public function numRemaining() { - $checkedout = $this->users->count(); + $checkedout = $this->users_count; $total = $this->qty; $remaining = $total - $checkedout; - return $remaining; + return (int) $remaining; } /** From 90c16318201b45fa233e07ca19f0e4f8a38c7c54 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:40:35 -0800 Subject: [PATCH 05/26] Added users_count to transformer for API Signed-off-by: snipe --- app/Http/Transformers/AccessoriesTransformer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Transformers/AccessoriesTransformer.php b/app/Http/Transformers/AccessoriesTransformer.php index 6f254b3b87..00c30f9ea2 100644 --- a/app/Http/Transformers/AccessoriesTransformer.php +++ b/app/Http/Transformers/AccessoriesTransformer.php @@ -38,7 +38,8 @@ class AccessoriesTransformer 'purchase_cost' => Helper::formatCurrencyOutput($accessory->purchase_cost), 'order_number' => ($accessory->order_number) ? e($accessory->order_number) : null, 'min_qty' => ($accessory->min_amt) ? (int) $accessory->min_amt : null, - 'remaining_qty' => $accessory->numRemaining(), + 'remaining_qty' => (int) $accessory->numRemaining(), + 'users_count' => $accessory->users_count, 'created_at' => Helper::getFormattedDateObject($accessory->created_at, 'datetime'), 'updated_at' => Helper::getFormattedDateObject($accessory->updated_at, 'datetime'), From 60eab08735187044240c3f180867411c9b772813 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:41:07 -0800 Subject: [PATCH 06/26] =?UTF-8?q?Added=20`->with(=E2=80=98users=20as=20use?= =?UTF-8?q?rs=5Fcount=E2=80=99)`=20in=20Accessory=20query?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- .../Accessories/AccessoriesController.php | 74 +++++++++---------- .../Controllers/Api/AccessoriesController.php | 5 +- 2 files changed, 41 insertions(+), 38 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoriesController.php b/app/Http/Controllers/Accessories/AccessoriesController.php index d1af79adf1..96f83d7665 100755 --- a/app/Http/Controllers/Accessories/AccessoriesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesController.php @@ -127,45 +127,45 @@ class AccessoriesController extends Controller */ public function update(ImageUploadRequest $request, $accessoryId = null) { - if (is_null($accessory = Accessory::find($accessoryId))) { + if ($accessory = Accessory::withCount('users as users_count')->find($accessoryId)) { + + $validator = Validator::make($request->all(), [ + "qty" => "required|numeric|min:$accessory->users_count" + ]); + + if ($validator->fails()) { + return redirect()->back() + ->withErrors($validator) + ->withInput(); + } + + $this->authorize($accessory); + + // Update the accessory data + $accessory->name = request('name'); + $accessory->location_id = request('location_id'); + $accessory->min_amt = request('min_amt'); + $accessory->category_id = request('category_id'); + $accessory->company_id = Company::getIdForCurrentUser(request('company_id')); + $accessory->manufacturer_id = request('manufacturer_id'); + $accessory->order_number = request('order_number'); + $accessory->model_number = request('model_number'); + $accessory->purchase_date = request('purchase_date'); + $accessory->purchase_cost = Helper::ParseCurrency(request('purchase_cost')); + $accessory->qty = request('qty'); + $accessory->supplier_id = request('supplier_id'); + $accessory->notes = request('notes'); + + $accessory = $request->handleImages($accessory); + + // Was the accessory updated? + if ($accessory->save()) { + return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success')); + } + } else { return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist')); } - $min = $accessory->numCheckedOut(); - $validator = Validator::make($request->all(), [ - "qty" => "required|numeric|min:$min" - ]); - - if ($validator->fails()) { - return redirect()->back() - ->withErrors($validator) - ->withInput(); - } - - $this->authorize($accessory); - - // Update the accessory data - $accessory->name = request('name'); - $accessory->location_id = request('location_id'); - $accessory->min_amt = request('min_amt'); - $accessory->category_id = request('category_id'); - $accessory->company_id = Company::getIdForCurrentUser(request('company_id')); - $accessory->manufacturer_id = request('manufacturer_id'); - $accessory->order_number = request('order_number'); - $accessory->model_number = request('model_number'); - $accessory->purchase_date = request('purchase_date'); - $accessory->purchase_cost = Helper::ParseCurrency(request('purchase_cost')); - $accessory->qty = request('qty'); - $accessory->supplier_id = request('supplier_id'); - $accessory->notes = request('notes'); - - $accessory = $request->handleImages($accessory); - - // Was the accessory updated? - if ($accessory->save()) { - return redirect()->route('accessories.index')->with('success', trans('admin/accessories/message.update.success')); - } - return redirect()->back()->withInput()->withErrors($accessory->getErrors()); } @@ -217,7 +217,7 @@ class AccessoriesController extends Controller */ public function show($accessoryID = null) { - $accessory = Accessory::find($accessoryID); + $accessory = Accessory::withCount('users as users_count')->find($accessoryID); $this->authorize('view', $accessory); if (isset($accessory->id)) { return view('accessories/view', compact('accessory')); diff --git a/app/Http/Controllers/Api/AccessoriesController.php b/app/Http/Controllers/Api/AccessoriesController.php index a894dc3760..fd21ebaf3a 100644 --- a/app/Http/Controllers/Api/AccessoriesController.php +++ b/app/Http/Controllers/Api/AccessoriesController.php @@ -41,10 +41,13 @@ class AccessoriesController extends Controller 'min_amt', 'company_id', 'notes', + 'users_count', + 'qty', ]; - $accessories = Accessory::select('accessories.*')->with('category', 'company', 'manufacturer', 'users', 'location', 'supplier'); + $accessories = Accessory::select('accessories.*')->with('category', 'company', 'manufacturer', 'users', 'location', 'supplier') + ->withCount('users as users_count'); if ($request->filled('search')) { $accessories = $accessories->TextSearch($request->input('search')); From 2bdf3d3f44cc460c26f68949891ea16c5f0025c8 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 21 Jan 2023 14:44:10 -0800 Subject: [PATCH 07/26] Missed a few strong HTML tags Signed-off-by: snipe --- resources/views/accessories/view.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/accessories/view.blade.php b/resources/views/accessories/view.blade.php index 59ff1b9c80..fd31722204 100644 --- a/resources/views/accessories/view.blade.php +++ b/resources/views/accessories/view.blade.php @@ -290,7 +290,7 @@ @if ($accessory->company)
- {{ trans('general.company')}} + {{ trans('general.company')}}
{{ $accessory->company->name }} @@ -302,7 +302,7 @@ @if ($accessory->category)
- {{ trans('general.category')}} + {{ trans('general.category')}}
{{ $accessory->category->name }} From dc155846ca11d404aed416bf7bc0bc64f2252b1b Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 23 Jan 2023 21:49:17 -0800 Subject: [PATCH 08/26] =?UTF-8?q?Hoist=20the=20autorization=20higher=20in?= =?UTF-8?q?=20the=20stack=20so=20we=E2=80=99re=20not=20doing=20logic=20or?= =?UTF-8?q?=20math=20when=20the=20user=20isn=E2=80=99t=20authorized=20to?= =?UTF-8?q?=20touch=20this?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: snipe --- app/Http/Controllers/Accessories/AccessoriesController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Accessories/AccessoriesController.php b/app/Http/Controllers/Accessories/AccessoriesController.php index 96f83d7665..f0b54a9498 100755 --- a/app/Http/Controllers/Accessories/AccessoriesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesController.php @@ -63,6 +63,7 @@ class AccessoriesController extends Controller public function store(ImageUploadRequest $request) { $this->authorize(Accessory::class); + // create a new model instance $accessory = new Accessory(); @@ -82,7 +83,6 @@ class AccessoriesController extends Controller $accessory->supplier_id = request('supplier_id'); $accessory->notes = request('notes'); - $accessory = $request->handleImages($accessory); // Was the accessory created? @@ -129,6 +129,8 @@ class AccessoriesController extends Controller { if ($accessory = Accessory::withCount('users as users_count')->find($accessoryId)) { + $this->authorize($accessory); + $validator = Validator::make($request->all(), [ "qty" => "required|numeric|min:$accessory->users_count" ]); @@ -139,7 +141,7 @@ class AccessoriesController extends Controller ->withInput(); } - $this->authorize($accessory); + // Update the accessory data $accessory->name = request('name'); From 596846a94a6c67e0378ef9e688b95d8a0c246e07 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 24 Jan 2023 15:29:27 -0500 Subject: [PATCH 09/26] Add VIP Checkbox --- app/Http/Controllers/Api/UsersController.php | 1 + app/Http/Controllers/Users/UsersController.php | 1 + app/Models/User.php | 4 +++- app/Presenters/UserPresenter.php | 9 +++++++++ resources/lang/en/admin/users/general.php | 2 ++ resources/views/users/edit.blade.php | 13 +++++++++++++ resources/views/users/view.blade.php | 12 +++++++++++- 7 files changed, 40 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index cca829c23f..8185583868 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -246,6 +246,7 @@ class UsersController extends Controller 'two_factor_optin', 'two_factor_enrolled', 'remote', + 'vipuser', 'start_date', 'end_date', ]; diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index 52d423036f..9d322ca4d9 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -271,6 +271,7 @@ class UsersController extends Controller $user->activated = $request->input('activated', 0); $user->zip = $request->input('zip', null); $user->remote = $request->input('remote', 0); + $user->vipuser = $request->input('vipuser', 0); $user->website = $request->input('website', null); $user->start_date = $request->input('start_date', null); $user->end_date = $request->input('end_date', null); diff --git a/app/Models/User.php b/app/Models/User.php index 399008430b..b51d23626f 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -61,7 +61,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'remote', 'start_date', 'end_date', - 'scim_externalid' + 'scim_externalid', + 'vipuser', ]; protected $casts = [ @@ -69,6 +70,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'manager_id' => 'integer', 'location_id' => 'integer', 'company_id' => 'integer', + 'vipuser' => 'boolean', ]; diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index 8f5cfcccf5..dc41050f5b 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -85,6 +85,15 @@ class UserPresenter extends Presenter 'visible' => true, 'formatter' => 'usersLinkFormatter', ], + [ + 'field' => 'vipuser', + 'searchable' => false, + 'sortable' => true, + 'switchable' => true, + 'title' => trans('admin/users/general.vip_label'), + 'visible' => false, + 'formatter' => 'trueFalseFormatter', + ], [ 'field' => 'remote', 'searchable' => false, diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index daa568e8bf..241667c387 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -41,4 +41,6 @@ return [ 'remote' => 'Remote', 'remote_help' => 'This can be useful if you need to filter by remote users who never or rarely come into your physical locations.', 'not_remote_label' => 'This is not a remote user', + 'vip_label' => 'VIP user', + 'vip_help' => 'This can be helpful to mark important people if you would like', ]; diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index 93b8fb7a21..b06dcad237 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -362,6 +362,19 @@ @include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.end_date'), 'fieldname' => 'end_date', 'item' => $user]) + +
+
+ +

{{ trans('admin/users/general.vip_help') }} +

+
+
+
diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index 5d959589e6..f12929a9d4 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -519,7 +519,17 @@
@endif - + +
+
+ {{ trans('admin/users/general.vip_label') }} +
+
+ {!! ($user->vipuser=='1') ? ' '.trans('general.yes') : ' '.trans('general.no') !!} +
+
+ +
{{ trans('admin/users/general.remote') }} From 19cf170dd99fdc3dfc8c78c2cbf3253f36bca741 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 24 Jan 2023 15:30:21 -0500 Subject: [PATCH 10/26] Add VIP Checkbox --- .../2023_01_23_232933_add_vip_to_users.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 database/migrations/2023_01_23_232933_add_vip_to_users.php diff --git a/database/migrations/2023_01_23_232933_add_vip_to_users.php b/database/migrations/2023_01_23_232933_add_vip_to_users.php new file mode 100644 index 0000000000..40db001b17 --- /dev/null +++ b/database/migrations/2023_01_23_232933_add_vip_to_users.php @@ -0,0 +1,34 @@ +boolean('vipuser')->nullable()->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + if (Schema::hasColumn('users', 'vipuser')) { + $table->dropColumn('vipuser'); + } + }); + } +} From cafe8f3074276c33aba4cf7537c008de14f12351 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 24 Jan 2023 16:20:20 -0500 Subject: [PATCH 11/26] notification for slack message --- resources/views/consumables/checkout.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/consumables/checkout.blade.php b/resources/views/consumables/checkout.blade.php index f768f78484..85cec320e2 100644 --- a/resources/views/consumables/checkout.blade.php +++ b/resources/views/consumables/checkout.blade.php @@ -60,7 +60,7 @@ @if ($snipeSettings->slack_endpoint!='') - A slack message will be sent + {{ trans('general.slack_msg_note') }} @endif
From 3ba79600fb6e163c9afec105a345cfabeef07c56 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 24 Jan 2023 18:17:49 -0500 Subject: [PATCH 12/26] checkin limit for the components checkin --- resources/lang/en/admin/components/general.php | 1 + resources/views/components/checkin.blade.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/en/admin/components/general.php b/resources/lang/en/admin/components/general.php index f7689a7ad1..5d93036054 100644 --- a/resources/lang/en/admin/components/general.php +++ b/resources/lang/en/admin/components/general.php @@ -12,4 +12,5 @@ return array( 'remaining' => 'Remaining', 'total' => 'Total', 'update' => 'Update Component', + 'checkin_limit' => 'Amount checked in must be equal to or less than this amount' ); diff --git a/resources/views/components/checkin.blade.php b/resources/views/components/checkin.blade.php index 8dca260443..55822fb9cf 100644 --- a/resources/views/components/checkin.blade.php +++ b/resources/views/components/checkin.blade.php @@ -42,7 +42,7 @@
-

Must be {{ $component_assets->assigned_qty }} or less.

+

{{ trans(admin/components/general.checkin_limit) }}: {{ $component_assets->assigned_qty }}

{!! $errors->first('checkin_qty', '') !!}
From 37f5cfa8ce0844edc65cc4e329d8a70a8fc6f845 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:02:53 -0800 Subject: [PATCH 13/26] Added edit button for fieldsets Signed-off-by: snipe --- resources/views/custom_fields/index.blade.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/views/custom_fields/index.blade.php b/resources/views/custom_fields/index.blade.php index 08c43cdd7b..d2435d7db5 100644 --- a/resources/views/custom_fields/index.blade.php +++ b/resources/views/custom_fields/index.blade.php @@ -69,8 +69,18 @@ @endforeach + + + + @can('update', $fieldset) + + + {{ trans('button.edit') }} + + @endcan + @can('delete', $fieldset) - {{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete']) }} + {{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete','style' => 'display:inline-block']) }} @if($fieldset->models->count() > 0) @else @@ -78,6 +88,7 @@ @endif {{ Form::close() }} @endcan + @endforeach From a16604285c5d8460f559af3c5eadbffa433c06cd Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:03:07 -0800 Subject: [PATCH 14/26] Normalize the fieldset form Signed-off-by: snipe --- .../custom_fields/fieldsets/edit.blade.php | 58 ++++--------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/resources/views/custom_fields/fieldsets/edit.blade.php b/resources/views/custom_fields/fieldsets/edit.blade.php index 04885891ec..a43769255d 100644 --- a/resources/views/custom_fields/fieldsets/edit.blade.php +++ b/resources/views/custom_fields/fieldsets/edit.blade.php @@ -1,49 +1,13 @@ -@extends('layouts.default') +@extends('layouts/edit-form', [ + 'createText' => trans('admin/custom_fields/general.create_fieldset') , + 'updateText' => trans('admin/custom_fields/general.update_fieldset'), + 'formAction' => (isset($item->id)) ? route('fieldsets.update', ['fieldset' => $item->id]) : route('fieldsets.store'), +]) + +@section('inputFields') + + @include ('partials.forms.edit.name', ['translated_name' => trans('general.name')]) + + -{{-- Page title --}} -@section('title') - {{ trans('admin/custom_fields/general.create_fieldset') }} -@parent -@stop - -@section('header_right') - - {{ trans('general.back') }} -@stop - - -{{-- Page content --}} -@section('content') -
-
- - {{ Form::open(['route' => 'fieldsets.store', 'class'=>'form-horizontal']) }} - -
-
- - -
- -
- - {!! $errors->first('name', '') !!} -
-
- -
- - -
- {{ Form::close() }} -
-
-

{{ trans('admin/custom_fields/general.about_fieldsets_title') }}

-

{{ trans('admin/custom_fields/general.about_fieldsets_text') }}

-
-
@stop From 583a0412fedba46f36598c5ddc65eb461d55ccc8 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:03:23 -0800 Subject: [PATCH 15/26] Added edit fieldsets translations Signed-off-by: snipe --- .../Controllers/CustomFieldsetsController.php | 61 +++++++++++++------ .../lang/en/admin/custom_fields/general.php | 3 + 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/CustomFieldsetsController.php b/app/Http/Controllers/CustomFieldsetsController.php index c7c00a7bd2..bee0f38e27 100644 --- a/app/Http/Controllers/CustomFieldsetsController.php +++ b/app/Http/Controllers/CustomFieldsetsController.php @@ -75,9 +75,9 @@ class CustomFieldsetsController extends Controller */ public function create() { - $this->authorize('create', CustomFieldset::class); + $this->authorize('create', CustomField::class); - return view('custom_fields.fieldsets.edit'); + return view('custom_fields.fieldsets.edit')->with('item', new CustomFieldset()); } /** @@ -91,7 +91,7 @@ class CustomFieldsetsController extends Controller */ public function store(Request $request) { - $this->authorize('create', CustomFieldset::class); + $this->authorize('create', CustomField::class); $cfset = new CustomFieldset([ 'name' => e($request->get('name')), @@ -110,31 +110,52 @@ class CustomFieldsetsController extends Controller } /** - * What the actual fuck, Brady? + * Presents edit form for fieldset * - * @todo Uhh, build this? - * @author [Brady Wetherington] [] + * @author [A. Gianotto] [] * @param int $id - * @since [v1.8] - * @return Fuckall + * @since [v6.0.14] + * @return Redirect + * @throws \Illuminate\Auth\Access\AuthorizationException */ public function edit($id) { - // + $this->authorize('create', CustomField::class); + + if ($fieldset = CustomFieldset::find($id)) { + return view('custom_fields.fieldsets.edit')->with('item', $fieldset); + } + + return redirect()->route('fields.index')->with('error', trans('admin/custom_fields/general.fieldset_does_not_exist', ['id' => $id])); + } /** - * GET IN THE SEA BRADY. + * Saves updated fieldset data * - * @todo Uhh, build this too? - * @author [Brady Wetherington] [] + * @author [A. Gianotto] [] * @param int $id - * @since [v1.8] - * @return Fuckall + * @since [v6.0.14] + * @return Redirect + * @throws \Illuminate\Auth\Access\AuthorizationException */ - public function update($id) + public function update(Request $request, $id) { - // + $this->authorize('create', CustomField::class); + + if ($fieldset = CustomFieldset::find($id)) { + + $fieldset->name = $request->input('name'); + + if ($fieldset->save()) { + return redirect()->route('fields.index')->with('success', trans('admin/custom_fields/general.fieldset_updated')); + } + + return redirect()->back()->withInput()->withErrors($fieldset->getErrors()); + + } + + return redirect()->route('fields.index')->with('error', trans('admin/custom_fields/general.fieldset_does_not_exist', ['id' => $id])); } /** @@ -148,7 +169,7 @@ class CustomFieldsetsController extends Controller */ public function destroy($id) { - $fieldset = CustomFieldset::find($id); + $fieldset = CustomField::find($id); $this->authorize('delete', $fieldset); @@ -175,7 +196,7 @@ class CustomFieldsetsController extends Controller */ public function associate(Request $request, $id) { - $set = CustomFieldset::find($id); + $set = CustomField::find($id); $this->authorize('update', $set); @@ -202,7 +223,7 @@ class CustomFieldsetsController extends Controller */ public function makeFieldRequired($fieldset_id, $field_id) { - $this->authorize('update', CustomFieldset::class); + $this->authorize('update', CustomField::class); $field = CustomField::findOrFail($field_id); $fieldset = CustomFieldset::findOrFail($fieldset_id); $fields[$field->id] = ['required' => 1]; @@ -220,7 +241,7 @@ class CustomFieldsetsController extends Controller */ public function makeFieldOptional($fieldset_id, $field_id) { - $this->authorize('update', CustomFieldset::class); + $this->authorize('update', CustomField::class); $field = CustomField::findOrFail($field_id); $fieldset = CustomFieldset::findOrFail($fieldset_id); $fields[$field->id] = ['required' => 0]; diff --git a/resources/lang/en/admin/custom_fields/general.php b/resources/lang/en/admin/custom_fields/general.php index 92bf240a76..9dae380aa5 100644 --- a/resources/lang/en/admin/custom_fields/general.php +++ b/resources/lang/en/admin/custom_fields/general.php @@ -27,6 +27,9 @@ return [ 'used_by_models' => 'Used By Models', 'order' => 'Order', 'create_fieldset' => 'New Fieldset', + 'update_fieldset' => 'Update Fieldset', + 'fieldset_does_not_exist' => 'Fieldset :id does not exist', + 'fieldset_updated' => 'Fieldset updated', 'create_fieldset_title' => 'Create a new fieldset', 'create_field' => 'New Custom Field', 'create_field_title' => 'Create a new custom field', From 22b0b9b090b0fc85fa1209cd6fa3a978666383d4 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Jan 2023 17:05:41 -0800 Subject: [PATCH 16/26] Fixed gates on fieldsets Signed-off-by: snipe --- .../Controllers/Api/CustomFieldsetsController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Api/CustomFieldsetsController.php b/app/Http/Controllers/Api/CustomFieldsetsController.php index 18da1b67c2..27da7733cd 100644 --- a/app/Http/Controllers/Api/CustomFieldsetsController.php +++ b/app/Http/Controllers/Api/CustomFieldsetsController.php @@ -33,7 +33,7 @@ class CustomFieldsetsController extends Controller */ public function index() { - $this->authorize('index', CustomFieldset::class); + $this->authorize('index', CustomField::class); $fieldsets = CustomFieldset::withCount('fields as fields_count', 'models as models_count')->get(); return (new CustomFieldsetsTransformer)->transformCustomFieldsets($fieldsets, $fieldsets->count()); @@ -49,7 +49,7 @@ class CustomFieldsetsController extends Controller */ public function show($id) { - $this->authorize('view', CustomFieldset::class); + $this->authorize('view', CustomField::class); if ($fieldset = CustomFieldset::find($id)) { return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset); } @@ -68,7 +68,7 @@ class CustomFieldsetsController extends Controller */ public function update(Request $request, $id) { - $this->authorize('update', CustomFieldset::class); + $this->authorize('update', CustomField::class); $fieldset = CustomFieldset::findOrFail($id); $fieldset->fill($request->all()); @@ -89,7 +89,7 @@ class CustomFieldsetsController extends Controller */ public function store(Request $request) { - $this->authorize('create', CustomFieldset::class); + $this->authorize('create', CustomField::class); $fieldset = new CustomFieldset; $fieldset->fill($request->all()); @@ -109,7 +109,7 @@ class CustomFieldsetsController extends Controller */ public function destroy($id) { - $this->authorize('delete', CustomFieldset::class); + $this->authorize('delete', CustomField::class); $fieldset = CustomFieldset::findOrFail($id); $modelsCount = $fieldset->models->count(); @@ -136,7 +136,7 @@ class CustomFieldsetsController extends Controller */ public function fields($id) { - $this->authorize('view', CustomFieldset::class); + $this->authorize('view', CustomField::class); $set = CustomFieldset::findOrFail($id); $fields = $set->fields; @@ -153,7 +153,7 @@ class CustomFieldsetsController extends Controller */ public function fieldsWithDefaultValues($fieldsetId, $modelId) { - $this->authorize('view', CustomFieldset::class); + $this->authorize('view', CustomField::class); $set = CustomFieldset::findOrFail($fieldsetId); From a4173e38819a717e702a487d93112ce6c1e753e3 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 31 Jan 2023 16:49:41 -0800 Subject: [PATCH 17/26] Permit not-delegated+dont-expire-password+normal-accounts to login --- app/Console/Commands/LdapSync.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index c6f8dd379a..ea99e74d1f 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -303,17 +303,18 @@ class LdapSync extends Command $user->activated = 0; } */ $enabled_accounts = [ - '512', // 0x200 NORMAL_ACCOUNT - '544', // 0x220 NORMAL_ACCOUNT, PASSWD_NOTREQD - '66048', // 0x10200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD - '66080', // 0x10220 NORMAL_ACCOUNT, PASSWD_NOTREQD, DONT_EXPIRE_PASSWORD - '262656', // 0x40200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED - '262688', // 0x40220 NORMAL_ACCOUNT, PASSWD_NOTREQD, SMARTCARD_REQUIRED - '328192', // 0x50200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD - '328224', // 0x50220 NORMAL_ACCOUNT, PASSWD_NOT_REQD, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD - '4194816',// 0x400200 NORMAL_ACCOUNT, DONT_REQ_PREAUTH + '512', // 0x200 NORMAL_ACCOUNT + '544', // 0x220 NORMAL_ACCOUNT, PASSWD_NOTREQD + '66048', // 0x10200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD + '66080', // 0x10220 NORMAL_ACCOUNT, PASSWD_NOTREQD, DONT_EXPIRE_PASSWORD + '262656', // 0x40200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED + '262688', // 0x40220 NORMAL_ACCOUNT, PASSWD_NOTREQD, SMARTCARD_REQUIRED + '328192', // 0x50200 NORMAL_ACCOUNT, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD + '328224', // 0x50220 NORMAL_ACCOUNT, PASSWD_NOT_REQD, SMARTCARD_REQUIRED, DONT_EXPIRE_PASSWORD + '4194816',// 0x400200 NORMAL_ACCOUNT, DONT_REQ_PREAUTH '4260352', // 0x410200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, DONT_REQ_PREAUTH '1049088', // 0x100200 NORMAL_ACCOUNT, NOT_DELEGATED + '1114624', // 0x110200 NORMAL_ACCOUNT, DONT_EXPIRE_PASSWORD, NOT_DELEGATED, ]; $user->activated = (in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts)) ? 1 : 0; From de1141491aa7441e7153f43e3cb73f0de18a9895 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 31 Jan 2023 19:41:42 -0800 Subject: [PATCH 18/26] Replaced help text Signed-off-by: snipe --- .../views/custom_fields/fieldsets/edit.blade.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/views/custom_fields/fieldsets/edit.blade.php b/resources/views/custom_fields/fieldsets/edit.blade.php index a43769255d..7a35ca146f 100644 --- a/resources/views/custom_fields/fieldsets/edit.blade.php +++ b/resources/views/custom_fields/fieldsets/edit.blade.php @@ -1,13 +1,17 @@ @extends('layouts/edit-form', [ 'createText' => trans('admin/custom_fields/general.create_fieldset') , 'updateText' => trans('admin/custom_fields/general.update_fieldset'), + 'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'), + 'helpPosition' => 'right', 'formAction' => (isset($item->id)) ? route('fieldsets.update', ['fieldset' => $item->id]) : route('fieldsets.store'), ]) -@section('inputFields') - - @include ('partials.forms.edit.name', ['translated_name' => trans('general.name')]) - - - +@section('content') + @parent @stop + +@section('inputFields') +@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')]) +@stop + + From a8643e5d35f1535bd28000bcbbaa44dc64b36a0a Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 15:55:16 -0500 Subject: [PATCH 19/26] cleaning up/adding variable --- resources/lang/en/admin/components/general.php | 2 +- resources/views/components/checkin.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/en/admin/components/general.php b/resources/lang/en/admin/components/general.php index 5d93036054..5b788a51ec 100644 --- a/resources/lang/en/admin/components/general.php +++ b/resources/lang/en/admin/components/general.php @@ -12,5 +12,5 @@ return array( 'remaining' => 'Remaining', 'total' => 'Total', 'update' => 'Update Component', - 'checkin_limit' => 'Amount checked in must be equal to or less than this amount' + 'checkin_limit' => 'Amount checked in must be equal to or less than :assigned_qty' ); diff --git a/resources/views/components/checkin.blade.php b/resources/views/components/checkin.blade.php index 55822fb9cf..0bbc46eff1 100644 --- a/resources/views/components/checkin.blade.php +++ b/resources/views/components/checkin.blade.php @@ -42,7 +42,7 @@
-

{{ trans(admin/components/general.checkin_limit) }}: {{ $component_assets->assigned_qty }}

+

{{ trans(admin/components/general.checkin_limit, ['assigned_qty' => '$component_assets->assigned_qty']) }}

{!! $errors->first('checkin_qty', '') !!}
From 4e5b8fa2136b79f398bca387f6b37740e482e17f Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 16:05:50 -0500 Subject: [PATCH 20/26] fixing pr --- app/Http/Controllers/Api/UsersController.php | 1 - app/Http/Controllers/Users/UsersController.php | 1 - app/Models/User.php | 1 - app/Presenters/UserPresenter.php | 9 --------- resources/lang/en/admin/users/general.php | 3 --- resources/views/users/edit.blade.php | 13 ------------- 6 files changed, 28 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 8185583868..cca829c23f 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -246,7 +246,6 @@ class UsersController extends Controller 'two_factor_optin', 'two_factor_enrolled', 'remote', - 'vipuser', 'start_date', 'end_date', ]; diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index 9d322ca4d9..52d423036f 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -271,7 +271,6 @@ class UsersController extends Controller $user->activated = $request->input('activated', 0); $user->zip = $request->input('zip', null); $user->remote = $request->input('remote', 0); - $user->vipuser = $request->input('vipuser', 0); $user->website = $request->input('website', null); $user->start_date = $request->input('start_date', null); $user->end_date = $request->input('end_date', null); diff --git a/app/Models/User.php b/app/Models/User.php index b51d23626f..87a0ef0916 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -62,7 +62,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'start_date', 'end_date', 'scim_externalid', - 'vipuser', ]; protected $casts = [ diff --git a/app/Presenters/UserPresenter.php b/app/Presenters/UserPresenter.php index dc41050f5b..8f5cfcccf5 100644 --- a/app/Presenters/UserPresenter.php +++ b/app/Presenters/UserPresenter.php @@ -85,15 +85,6 @@ class UserPresenter extends Presenter 'visible' => true, 'formatter' => 'usersLinkFormatter', ], - [ - 'field' => 'vipuser', - 'searchable' => false, - 'sortable' => true, - 'switchable' => true, - 'title' => trans('admin/users/general.vip_label'), - 'visible' => false, - 'formatter' => 'trueFalseFormatter', - ], [ 'field' => 'remote', 'searchable' => false, diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index 241667c387..8d890d6c08 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -41,6 +41,3 @@ return [ 'remote' => 'Remote', 'remote_help' => 'This can be useful if you need to filter by remote users who never or rarely come into your physical locations.', 'not_remote_label' => 'This is not a remote user', - 'vip_label' => 'VIP user', - 'vip_help' => 'This can be helpful to mark important people if you would like', -]; diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index b06dcad237..93b8fb7a21 100755 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -362,19 +362,6 @@ @include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.end_date'), 'fieldname' => 'end_date', 'item' => $user]) - -
-
- -

{{ trans('admin/users/general.vip_help') }} -

-
-
-
From 4d9d73483fc35a299c766aa53c7d2b781a3b6e69 Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 16:09:19 -0500 Subject: [PATCH 21/26] fixing pr --- .../2023_01_23_232933_add_vip_to_users.php | 34 ------------------- resources/views/users/view.blade.php | 10 ------ 2 files changed, 44 deletions(-) delete mode 100644 database/migrations/2023_01_23_232933_add_vip_to_users.php diff --git a/database/migrations/2023_01_23_232933_add_vip_to_users.php b/database/migrations/2023_01_23_232933_add_vip_to_users.php deleted file mode 100644 index 40db001b17..0000000000 --- a/database/migrations/2023_01_23_232933_add_vip_to_users.php +++ /dev/null @@ -1,34 +0,0 @@ -boolean('vipuser')->nullable()->default(0); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - if (Schema::hasColumn('users', 'vipuser')) { - $table->dropColumn('vipuser'); - } - }); - } -} diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index f12929a9d4..725a97ebe7 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -518,16 +518,6 @@
@endif - - -
-
- {{ trans('admin/users/general.vip_label') }} -
-
- {!! ($user->vipuser=='1') ? ' '.trans('general.yes') : ' '.trans('general.no') !!} -
-
From 3702dd87ce25a202be53ba090500a0dc0c8d4e0e Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 16:10:30 -0500 Subject: [PATCH 22/26] fixing pr --- resources/lang/en/admin/users/general.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lang/en/admin/users/general.php b/resources/lang/en/admin/users/general.php index 8d890d6c08..ff482b8ebb 100644 --- a/resources/lang/en/admin/users/general.php +++ b/resources/lang/en/admin/users/general.php @@ -41,3 +41,4 @@ return [ 'remote' => 'Remote', 'remote_help' => 'This can be useful if you need to filter by remote users who never or rarely come into your physical locations.', 'not_remote_label' => 'This is not a remote user', +]; \ No newline at end of file From 90c1bfe03df1278c4ae6b03eb6bf76e78590207e Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 16:12:39 -0500 Subject: [PATCH 23/26] fixing pr --- app/Models/User.php | 1 - resources/views/users/view.blade.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 87a0ef0916..1b336503c8 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -69,7 +69,6 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'manager_id' => 'integer', 'location_id' => 'integer', 'company_id' => 'integer', - 'vipuser' => 'boolean', ]; diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index 725a97ebe7..75be81a886 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -518,7 +518,7 @@
@endif - +
From 33d819fd41df9b8a3bbaa274549db4db1f34976b Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 16:13:53 -0500 Subject: [PATCH 24/26] fixing pr --- resources/views/users/view.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index 75be81a886..5d959589e6 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -519,7 +519,7 @@
@endif - +
{{ trans('admin/users/general.remote') }} From 0ffd40a2170a51feea442a8eac3e0f3f4a4473da Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 1 Feb 2023 16:30:07 -0500 Subject: [PATCH 25/26] fixing syntax --- resources/views/components/checkin.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/checkin.blade.php b/resources/views/components/checkin.blade.php index 0bbc46eff1..6a7055f727 100644 --- a/resources/views/components/checkin.blade.php +++ b/resources/views/components/checkin.blade.php @@ -42,7 +42,7 @@
-

{{ trans(admin/components/general.checkin_limit, ['assigned_qty' => '$component_assets->assigned_qty']) }}

+

{{ trans('admin/components/general.checkin_limit', ['assigned_qty' => $component_assets->assigned_qty]) }}

{!! $errors->first('checkin_qty', '') !!}
From 67e6089805099b6c86249a2a246fc483af562bc8 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 1 Feb 2023 16:36:30 -0800 Subject: [PATCH 26/26] Short circuit the LDAP sync is LDAP is disabled Signed-off-by: snipe --- app/Console/Commands/LdapSync.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index ea99e74d1f..f7b7518316 100755 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -44,12 +44,17 @@ class LdapSync extends Command */ public function handle() { + + // If LDAP enabled isn't set to 1 (ldap_enabled!=1) then we should cut this short immediately without going any further + if (Setting::getSettings()->ldap_enabled!='1') { + $this->error('LDAP is not enabled. Aborting. See Settings > LDAP to enable it.'); + } + ini_set('max_execution_time', env('LDAP_TIME_LIM', 600)); //600 seconds = 10 minutes ini_set('memory_limit', env('LDAP_MEM_LIM', '500M')); $ldap_result_username = Setting::getSettings()->ldap_username_field; $ldap_result_last_name = Setting::getSettings()->ldap_lname_field; $ldap_result_first_name = Setting::getSettings()->ldap_fname_field; - $ldap_result_active_flag = Setting::getSettings()->ldap_active_flag; $ldap_result_emp_num = Setting::getSettings()->ldap_emp_num; $ldap_result_email = Setting::getSettings()->ldap_email;