public function add($params) { $path = Controller_carousel::getPathCarousel(); //Ajout des documents de upload_files FoxFWKernel::addController('Upload_files'); Upload_files::deplacer($path); FoxFWKernel::loadRouter('carousel_gestion'); }
public function viderCache($params) { //vider le cache mais on garde le dossier FoxFWFile::delTree(_CACHE, false); FoxFWKernel::loadRouter('PanelAdmin_view'); }
public function confirmEditFile($params) { $_POST['file'] = htmlspecialchars_decode($_POST['file']); $_POST['body'] = htmlspecialchars_decode($_POST['body']); file_put_contents($_POST['file'], $_POST['body']); FoxFWKernel::loadRouter('Document_view'); }
private static function securityFormSend() { //token des formulaires if (!isset($_SESSION['form_token'])) { $_SESSION['form_token'] = FoxFWCrypte::randomString(20); } if (count($_POST) > 0) { //verifier que le token existe dans le formulaire if (isset($_POST['tf_t']) && isset($_POST['tf_u'])) { if ($GLOBALS['User']->isLogin()) { $clef = FoxFWCrypte::decrypte($_POST['tf_u'], $_SESSION['form_token']); if ($clef != $GLOBALS['User']->getClef()) { sleep(10); FoxFWKernel::loadRouter('index'); } } if ($_POST['tf_t'] != $_SESSION['form_token']) { sleep(3); FoxFWKernel::loadRouter('index'); } } else { die('Security: Error Form !'); } //recharge du token $_SESSION['form_token'] = FoxFWCrypte::randomString(20); } }
public function confirmEditEvenement($params) { //traitement de l'ajout $data = array('id' => $_POST['id'], 'date' => strtotime($_POST['date']) + $_POST['date_heur'] * 60 * 60, 'dateEnd' => strtotime($_POST['dateEnd']) + $_POST['dateEnd_heur'] * 60 * 60, 'titre' => $_POST['titre'], 'body' => htmlspecialchars_decode($_POST['body']), 'lieu' => $_POST['lieu'], 'tag' => $_POST['tag']); //update event $id = Evenement::edit($data); //voir les evenements FoxFWKernel::loadRouter('calendrier_view', $id); }
public function updateRole() { //ajout du role $user = new FoxFWUsers(); $user->loginClef($_POST['clef']); if (isset($_POST['add'])) { $user->addRole($_POST['role']); } if (isset($_POST['del'])) { $user->removeRole($_POST['role']); } FoxFWKernel::loadRouter('user_viewListeUsers'); }
public function confirmEdit() { //préparation de la structure $tab = array(); $tab['id'] = $_POST['id']; $tab['nom'] = $_POST['nom']; $tab['prenom'] = $_POST['prenom']; $tab['email'] = $_POST['email']; $tab['telfixe'] = $_POST['telfixe']; $tab['telportable'] = $_POST['telportable']; $tab['fax'] = $_POST['fax']; $tab['structure'] = $_POST['structure']; $tab['intitule'] = $_POST['intitule']; $tab['groupe'] = $_POST['groupe']; $tab['commentaire'] = $_POST['commentaire']; //Ajouter FoxFWbdd::bdd('contacts', 'upgrade', $tab); //Redirection vers la page d'accueil des contacts FoxFWKernel::loadRouter('contacts_view'); }
public function viewPage($params) { $id = $params['id']; $data = $this->page->getByUrl($id); if ($data == NULL) { FoxFWKernel::loadRouter('error404'); } //renvoyé les images attaché a cette page FoxFWKernel::addController('Upload_files'); $files = Upload_files::getFilesDir(_WEB . 'page/' . $id . '/'); //rendu return $GLOBALS['Twig']->render(FoxFWKernel::getView($data['twig']), array('page' => $data, 'id_page' => $data->id, 'files' => $files)); }