PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.0.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.0.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Controllers / UsersController.php

UsersController.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.0.1, at back/Controllers/UsersController.php

68 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Controllers;
4
5 use AcyMailing\Classes\UserClass;
6 use AcyMailing\Core\AcymController;
7 use AcyMailing\Controllers\Users\Listing;
8 use AcyMailing\Controllers\Users\Edition;
9 use AcyMailing\Controllers\Users\Import;
10 use AcyMailing\Controllers\Users\Export;
11 use AcyMailing\Controllers\Users\Subscription;
12
13 class UsersController extends AcymController
14 {
15 use Listing;
16 use Edition;
17 use Import;
18 use Export;
19 use Subscription;
20
21 public function __construct()
22 {
23 parent::__construct();
24 $this->breadcrumb[acym_translation('ACYM_SUBSCRIBERS')] = acym_completeLink('users');
25 $this->loadScripts = [
26 'edit' => ['datepicker'],
27 'all' => ['vue-applications' => ['entity_select']],
28 ];
29 }
30
31 public function getAll()
32 {
33 $userClass = new UserClass();
34 return $userClass->getAll();
35 }
36
37 public function clean()
38 {
39 if (acym_isAcyCheckerInstalled()) {
40 if (ACYM_CMS === 'joomla') {
41 acym_redirect(acym_route('index.php?option=com_acychecker', false));
42 } else {
43 acym_redirect(admin_url().'admin.php?page=acychecker_dashboard');
44 }
45 } else {
46 acym_redirect(acym_completeLink('dashboard&task=acychecker', false, true));
47 }
48 }
49
50 public function getUserInfoAjax()
51 {
52 $userId = acym_getVar('int', 'userId', 0);
53
54 if (empty($userId)) {
55 acym_sendAjaxResponse(acym_translation('ACYM_USER_NOT_FOUND'), [], false);
56 }
57
58 $userClass = new UserClass();
59 $user = $userClass->getCustomFieldValueById($userId);
60
61 if (empty($user)) {
62 acym_sendAjaxResponse(acym_translation('ACYM_SUBSCRIBER_NOT_CUSTOM_FIELD'), [], false);
63 }
64
65 acym_sendAjaxResponse('', $user);
66 }
67 }
68