|
@@ -4,6 +4,7 @@ namespace Luticate\Auth\Business;
|
4
|
4
|
|
5
|
5
|
use Illuminate\Support\Facades\DB;
|
6
|
6
|
use Luticate\Auth\DBO\LuticatePermissions;
|
|
7
|
+use Luticate\Auth\DBO\LuticateUsersLightDbo;
|
7
|
8
|
use Luticate\Auth\DBO\LuticateUsersLoginDbo;
|
8
|
9
|
use Luticate\Utils\LuBusiness;
|
9
|
10
|
use Luticate\Auth\DataAccess\LuticateUsersDataAccess;
|
|
@@ -99,6 +100,16 @@ class LuticateUsersBusiness extends LuBusiness {
|
99
|
100
|
return true;
|
100
|
101
|
}
|
101
|
102
|
|
|
103
|
+ public static function getAll($page = 0, $perPage = PHP_INT_MAX)
|
|
104
|
+ {
|
|
105
|
+ $users = self::search($page, $perPage, "username", "ASC");
|
|
106
|
+ $usersLight = array();
|
|
107
|
+ foreach ($users as $user) {
|
|
108
|
+ $usersLight[] = LuticateUsersLightDbo::fromUserDbo($user);
|
|
109
|
+ }
|
|
110
|
+ return $usersLight;
|
|
111
|
+ }
|
|
112
|
+
|
102
|
113
|
public static function add($username, $email, $password)
|
103
|
114
|
{
|
104
|
115
|
$hash = self::hashPassword($password);
|
|
@@ -124,7 +135,7 @@ class LuticateUsersBusiness extends LuBusiness {
|
124
|
135
|
$user_id = LuticateUsersDataAccess::addId($user);
|
125
|
136
|
|
126
|
137
|
if (!is_null(LuticateGroupsBusiness::getById(0))) {
|
127
|
|
- LuticateGroupsBusiness::addUserToGroup($user_id, 0);
|
|
138
|
+ LuticateGroupsBusiness::addUser($user_id, 0);
|
128
|
139
|
}
|
129
|
140
|
DB::commit();
|
130
|
141
|
|