コード例 #1
0
ファイル: setting.php プロジェクト: inscriptionweb/gutuma
 /**
  * Loads settings - default values are overridden by user's config file if it exists
  */
 public static function load()
 {
     $plxAdmin = plxAdmin::getInstance();
     $profil = $plxAdmin->aUsers[$_SESSION['user']];
     if (empty($profil['email']) && strpos($plxAdmin->path_url, 'news/ajax.php') === FALSE && strpos($plxAdmin->path_url, 'news/js/gadgets.js.php') === FALSE && strpos($plxAdmin->path_url, 'news/subscribe.php') === FALSE) {
         header('Location: ' . $plxAdmin->urlRewrite() . 'core/admin/profil.php');
         exit;
     }
     // Set defaults
     self::$values = array();
     self::$values['application_name'] = 'Newsletters';
     self::$values['collective_name'] = t('My Newsletters');
     self::$values['admin_name'] = $profil['name'];
     self::$values['admin_username'] = $profil['login'];
     self::$values['admin_password'] = $profil['password'];
     self::$values['admin_email'] = $profil['email'];
     self::$values['use_smtp'] = TRUE;
     self::$values['use_sendmail'] = FALSE;
     self::$values['use_phpmail'] = TRUE;
     self::$values['smtp_server'] = '';
     self::$values['smtp_port'] = '';
     self::$values['smtp_encryption'] = '';
     self::$values['smtp_username'] = '';
     self::$values['smtp_password'] = '';
     self::$values['batch_max_size'] = 500;
     self::$values['batch_time_limit'] = 30;
     self::$values['msg_prefix_subject'] = TRUE;
     self::$values['msg_coll_name_on_multilist'] = FALSE;
     self::$values['msg_append_signature'] = TRUE;
     self::$values['msg_admin_copy'] = TRUE;
     self::$values['theme_name'] = 'default';
     self::$values['list_send_welcome'] = TRUE;
     self::$values['list_send_goodbye'] = TRUE;
     self::$values['list_subscribe_notify'] = TRUE;
     self::$values['list_unsubscribe_notify'] = TRUE;
     self::$values['salt'] = $profil['salt'];
     self::$values['ROOT'] = RPATH;
     self::$values['users'] = serialize(array());
     // Check if a config exists
     if (!file_exists(GUTUMA_CONFIG_FILE)) {
         return FALSE;
     }
     // Read file values and copy to static members
     $gu_config = array();
     //include GUTUMA_CONFIG_FILE;
     // Version encodée (voir ligne 232)
     eval(base64_decode(substr(file_get_contents(GUTUMA_CONFIG_FILE), 9, -5)));
     // Version décodée (voir ligne 234)
     //eval(substr(file_get_contents(GUTUMA_CONFIG_FILE),7,-4));
     self::$version = $gu_config_version;
     foreach (array_keys($gu_config) as $keys) {
         self::$values[$keys] = $gu_config[$keys];
     }
     return TRUE;
 }