| @@ 908-937 (lines=30) @@ | ||
| 905 | * |
|
| 906 | * @return array |
|
| 907 | */ |
|
| 908 | public function getAllUsers($withoutAnonymous = true, $allowBlockedUsers = true) |
|
| 909 | { |
|
| 910 | $select = sprintf(" |
|
| 911 | SELECT |
|
| 912 | user_id |
|
| 913 | FROM |
|
| 914 | %sfaquser |
|
| 915 | WHERE |
|
| 916 | 1 = 1 |
|
| 917 | %s |
|
| 918 | %s |
|
| 919 | ORDER BY |
|
| 920 | user_id ASC", |
|
| 921 | PMF_Db::getTablePrefix(), |
|
| 922 | ($withoutAnonymous ? 'AND user_id <> -1' : ''), |
|
| 923 | ($allowBlockedUsers ? '' : "AND account_status != 'blocked'") |
|
| 924 | ); |
|
| 925 | ||
| 926 | $res = $this->config->getDb()->query($select); |
|
| 927 | if (!$res) { |
|
| 928 | return array(); |
|
| 929 | } |
|
| 930 | ||
| 931 | $result = array(); |
|
| 932 | while ($row = $this->config->getDb()->fetchArray($res)) { |
|
| 933 | $result[] = $row['user_id']; |
|
| 934 | } |
|
| 935 | ||
| 936 | return $result; |
|
| 937 | } |
|
| 938 | ||
| 939 | /** |
|
| 940 | * Returns an array of all users found in the database. By default, the |
|
| @@ 948-972 (lines=25) @@ | ||
| 945 | * @param boolean $withoutAnonymous Without anonymous? |
|
| 946 | * @return array |
|
| 947 | */ |
|
| 948 | public function getAllUserData($withoutAnonymous = true) |
|
| 949 | { |
|
| 950 | $select = sprintf(" |
|
| 951 | SELECT |
|
| 952 | user_id, login, account_status, auth_source, member_since |
|
| 953 | FROM |
|
| 954 | %sfaquser |
|
| 955 | %s |
|
| 956 | ORDER BY |
|
| 957 | login ASC", |
|
| 958 | PMF_Db::getTablePrefix(), |
|
| 959 | ($withoutAnonymous ? 'WHERE user_id <> -1' : '')); |
|
| 960 | ||
| 961 | $res = $this->config->getDb()->query($select); |
|
| 962 | if (!$res) { |
|
| 963 | return array(); |
|
| 964 | } |
|
| 965 | ||
| 966 | $result = array(); |
|
| 967 | while ($row = $this->config->getDb()->fetchArray($res)) { |
|
| 968 | $result[$row['user_id']] = $row; |
|
| 969 | } |
|
| 970 | ||
| 971 | return $result; |
|
| 972 | } |
|
| 973 | ||
| 974 | /** |
|
| 975 | * Get all users in <option> tags |
|