コード例 #1
0
 public function load_config($config_file = false)
 {
     //*************************************************************
     // Initialize the Arrays
     //*************************************************************
     $config_arr = array();
     $data_arr = array();
     //*************************************************************
     // Set Application Plugin Folder
     //*************************************************************
     $app_plugin_folder = "{$_SESSION['file_path']}/plugins";
     if (is_dir($app_plugin_folder)) {
         set_plugin_folder($app_plugin_folder);
     }
     //*************************************************************
     // Include the configuration file
     //*************************************************************
     if ($config_file && file_exists($config_file)) {
         require $config_file;
     } else {
         require $_SESSION['file_path'] . '/config.inc.php';
     }
     //*************************************************************
     // Set HTML Path
     //*************************************************************
     if (isset($config_arr['html_path'])) {
         $_SESSION['html_path'] = $config_arr['html_path'];
     } else {
         $_SESSION['html_path'] = $this->get_html_path();
     }
     //*************************************************************
     // Generate / initialize session variables from config.inc.php
     //*************************************************************
     //=============================================================
     // *** Configuration Array
     //=============================================================
     $key_arr = array_keys($config_arr);
     foreach ($key_arr as $key) {
         $_SESSION[$key] = $config_arr[$key];
     }
     //=============================================================
     // *** Data Source Array
     //=============================================================
     $key_arr2 = array_keys($data_arr);
     foreach ($key_arr2 as $key2) {
         $reg_code = reg_data_source($key2, $data_arr[$key2]);
         if (!$reg_code) {
             $_SESSION[$key2]['handle'] = 0;
         }
     }
     //*************************************************************
     // Set Authentication Data Source
     //*************************************************************
     if (!isset($_SESSION['auth_data_source']) || empty($_SESSION['auth_data_source'])) {
         $_SESSION['auth_data_source'] = 'none';
     }
     //*************************************************************
     // Set Authentication Data Type
     //*************************************************************
     if ($_SESSION['auth_data_source'] != 'none' && $_SESSION['auth_data_source'] != 'custom') {
         if (!array_key_exists($_SESSION['auth_data_source'], $data_arr) && $_SESSION['auth_data_source'] != 'none') {
             $_SESSION['auth_data_type'] = 'error';
         } else {
             $_SESSION['auth_data_type'] = $data_arr[$_SESSION['auth_data_source']]['type'];
         }
     } else {
         if ($_SESSION['auth_data_source'] == 'custom') {
             $_SESSION['auth_data_type'] = 'custom';
         } else {
             $_SESSION['auth_data_type'] = 'none';
         }
     }
 }
コード例 #2
0
ファイル: phplitefw.inc.php プロジェクト: codifyllc/phpopenfw
 public function set_plugin_folder($dir)
 {
     set_plugin_folder($dir);
 }