DiogenesCoreLogger($uid,'',$auth,''); if ($this->newsession) { $this->log("auth_ok","{$username}@WebDAV"); } } /** Try to pickup an existing session, otherwise create a new entry * * @param $uid the id of the logged user * @param $suid the id of the administrator who has just su'd to the user * @param $auth authentication method for the logged user * @param $sauth authentication method for the su'er * @return session the session id */ function writeSession($uid,$suid,$auth,$sauth) { global $globals; // we look for a session with the same user, auth and browser that is less // than $sessionlength seconds old $browser = (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''); $stime = date("YmdHis",time()-$this->sessionlength); $res = $globals->db->query("select id from {$this->table_sessions} where uid='$uid' and auth='$auth' and browser='$browser' and start > $stime"); if (list($session) = mysql_fetch_row($res)) { // we have an existing session $this->newsession = false; } else { // we do not have an existing session $this->newsession = true; $session = parent::writeSession($uid,$suid,$auth,$sauth); } mysql_free_result($res); return $session; } } ?>