<?xml version="1.0" encoding="UTF-8" ?>
<php:start xmlns:php="http://php.net/xsl">
<php:top_statement_list id="77">
<php:top_statement_list id="70">
<php:top_statement_list id="63">
<php:top_statement_list id="56">
<php:top_statement_list id="49">
<php:top_statement_list id="42">
<php:top_statement_list id="35">
<php:top_statement_list id="28">
<php:top_statement_list id="21">
<php:top_statement_list id="14">
<php:top_statement_list id="7">
<php:top_statement_list id="0">
</php:top_statement_list>
<php:ACTION1 id="2">
</php:ACTION1>
<php:top_statement id="6">
<php:statement id="5">
<php:unticked_statement id="4">
<php:T_INLINE_HTML id="3"><?</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="9">
</php:ACTION1>
<php:top_statement id="13">
<php:statement id="12">
<php:unticked_statement id="11">
<php:T_INLINE_HTML id="10">PHP
/*
* phpMyPurchasing
* Jason Gerfen [hide@address.com]
*
* index.php - index or main page
*/
if(file_exists('scripts/inc.config.php')) {
require 'scripts/inc.config.php';
// ensure we are being called from our configured host
if( $defined['hostname'] === $_SERVER['SERVER_NAME'] ) {
// obtain default options
$defined = array_merge($defined,$handles['misc']->getDefaults());
</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="16">
</php:ACTION1>
<php:top_statement id="20">
<php:statement id="19">
<php:unticked_statement id="18">
<php:T_INLINE_HTML id="17"> $defined = array_merge($defined,$handles['misc']->getAuthentication());
$accessList = $handles['misc']->getAccessList();
// copy and filter incoming data
$get = @array_map( $handles['val']->ValidateXSS, $_GET );
$post = @array_map( $handles['val']->ValidateXSS, $_POST );
$sess = @array_map( $handles['val']->ValidateXSS, $_SESSION );
$serv = @array_map( $handles['val']->ValidateXSS, </php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="23">
</php:ACTION1>
<php:top_statement id="27">
<php:statement id="26">
<php:unticked_statement id="25">
<php:T_INLINE_HTML id="24">$_SERVER );
// handle logging of requests, remote data
$handles['logs']->process($serv);
//define the template and cache directories
$handles['tpl']->strTemplateDir = $defined['templates'];
$handles['tpl']->strCacheDir = '/tmp';
if( !empty( $post ) ) { $flag = "TRUE"; } else { $flag = "FALSE"; }
// gather up some information for the token
if( ( !isset( $_SESSION['token'] ) ) </php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="30">
</php:ACTION1>
<php:top_statement id="34">
<php:statement id="33">
<php:unticked_statement id="32">
<php:T_INLINE_HTML id="31">|| ( !is_resource( $handles['session'] ) ) ) {
$handles['session'] = new dbSession( $defined['timeout'] );
}
$_SESSION['referrer'] = $serv['HTTP_REFERER'];
// perform authentication
$authenticated = $handles['auth']->DecideAuth( $_SESSION['token'], $post['user'], $post['pass'], $serv );
if($authenticated===0){ $class = "good"; } else { $class= "error"; }
// include our header file</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="37">
</php:ACTION1>
<php:top_statement id="41">
<php:statement id="40">
<php:unticked_statement id="39">
<php:T_INLINE_HTML id="38">
$handles['tpl']->assign( 'TITLE', $defined['title'], NULL, NULL );
$handles['tpl']->assign('ip',$serv['REMOTE_ADDR'],NULL,NULL);
$handles['tpl']->assign('logo',$defined['logo'],NULL,NULL);
$handles['tpl']->assign( 'templates', $defined['templates'], NULL, NULL );
$handles['tpl']->assign('timeout',$defined['timeout'],NULL,NULL);
$handles['tpl']->display( 'header.tpl', $flag, NULL );
</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="44">
</php:ACTION1>
<php:top_statement id="48">
<php:statement id="47">
<php:unticked_statement id="46">
<php:T_INLINE_HTML id="45"> // process authentication and load appropriate template
if($authenticated !== 0) {
$ERROR = '<div class="'.$class.'">' . $handles['err']->detLoginErr($authenticated) . '</div>';
$use = 'content-login.tpl';
} else {
// determine our template
switch( $get['do'] ) {
case '0x00a0':
$ele = 'tabMain';
$use = 'content-authenticated.tpl';
break;
case '0x00b0':
$e</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="51">
</php:ACTION1>
<php:top_statement id="55">
<php:statement id="54">
<php:unticked_statement id="53">
<php:T_INLINE_HTML id="52">le = 'tabPurchasing';
$use = 'content-purchasing.tpl';
break;
case '0x00c0':
$ele = 'tabReports';
$use = 'content-reports.tpl';
break;
case '0x00d0':
$ele = 'tabConfiguration';
$use = 'content-configuration.tpl';
break;
case '0x00e0':
$ele = 'tabPermissions';
$use = 'content-permissions.tpl';
break;
case '0x00f0':
$ele = '</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="58">
</php:ACTION1>
<php:top_statement id="62">
<php:statement id="61">
<php:unticked_statement id="60">
<php:T_INLINE_HTML id="59">tabExit';
$use = 'content-exit.tpl';
break;
default:
$ele = 'tabMain';
$use = 'content-login.tpl';
break;
}
}
$handles['tpl']->assign('ERROR',$ERROR,NULL,NULL);
$handles['tpl']->assign( $ele, $handles['tpl']->assign( NULL, NULL, $use, $flag ), NULL, NULL );
$handles['tpl']->display( 'main.tpl', $flag, NULL );
// call our footer file
$handles['tpl']->as</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="65">
</php:ACTION1>
<php:top_statement id="69">
<php:statement id="68">
<php:unticked_statement id="67">
<php:T_INLINE_HTML id="66">sign('copyright', $defined['copyright'], NULL, NULL);
$handles['tpl']->assign('FOOTER', $footer, NULL, NULL);
$handles['tpl']->display('footer.tpl', $flag, NULL);
} else {
echo "Cannot be called from anywhere other then our defined host";
}
} else {
echo "Configuration file not found";
}
if($defined['debug']==="true"){ $handles['debug']->ShowDebug( $_GET, $post, $_REQUEST, $sess, $hand</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
<php:ACTION1 id="72">
</php:ACTION1>
<php:top_statement id="76">
<php:statement id="75">
<php:unticked_statement id="74">
<php:T_INLINE_HTML id="73">les ); }
?>
</php:T_INLINE_HTML>
</php:unticked_statement>
</php:statement>
</php:top_statement>
</php:top_statement_list>
</php:start>