echo '<p>Error: Could not insert a new entry to the Moodle log</p>'; // Don't throw an error
}
if ( isset($USER) && (empty($user) || $user==$USER->id) ) {
- $db->Execute('UPDATE '. $CFG->prefix .'user SET lastIP=\''. $REMOTE_ADDR .'\', lastaccess=\''. $timenow .'\'
+ $db->Execute('UPDATE '. $CFG->prefix .'user SET lastip=\''. $REMOTE_ADDR .'\', lastaccess=\''. $timenow .'\'
WHERE id = \''. $userid .'\' ');
if ($courseid != SITEID && !empty($courseid)) { // logins etc dont't have a courseid and isteacher will break without it.
if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++;};
<FIELD name="country" method="NO_CONV" type="char" length="2" dropindex="user_country" addindex="user_country(country(2))"/>
<FIELD name="theme" method="NO_CONV" type="varchar" length="50" />
<FIELD name="timezone" method="NO_CONV" type="varchar" length="100" />
- <FIELD name="lastIP" method="NO_CONV" type="varchar" length="15" />
+ <FIELD name="lastip" method="NO_CONV" type="varchar" length="15" />
<FIELD name="secret" method="PHP_FUNCTION" type="varchar" length="15">
<PHP_FUNCTION>
migrate2utf8_user_secret(RECORDID)
update_internal_user_password($newuser, $password, false);
$newuser->lang = $CFG->lang;
$newuser->confirmed = 1;
- $newuser->lastIP = getremoteaddr();
+ $newuser->lastip = getremoteaddr();
$newuser->timemodified = time();
if (insert_record('user', $newuser)) {
$newuser->confirmed = 1;
$newuser->site = $CFG->wwwroot;
$newuser->lang = $CFG->lang;
- $newuser->lastIP = getremoteaddr();
+ $newuser->lastip = getremoteaddr();
}
return $newuser;
global $USER;
if (($version != 'sockets') and $chatuser = get_record_select('chat_users', "chatid='$chatid' AND userid='$USER->id' AND groupid='$groupid'")) {
$chatuser->version = $version;
- $chatuser->ip = $USER->lastIP;
+ $chatuser->ip = $USER->lastip;
$chatuser->lastping = time();
$chatuser->lang = current_language();
- // Sometimes $USER->lastIP is not setup properly
+ // Sometimes $USER->lastip is not setup properly
// during login. Update with current value if possible
// or provide a dummy value for the db
if (empty($chatuser->ip)) {
$chatuser->userid = $USER->id;
$chatuser->groupid = $groupid;
$chatuser->version = $version;
- $chatuser->ip = $USER->lastIP;
+ $chatuser->ip = $USER->lastip;
$chatuser->lastping = $chatuser->firstping = $chatuser->lastmessageping = time();
$chatuser->sid = random_string(32);
$chatuser->course = $course->id; //caching - needed for current_language too
$chatuser->lang = current_language(); //caching - to resource intensive to find out later
- // Sometimes $USER->lastIP is not setup properly
+ // Sometimes $USER->lastip is not setup properly
// during login. Update with current value if possible
// or provide a dummy value for the db
if (empty($chatuser->ip)) {