00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 require_once 'diogenes/diogenes.core.logger.inc.php';
00023
00030 class DiogenesWebDAVLogger extends DiogenesCoreLogger {
00031
00033 var $newsession;
00034
00036 var $sessionlength = 1800;
00037
00045 function DiogenesWebDAVLogger($uid,$auth,$username) {
00046 global $globals;
00047
00048 $this->DiogenesCoreLogger($uid,'',$auth,'');
00049
00050 if ($this->newsession) {
00051 $this->log("auth_ok","{$username}@WebDAV");
00052 }
00053 }
00054
00055
00064 function writeSession($uid,$suid,$auth,$sauth) {
00065 global $globals;
00066
00067
00068
00069 $browser = (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '');
00070 $stime = date("YmdHis",time()-$this->sessionlength);
00071 $res = $globals->db->query("select id from {$this->table_sessions} where uid='$uid' and auth='$auth' and browser='$browser' and start > $stime");
00072
00073 if (list($session) = mysql_fetch_row($res)) {
00074
00075 $this->newsession = false;
00076 } else {
00077
00078 $this->newsession = true;
00079 $session = parent::writeSession($uid,$suid,$auth,$sauth);
00080 }
00081 mysql_free_result($res);
00082 return $session;
00083 }
00084
00085 }
00086
00087 ?>