diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index f011616a0..779e01c47 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -67,7 +67,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface }); } } - if (!setting_value('visiosoft.module.location::hide_location_filter') and isset($param['country'])) { + if (!setting_value('visiosoft.module.location::hide_location_filter')) { $country = !empty($param['country']) ? $param['country'] : setting_value('visiosoft.module.location::default_country'); if ($country) { $query = $query->where('country_id', $country); diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index fc02329eb..6a33ec44b 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -483,9 +483,9 @@ class AdvsController extends PublicController $adv = $this->adv_repository->getListItemAdv($id); } - if ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id())) { + if ((auth()->user() and auth()->user()->hasRole('admin')) or ($adv && ((!$adv->expired() && $adv->getStatus() === 'approved') || $adv->created_by_id === \auth()->id()))) { // Check if created by exists - if (!$adv->created_by) { + if ((auth()->user() and !auth()->user()->hasRole('admin')) and !$adv->created_by) { $this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore'); return $this->redirect->route('visiosoft.module.advs::list'); } diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php b/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php index 090c58b74..99906459c 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/Admin/UsersController.php @@ -18,9 +18,10 @@ class UsersController extends AdminController $term = request()->term; if ($term) { return $userRepository->newQuery() - ->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', email, ')') AS name"), 'id') + ->select(DB::raw("CONCAT_WS('', first_name, ' ', last_name, ' (', gsm_phone, ' || ', display_name, ' || ', email, ')') AS name"), 'id') ->where('first_name', 'LIKE', "%$term%") ->orWhere('last_name', 'LIKE', "%$term%") + ->orWhere('display_name', 'LIKE', "%$term%") ->orWhere('gsm_phone', 'LIKE', "%$term%") ->limit(setting_value('visiosoft.module.advs::user_filter_limit')) ->pluck('name', 'id'); diff --git a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php index 2d8df1b3e..476ce364a 100644 --- a/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php +++ b/addons/default/visiosoft/profile-module/src/ProfileModuleServiceProvider.php @@ -68,6 +68,7 @@ class ProfileModuleServiceProvider extends AddonServiceProvider 'profile/class/extendTime/{id},{type}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@extendAds', 'profile/message/show/{id}' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@showMessage', 'profile/close-account' => [ + 'middleware' => 'auth', 'as' => 'visiosoft.module.profile::profile_close_account', 'uses' => 'Visiosoft\ProfileModule\Http\Controller\MyProfileController@disableAccount' ], diff --git a/database/seeds/settings.sql b/database/seeds/settings.sql index 68830c03d..5e0835ad1 100644 --- a/database/seeds/settings.sql +++ b/database/seeds/settings.sql @@ -9,12 +9,14 @@ SET time_zone = "+00:00"; /*!40101 SET NAMES utf8mb4 */; -INSERT INTO `default_settings_settings` (`id`, `sort_order`, `created_at`, `created_by_id`, `updated_at`, `updated_by_id`, `key`, `value`) VALUES -(7, 7, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::date_format', 'j F, Y'), -(8, 8, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::time_format', 'H:i'), -(11, 11, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::standard_theme', 'visiosoft.theme.base'), -(12, 12, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::admin_theme', 'visiosoft.theme.defaultadmin'), -(15, 15, '2019-07-15 06:48:46', 1, '2019-07-15 06:53:05', 1, 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}'); +INSERT INTO `default_settings_settings` (`created_at`,`key`, `value`) VALUES +('2019-07-15 06:48:46', 'streams::date_format', 'j F, Y'), +('2019-07-15 06:48:46', 'streams::time_format', 'H:i'), +('2019-07-15 06:48:46', 'streams::name', 'PHP Classifieds software'), +('2019-07-15 06:48:46', 'streams::description', 'OpenClassify is modular and most advanced open source classified platform build with Laravel.Use it in real estate classifieds, auto, e-commerce and other ...'), +('2019-07-15 06:48:46', 'streams::standard_theme', 'visiosoft.theme.base'), +('2019-07-15 06:48:46', 'streams::admin_theme', 'visiosoft.theme.defaultadmin'), +('2019-07-15 06:48:46', 'streams::enabled_locales', 'a:11:{i:0;s:2:\"en\";i:1;s:2:\"fa\";i:2;s:2:\"ar\";i:3;s:2:\"el\";i:4;s:2:\"es\";i:5;s:2:\"fr\";i:6;s:2:\"it\";i:7;s:2:\"nl\";i:8;s:2:\"pt\";i:9;s:2:\"ru\";i:10;s:2:\"tr\";}'); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;