コード例 #1
0
ファイル: image.php プロジェクト: anti-conformiste/thelia1
function get_img_quality($nomvar, $min, $max, $defaut)
{
    $quality = intval(Variable::lire($nomvar, $defaut));
    if ($quality < $min || $quality > $max) {
        $quality = $defaut;
    }
    return $quality;
}
コード例 #2
0
 public function getUrl()
 {
     if (Variable::lire("rewrite") != 0) {
         $reecriture = new Reecriture();
         if ($reecriture->charger_param($this->colonne, "&" . $this->clef_url_reecrite(), $this->lang, 1)) {
             return urlfond() . "/" . $reecriture->url;
         }
     }
     return urlfond($this->colonne, htmlspecialchars($this->clef_url_reecrite()), true);
 }
コード例 #3
0
function substitvariable($texte)
{
    $matches = array();
    if (preg_match_all("`\\#VARIABLE\\(([^\\)]+)\\)`", $texte, $matches, PREG_SET_ORDER)) {
        foreach ($matches as $match) {
            $texte = str_replace($match[0], Variable::lire($match[1]), $texte);
        }
    }
    return $texte;
}
コード例 #4
0
 public function ecrire(&$res)
 {
     $texte = implode("\n", $this->_logs);
     if (!empty($texte)) {
         $adresses = explode(";", $this->get_config(self::VAR_ADRESSES));
         // Un CC serait plus efficace...
         foreach ($adresses as $adresse) {
             Mail::envoyer("", $adresse, "Log " . Variable::lire('nomsite'), Variable::lire('emailfrom'), strftime("%d/%m/%Y %H:%M:%S", time()) . " - Logs " . Variable::lire('nomsite'), "", $texte);
         }
     }
 }
コード例 #5
0
ファイル: url.php プロジェクト: anti-conformiste/thelia1
/**
 * Calculer une URL à partir d'un nom de fond.
 *
 * @param string fond le nom du fond
 * @param string parametres les parametres éventuels à ajouter à l'URL
 * @param boolean escape si true, on sépoare l'URL et les paramètres par &amp;. Si false, par '&'
 */
function urlfond($fond = "", $parametres = false, $escape = false)
{
    $urlsite = urlsite();
    if (!empty($fond)) {
        if (Variable::lire("rewrite") != 0) {
            // Trouver une éventuelle reecriture
            $rw = new Reecriture();
            if ($rw->charger_param($fond, $parametres == false ? '' : "&" . $parametres, ActionsLang::instance()->get_id_langue_courante(), 1)) {
                return "{$urlsite}/{$rw->url}";
            }
        }
        $urlsite = sprintf("%s/?fond=%s", $urlsite, $fond);
    }
    if ($parametres !== false) {
        if ($escape) {
            $parametres = escape_ampersand($parametres);
        }
        $urlsite .= ($escape ? "&amp;" : "&") . $parametres;
    }
    return $urlsite;
}
コード例 #6
0
 public function set_admin_mode()
 {
     $mask = '#^(http|https)://(%s)#';
     $allowURI = Variable::lire('htmlpurifier_whiteList', 'www.youtube.com/embed/\\nplayer.vimeo.com/video/\\nmaps.google.*/');
     $config = HTMLPurifier_Config::createDefault();
     $config->set('Core.Encoding', "UTF-8");
     $config->set('HTML.DefinitionID', 'Thelia back-office content filter');
     $config->set('HTML.DefinitionRev', 1);
     $config->set('Attr.EnableID', true);
     $config->set('CSS.AllowTricky', true);
     $config->set('HTML.Allowed', 'a,strong,em,div,p,span,img,li,ul,ol,sup,sub,small,big,code,blockquote,h1,h2,h3,h4,h5, iframe');
     $config->set('HTML.AllowedAttributes', 'a.href,a.title,img.src,img.alt,img.title,img.width,img.height,*.style,*.id,*.class, iframe.width, iframe.height, iframe.src, iframe.frameborder');
     $config->set('AutoFormat.Linkify', true);
     $config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
     //Filter.Youtube est déprécié, à remplacer dans thelia 1.5.3.5, voir début de la méthode
     //            $config->set('Filter.YouTube', true);
     $config->set('HTML.SafeObject', true);
     $config->set('Output.FlashCompat', true);
     $config->set('HTML.SafeIframe', true);
     $config->set('URI.SafeIframeRegexp', sprintf($mask, str_replace("\n", "|", $allowURI)));
     $config->set('HTML.TidyLevel', 'medium');
     // Recreate a new instance with this config
     self::$purifier = new HTMLPurifier($config);
 }
