Location: PHPKode > projects > FiForms Framework > FiForms/scripts/authenticate.php
<?php
/*  This file is part of the FiForms Framework
    Copyright (C) 2003-2008 by Daniel McFeeters,
    Licensed under the GNU GPL. 
    See LICENSE.txt for details. 
*/

require_once('promptpage.php');
 if(@include_once('localconfig.php'))
{
if($FIFORMS_CONFIG['USE_COMBINED'])
{
    include_once(dirname(__FILE__).'/FiForms_combined.inc.php');
}
else
{
    include_once($FIFORMS_CONFIG['INCLUDE_PATH'].'FiForms_genericIcons.inc.php');
    include_once($FIFORMS_CONFIG['INCLUDE_PATH'].'FiForms_global.inc.php');
    include_once($FIFORMS_CONFIG['INCLUDE_PATH'].'FiForms_FiForm.inc.php');
    include_once($FIFORMS_CONFIG['AUTH_MODULE']);
}

$auth = new FiFormsAuth();
if(!@mysql_connect($FIFORMS_CONFIG['DEFAULT_SERVER'],$auth->username,$auth->passwd))
{
        $auth->connectFailure();
        die();
}
if(!isset($noclose))
{
    mysql_close();
}
if($FIFORMS_CONFIG['UPDATE_HOST'] !== "any" && ($FIFORMS_CONFIG['UPDATE_HOST'] !== "localhost" || $_SERVER['REMOTE_ADDR'] !== "127.0.0.1"))
{
    die("This feature is not allowed in localconfig.php.");
}
if($checkpass && !$_POST['password'])
{
    $action = $FIFORMS_CONFIG['SERVER_ADDRESS'].$_SERVER['PHP_SELF'].($_GET['app'] ? "?app=".$_GET['app'] : "");
    promptPage("Enter FiForms Admin Login",<<<EOD
    <form action="$action" method="post">
    <table><tr>
    <td>Enter Password:</td><td>
    <input type="password" name="password" class="password" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit" value="Continue..." class="cont" /></td>
    </tr></table>
    </form>

EOD
,"30%","25%","355pt");
?>

<?php
die();
}
else if(($checkpass && (!$_POST['password'] || sha1($_POST['password']) !== $FIFORMS_CONFIG['UPDATEPW_HASH'])) || $checkpasshash && $_POST['pwhash'] !== $FIFORMS_CONFIG['UPDATEPW_HASH'])
{
    promptPage("Enter FiForms Admin Login",<<<EOD
Password Incorrect. <br /><a href="javascript:history.go(-1)">Click Here to Go Back and Try Again</a>
EOD
,"30%","25%","355pt");
die();
}
}

?>
Return current item: FiForms Framework