Ejemplo n.º 1
0
 function update_config()
 {
     foreach ($_REQUEST as $var => $value) {
         if (!preg_match('/^' . Parseur::PREFIXE . '/', $var)) {
             continue;
         }
         Variable::ecrire($var, $value);
     }
     // Bug 1.4.3.1
     if (class_exists('CacheBase')) {
         CacheBase::getCache()->reset_cache();
     }
 }
 /**
  * Modifier une langue existante
  *
  */
 public function modifier($id, $description, $code, $url, $defaut)
 {
     $lang = new Lang();
     if ($lang->charger_id($id)) {
         $lang->description = trim($description);
         $lang->code = strtolower(trim($code));
         $lang->defaut = $defaut;
         if ($this->get_un_domaine_par_langue() == 1) {
             $lang->url = rtrim($url, "/");
             // Compatibilité ascendante: urlsite contient l'url du site par defaut.
             if ($defaut) {
                 Variable::ecrire('urlsite', $lang->url);
             }
         }
         $lang->maj();
         ActionsModules::instance()->appel_module("modlangue", $lang);
     }
 }
Ejemplo n.º 3
0
    $admin = new Administrateur();
    $admin->charger_id(1);
    $admin->identifiant = $_POST['utilisateur'];
    $admin->motdepasse = $_POST['motdepasse1'];
    $admin->profil = 1;
    $admin->crypter();
    $admin->maj();
    Variable::ecrire("emailcontact", $_POST['emailcontact']);
    Variable::ecrire("emailfrom", $_POST['emailcontact']);
    Variable::ecrire("emailscommande", $_POST['emailcontact']);
    Variable::ecrire("nomsite", $_POST['nomsite']);
    Variable::ecrire("urlsite", $_POST['urlsite']);
    $lang = new Lang();
    $query_cnx = "update {$lang->table} set url=\"" . rtrim($_POST['urlsite'], "/") . "\" where id=1";
    $resul_cnx = $lang->query($query_cnx);
    Variable::ecrire("rsspass", genpass(40));
}
$_SESSION['etape'] = 5;
include_once __DIR__ . "/entete.php";
$parser = xml_parser_create('UTF-8');
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
$xml = file_get_contents('http://thelia.net/spip.php?page=xml_modules_promus&var_mode=calcul');
$values = array();
$index = array();
xml_parse_into_struct($parser, $xml, $values);
$listeModules = false;
$infosModule = false;
$listeModulesPromus = array();
foreach ($values as $key => $node) {
    if ($node['tag'] == 'modules' && $node['type'] == 'open' && $node['level'] == 1) {
Ejemplo n.º 4
0
 public static function cleanup_cache($cache_dir, $force = 0)
 {
     // Doit-on purger le cache ?
     $last_check = intval(Variable::lire(Parseur::PREFIXE . '_cache_check_time'));
     $check_period = intval(3600 * Variable::lire(Parseur::PREFIXE . '_cache_check_period'));
     if ($force == 0 && time() - $last_check < $check_period) {
         return;
     }
     Variable::ecrire(Parseur::PREFIXE . '_cache_check_time', time());
     $cache_file_lifetime = 3600 * Variable::lire(Parseur::PREFIXE . '_cache_file_lifetime');
     if ($dh = @opendir($cache_dir)) {
         while ($file = readdir($dh)) {
             if (strstr($file, '.cache') !== false) {
                 $path = $cache_dir . $file;
                 $filemtime = @filemtime($path);
                 if (!$filemtime || time() - $filemtime >= $cache_file_lifetime) {
                     @unlink($path);
                 }
             }
         }
         @closedir($dh);
     }
 }