<?php
    public function identifyOffline($user)
    {
        $ip   = $this->server->remote_addr;
        $last = $this->server->request_time;

        $user->lastTime       = $user->last;
        $user->last           = date(DT_DATETIME1, $last);
        $user->admin          = strpos($this->app->company->admins, ",{$user->account},") !== false;
        $user->modifyPassword = ($user->visits == 0 and !empty($this->config->safe->modifyPasswordFirstLogin));
        if($user->modifyPassword) $user->modifyPasswordReason = 'modifyPasswordFirstLogin';
        if(!$user->modifyPassword and !empty($this->config->safe->changeWeak))
        {
            $user->modifyPassword = $this->loadModel('admin')->checkWeak($user);
            if($user->modifyPassword) $user->modifyPasswordReason = 'weak';
        }

        /* code for bug #2729. */
        if(defined('IN_USE')) $this->dao->update(TABLE_USER)
                                        ->set('visits = visits + 1')
                                        ->set('ip')->eq($ip)
                                        ->set('last')->eq($last)
                                        ->where('account')->eq($user->account)
                                        ->exec();

        $user = $this->login($user);

        return $user;
    }
?>