Hi,
A quick question to start with - in the file 'user_library.php' is the code:
function check_if_first_time($username){
global $xerte_toolkits_site;
$query = "select login_id from {$xerte_toolkits_site->database_table_prefix}logindetails where username = ? ";
$response = db_query_one($query, array($username));
if(empty($response)) {
return true;
}
return false;
}
The question is could this, or should this, be changed to check for the 'lastlogin' value rather than the login_id? By default the lastlogin value is NULL, and, obviously, gets set when the user actually logs in.
Why do this? Well, I've been asked if it is possible to 'add' 300+ users to Xerte without them actually having to log in. What is wanted is that a project is shared with these users without them having to go through the sequence of actually logging in, then notifying the admin team that they have done so and then share the project with the logged in user. To share the project the users name/id must appear in the drop-down list, and for that to happen the user must be in the logindetails table.
It seems a reasonable request, and looking through the code I think it could be done by simply adding the user to the 'logindetails' table (with a NULL lastlogin value). When the user actually logs in for the first time, their root directory and recycle bin should be created but the above code would prevent that (since the login_id would exist) unless it was changed to use the lastlogin field.
Does the code change seem reasonable?
Does adding users then seem possible? (We use the SAML2 authentication method; I know that using 'Db' authentication already has a mechanism for adding users.)
Thanks.