GlisWeb framework
_950.pages.php
Vai alla documentazione di questo file.
1 <?php
2 
26  // debug
27  // print_r( $cf['contents']['pages']['licenza']['content'] );
28 
29  // includo il file di configurazione del template
30  if( file_exists( DIRECTORY_BASE . $ct['page']['template']['path'] . 'etc/template.conf' ) ) {
31  $ct['page'] = array_merge_recursive(
32  $ct['page'],
33  parse_ini_file( DIRECTORY_BASE . $ct['page']['template']['path'] . 'etc/template.conf', true, INI_SCANNER_RAW )
34  );
35  } else {
36  logWrite( 'il file ' . DIRECTORY_BASE . $ct['page']['template']['path'] . 'etc/template.conf non esiste', 'template', LOG_CRIT );
37  }
38 
39  // forzo lo schema di login se l'utente corrente non ha i permessi sulla pagina
40  if( isset( $ct['page']['auth']['groups'] ) && is_array( $ct['page']['auth']['groups'] ) ) {
41  if( ! isset( $_SESSION['account']['gruppi'] ) || ! is_array( $_SESSION['account']['gruppi'] ) || count( array_intersect( $ct['page']['auth']['groups'], $_SESSION['account']['gruppi'] ) ) == 0 ) {
42  logWrite( 'accesso non consentito alla pagina ' . $ct['page']['id'] . ', sessione ' . session_id() .
43  ' (gruppi utente ' . ( ( isset($_SESSION['account']['gruppi']) ) ? implode( ',',$_SESSION['account']['gruppi']) : 'nessuno' ) . ' / ' .
44  'gruppi richiesti ' . ( ( isset($ct['page']['auth']['groups']) ) ? implode( ',',$ct['page']['auth']['groups']) : 'nessuno' ) . ')', 'auth', LOG_NOTICE );
45  $ct['page']['template']['schema'] = 'login.html';
46 # $h = fopen( DIRECTORY_BASE . 'var/log/sessions.debug', 'a+' );
47 # fwrite( $h, date('Y-m-d H:i:s') . ' ' . session_id() . ' -> logout' . PHP_EOL );
48 # fclose( $h );
49  } else {
50  logWrite( 'accesso consentito alla pagina ' . $ct['page']['id'] . ', sessione ' . session_id(), 'auth', LOG_DEBUG );
51 # $h = fopen( DIRECTORY_BASE . 'var/log/sessions.debug', 'a+' );
52 # fwrite( $h, date('Y-m-d H:i:s') . ' ' . session_id() . ' -> continue' . PHP_EOL );
53 # fclose( $h );
54  }
55  }
56 
57  // fwrite( fopen( DIRECTORY_BASE . 'var/log/sessions.debug', session_id() . ' -> current' ) );
58 
59 /*
60  // costruisco gli alberi dei menu
61  $ct['page']['navigation'] = buildMenu( $ct['page']['template']['etc']['menu']['active'] );
62 
63  // percorsi utili
64  $ct['path']['root'] = '/' . $cf['site']['basefolders'][ $cf['site']['status'] ];
65  $ct['path']['template'] = $ct['path']['root'] . $ct['page']['template']['path'];
66  $ct['page']['root'] = &$ct['path']['root'];
67 
68  // eseguo le macro richieste per la pagina corrente
69  if( isset( $ct['page']['macro'] ) && is_array( $ct['page']['macro'] ) ) {
70 
71  foreach( $ct['page']['macro'] as $macro ) {
72 
73  require DIRECTORY_BASE . $macro;
74 
75  }
76 
77  }
78 
79  // debug
80  // header('content-type: text/plain;charset=utf-8');
81  // print_r( $ct['page']['navigation'] );
82 
83 */
84 
85  // debug
86  // print_r( $cf['contents']['pages']['licenza']['content'] );
87  // echo $cf['contents']['updated'];
88 
89 ?>
if(isset( $cx['contatti'])) if(isset( $cf['site']['contatti'])) $ct['contatti']
Definition: _035.common.php:24
logWrite( $m, $f='site', $l=LOG_NOTICE, $d=DIRECTORY_LOG, $t=CURRENT_LOG_LEVEL, $s=SITE_STATUS)
scrive un messaggio nei log del sito
Definition: _log.utils.php:48
const DIRECTORY_BASE
Definition: _osm.php:3
if(isset( $_REQUEST['amazonCheckoutSessionId'])) $_SESSION['carrello']