mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-28 15:40:14 +00:00
Re-read local database record if the remote auth did not supply principal_id
This commit is contained in:
parent
28af315848
commit
b296151724
@ -65,6 +65,14 @@ class DAViCalSession extends Session
|
||||
* @param object $u The user+session object we (probably) read from the database.
|
||||
*/
|
||||
function AssignSessionDetails( $u ) {
|
||||
if ( !isset($u->principal_id) ) {
|
||||
// If they don't have a principal_id set then we should re-read from our local database
|
||||
$qry = new AwlQuery('SELECT * FROM dav_principal WHERE username = :username', array(':username' => $u->username) );
|
||||
if ( $qry->Exec() && $qry->rows() == 1 ) {
|
||||
$u = $qry->Fetch();
|
||||
}
|
||||
}
|
||||
|
||||
parent::AssignSessionDetails( $u );
|
||||
$this->GetRoles();
|
||||
if ( function_exists('awl_set_locale') && isset($this->locale) && $this->locale != '' ) {
|
||||
|
||||
@ -274,6 +274,14 @@ class HTTPAuthSession {
|
||||
* @param object $u The user+session object we (probably) read from the database.
|
||||
*/
|
||||
function AssignSessionDetails( $u ) {
|
||||
if ( !isset($u->principal_id) ) {
|
||||
// If they don't have a principal_id set then we should re-read from our local database
|
||||
$qry = new AwlQuery('SELECT * FROM dav_principal WHERE username = :username', array(':username' => $u->username) );
|
||||
if ( $qry->Exec() && $qry->rows() == 1 ) {
|
||||
$u = $qry->Fetch();
|
||||
}
|
||||
}
|
||||
|
||||
// Assign each field in the selected record to the object
|
||||
foreach( $u AS $k => $v ) {
|
||||
$this->{$k} = $v;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user