2016-10-06 15:57:01 +00:00
< ? php
2019-12-28 11:25:38 +00:00
2016-10-06 15:57:01 +00:00
/**
* Project :
* Contenido Content Management System
*
* Description :
* Header File
*
* Requirements :
* @ con_php_req 5.0
*
*
* @ package Contenido Backend
* @ version 1.2 . 2
* @ author Jan Lengowski
* @ copyright four for business AG < www . 4 fb . de >
* @ license http :// www . contenido . org / license / LIZENZ . txt
* @ link http :// www . 4 fb . de
* @ link http :// www . contenido . org
* @ since file available since contenido release <= 4.6
*
* { @ internal
* created 2003 - 03 - 18
* modified 2008 - 06 - 25 , Timo Trautmann , Contenido Framework Constand added
* modified 2008 - 07 - 02 , Frederic Schneider , add security fix and include_security_class
* modified 2010 - 05 - 20 , Murat Purc , standardized Contenido startup and security check invocations , see [ #CON-307]
*
2019-07-03 11:58:28 +00:00
* $Id $ :
2016-10-06 15:57:01 +00:00
* }}
*
*/
if ( ! defined ( " CON_FRAMEWORK " )) {
define ( " CON_FRAMEWORK " , true );
}
// Contenido startup process
include_once ( './includes/startup.php' );
2019-12-28 11:25:38 +00:00
$db = new DB_ConLite ();
2016-10-06 15:57:01 +00:00
page_open (
2019-12-28 11:25:38 +00:00
array ( 'sess' => 'Contenido_Session' ,
'auth' => 'Contenido_Challenge_Crypt_Auth' ,
'perm' => 'Contenido_Perm' ));
2016-10-06 15:57:01 +00:00
2019-12-28 11:25:38 +00:00
i18nInit ( $cfg [ " path " ][ " contenido " ] . $cfg [ " path " ][ " locale " ], $belang );
2016-10-06 15:57:01 +00:00
2019-12-28 11:25:38 +00:00
cInclude ( " includes " , 'cfg_language_de.inc.php' );
cInclude ( " includes " , 'functions.forms.php' );
2016-10-06 15:57:01 +00:00
2019-12-28 11:25:38 +00:00
if ( isset ( $killperms )) {
2016-10-06 15:57:01 +00:00
$sess -> unregister ( " right_list " );
$sess -> unregister ( " area_rights " );
$sess -> unregister ( " item_rights " );
}
2019-12-28 11:25:38 +00:00
i18nInit ( $cfg [ " path " ][ " contenido " ] . $cfg [ " path " ][ " locale " ], $belang );
2016-10-06 15:57:01 +00:00
$sess -> register ( " sess_area " );
if ( isset ( $area )) {
$sess_area = $area ;
} else {
$area = ( isset ( $sess_area )) ? $sess_area : 'login' ;
}
if ( is_numeric ( $changelang )) {
2019-12-28 11:25:38 +00:00
unset ( $area_rights );
unset ( $item_rights );
2016-10-06 15:57:01 +00:00
$sess -> register ( " lang " );
$lang = $changelang ;
}
2019-12-28 11:25:38 +00:00
if ( empty ( $client ) || ! is_numeric ( $client ) || ( ! $perm -> have_perm_client ( " client[ " . $client . " ] " ) && ! $perm -> have_perm_client ( " admin[ " . $client . " ] " ))) {
// use first client which is accessible
2016-10-06 15:57:01 +00:00
$sess -> register ( " client " );
2019-12-28 11:25:38 +00:00
$sql = " SELECT idclient FROM " . $cfg [ " tab " ][ " clients " ] . " ORDER BY idclient ASC " ;
2016-10-06 15:57:01 +00:00
$db -> query ( $sql );
2019-12-28 11:25:38 +00:00
while ( $db -> next_record ()) {
$mclient = $db -> f ( " idclient " );
if ( $perm -> have_perm_client ( " client[ " . $mclient . " ] " ) || $perm -> have_perm_client ( " admin[ " . $mclient . " ] " )) {
unset ( $lang );
$client = $mclient ;
break ;
}
2016-10-06 15:57:01 +00:00
}
} else {
2019-12-28 11:25:38 +00:00
$sess -> register ( " client " );
2016-10-06 15:57:01 +00:00
}
if ( empty ( $lang ) || ! is_numeric ( $lang )) { // use first language found
$sess -> register ( " lang " );
2019-12-28 11:25:38 +00:00
$sql = " SELECT * FROM " . $cfg [ " tab " ][ " lang " ] . " AS A, " . $cfg [ " tab " ][ " clients_lang " ] . " AS B WHERE A.idlang=B.idlang AND idclient=' " . Contenido_Security :: toInteger ( $client ) . " ' ORDER BY A.idlang ASC " ;
2016-10-06 15:57:01 +00:00
$db -> query ( $sql );
$db -> next_record ();
$lang = $db -> f ( " idlang " );
} else {
$sess -> register ( " lang " );
}
// call http encoding header sending function
sendEncodingHeader ( $db , $cfg , $lang );
$perm -> load_permissions ();
2019-12-28 11:25:38 +00:00
$xml = new XML_doc ;
$tpl = new Template ;
$nav = new Contenido_Navigation ();
2016-10-06 15:57:01 +00:00
rereadClients ();
$nav -> buildHeader ( $lang );
2019-12-28 11:25:38 +00:00
page_close ();