<?php require_once("res/x5engine.php"); ?>
<?php
$pa = Configuration::getPrivateArea();
$pa->admin_email = 'pjboba@gmail.com';
$db = getDbData('vyjbkf98');
if ($db === false)
	die("Cannot find a database");
$pa->setDBData($db['host'], $db['user'], $db['password'], $db['database'], 'uzytkownicy');
if (isset($_GET['waitingusers']) && ($headers = imRequestHeaders()) !== false) {
	$token = "";
	foreach ($headers as $key => $value)
		if (strtolower($key) == 'x-incomedia-wsx5-token')
			$token = $value;
	if ($token == '662h0im60020562gjl36478g03rrdbe38d4ygv16pyn') {
		echo $pa->getWaitingUsers($imSettings['general']['salt']);
		exit();
	}
}
if (isset($_POST['lostdata'])) {
	$res = $pa->sendLostPasswordEmail($_POST['lostdata']);
	header('Location: imlogin.php?loginstatus=' . ($res ? '4' : '-7'));
}
if (isset($_GET['registernew']) && $_GET['registernew'] == 1 && checkJsAndSpam('065926C2BC934265D0840B81570FFD46')) {
	$res = $pa->registerNewUser(imFilterInput($_POST['imUname']), imFilterInput($_POST['imRegPwd']), imFilterInput($_POST['imFirstname']), imFilterInput($_POST['imLastname']), 1);
	if ($res > 0 && $_GET['redirect_after_registration'] == 'true') {
		$page = $pa->getSavedPage() ? $pa->getSavedPage() : $pa->getLandingPage();
		$pa->sessionSafeRedirect($page);
	} else {
		header('Location: imlogin.php?registrationstatus=' . ($res < 0 ? $res : '3'));
	}
	exit();
}
if (isset($_POST['imUname']) && isset($_POST['imPwd'])) {
	$result = $pa->login($_POST['imUname'], $_POST['imPwd']);
	if ($result < 0) {
		header('Location: imlogin.php?loginstatus=' . $result);
		exit();
	}
	$page = $pa->getSavedPage() ? $pa->getSavedPage() : $pa->getLandingPage();
	if (!$page) {
		if(isset($_SERVER["HTTP_REFERER"]) && strlen($_SERVER["HTTP_REFERER"]) && strpos($_SERVER["HTTP_REFERER"], 'imlogin.php') === false) {
			$page = preg_replace('/\?.*/', '', $_SERVER["HTTP_REFERER"]) . '?loginstatus=1';
		} else {
			$page = 'imlogin.php?loginstatus=1';
		}
	}
	$pa->clearSavedPage();
	$pa->sessionSafeRedirect($page);
}
if (isset($_GET['landing_page'])) {
	$pa->savePage($_GET['landing_page']);
}
?><!DOCTYPE html><!-- HTML5 -->
<html prefix="og: http://ogp.me/ns#" lang="pl-PL" dir="ltr">
	<head>
		<title>Dostęp chroniony - FiNIO</title>
		<meta charset="utf-8" />
		<!--[if IE]><meta http-equiv="ImageToolbar" content="False" /><![endif]-->
		<meta name="generator" content="Incomedia WebSite X5 Professional 14.0.5.3 - www.websitex5.com" />
		<meta property="og:locale" content="pl" />
		<meta property="og:type" content="website" />
		<meta property="og:url" content="http://finio.com.pl/imlogin.php" />
		<meta property="og:title" content="Dostęp chroniony" />
		<meta property="og:site_name" content="FiNIO" />
		<meta name="viewport" content="width=1200" />
		
		<link rel="stylesheet" type="text/css" href="style/reset.css?14-0-5-3" media="screen,print" />
		<link rel="stylesheet" type="text/css" href="style/print.css?14-0-5-3" media="print" />
		<link rel="stylesheet" type="text/css" href="style/style.css?14-0-5-3" media="screen,print" />
		<link rel="stylesheet" type="text/css" href="style/template.css?14-0-5-3" media="screen" />
		<link rel="stylesheet" type="text/css" href="pcss/imlogin.css?14-0-5-3-636739373279503715" media="screen,print" />
		<script type="text/javascript" src="res/jquery.js?14-0-5-3"></script>
		<script type="text/javascript" src="res/x5engine.js?14-0-5-3" data-files-version="14-0-5-3"></script>
		<script type="text/javascript">
			window.onload = function(){ checkBrowserCompatibility('Twoja przeglądarka nie obsługuje funkcji potrzebnych do wyświetlenia tej witryny.','Twoja przeglądarka może nie obsługiwać funkcji niezbędnych do wyświetlenia tej witryny.','[1]Aktualizuj przeglądarkę[/1] lub [2]kontynuuj bez aktualizacji[/2].','http://outdatedbrowser.com/'); };
			x5engine.utils.currentPagePath = 'imlogin.php';
			x5engine.boot.push(function () { x5engine.imPageToTop.initializeButton({}); });
		</script>
		<link rel="icon" href="favicon.ico?14-0-5-3-636739373279463776" type="image/vnd.microsoft.icon" />
	</head>
	<body>
		<div id="imPageExtContainer">
			<div id="imPageIntContainer">
				<div id="imHeaderBg"></div>
				<div id="imFooterBg"></div>
				<div id="imPage">
					<div id="imHeader">
						<h1 class="imHidden">Dostęp chroniony - FiNIO</h1>
						<div id="imHeaderObjects"><div id="imHeader_imObjectImage_01_wrapper" class="template-object-wrapper"><div id="imHeader_imCell_1" class="" > <div id="imHeader_imCellStyleGraphics_1"></div><div id="imHeader_imCellStyle_1" ><img id="imHeader_imObjectImage_01" src="images/logoFINIO.png" title="" alt="" /></div></div></div><div id="imHeader_imMenuObject_04_wrapper" class="template-object-wrapper"><div id="imHeader_imCell_4" class="" > <div id="imHeader_imCellStyleGraphics_4"></div><div id="imHeader_imCellStyle_4" ><div id="imHeader_imMenuObject_04"><div class="hamburger-button hamburger-component"><div><div><div class="hamburger-bar"></div><div class="hamburger-bar"></div><div class="hamburger-bar"></div></div></div></div><div class="hamburger-menu-background-container hamburger-component">
	<div class="hamburger-menu-background menu-mobile menu-mobile-animated hidden">
		<div class="hamburger-menu-close-button"><span>&times;</span></div>
	</div>
