public function updateConfig()
 {
     if ('' != ($value = lireParam('white_list'))) {
         $this->updateParam('htmlpurifier_whiteList', $value);
         unset($_REQUEST['white_list']);
     }
     foreach ($_REQUEST as $key => $value) {
         if (!preg_match('/^sanitize/', $key)) {
             continue;
         }
         self::ecrire($key, $value);
     }
     redirige($_SERVER['PHP_SELF']);
 }
Example #2
0
 function edition()
 {
     $id = intval(lireParam('pays', 'int'));
     $maj = $id > 0;
     $pays = new Pays();
     if ($maj) {
         $pays->charger($id);
     } else {
         $pays->lang = 0;
         $pays->defaut = 0;
     }
     $pays->tva = intval($_REQUEST['tva']) != 0 ? 1 : 0;
     $pays->zone = intval($_REQUEST['zone']);
     $pays->isocode = intval($_REQUEST['isocode']);
     $pays->isoalpha2 = $_REQUEST['isoalpha2'];
     $pays->isoalpha3 = $_REQUEST['isoalpha3'];
     if ($maj) {
         $pays->maj();
     } else {
         $id = $pays->add();
     }
     if ($id > 0) {
         foreach ($_REQUEST['langue'] as $langue) {
             $paysdesc = new Paysdesc();
             if ($maj) {
                 $paysdesc->charger($id, $langue);
             }
             $paysdesc->pays = $id;
             $paysdesc->lang = $langue;
             $paysdesc->titre = $_REQUEST['titre'][$langue];
             $paysdesc->chapo = $_REQUEST['chapo'][$langue];
             $paysdesc->description = $_REQUEST['description'][$langue];
             if ($maj) {
                 $paysdesc->maj();
             } else {
                 $paysdesc->add();
             }
         }
     }
 }
Example #3
0
if (empty($devise)) {
    if (isset($_REQUEST['devise'])) {
        $devise = lireParam('devise', 'int');
    } else {
        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);
        }
    }
}
Example #4
0
        $obj->charger($id);
        $objdesc = new Contenudesc();
        $objdesc->charger($obj->id);
        $point_entree = "moddos";
        $champ_parent = "dossier";
    } else {
        exit;
    }
}
switch ($modif) {
    case 'titrecont':
    case 'titredos':
        $objdesc->titre = lireParam("value", "string");
        echo $objdesc->titre;
        break;
    case 'lignecont':
    case 'lignedos':
        $obj->ligne = $obj->ligne ? 0 : 1;
        break;
    case 'lignetouscont':
    case 'lignetousdos':
        $ligne = lireParam("ligne", "int");
        $parent = intval(lireParam("parent", "int"));
        $obj->query("update {$obj->table} set ligne={$ligne} where {$champ_parent}={$parent}");
        break;
    default:
        exit;
}
$obj->maj();
$objdesc->maj();
ActionsModules::instance()->appel_module($point_entree, $obj);
Example #5
0
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;
}
            $variable = new Variable();
            if ($variable->charger_id($id)) {
                if ($valeur != $variable->valeur) {
                    $variable->valeur = $valeur;
                    $variable->maj();
                    ActionsModules::instance()->appel_module("modvariable", $variable);
                }
            }
        }
    }
    // Ajouter ?
    $nom = lireParam('ajout_nom', 'string');
    if ($nom != '') {
        $variable = new Variable();
        $variable->nom = $nom;
        $variable->valeur = lireParam('ajout_valeur', 'string');
        $variable->protege = 0;
        $variable->cache = 0;
        $variable->add();
        ActionsModules::instance()->appel_module("addvariable", $variable);
    }
} else {
    if ($action == "supprimer") {
        $variable = new Variable();
        if ($variable->charger_id(intval(lireParam('id', 'int')))) {
            $variable->delete();
        }
        ActionsModules::instance()->appel_module("delvariable", $variable);
    }
}
redirige("variable.php");
Example #7
0
            $pays->query("update {$pays->table} set `boutique`=0");
            $pays->query("update {$pays->table} set `boutique`=1 where id={$id}");
            exit;
        }
    }
}
/* Afficher la forme de modif/creation de pays */
$langues = array();
$langue = new Lang();
$result = $langue->query("select * from " . $langue->table . " order by id");
while ($result && ($row = $langue->fetch_object($result))) {
    $langues[] = $row;
}
$pays = new Pays();
$paysdesc = new Paysdesc();
$id = intval(lireParam('pays', 'int'));
$pays->id = $id;
if ($id > 0) {
    $pays->charger($id);
}
?>
<div class="entete_config" style="width: auto; float: none;">
			<div class="titre"><?php 
echo trad('EDITION', 'admin');
?>
</div>
			<div class="fonction_valider"><a href="#" onclick="$('#pays_edit_form').submit(); return false;"><?php 
echo trad('VALIDER_LES_MODIFICATIONS', 'admin');
?>
</a></div>
		</div>
Example #8
0
        ActionsModules::instance()->appel_module("clear_cache");
    }
    public function check_cache()
    {
        Analyse::cleanup_cache($this->cache_dir, 1);
    }
    public function check_cache_dir()
    {
        if (!is_dir($this->cache_dir)) {
            mkdir($this->cache_dir, 0777, true);
            @clearstatcache();
        }
    }
}
$adm = new AdmParseur();
$commande = lireParam('commande', 'string');
switch ($commande) {
    case 'maj_config':
        $adm->update_config();
        break;
    case 'clear_cache':
        $adm->clear_cache();
        break;
    case 'check_cache':
        $adm->check_cache();
        break;
    case 'patch':
        $adm->patch();
        break;
    case 'check_cache_dir':
        $adm->check_cache_dir();
Example #9
0
/*      but WITHOUT ANY WARRANTY; without even the implied warranty of               */
/*      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                */
/*      GNU General Public License for more details.                                 */
/*                                                                                   */
/*      You should have received a copy of the GNU General Public License            */
/*	    along with this program. If not, see <http://www.gnu.org/licenses/>.         */
/*                                                                                   */
/*************************************************************************************/
require_once __DIR__ . "/../pre.php";
require_once __DIR__ . "/../auth.php";
require_once __DIR__ . "/../../fonctions/divers.php";
if (!est_autorise("acces_catalogue")) {
    exit;
}
header('Content-Type: text/html; charset=utf-8');
list($modif, $id) = explode("_", lireParam('id', 'string'));
if ($modif == "titrerub") {
    $obj = new Rubrique();
    $obj->charger($id);
    $objdesc = new Rubriquedesc();
    $objdesc->charger($obj->id);
    echo $objdesc->titre;
} else {
    if ($modif == "titreprod") {
        $obj = new Produit();
        $obj->charger_id($id);
        $objdesc = new Produitdesc();
        $objdesc->charger($obj->id);
        echo $objdesc->titre;
    } else {
        if ($modif == "stock") {