| @@ -934,12 +934,10 @@ | ||
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | if (!empty($cmsUserLanguage)) { |
| 937 | 937 | $user->language = $cmsUserLanguage; |
| 938 | - } elseif (acym_isMultilingual()) { | |
| 939 | - // Take the configuration's language | |
| 940 | - $configUserLanguage = $this->config->get('multilingual_user_default', 'current_language'); | |
| 941 | - $user->language = $configUserLanguage === 'current_language' ? acym_getLanguageTag() : $configUserLanguage; | |
| 938 | + } else { | |
| 939 | + $user->language = acym_getDefaultUserLanguage(); | |
| 942 | 940 | } |
| 943 | 941 | } |
| 944 | 942 | |
| 945 | 943 | $currentUserid = acym_currentUserId(); |
| @@ -1834,8 +1832,13 @@ | ||
| 1834 | 1832 | { |
| 1835 | 1833 | $limit = $options['limit'] ?? 10; |
| 1836 | 1834 | $offset = $options['offset'] ?? 0; |
| 1837 | 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 | + } | |
| 1838 | 1841 | |
| 1839 | 1842 | $conditions = []; |
| 1840 | 1843 | foreach ($filters as $column => $filter) { |
| 1841 | 1844 | if (in_array($column, ['id', 'cms_id', 'active', 'confirmed', 'tracking'])) { |
| @@ -1855,8 +1858,16 @@ | ||
| 1855 | 1858 | |
| 1856 | 1859 | $query = 'SELECT * FROM #__acym_user'; |
| 1857 | 1860 | if (!empty($conditions)) { |
| 1858 | 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'; | |
| 1859 | 1870 | } |
| 1860 | 1871 | |
| 1861 | 1872 | return acym_loadObjectList($query, $this->pkey, $offset, $limit); |
| 1862 | 1873 | } |