mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
related to #2165 new add user popin
- add field for add user - in the `pwg.users.add` method, the params `send_password_by_mail` does nothing anymore. Because we no longer want to send passwords in clear text. - in the `pwg.users.add` add a new `auto_password` parameter to generate a random password when a user is created - use this parameter (`auto_password`) in user_list.js - change mail content et password page on first login
This commit is contained in:
@@ -1905,4 +1905,26 @@ function userprefs_get_param($param, $default_value=null)
|
||||
|
||||
return $default_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* See if this is the first time the user has logged on
|
||||
*
|
||||
* @since 15
|
||||
* @param int $user_id
|
||||
* @return bool true if first connexion else false
|
||||
*/
|
||||
function first_connexion($user_id)
|
||||
{
|
||||
$query = '
|
||||
SELECT COUNT(*)
|
||||
FROM '.ACTIVITY_TABLE.'
|
||||
WHERE action = \'login\' and performed_by = '.$user_id.'';
|
||||
|
||||
list($logged_in) = pwg_db_fetch_row(pwg_query($query));
|
||||
if ($logged_in > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user