コード例 #7
0
ファイル: boucles.php プロジェクト: anti-conformiste/thelia1
function boucleLangue($texte, $args)
{
    $exclure = lireTag($args, 'exclure');
    $id = lireTag($args, 'id');
    $res = '';
    $url = preg_replace('/[\\&\\?]*lang=[0-9]+/', '', url_page_courante());
    // S'il faut suffixer par lang=x, s'assurer de placer le bon séparateur
    if (!ActionsLang::instance()->get_un_domaine_par_langue()) {
        $url .= strstr($url, '?') == false ? '?' : '&';
    }
    $lng = new Lang();
    $query = 'select * from ' . $lng->table . ' where 1 ';
    if ($id != '') {
        $query .= ' and id in ( ' . $id . ')';
    }
    if ($exclure != '') {
        $query .= ' and id not in ( ' . $exclure . ')';
    }
    // Trouver l'url ré-écrite, si elle existe
    $reecriture = new Reecriture();
    if (Variable::lire("rewrite") != 0) {
        // L'URL de la page courante
        $requrl = lireParam('url', 'string');
        if ($requrl != '') {
            $reecriture->charger($requrl);
        }
    }
    $lngredir = new Reecriture();
    $result = $lng->query($query);
    while ($result && ($row = $lng->fetch_object($result))) {
        $lng->charger($row->id);
        if ($reecriture->actif && $lngredir->charger_param($reecriture->fond, $reecriture->param, $lng->id, 1)) {
            if (ActionsLang::instance()->get_un_domaine_par_langue()) {
                $lngurl = "{$row->url}/{$lngredir->url}";
            } else {
                $lngurl = $lngredir->url;
            }
        } else {
            if (ActionsLang::instance()->get_un_domaine_par_langue()) {
                $lngurl = str_replace(ActionsLang::instance()->get_langue_courante()->url, $row->url, $url);
            } else {
                $lngurl = $url . 'lang=' . $lng->id;
            }
        }
        $tmp = str_replace('#ID', $lng->id, $texte);
        $tmp = str_replace('#DESCRIPTION', $lng->description, $tmp);
        $tmp = str_replace('#CODE', $lng->code, $tmp);
        $tmp = str_replace('#DEFAUT', $lng->defaut ? '1' : '0', $tmp);
        $tmp = str_replace('#URL', $lngurl, $tmp);
        $res .= $tmp;
    }
    return $res;
}
コード例 #8
0
    if (file_exists("../client.orig")) {
        rename_securise("../client.orig", "../client", 'dossier');
    }
    if (file_exists("../template.orig")) {
        rename_securise("../template.orig", "../template", 'dossier');
    }
    // Mettre en place le Cnx.class.php définitif, en effaçant le précédent.
    $cnxfile = "../classes/Cnx.class.php";
    if (file_exists("{$cnxfile}.orig")) {
        @unlink($cnxfile);
        rename_securise("{$cnxfile}.orig", "{$cnxfile}", 'fichier');
    }
}
require_once "../fonctions/divers.php";
require_once "../classes/Variable.class.php";
$params = array('utilisateur' => 'admin', 'nomadmin' => "admin_" . genpass(10), 'emailcontact' => Variable::lire('emailcontact'), 'nomsite' => Variable::lire('nomsite'), 'urlsite' => "http://" . $_SERVER['SERVER_NAME']);
foreach ($params as $var => $defaut) {
    ${$var} = isset($_REQUEST[$var]) ? $_REQUEST[$var] : $defaut;
}
$_SESSION['etape'] = 4;
include __DIR__ . "/entete.php";
?>
<div id="chapeau"style="overflow:hidden;zoom: 1">
<h2>Configuration</h2>

	<form action="modules.php" method="post">

	<br />

	Passons &agrave; la configuration de Thelia <br /><br />
コード例 #9
0
ファイル: cache.php プロジェクト: anti-conformiste/thelia1
                            <?php 
echo trad('Periode_examen', 'admin');
?>
                            <p>
                                <small><?php 
