PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
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
← All changes | back/Classes/UserClass.php +16 -6 11.0.0 → 11.1.0 View file →
@@ -591,10 +591,9 @@
591 591 $currentlyUnsubscribed = [];
592 592 foreach ($currentSubscription as $oneList) {
593 593 if ($oneList->status == 1) {
594 594 $currentlySubscribed[$oneList->id] = $oneList;
595 - }
596 - if ($oneList->status == 0) {
595 + } else {
597 596 $currentlyUnsubscribed[$oneList->id] = $oneList;
598 597 }
599 598 }
600 599
@@ -935,12 +934,10 @@
935 934 }
936 935
937 936 if (!empty($cmsUserLanguage)) {
938 937 $user->language = $cmsUserLanguage;
939 - } elseif (acym_isMultilingual()) {
940 - // Take the configuration's language
941 - $configUserLanguage = $this->config->get('multilingual_user_default', 'current_language');
942 - $user->language = $configUserLanguage === 'current_language' ? acym_getLanguageTag() : $configUserLanguage;
938 + } else {
939 + $user->language = acym_getDefaultUserLanguage();
943 940 }
944 941 }
945 942
946 943 $currentUserid = acym_currentUserId();
@@ -1835,8 +1832,13 @@
1835 1832 {
1836 1833 $limit = $options['limit'] ?? 10;
1837 1834 $offset = $options['offset'] ?? 0;
1838 1835 $filters = $options['filters'] ?? [];
1836 + $orderBy = $options['orderBy'] ?? '';
1837 + $orderBySort = strtolower((string)($options['orderBySort'] ?? ''));
1838 + if (!in_array($orderBySort, ['asc', 'desc'], true)) {
1839 + $orderBySort = 'asc';
1840 + }
1839 1841
1840 1842 $conditions = [];
1841 1843 foreach ($filters as $column => $filter) {
1842 1844 if (in_array($column, ['id', 'cms_id', 'active', 'confirmed', 'tracking'])) {
@@ -1856,8 +1858,16 @@
1856 1858
1857 1859 $query = 'SELECT * FROM #__acym_user';
1858 1860 if (!empty($conditions)) {
1859 1861 $query .= ' WHERE '.implode(' AND ', $conditions);
1862 + }
1863 +
1864 + $orderByColumn = empty($orderBy) ? $this->pkey : acym_secureDBColumn($orderBy);
1865 + $query .= ' ORDER BY '.$orderByColumn.' '.$orderBySort;
1866 +
1867 + // Any other column can hold duplicates, we need a unique one to break the ties
1868 + if ($orderByColumn !== $this->pkey) {
1869 + $query .= ', '.$this->pkey.' ASC';
1860 1870 }
1861 1871
1862 1872 return acym_loadObjectList($query, $this->pkey, $offset, $limit);
1863 1873 }