</div>
<ul class="menu-mobile-animated hidden">
	<li class="imMnMnFirst imPage" data-link-paths="/index.html,/">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="index.html">
Strona główna		</a>
</div>
</div>
	</li><li class="imMnMnMiddle imPage" data-link-paths="/ankieta.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="ankieta.html">
Ankieta		</a>
</div>
</div>
	</li><li class="imMnMnMiddle imPage" data-link-paths="/logowanie.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="logowanie.html">
Logowanie		</a>
</div>
</div>
	</li><li class="imMnMnMiddle imLevel" data-link-paths="/index.html,/" data-link-anchor="ofinio" data-link-hash="97578024"><div class="label-wrapper"><div class="label-inner-wrapper"><a href="index.html#ofinio" class="label" onclick="return x5engine.utils.location('index.html#ofinio', null, false)">O FiNIO</a></div></div></li><li class="imMnMnMiddle imLevel"><div class="label-wrapper"><div class="label-inner-wrapper"><span class="label">Ćwiczenia</span></div></div><ul data-original-position="bottom" class="bottom">
	<li class="imMnMnFirst imPage" data-link-paths="/zestaw-1.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="zestaw-1.html">
Zestaw 1		</a>
</div>
</div>
	</li><li class="imMnMnLast imPage" data-link-paths="/zestaw-2.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="zestaw-2.html">
Zestaw 2		</a>
</div>
</div>
	</li></ul></li><li class="imMnMnLast imLevel"><div class="label-wrapper"><div class="label-inner-wrapper"><span class="label">Filmy</span></div></div></li></ul></div><script type="text/javascript">
x5engine.boot.push(function(){x5engine.initMenu('imHeader_imMenuObject_04',1000)});
$(function () {$('#imHeader_imMenuObject_04 ul li').each(function () {    var $this = $(this), timeout = 0;    $this.on('mouseenter', function () {        clearTimeout(timeout);        setTimeout(function () { $this.children('ul, .multiple-column').stop(false, false).show(); }, 250);    }).on('mouseleave', function () {        timeout = setTimeout(function () { $this.children('ul, .multiple-column').stop(false, false).hide(); }, 250);    });});});

</script>
</div></div></div></div>
					</div>
					<div id="imStickyBarContainer">
						<div id="imStickyBarGraphics"></div>
						<div id="imStickyBar">
							<div id="imStickyBarObjects"><div id="imStickyBar_imMenuObject_01_wrapper" class="template-object-wrapper"><div id="imStickyBar_imCell_1" class="" > <div id="imStickyBar_imCellStyleGraphics_1"></div><div id="imStickyBar_imCellStyle_1" ><div id="imStickyBar_imMenuObject_01"><div class="hamburger-button hamburger-component"><div><div><div class="hamburger-bar"></div><div class="hamburger-bar"></div><div class="hamburger-bar"></div></div></div></div><div class="hamburger-menu-background-container hamburger-component">
	<div class="hamburger-menu-background menu-mobile menu-mobile-animated hidden">
		<div class="hamburger-menu-close-button"><span>&times;</span></div>
	</div>