echo trad('detail_periode_examen', 'admin');
?>
</small>
                            </p>
                        </td>
                        <td>
                            <input type="text" class="input-medium" name="<?php 
echo Parseur::PREFIXE . '_cache_check_period';
?>
" value="<?php 
echo intval(Variable::lire(Parseur::PREFIXE . '_cache_check_period'));
?>
">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p><?php 
echo trad('Fichier_actuellement', 'admin');
?>
 : <?php 
echo $adm->cache_count;
?>
</p>
                            <p><?php 
echo trad('Dernier_examen', 'admin');
コード例 #10
0
    redirige($_SERVER['PHP_SELF'] . "?ref=" . $produit->ref . "&rubrique=" . $produit->rubrique . "&lang=" . $lang);
}
function supprimer($ref, $parent)
{
    $produit = new Produit($ref);
    $produit->delete();
    ActionsModules::instance()->appel_module("supprod", $produit);
    redirige("parcourir.php?parent=" . $parent);
}
$produit = new Produit();
$produitdesc = new Produitdesc();
$produit->charger($ref);
$produitdesc->charger($produit->id, $lang);
$produitdesc->chapo = str_replace("<br />", "\n", $produitdesc->chapo);
if ($produit->tva == "") {
    $tva = Variable::lire("tva");
} else {
    $tva = $produit->tva;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php 
require_once "title.php";
?>

<script type="text/javascript">
<!--
	function envoyer(){
	        var ref=$('#ref_c').val();
コード例 #11
0
ファイル: action.php プロジェクト: anti-conformiste/thelia1
function chmdp($email, $urlok = "", $urlerr = "")
{
    $tclient = new Client();
    if ($tclient->charger_mail($email)) {
        $msg = new Message();
        $msgdesc = new Messagedesc();
        $pass = genpass(8);
        $tclient->motdepasse = $pass;
        $tclient->crypter();
        $tclient->maj();
        $msg->charger("changepass");
        $msgdesc->charger($msg->id);
        $sujet = $msgdesc->titre;
        $corps = $msgdesc->description;
        $corpstext = $msgdesc->descriptiontext;
        $nomsite = Variable::lire("nomsite");
        $corps = str_replace("__NOMSITE__", $nomsite, $corps);
        $corps = str_replace("__MOTDEPASSE__", $pass, $corps);
        $corps = str_replace("__URLSITE__", urlfond(), $corps);
        $corps = str_replace("__NOM__", $tclient->nom, $corps);
        $corps = str_replace("__PRENOM__", $tclient->prenom, $corps);
        $corps = str_replace("__EMAIL__", $tclient->email, $corps);
        $corpstext = str_replace("__NOMSITE__", $nomsite, $corpstext);
        $corpstext = str_replace("__MOTDEPASSE__", $pass, $corpstext);
        $corpstext = str_replace("__URLSITE__", urlfond(), $corpstext);
        $corpstext = str_replace("__NOM__", $tclient->nom, $corpstext);
        $corpstext = str_replace("__PRENOM__", $tclient->prenom, $corpstext);
        $corpstext = str_replace("__EMAIL__", $tclient->email, $corpstext);
        $emailfrom = Variable::lire("emailfrom");
        Mail::envoyer($tclient->prenom . " " . $tclient->nom, $tclient->email, $nomsite, $emailfrom, $sujet, $corps, $corpstext);
        redirige_action($urlok, '');
    } else {
        redirige_action($urlerr, urlfond("mdperreur"));
    }
}
コード例 #12
0
 public function make_yes_no_radio($var_name)
 {
     $val = Variable::lire($var_name);
     echo '<input type="radio" name="' . $var_name . '" value="1"' . ($val == 1 ? ' checked="checked"' : '') . '>' . trad('Oui', 'admin') . '
           <input type="radio" name="' . $var_name . '" value="0"' . ($val == 0 ? ' checked="checked"' : '') . '>' . trad('Non', 'admin');
 }
コード例 #13
0
ファイル: entete.php プロジェクト: anti-conformiste/thelia1
function activemenu($menu, $verif)
{
    if ($menu == $verif) {
        print 'active';
    }
}
$statAdmin = new StatAdmin();
ActionsAdminModules::instance()->inclure_module_admin("entete_top");
ActionsAdminModules::instance()->inclure_module_admin("entete_brandbar");
?>
    <div class="brandbar">
        <div class="container">
            <a class="brand" href="accueil.php">
                v. <?php 
echo rtrim(preg_replace("/(.)/", "\$1.", Variable::lire('version')), ".");
?>
            </a>

            <div class="pull-right call-to-action">
                <?php 
if (est_autorise("acces_rechercher")) {
    ?>
                    <form class="form-search" method="GET" action="recherche.php">
                        <div class="pull-right">
                            <div class="control-group">
                                <div class="input-append">
                                    <input type="text" class="input-medium search-query" id="motcle" name="motcle" />
                                    <button class="btn">
                                        <i class="icon-search"></i>
                                    </button>
コード例 #14
0
 /**
  * @method bool Déterminer si un module est activable
  * @param Modules modules un object Modules chargé
  * @return bool true si le module est activable, ou n'a pas d'indication de version
  */
 public function est_activable($modules)
 {
     try {
         $this->lire_descripteur_xml($modules);
         if (isset($modules->xml->thelia)) {
             $version_courante = rtrim(preg_replace("/(.)/", "\$1.", Variable::lire('version')), ".");
             return version_compare($version_courante, $modules->xml->thelia) != -1;
         }
     } catch (Exception $e) {
     }
     return true;
 }
コード例 #15
0
 function post($res)
 {
     // Traitement de #HEADER{}
     if (preg_match_all('/#HEADER{([^}]+)}/', $res, $matches, PREG_SET_ORDER)) {
         foreach ($matches as $match) {
             $res = str_replace($match[0], '', $res);
             header($match[1]);
         }
     }
     if (Variable::lire(self::PREFIXE . '_show_time')) {
         $res = str_ireplace('</html>', '<!-- Page parsée et évaluée en ' . round(self::$parse_time, 4) . " secondes -->\n</html>", $res);
     }
     if (Analyse::$debug_text) {
         if (strstr($res, '<body>')) {
             $res = str_ireplace('<body>', '<body>\\n' . Analyse::$debug_text, $res);
         } else {
             $res = Analyse::$debug_text . $res;
         }
     }
     return $res;
 }
コード例 #16
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);
     }
 }
