<?php
/*
 **************************************************************************************************
 *    Copyright (c) 2010-2012 Just Another Video script
 *
 * 	  This file is part of Just Another Video Script.
 *    Version 1.4.3
 *    info@justanothervideoscript.com
 **************************************************************************************************
 *    Come to website for support or buying additional plugins/modules.
 *    http://justanothervideoscript.com/
 **************************************************************************************************
 *    By using this software you agree that you have read and acknowledged our End-User License
 *    Agreement available at http://justanothervideoscript.com/license and can be bound by it.
 **********************************************************************************
 */
function LoginControle () {
			include_once("modules/settings.inc");

			$find_this = array(' ','__','[', ']','-','(',')','.','/','\\');
			$replace_wthis= array(' ',' ','','',' ','','',' ','','');
			$susername = str_replace($find_this,$replace_wthis,$_POST['susername']);
			$spass = str_replace($find_this,$replace_wthis,$_POST['spass']);

            if ($susername == $username  && sha1($spass) == $pass) {
                $_SESSION['blogged'] = TRUE;
                $_SESSION['iTime'] = time()+30000;
                $_SESSION['iIp'] = $_SERVER['REMOTE_ADDR'];
                return true;
            }
}

function Beveiliging() {
    if ( isSet ( $_SESSION['blogged'] ) && ( $_SESSION['blogged'] == 1) ) {
        if ( $_SESSION['iTime'] > ( time() ) )
        {
            $_SESSION['iTime'] = time()+60000;
            return true;
        }
        elseif ( $_SERVER['REMOTE_ADDR'] != $_SESSION['iIp'] )
        {
            return false;
        }
        else
        {
            return false;
        }
    }

}

?>