</div>
<ul class="menu-mobile-animated hidden">
	<li class="imMnMnFirst imPage" data-link-paths="/index.html,/">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="index.html">
Strona główna		</a>
</div>
</div>
	</li><li class="imMnMnMiddle imPage" data-link-paths="/ankieta.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="ankieta.html">
Ankieta		</a>
</div>
</div>
	</li><li class="imMnMnMiddle imPage" data-link-paths="/logowanie.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="logowanie.html">
Logowanie		</a>
</div>
</div>
	</li><li class="imMnMnMiddle imLevel" data-link-paths="/index.html,/" data-link-anchor="ofinio" data-link-hash="97578024"><div class="label-wrapper"><div class="label-inner-wrapper"><a href="index.html#ofinio" class="label" onclick="return x5engine.utils.location('index.html#ofinio', null, false)">O FiNIO</a></div></div></li><li class="imMnMnMiddle imLevel"><div class="label-wrapper"><div class="label-inner-wrapper"><span class="label">Ćwiczenia</span></div></div><ul data-original-position="bottom" class="bottom">
	<li class="imMnMnFirst imPage" data-link-paths="/zestaw-1.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="zestaw-1.html">
Zestaw 1		</a>
</div>
</div>
	</li><li class="imMnMnLast imPage" data-link-paths="/zestaw-2.html">
<div class="label-wrapper">
<div class="label-inner-wrapper">
		<a class="label" href="zestaw-2.html">
Zestaw 2		</a>
</div>
</div>
	</li></ul></li><li class="imMnMnLast imLevel"><div class="label-wrapper"><div class="label-inner-wrapper"><span class="label">Filmy</span></div></div></li></ul></div><script type="text/javascript">
x5engine.boot.push(function(){x5engine.initMenu('imStickyBar_imMenuObject_01',1000)});
$(function () {$('#imStickyBar_imMenuObject_01 ul li').each(function () {    var $this = $(this), timeout = 0;    $this.on('mouseenter', function () {        clearTimeout(timeout);        setTimeout(function () { $this.children('ul, .multiple-column').stop(false, false).show(); }, 250);    }).on('mouseleave', function () {        timeout = setTimeout(function () { $this.children('ul, .multiple-column').stop(false, false).hide(); }, 250);    });});});

