saml enable - initial testing

This commit is contained in:
2021-05-07 12:44:04 -04:00
parent 7e2c25e46f
commit b60af215ed
10 changed files with 531 additions and 344 deletions

View File

@@ -26,6 +26,30 @@ use App\LobbySIO\Config\Registry;
* @author josh.north
*/
class Users {
// Get user info as array by user id. Pass % for all.
public function getUserInfoByEmail($useremail, $rowsperpage, $offset) {
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
$query = "
SELECT
" . Registry::DB_PRFX . "users.id as users_id,
" . Registry::DB_PRFX . "users.username as users_username,
" . Registry::DB_PRFX . "users.email as users_email,
" . Registry::DB_PRFX . "users.created as users_created,
" . Registry::DB_PRFX . "users.firstname as users_firstname,
" . Registry::DB_PRFX . "users.lastname as users_lastname,
" . Registry::DB_PRFX . "users.usertype as users_usertypeid,
" . Registry::DB_PRFX . "usertypes.name as users_usertype,
" . Registry::DB_PRFX . "users.password as users_password
FROM " . Registry::DB_PRFX . "users
INNER JOIN " . Registry::DB_PRFX . "usertypes ON " . Registry::DB_PRFX . "users.usertype = " . Registry::DB_PRFX . "usertypes.id
WHERE " . Registry::DB_PRFX . "users.email LIKE \"$useremail\"
ORDER BY " . Registry::DB_PRFX . "users.lastname ASC" . $cond_rowsperpage . $cond_offset;
$database = new \App\LobbySIO\Database\Connect();
$rows = $database->getQuery($query);
return $rows;
}
// Get user info as array by user id. Pass % for all.
public function getUserInfo($userid, $rowsperpage, $offset) {
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };