public function testUpdate() { $fdao = new SessionsDao(); $session = new Session(); $session->sid = "testsid"; $session->username = "******"; $fdao->save($file); $res = $fdao->getBySid("testsid"); $this->assertGreaterThan(0, $res); $dsession = $res[0]; $dsession->username = "******"; $fdao->save($dsession); $msession = $fdao->getById($dsession->id)[0]; $this->assertEquals("changedname", $msession->username); }
$searchfid = isset($_GET['fid']) ? $_GET['fid'] : ""; $start = is_numeric($_GET['start']) ? $_GET['start'] : 0; $end = is_numeric($_GET['end']) ? $_GET['end'] : 50; $filenb = $fdao->countFiles(); if ($searchfid != "") { $filesList = array($fdao->getByFid($searchfid)); } else { if ($searchname != "") { $filesList = $fdao->searchByName($searchname); } else { $filesList = $fdao->getLastFiles($start, $end); } } $filesTotalSize = $fdao->filesTotalSize() / 1000000; $fullurl = get_full_url() . '/'; $sdao = new SessionsDao(); $sessionscount = $sdao->countSessions(); $usercount = $sdao->countUsers(); $sessionstoday = $sdao->getSessionToday(); $action = isset($_GET['dis']) ? $_GET['dis'] : 1; ?> <!doctype html> <!--[if lt IE 7]> <html class="no-js ie ie6 lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js ie ie7 lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js ie ie8 lt-ie9"> <![endif]--> <!--[if IE 9]> <html class="no-js ie ie9 lt-ie10"> <![endif]--> <!--[if gt IE 9]><!--> <html class="no-js"> <!--<![endif]--> <head> <title><?php echo $Hoster_name; ?>
function checkSession() { $sdao = new SessionsDao(); $sess = $sdao->getBySid(session_id()); if ($sess != null && count($sess) > 0) { $me = $sess[count($sess) - 1]; } else { $me = null; } return $me; }