コード例 #17
0
 public function substitmail($corps, $commande)
 {
     ActionsModules::instance()->appel_module("preSubstitmail", $corps, $commande);
     $nomsite = Variable::lire("nomsite");
     $jour = substr($commande->date, 8, 2);
     $mois = substr($commande->date, 5, 2);
     $annee = substr($commande->date, 0, 4);
     $heure = substr($commande->date, 11, 2);
     $minute = substr($commande->date, 14, 2);
     $seconde = substr($commande->date, 17, 2);
     $client = new Client($commande->client);
     $paiement = new Modules($commande->paiement);
     $paiementdesc = new Modulesdesc($paiement->nom, $commande->lang);
     $transport = new Modules($commande->transport);
     $transportdesc = new Modulesdesc($transport->nom, $commande->lang);
     $total = $commande->total();
     $totcmdport = $commande->port + $total;
     $adresse = new Venteadr($commande->adrlivr);
     $raisondesc = new Raisondesc();
     $raisondesc->charger($adresse->raison, $commande->lang);
     $nom = $adresse->nom;
     $prenom = $adresse->prenom;
     $entreprise = $adresse->entreprise;
     $adresse1 = $adresse->adresse1;
     $adresse2 = $adresse->adresse2;
     $adresse3 = $adresse->adresse3;
     $cpostal = $adresse->cpostal;
     $ville = $adresse->ville;
     $pays = new Paysdesc($adresse->pays, $commande->lang);
     $corps = str_replace("__COMMANDE_REF__", $commande->ref, $corps);
     $corps = str_replace("__COMMANDE_DATE__", $jour . "/" . $mois . "/" . $annee, $corps);
     $corps = str_replace("__COMMANDE_HEURE__", $heure . ":" . $minute, $corps);
     $corps = str_replace("__COMMANDE_TRANSACTION__", $commande->transaction, $corps);
     $corps = str_replace("__COMMANDE_PAIEMENT__", $paiementdesc->titre, $corps);
     $corps = str_replace("__COMMANDE_TOTALPORT__", $totcmdport - $commande->remise, $corps);
     $corps = str_replace("__COMMANDE_TOTAL__", $total, $corps);
     $corps = str_replace("__COMMANDE_PORT__", $commande->port, $corps);
     $corps = str_replace("__COMMANDE_REMISE__", $commande->remise, $corps);
     $corps = str_replace("__COMMANDE_TRANSPORT__", $transportdesc->titre, $corps);
     $corps = str_replace("__COMMANDE_TRANSPORTCHAPO__", $transportdesc->chapo, $corps);
     $corps = str_replace("__COMMANDE_LIVRRAISON__", $raisondesc->court, $corps);
     $corps = str_replace("__COMMANDE_LIVRNOM__", $nom, $corps);
     $corps = str_replace("__COMMANDE_LIVRPRENOM__", $prenom, $corps);
     $corps = str_replace("__COMMANDE_LIVRENTREPRISE__", $entreprise, $corps);
     $corps = str_replace("__COMMANDE_LIVRADRESSE1__", $adresse1, $corps);
     $corps = str_replace("__COMMANDE_LIVRADRESSE2__", $adresse2, $corps);
     $corps = str_replace("__COMMANDE_LIVRADRESSE3__", $adresse3, $corps);
     $corps = str_replace("__COMMANDE_LIVRCPOSTAL__", $cpostal, $corps);
     $corps = str_replace("__COMMANDE_LIVRVILLE__", $ville, $corps);
     $corps = str_replace("__COMMANDE_LIVRPAYS__", $pays->titre, $corps);
     $corps = str_replace("__COMMANDE_LIVRTEL__", $adresse->tel, $corps);
     $corps = str_replace("__NOMSITE__", $nomsite, $corps);
     $corps = str_replace("__URLSITE__", urlfond(), $corps);
     $adresse = new Venteadr($commande->adrfact);
     $raisondesc = new Raisondesc();
     $raisondesc->charger($adresse->raison);
     $pays = new Paysdesc();
     $pays->charger($adresse->pays);
     $corps = str_replace("__CLIENT_REF__", $client->ref, $corps);
     $corps = str_replace("__CLIENT_RAISON__", $raisondesc->court, $corps);
     $corps = str_replace("__CLIENT_ENTREPRISE__", $client->entreprise, $corps);
     $corps = str_replace("__CLIENT_SIRET__", $client->siret, $corps);
     $corps = str_replace("__CLIENT_FACTNOM__", $adresse->nom, $corps);
     $corps = str_replace("__CLIENT_FACTPRENOM__", $adresse->prenom, $corps);
     $corps = str_replace("__CLIENT_ADRESSE1__", $adresse->adresse1, $corps);
     $corps = str_replace("__CLIENT_ADRESSE2__", $adresse->adresse2, $corps);
     $corps = str_replace("__CLIENT_ADRESSE3__", $adresse->adresse3, $corps);
     $corps = str_replace("__CLIENT_CPOSTAL__", $adresse->cpostal, $corps);
     $corps = str_replace("__CLIENT_VILLE__", $adresse->ville, $corps);
     $corps = str_replace("__CLIENT_PAYS__", $pays->titre, $corps);
     $corps = str_replace("__CLIENT_EMAIL__", $client->email, $corps);
     $corps = str_replace("__CLIENT_TELFIXE__", $client->telfixe, $corps);
     $corps = str_replace("__CLIENT_TELPORT__", $client->telport, $corps);
     $pattern = '{<VENTEPROD>((?:(?:(?!<VENTEPROD[^>]*>|</VENTEPROD>).)++|<VENTEPROD[^>]*>(?1)</VENTEPROD>)*)</VENTEPROD>}si';
     if (preg_match($pattern, $corps, $cut)) {
         $corps = str_replace("<VENTEPROD>", "", $corps);
         $corps = str_replace("</VENTEPROD>", "", $corps);
         $res = "";
         $venteprod = new Venteprod();
         $query = "select * from {$venteprod->table} where commande=\"" . $commande->id . "\"";
         $resul = $venteprod->query($query);
         while ($resul && ($row = $venteprod->fetch_object($resul))) {
             $temp = str_replace("__VENTEPROD_TITRE__", $row->titre, $cut[1]);
             $temp = str_replace("__VENTEPROD_REF__", $row->ref, $temp);
             $temp = str_replace("__VENTEPROD_CHAPO__", $row->chapo, $temp);
             $temp = str_replace("__VENTEPROD_QUANTITE__", $row->quantite, $temp);
             $temp = str_replace("__VENTEPROD_PRIXU__", $row->prixu, $temp);
             $temp = str_replace("__VENTEPROD_TOTAL__", $row->prixu * $row->quantite, $temp);
             ActionsModules::instance()->appel_module("substitutionsventeprodmailcommande", $temp, $row);
             $res .= $temp;
         }
         $corps = str_replace($cut[1], $res, $corps);
     }
     // Substitutions mail "devise"
     $devise = new Devise($commande->devise);
     ActionsDevises::instance()->subsititutions_mail($devise, $corps);
     ActionsModules::instance()->appel_module("substitutionsmailcommande", $corps, $commande);
     return $corps;
 }
