MDL-48282 Standardise update of user->firstaccess

This commit is contained in:
Petr Skoda 2014-11-19 14:16:41 +13:00
parent ca0e301c7b
commit f720c2c060
6 changed files with 6 additions and 14 deletions

View File

@ -147,9 +147,6 @@ class auth_plugin_email extends auth_plugin_base {
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($user->firstaccess == 0) {
$DB->set_field("user", "firstaccess", time(), array("id"=>$user->id));
}
return AUTH_CONFIRM_OK;
}
} else {

View File

@ -615,9 +615,6 @@ class auth_plugin_ldap extends auth_plugin_base {
return AUTH_CONFIRM_FAIL;
}
$user->confirmed = 1;
if ($user->firstaccess == 0) {
$user->firstaccess = time();
}
user_update_user($user, false);
return AUTH_CONFIRM_OK;
}

View File

@ -233,9 +233,6 @@ class auth_plugin_manual extends auth_plugin_base {
return AUTH_CONFIRM_ALREADY;
} else {
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($user->firstaccess == 0) {
$DB->set_field("user", "firstaccess", time(), array("id"=>$user->id));
}
return AUTH_CONFIRM_OK;
}
} else {

View File

@ -289,7 +289,7 @@ class auth_plugin_mnet extends auth_plugin_base {
} See MDL-21327 for why this is commented out
*/
$remoteuser->mnethostid = $remotehost->id;
$remoteuser->firstaccess = time(); // First time user in this server, grab it here
$remoteuser->firstaccess = 0;
$remoteuser->confirmed = 1;
$remoteuser->id = $DB->insert_record('user', $remoteuser);
@ -359,9 +359,6 @@ class auth_plugin_mnet extends auth_plugin_base {
}
$localuser->mnethostid = $remotepeer->id;
if (empty($localuser->firstaccess)) { // Now firstaccess, grab it here
$localuser->firstaccess = time();
}
user_update_user($localuser, false);
if (!$firsttime) {

View File

@ -1,6 +1,10 @@
This files describes API changes in /auth/* - plugins,
information provided here is intended especially for developers.
=== 2.9 ===
* Do not update user->firstaccess from any auth plugin, the complete_user_login() does it automatically.
=== 2.8 ===
* \core\session\manager::session_exists() now verifies the session is active

View File

@ -56,7 +56,7 @@ if ($mform_signup->is_cancelled()) {
} else if ($user = $mform_signup->get_data()) {
$user->confirmed = 0;
$user->lang = current_language();
$user->firstaccess = time();
$user->firstaccess = 0;
$user->timecreated = time();
$user->mnethostid = $CFG->mnet_localhost_id;
$user->secret = random_string(15);