= "5") { # Work-around to get PLA to work in PHP5 ini_set( "zend.ze1_compatibility_mode", 1 ); # E_DEBUG is PHP5 specific and prevents warnings about using 'var' to declare class members error_reporting( E_DEBUG ); } else # For PHP4 error_reporting( E_ALL ); /** * At this point we have read all our additional function PHP files and our configuration. */ # Check our custom variables. $config->CheckCustom(); if (pla_session_start()) run_hook('post_session_init',array()); /* * Language configuration. Auto or specified? * Shall we attempt to auto-determine the language? */ $language = $config->GetValue('appearance','language'); # Get english by default, in case there are tags that are missing. ob_start(); include LANGDIR."recoded/en.php"; ob_end_clean(); if ($language == "auto") { # Make sure their browser correctly reports language. If not, skip this. if( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) { # get the languages which are spetcified in the HTTP header $HTTP_LANGS1 = preg_split ("/[;,]+/", $_SERVER['HTTP_ACCEPT_LANGUAGE'] ); $HTTP_LANGS2 = preg_split ("/[;,]+/", $_SERVER['HTTP_ACCEPT_LANGUAGE'] ); foreach( $HTTP_LANGS2 as $key => $value ) { $value=preg_split ("/[-]+/", $value ); $HTTP_LANGS2[$key]=$value[0]; } $HTTP_LANGS = array_merge ($HTTP_LANGS1, $HTTP_LANGS2); foreach( $HTTP_LANGS as $HTTP_LANG) { # try to grab one after the other the language file $language_file = LANGDIR."recoded/$HTTP_LANG.php"; if( file_exists($language_file) && is_readable($language_file)) { ob_start(); include $language_file; ob_end_clean(); break; } } } } else { # grab the language file configured in config.php if( $language != null ) { if( 0 == strcmp( $language, 'english' ) ) $language = 'en'; $language_file = LANGDIR."recoded/$language.php"; if( file_exists($language_file) && is_readable($language_file)) { ob_start(); include $language_file; ob_end_clean(); } else { pla_error(sprintf('Could not read language file "%s". Either the file does not exist, or its permissions do not allow phpLDAPadmin to read it.',$language_file)); } } } # If config.php doesn't create the templates array, create it here. if (! isset($templates) || ! is_array($templates)) $templates = array(); # Always including the 'custom' template (the most generic and flexible) $templates['custom'] = array('desc' => 'Custom', 'icon' => 'images/object.png', 'handler' => 'custom.php' ); /* * Strip slashes from GET, POST, and COOKIE variables if this * PHP install is configured to automatically addslashes() */ if (get_magic_quotes_gpc() && (! isset($slashes_stripped) || ! $slashes_stripped)) { array_stripslashes($_REQUEST); array_stripslashes($_GET); array_stripslashes($_POST); array_stripslashes($_COOKIE); array_stripslashes($_FILES); $slashes_stripped = true; } /* * Update $_SESSION['activity'] * for timeout and automatic logout feature */ if (isset($_REQUEST['server_id'])) { $ldapserver = $ldapservers->Instance($_REQUEST['server_id']); if ($ldapserver->haveAuthInfo()) set_lastactivity($ldapserver); } ?>