Permalink
Browse files

MDL-19697 mnet auth - start saving user->firstaccess

  • Loading branch information...
1 parent ee720bd commit a5f0b03411c76b057bec11b22aaea96b10b1f18b @stronk7 stronk7 committed Nov 27, 2009
Showing with 5 additions and 0 deletions.
  1. +5 −0 auth/mnet/auth.php
View
@@ -294,6 +294,8 @@ function confirm_mnet_session($token, $remotewwwroot) {
print_error('nolocaluser', 'mnet');
}
$remoteuser->mnethostid = $remotehost->id;
+ $remoteuser->firstaccess = time(); // First time user in this server, grab it here
+
if (! insert_record('user', addslashes_recursive($remoteuser))) {
print_error('databaseerror', 'mnet');
}
@@ -367,6 +369,9 @@ function confirm_mnet_session($token, $remotewwwroot) {
}
$localuser->mnethostid = $remotepeer->id;
+ if (empty($localuser->firstaccess)) { // Now firstaccess, grab it here
+ $localuser->firstaccess = time();
+ }
$bool = update_record('user', addslashes_recursive($localuser));
if (!$bool) {

0 comments on commit a5f0b03

Please sign in to comment.