mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-09 15:06:05 +00:00
Allow user_no, created and modified to be set on create.
This commit is contained in:
parent
fb3eca0b07
commit
7140963e49
@ -23,8 +23,8 @@ DO INSTEAD
|
||||
VALUES(
|
||||
COALESCE( NEW.user_no, nextval('usr_user_no_seq')),
|
||||
COALESCE( NEW.user_active, TRUE),
|
||||
current_timestamp,
|
||||
current_timestamp,
|
||||
COALESCE( NEW.created, current_timestamp),
|
||||
COALESCE( NEW.modified, current_timestamp),
|
||||
NEW.username, NEW.password,
|
||||
COALESCE( NEW.fullname, NEW.displayname ),
|
||||
NEW.email, NEW.email_ok,
|
||||
|
||||
@ -553,6 +553,16 @@ class Principal {
|
||||
throw new Exception( get_class($this).'::Create: Mandatory field "'.$k.'" is not set.');
|
||||
}
|
||||
}
|
||||
if ( isset($this->user_no) ) {
|
||||
$param_names[] = ':user_no';
|
||||
$insert_fields[] = 'user_no';
|
||||
$sql_params[':user_no'] = $this->user_no;
|
||||
}
|
||||
if ( isset($this->created) ) {
|
||||
$param_names[] = ':created';
|
||||
$insert_fields[] = 'created';
|
||||
$sql_params[':created'] = $this->created;
|
||||
}
|
||||
$sql = 'INSERT INTO '.self::$db_tablename.' ('.implode(',',$insert_fields).') VALUES('.implode(',',$param_names).')';
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user