session_start(); include ("classes/user.php"); include ("classes/db.php"); include ("inc/connect.php"); include ("inc/func_common.php"); include ("inc/functions.php"); include ("inc/uploadsetting.php"); include ("services/servicefactory.php"); include ("inc/check_login.php"); $guiservice =& ServiceFactory::getServiceInstance('GuiService'); $secure_url = sprintf("%s%s%s","http://",$HTTP_HOST,$REQUEST_URI); if(isset($_SERVER["HTTPS"])){ // do nothing } else { header("Location: $secure_url"); } $folder=quote_smart($_REQUEST["folder"]); if (!isset($_GET["page"])) $page = 0; else $page = $_GET["page"]; $perpage = 32; $start = ($page) * $perpage; if (logged_in($db)) { $curr_user = new cls_linksilo_user($_COOKIE["linksilo_session"],$db); //KILL $userservice =& ServiceFactory::getServiceInstance('UserService'); $functionservice =& ServiceFactory::getServiceInstance('FunctionService'); $userservice->SetCurentSession($_COOKIE["linksilo_session"]); $sql="SELECT COUNT(*) as num FROM media_folders WHERE id='".$folder."' AND auid='".$userservice->getCurrentUser()."'"; $db->query($sql); $db->next_record(); if ($db->f("num")>0) { $_SESSION["passwort"]=$functionservice->getNewPassword(50); } else { unset($_SESSION["passwort"]); } } if (!logged_in($db)) { $sql="SELECT * FROM media_folders_album WHERE folder_id='".$folder."'"; $db->query($sql); if (!$db->next_record()) die("Ordner existiert nicht oder Sie sind nicht eingeloggt"); if ($_SESSION["passwort"]!=$db->f("passwort") || $db->f("aktiv")=="0") unset($_SESSION["passwort"]); } if (isset($_POST["passwort"])) { if ($_POST["passwort"] == $db->f("passwort") && $db->f("aktiv")=="1"){ $_SESSION["passwort"]=$db->f("passwort"); mail("info@vinzl.de","Login auf Fotoalbum",$REMOTE_ADDR); } } $sql2="SELECT * FROM media_folders WHERE id='".quote_smart($_REQUEST["folder"])."'"; $db2->query($sql2); $db2->next_record(); $albumname=$db2->f("titel"); if (!isset($_GET["id"])) { $id=0; } else { $id=intval($_GET["id"]); if ($id<0) $id=0; } $sql="SELECT COUNT(*) AS _num FROM media_files WHERE upperdir='".$folder."' AND deleted='0'"; $db3->query($sql); $db3->next_record(); $_num = $db3->f("_num"); if ($id>($_num-1)) $id=$_num-1; $sql="SELECT name_svr, name_src FROM media_files WHERE upperdir='".$folder."' AND deleted='0' ORDER BY title LIMIT ".$start.", 1"; $db3->query($sql); $db3->next_record(); $name_svr = $db3->f("name_svr"); $name_src = $db3->f("name_src"); $title = $db3->f("title"); $id++; ?>
