mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-20 06:09:32 +00:00
We now need to create a principal record along with a usr one.
This commit is contained in:
parent
e8f9d6a103
commit
bff7a9930c
@ -87,6 +87,7 @@ function CreateDefaultRelationships( $username ) {
|
|||||||
* @param object $usr The user details we read from the remote.
|
* @param object $usr The user details we read from the remote.
|
||||||
*/
|
*/
|
||||||
function UpdateUserFromExternal( &$usr ) {
|
function UpdateUserFromExternal( &$usr ) {
|
||||||
|
global $c;
|
||||||
/**
|
/**
|
||||||
* When we're doing the create we will usually need to generate a user number
|
* When we're doing the create we will usually need to generate a user number
|
||||||
*/
|
*/
|
||||||
@ -131,6 +132,9 @@ function UpdateUserFromExternal( &$usr ) {
|
|||||||
if ( isset($usr->active) && ($usr->active === 'f' || $usr->active === false) ) return false;
|
if ( isset($usr->active) && ($usr->active === 'f' || $usr->active === false) ) return false;
|
||||||
|
|
||||||
if ( $type == 'INSERT' ) {
|
if ( $type == 'INSERT' ) {
|
||||||
|
$privs = decbin(privilege_to_bits($c->default_privileges));
|
||||||
|
$qry = new PgQuery( 'INSERT INTO principal( type_id, user_no, displayname, default_privileges) SELECT 1, user_no, fullname, ?::BIT(24) FROM usr WHERE username=?', $privs, $usr->username );
|
||||||
|
$qry->Exec('Login',__LINE,__FILE__);
|
||||||
CreateHomeCalendar($usr->username);
|
CreateHomeCalendar($usr->username);
|
||||||
CreateDefaultRelationships($usr->username);
|
CreateDefaultRelationships($usr->username);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user