コード例 #18
0
ファイル: logs.php プロジェクト: anti-conformiste/thelia1
 public function liste_destinations_actives()
 {
     return explode(";", Variable::lire(self::VAR_DESTINATIONS, self::DEFAUT_DESTINATIONS));
 }
コード例 #19
0
 /**
  * Retourner l'action à effectuer si une traduction est absente
  * @return boolean
  */
 public function get_action_si_trad_absente()
 {
     // Intialiser l'action à affectuer si la traduction n'est pas definie
     if ($this->action_si_trad_absente === false) {
         $this->action_si_trad_absente = Variable::lire(self::VAR_ACTION_SI_TRAD_ABSENTE);
     }
     return $this->action_si_trad_absente;
 }
コード例 #20
0
        </div>
    </div>
<?php 
ActionsAdminModules::instance()->inclure_module_admin("commande_creer_bottom");
?>
    
<?php 
require_once "pied.php";
?>

    
<script type="text/javascript">

/*variables from PHP*/
var PHP_verifstock = <?php 
echo Variable::lire("verifstock", 0) == 1 ? 'true' : 'false';
?>
;

jQuery(function($)
{
    loadFastBrowser(0);
    
    $('#copy_facturation_to_delivery').click(function(e)
    {
        e.preventDefault();
        
        $('select[name="livraison_raison"]').val( $('select[name="facturation_raison"]').val() );
        $('input[name="livraison_entreprise"]').val( $('input[name="facturation_entreprise"]').val() );
        $('input[name="livraison_nom"]').val( $('input[name="facturation_nom"]').val() );
        $('input[name="livraison_prenom"]').val( $('input[name="facturation_prenom"]').val() );
コード例 #21
0
ファイル: logs.php プロジェクト: anti-conformiste/thelia1
                            </td>
                            <td>
                                <input type="hidden" name="<?php 
echo Tlog::VAR_FILES;
?>
" value="<?php 
echo htmlspecialchars(Variable::lire(Tlog::VAR_FILES, Tlog::DEFAUT_FILES));
?>
" >
                                <?php 
if (Variable::lire(Tlog::VAR_FILES, Tlog::DEFAUT_FILES) != '') {
    ?>

                                        <ul class="unstyled">
                                        <?php 
    $files = explode(";", Variable::lire(Tlog::VAR_FILES, Tlog::DEFAUT_FILES));
    $idx = 0;
    if ($files) {
        foreach ($files as $file) {
            ?>
                                                <li>
                                                    <a href="#" class="js-delete-file" file-id="<?php 
            echo $idx;
            ?>
"><i class="icon-trash"></i></a>
                                                        <?php 
            echo $file;
            if ($file == '*') {
                echo " (tous les fichiers)";
            }
            ?>
コード例 #22
0
ファイル: moteur.php プロジェクト: anti-conformiste/thelia1
        if (ActionsDevises::instance()->id_devise_courante_definie()) {
            $devise = ActionsDevises::instance()->get_id_devise_courante();
        } else {
            // Devise par defaut
            $devise = ActionsDevises::instance()->get_id_devise_defaut();
        }
    }
}
// Les autres paramètres présents dans les URL
$vars = array('action' => "string", 'append' => "int", 'id' => "int", 'id_parrain' => "int", 'nouveau' => "int", 'parent' => "int", 'ref' => "string", 'quantite' => "float", 'article' => "int", 'type_paiement' => "int", 'code' => "string", 'entreprise' => "string", 'siret' => "string", 'intracom' => "string", 'parrain' => "string", 'motdepasse1' => "string", 'motdepasse2' => "string", 'raison' => "int", 'prenom' => "string", 'libelle' => "string", 'nom' => "string", 'adresse1' => "string", 'adresse2' => "string", 'adresse3' => "string", 'cpostal' => "string", 'ville' => "string", 'pays' => "int", 'telfixe' => "string", 'telport' => "string", 'tel' => "string", 'email1' => "string", 'email2' => "string", 'email' => "string", 'motdepasse' => "string", 'adresse' => "int", 'id_rubrique' => "int", 'id_dossier' => "int", 'nouveaute' => "int", 'promo' => "int", 'stockmini' => "float", 'page' => "int", 'totbloc' => "int", 'id_contenu' => "int", 'caracdisp' => "int+\\-", 'reforig' => "string", 'motcle' => "string", 'id_produit' => "int", 'classement' => "string", 'prixmin' => "float", 'prixmax' => "float", 'id_image' => "int", 'declinaison' => "string", 'declidisp' => "int+\\-", 'declival' => "string", 'declistock' => "float", 'commande' => "string", 'caracteristique' => "int+\\-", 'caracval' => "string", 'url' => "string", 'nopageret' => "int", 'obligetel' => "int", 'urlok' => "string", 'urlerr' => "string", 'id_commande' => "int", 'id_paiement' => "int");
foreach ($vars as $nomvar => $typevar) {
    ${$nomvar} = lireParam($nomvar, $typevar);
}
// Compatibilité 1.4 qui intialise $append à 0 et non pas à ''
$append = intval($append);
$rewrite_active = Variable::lire("rewrite", 0);
// Si le rewrite est activé, on doit rediriger les pages non réécrites vers les pages réécrites (duplicate content).
$tab_fond_rewrite = array("rubrique", "produit", "dossier", "contenu");
if (isset($_GET['fond']) && in_array($_GET['fond'], $tab_fond_rewrite)) {
    if ($rewrite_active == 1) {
        $redir = new Reecriture();
        if ($redir->charger_url_classique($_SERVER['QUERY_STRING'], ActionsLang::instance()->get_id_langue_courante(), 1)) {
            header("HTTP/1.1 301 Moved Permanently");
            redirige(urlfond() . "/" . $redir->url);
        }
    }
}
// Chargement du contexte dans le cas d'une réécriture
if ($url != "") {
    $reecriture = new Reecriture();
    if ($reecriture->charger($url)) {
コード例 #23
0
 function verfistock($refproduit, $quantite, $perso)
 {
     $stockok = true;
     if (Variable::lire("verifstock", 0) == 1) {
         $prod = new Produit();
         if ($prod->charger($refproduit)) {
             if ($prod->stock >= $quantite) {
                 foreach ($perso as $decli) {
                     $stock = new Stock();
                     if ($stock->charger($decli->valeur, $prod->id) && $stock->valeur < $quantite) {
                         $stockok = false;
                         break;
                     }
                 }
             } else {
                 $stockok = false;
             }
         } else {
             $stockok = false;
         }
     }
     $parametres = array("refproduit" => $refproduit, "quantite" => $quantite, "perso" => $perso);
     ActionsModules::instance()->appel_module("apresverifstock", $stockok, $parametres);
     return $stockok;
 }
コード例 #24
0
ファイル: modules.php プロジェクト: anti-conformiste/thelia1
    ?>
                <div class="bloc_rubrique">
                    <div class="titre_rubrique">
                        <img src="gfx/Puce-fleche-pivot-orange.png" class="puce" />
                        <?php 
    echo $afficheRubrique;
    ?>
                    </div>
<?php 
    krsort($afficheListeNiveaux);
    $compteurModule = 0;
    foreach ($afficheListeNiveaux as $afficheNiveau => $afficheListeModules) {
        foreach ($afficheListeModules as $afficheModule) {
            /*verification de la compatibilité*/
            if ($afficheModule['thelia']) {
                $version_courante = rtrim(preg_replace("/(.)/", "\$1.", Variable::lire('version')), ".");
                if (version_compare($version_courante, $afficheModule['thelia']) == -1) {
                    continue;
                }
            }
            ?>
                    <div class="bloc_module <?php 
            echo $compteurModule == 0 ? 'first' : '';
            ?>
">
                        <div class="titre_plugin <?php 
            echo $afficheModule['install_defaut'] == 1 ? 'est-selection' : '';
            ?>
">
                            <input type="checkbox" name="modules[]" value="<?php 
            echo $afficheModule['lien'];
コード例 #25
0
 public function subSendMailCreation($corps, $client, $password)
 {
     $raisondesc = new Raisondesc($client->raison, ActionsLang::instance()->get_id_langue_courante());
     $paysdesc = new Paysdesc();
     $paysdesc->charger($client->pays);
     $corps = str_replace("__NOMSITE__", Variable::lire("nomsite"), $corps);
     $corps = str_replace("__EMAIL__", $client->email, $corps);
     $corps = str_replace("__MOTDEPASSE__", $password, $corps);
     $corps = str_replace("__URLSITE__", Variable::lire("urlsite"), $corps);
     $corps = str_replace("__NOM__", $client->nom, $corps);
     $corps = str_replace("__PRENOM__", $client->prenom, $corps);
     $corps = str_replace("__ADRESSE1__", $client->adresse1, $corps);
     $corps = str_replace("__ADRESSE2__", $client->adresse2, $corps);
     $corps = str_replace("__ADRESSE3__", $client->adresse3, $corps);
     $corps = str_replace("__VILLE__", $client->ville, $corps);
     $corps = str_replace("__CPOSTAL__", $client->cpostal, $corps);
     $corps = str_replace("__TELEPHONE__", $client->telfixe, $corps);
     $corps = str_replace("__CIVILITE__", $raisondesc->court, $corps);
     $corps = str_replace("__PAYS__", $paysdesc->titre, $corps);
     return $corps;
 }
コード例 #26
0
ファイル: langue.php プロジェクト: anti-conformiste/thelia1
    echo 'checked="checked"';
}
?>
 /> <?php 
echo trad('Utiliser le même domaine pour toutes les langues', 'admin');
?>
</li>
						</ul>

						<ul class="ligne_fonce_BlocDescription">
							<li style="width:151px;"><?php 
echo trad('URL du site', 'admin');
?>
</li>
							<li style="width:406px;"><input style="width:406px;" name="urlsite" type="text" class="form urlsite" value="<?php 
echo Variable::lire('urlsite');
?>
" /></li>
						</ul>

						<ul class="ligne_claire_BlocDescription lignetop">
							<li style="width:561px;"><input type="radio" onclick="change_lang_type(1, true);" name="un_domaine_par_langue" value="1" <?php 
if (ActionsAdminLang::instance()->get_un_domaine_par_langue() == 1) {
    echo 'checked="checked"';
}
?>
 /> <?php 
echo trad('Utiliser un domaine ou sous-domaine pour chaque langue', 'admin');
?>
</li>
						</ul>
コード例 #27
0
ファイル: pre.php プロジェクト: anti-conformiste/thelia1
/*************************************************************************************/
if (strstr($_SERVER['PHP_SELF'], "/admin/")) {
    header("Location: changerep.php");
    exit;
}
define('THELIA_MAGIC_QUOTE_ENABLED', get_magic_quotes_gpc());
require_once __DIR__ . "/../fonctions/error_reporting.php";
require_once __DIR__ . "/autoload.php";
require_once __DIR__ . "/../lib/TheliaPurifier.php";
function _sanitize_param($value, $config = null)
{
    if (is_array($value)) {
        foreach ($value as $key => $item) {
            $value[$key] = _sanitize_param($item, $config);
        }
        return $value;
    } else {
        if (THELIA_MAGIC_QUOTE_ENABLED) {
            $value = stripcslashes($value);
        }
        return TheliaPurifier::instance()->purifier($value);
    }
}
ActionsLang::instance()->set_mode_backoffice(true);
Tlog::mode_back_office(true);
require_once __DIR__ . "/../fonctions/divers.php";
// Put sanitize_admin value to 0 into variable table if you don't want to sanitize (escaping) $_REQUEST parameters
TheliaPurifier::instance()->set_admin_mode();
foreach ($_REQUEST as $key => $value) {
    ${$key} = Variable::lire('sanitize_admin', 1) ? _sanitize_param($value) : $value;
}