<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of last_logged_observer
 *
 * @author Igor Ratsun
 */
class last_logged_observer implements SplObserver {

    public function update(SplSubject $subject) {
        if ($subject->is_logged) {
            $CI = & get_instance();
            $CI->db->
                    where('login', $subject->user_name)->
                    update('acl_user', array('last_logged' => date('Y-m-d H:i:s')));
            
        }
    }

}
