/** * Méthode qui se charger de créer le Singleton plxAdmin * * @return objet return une instance de la classe plxAdmin * @author Stephane F **/ public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new plxAdmin(path('XMLFILE_PARAMETERS')); } return self::$instance; }
function addToPluxml() { define('PLX_ROOT', '../../../'); define('PLX_CORE', PLX_ROOT . 'core/'); define('PLX_CONFIG_PATH', 'data/configuration/'); define('PLX_PLUGINS', PLX_ROOT . 'plugins/'); define('PLX_UPDATER', true); include PLX_CORE . 'lib/config.php'; # On inclut les librairies nécessaires include_once PLX_CORE . 'lib/class.plx.glob.php'; include_once PLX_CORE . 'lib/class.plx.utils.php'; include_once PLX_CORE . 'lib/class.plx.motor.php'; include_once PLX_CORE . 'lib/class.plx.admin.php'; include_once PLX_CORE . 'lib/class.plx.plugins.php'; $plxAdmin = plxAdmin::getInstance(); # Si cryptMyPluxml est chargé if (in_array('cryptMyPluxml', plxGlob::getInstance(PLX_PLUGINS, true)->aFiles)) { $pickyPasteInPluxml = $plxAdmin->plxPlugins->getInstance('pickyPasteInPluxml'); if ($pickyPasteInPluxml->getParam('cryptMyPluxml') == 1) { // Create storage directory if it does not exist. if (!is_dir(PLX_ROOT . 'data/zb')) { mkdir(PLX_ROOT . 'data/zb', 0705); file_put_contents(PLX_ROOT . 'data/zb/.htaccess', "Allow from none\nDeny from all\n", LOCK_EX); } define('PLX_ZB', PLX_ROOT . 'data/zb/'); } else { define('PLX_ZB', './data/'); } } else { define('PLX_ZB', './data/'); } }
public function AdminPrepend() { $this->plxMotor = plxAdmin::getInstance(); if (isset($this->plxMotor->aConf['images'])) { // jusqu'à la version 5.3.1 $this->cheminImages = $this->plxMotor->aConf['images']; } else { $this->cheminImages = $this->plxMotor->aConf['medias']; } }
<?php /************************************************************************ * @project Gutuma Newsletter Managment * @author Rowan Seymour * @copyright This source is distributed under the GPL * @file included settings page * @modifications Cyril Maguire */ /* Gutama plugin package * @version 1.6 * @date 01/10/2013 * @author Cyril MAGUIRE */ $plxAdmin = plxAdmin::getInstance(); $profil = $plxAdmin->aUsers[$_SESSION['user']]; $plxPlugin = $plxShow->plxMotor->plxPlugins->getInstance('gutuma'); include_once '_menu.php'; ?> <div id="sectionheader"> <h2><?php echo $section_titles[$section]; ?> </h2> <ul id="sectionmenu"> <li><a href="settings.php" <?php echo $section == 'general' ? 'class="current"' : ''; ?> ><?php
/** * Constructeur qui initialise l'objet plxAdmin par référence * * @return null * @author Stephane F **/ public function __construct() { $this->plxAdmin = plxAdmin::getInstance(); if (!isset($this->plxAdmin->aConf['plugins'])) { $this->plxAdmin->aConf['plugins'] = 'data/configuration/plugins.xml'; } }
/** * 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; }