</script>
</div></div></div></div>
						</div>
					</div>
					<a class="imHidden" href="#imGoToCont" title="Pomiń menu główne">Przejdź do treści</a>
					<div id="imSideBarContainer">
						<div id="imSideBarGraphics"></div>
						<div id="imSideBar">
							<div id="imSideBarObjects"></div>
						</div>
					</div>
					<div id="imContentContainer">
						<div id="imContentGraphics"></div>
						<div id="imContent">
							<a id="imGoToCont"></a>
				<div id="imLoginPage">
				<?php if (!isset($_GET['cart'])): ?>
					<h2 id="imPgTitle" class="imTitleMargin">Dostęp chroniony</h2>
					<div style="height: 15px;">&nbsp;</div>
				<?php else: ?>
					<h2 id ="imPgTitle" class="imTitleMargin">Krok 2 - Dane klienta</h2>
					<script>x5engine.boot.push(function () {
					if (x5engine.cart.ui.steps.active) {
						$('#imPgTitle').before(x5engine.cart.ui.getStepStyleDom(1));
					}
					});</script>
				<?php endif; ?>
					<?php if (isset($_GET['loginstatus']) && $_GET['loginstatus'] == 1): ?>
					<div class="alert alert-green"><?php echo $pa->messageFromStatusCode(1) ?></div>
					<?php else: ?>
								<div id="imLoginDescription"><?php echo isset($_GET['cart']) ? Configuration::getLocalizations()->get('cart_step2_descr_login', 'To set the order you are required to login or register.' ) : 'Per poter accedere a questa sezione del Sito è necessario inserire i propri dati di accesso.'; ?></div>
								<div class="imLogin">
									<?php
										if (isset($_GET['loginstatus']) && $pa->messageFromStatusCode($_GET['loginstatus']) != '') {
											echo '<div class="alert alert-' . ($_GET['loginstatus'] >= 0 ? 'green' : 'red') . '">' . $pa->messageFromStatusCode($_GET['loginstatus']) . '</div>';
										}
									?>
									<h3>Użytkownik jest już zarejestrowany</h3>
									<form method="post" action="imlogin.php" id="imLoginForm">
										<div class="imLoginBlock">
											<label for="imUname"><span>E-mail:</span></label><br />
											<input type="text" name="imUname" id="imUname" class="mandatory"><br />
										</div>
										<div class="imLoginBlock">
											<label for="imPwd"><span>Hasło:</span></label><br />
											<input type="password" name="imPwd" id="imPwd" class="mandatory"><br />
										</div>
										<div class="imLoginBlock" style="text-align: right;">
											<a href="#" class="imCssLink" style="margin-right: 5px;" onclick="$('#imLoginForm').slideUp();$('#imLostPassword').slideDown(); return false;">Nie pamiętam hasła</a>
											<input type="submit" value="Zaloguj się" class="imLoginSubmit">
										</div>
									</form>
									<script type="text/javascript">x5engine.boot.push(function() { x5engine.imForm.initForm('#imLoginForm', false, { 'jsid': '065926C2BC934265D0840B81570FFD46', showAll: true, offlineMessage: 'Podczas testowania witryny nie będziesz proszony o login i hasło. Stanie się to dopiero po opublikowaniu witryny.' }); });</script>
									<form method="post" id="imLostPassword" action="imlogin.php" style="display: none;">
										<div class="imLoginBlock">
											<label for="lostdata">Podaj swoją nazwę użytkownika lub adres e-mail:*</label>
											<input type="text" id="lostdata" name="lostdata" class="mandatory">
										</div>
										<div class="imLoginBlock" style="text-align: right;">
											<input type="submit" value="Zapomniałeś hasła?" class="imLoginSubmit">
										</div>
									</form>
									<script type="text/javascript">x5engine.boot.push(function() { x5engine.imForm.initForm('#imLostPassword', false, { 'jsid': '065926C2BC934265D0840B81570FFD46', showAll: true, offlineMessage: 'Podczas testowania witryny nie będziesz proszony o login i hasło. Stanie się to dopiero po opublikowaniu witryny.' }); });</script>
								</div>
								<div class="imLogin">
									<?php
										if (isset($_GET['registrationstatus']) && $pa->messageFromStatusCode($_GET['registrationstatus']) != '') {
											echo '<div class="alert alert-' . ($_GET['registrationstatus'] >= 0 ? 'green' : 'red') . '">' . $pa->messageFromStatusCode($_GET['registrationstatus']) . '</div>';
										}
									?>
									<h3>Rejestruj nowe konto</h3>
									<form method="post" action="imlogin.php?registernew=1<?php if (@$_GET['redirect_after_registration'] == 'true') echo '&redirect_after_registration=true'; ?>" id="imRegister">
										<div class="imLoginBlock">
											<label for="imFirstname"><span>Imię:*</span></label><br />
											<input type="text" name="imFirstname" id="imFirstname" class="mandatory"><br />
										</div>
										<div class="imLoginBlock">
											<label for="imLastname"><span>Nazwisko:*</span></label><br />
											<input type="text" name="imLastname" id="imLastname" class="mandatory"><br />
										</div>
										<div class="imLoginBlock">
											<label for="imUname"><span>E-mail*:</span></label><br />
											<input type="text" name="imUname" id="imUname" class="mandatory valEmail"><br />
										</div>
										<div class="imLoginBlock">
											<label for="imRegPwd"><span>Hasło:*</span></label><br />
											<input type="password" name="imRegPwd" id="imRegPwd" class="mandatory"><br />
										</div>
										<input type="text" value="" name="prt" class="prt_field">
										<div class="imLoginBlock" style="text-align: right;">
											<input type="submit" value="Zarejestruj się" class="imLoginSubmit">
										</div>
									</form>
									<script type="text/javascript">x5engine.boot.push(function() { x5engine.imForm.initForm('#imRegister', false, { 'jsid': '065926C2BC934265D0840B81570FFD46', showAll: true, offlineMessage: 'Podczas testowania witryny nie będziesz proszony o login i hasło. Stanie się to dopiero po opublikowaniu witryny.' }); });</script>
								</div>
								<script>$(function () { $("#imUname").focus(); });</script>	<?php endif; ?>
				</div>
				
							<div class="imClear"></div>
						</div>
					</div>
					<div id="imFooter">
						<div id="imFooterObjects"><div id="imFooter_imObjectImage_01_wrapper" class="template-object-wrapper"><div id="imFooter_imCell_1" class="" > <div id="imFooter_imCellStyleGraphics_1"></div><div id="imFooter_imCellStyle_1" ><img id="imFooter_imObjectImage_01" src="images/linia.png" title="" alt="" /></div></div></div></div>
					</div>
				</div>
				<span class="imHidden"><a href="#imGoToCont" title="Czytaj stronę ponownie">Wróć do spisu treści</a></span>
			</div>
		</div>
		
		<noscript class="imNoScript"><div class="alert alert-red">Aby korzystać z tej strony musisz włączyć obsługę JavaScript.</div></noscript>
	</body>
</html>
