Esempio n. 1
0
 /**
  * @access private
  * Assign les variables pour les paramètres des tailles images
  */
 public function assign_img_size($attr_name)
 {
     if (!is_null($attr_name)) {
         foreach (parent::s_all_img_size_config($attr_name) as $conf) {
             backend_controller_template::assign($conf['config_size_attr'], $conf['width'], $conf['height']);
         }
     }
 }
Esempio n. 2
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $plugin = new backend_controller_plugins();
     $create->addConfigFile(array('news'), array('news_'), false);
     $access = $this->model_access->module_access("backend_controller_news");
     $create->assign('access', $access);
     if (magixcjquery_filter_request::isGet('getlang')) {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 $max = 20;
                 if (magixcjquery_filter_request::isGet('json_list_news')) {
                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                     $header->pragma();
                     $header->cache_control("nocache");
                     $header->getStatus('200');
                     $header->json_header("UTF-8");
                     $this->json_list_news($max);
                 } else {
                     $create->assign('pagination', $this->news_pagination($max));
                     $create->display('news/list.tpl');
                 }
             } elseif ($this->action == 'add') {
                 if (isset($this->n_title)) {
                     $this->insert_news_data();
                 }
             } elseif ($this->action == 'edit') {
                 if (isset($this->edit)) {
                     $data = parent::s_news_data($this->edit);
                     $create->assign('plugin', $plugin->menu_item_plugin('news'));
                     if (magixcjquery_filter_request::isGet('json_urinews')) {
                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                         $header->pragma();
                         $header->cache_control("nocache");
                         $header->getStatus('200');
                         $header->json_header("UTF-8");
                         $this->json_uri($data);
                     } elseif (magixcjquery_filter_request::isGet('ajax_image')) {
                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                         $header->pragma();
                         $header->cache_control("nocache");
                         $header->getStatus('200');
                         $header->html_header("UTF-8");
                         $this->ajax_image($create, $data['n_image']);
                     } elseif (isset($this->n_image)) {
                         $this->update_news_image();
                     } elseif (isset($this->n_title)) {
                         $this->update_news_data();
                     } elseif (isset($this->name_tag)) {
                         $this->add_reltag();
                     } elseif (isset($this->delete_tag)) {
                         $this->remove_tag();
                     } else {
                         if (isset($this->plugin)) {
                             // Chargement du plugin dans les actualités (edition)
                             $this->load_edit_data($create, $data);
                             $param_arr = array($this->plugin, $this->getlang, $this->edit);
                             $plugin->extend_module($this->plugin, 'news', $param_arr);
                         } else {
                             $this->load_edit_data($create, $data);
                             $create->display('news/edit.tpl');
                         }
                     }
                 } else {
                     if (isset($this->published)) {
                         $this->update_published();
                     }
                 }
             } elseif ($this->action == 'remove') {
                 if (isset($this->delete_news)) {
                     $this->remove_news();
                 } elseif (isset($this->delete_image)) {
                     $this->remove_image();
                 }
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } elseif (isset($this->news_search)) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_url_news();
         } else {
             $create->display('news/index.tpl');
         }
     }
 }
Esempio n. 3
0
 /**
  * @access public 
  * Execute la classe
  */
 public function run()
 {
     $create = new backend_controller_template();
     $create->addConfigFile(array('config'), array('config_'), false);
     if (magixcjquery_filter_request::isPost('id_size_img')) {
         $this->update_img();
     } else {
         backend_controller_template::assign('img_size_forms_catalog', $this->load_img_forms('catalog'));
         backend_controller_template::assign('img_size_forms_news', $this->load_img_forms('news'));
         backend_controller_template::assign('img_size_forms_plugins', $this->load_img_forms('plugins'));
         backend_controller_template::display('config/imagesize.tpl');
     }
 }
Esempio n. 4
0
 /**
  * @access private
  * Vérification de la session pour accèder à l'administration
  * @param bool $debug
  */
 private function authSession($debug = false)
 {
     //Language model init class
     $language = new backend_model_language();
     $language->run();
     $token = isset($_SESSION['mc_auth_token']) ? $_SESSION['mc_auth_token'] : magixglobal_model_cryptrsa::tokenId();
     $tokentools = $this->hashPassCreate($token);
     backend_controller_template::assign('hashpass', $tokentools);
     if (isset($this->email_admin) and isset($this->passwd_admin) and isset($this->hashtoken)) {
         if (strcasecmp($this->hashtoken, $tokentools) == 0) {
             if ($debug == true) {
                 $firebug = new magixcjquery_debug_magixfire();
                 $firebug->magixFireGroup('tokentest');
                 if ($this->hashtoken) {
                     if (strcasecmp($this->hashtoken, $tokentools) == 0) {
                         $firebug->magixFireLog('session compatible');
                     } else {
                         $firebug->magixFireError('session incompatible');
                     }
                 }
                 $firebug->magixFireLog($_SESSION);
                 $firebug->magixFireGroupEnd();
             }
             $auth_exist = parent::s_auth_exist($this->email_admin, $this->passwd_admin);
             if (count($auth_exist['id_admin']) == true) {
                 $session = new backend_model_sessions();
                 $lang = new backend_model_language();
                 $string = $_SERVER['HTTP_USER_AGENT'];
                 $string .= 'SHIFLETT';
                 /* Add any other data that is consistent */
                 $fingerprint = md5($string);
                 //Fermeture de la première session, ses données sont sauvegardées.
                 session_write_close();
                 $this->start_session();
                 $data = parent::s_data_session($auth_exist['keyuniqid_admin']);
                 if (!isset($_SESSION['email_admin']) and !isset($_SESSION['keyuniqid_admin'])) {
                     $lang = new backend_model_language();
                     $session->openSession($data['id_admin'], session_regenerate_id(true), $data['keyuniqid_admin']);
                     //session_regenerate_id(true);
                     $_SESSION['id_admin'] = $data['id_admin'];
                     $_SESSION['email_admin'] = $data['email_admin'];
                     $_SESSION['keyuniqid_admin'] = $data['keyuniqid_admin'];
                     $_SESSION['adminLanguage'] = $lang->run();
                     if ($debug == true) {
                         $firebug = new magixcjquery_debug_magixfire();
                         $firebug->magixFireGroup('adminsession');
                         $firebug->magixFireDump('User session', $_SESSION);
                         $firebug->magixFireGroupEnd();
                     }
                     magixglobal_model_redirect::backend_redirect_login(false);
                 } else {
                     $session->openSession($data['id_admin'], null, $data['keyuniqid_admin']);
                     $_SESSION['id_admin'] = $data['id_admin'];
                     $_SESSION['email_admin'] = $data['email_admin'];
                     $_SESSION['keyuniqid_admin'] = $data['keyuniqid_admin'];
                     $_SESSION['adminLanguage'] = $lang->run();
                     if ($debug == true) {
                         $firebug = new magixcjquery_debug_magixfire();
                         $firebug->magixFireGroup('adminsession');
                         $firebug->magixFireDump('User session', $_SESSION);
                         $firebug->magixFireGroupEnd();
                     }
                     magixglobal_model_redirect::backend_redirect_login(false);
                 }
             } else {
                 $this->message->getNotify('error_login', array('method' => 'fetch', 'assignFetch' => 'login_message'));
             }
         } else {
             $this->message->getNotify('error_hash', array('method' => 'fetch', 'assignFetch' => 'login_message'));
         }
     }
 }
Esempio n. 5
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $plugin = new backend_controller_plugins();
     $create->addConfigFile(array('catalog'), array('catalog_'), false);
     $access = $this->model_access->module_access("backend_controller_catalog");
     $create->assign('access', $access);
     if (isset($this->section)) {
         if ($this->section === 'category') {
             if (isset($this->getlang)) {
                 if (isset($this->action)) {
                     if ($this->action === 'list') {
                         if (magixcjquery_filter_request::isGet('json_list_category')) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_listing_category();
                         } elseif (isset($this->name_category)) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_autocomplete_category();
                         }
                     } elseif ($this->action === 'add') {
                         if (isset($this->clibelle)) {
                             $this->addCategory($create);
                         }
                     } elseif ($this->action === 'edit') {
                         if (isset($this->edit)) {
                             $data = parent::s_catalog_category_data($this->edit);
                             $create->assign('plugin', $plugin->menu_item_plugin('catalog_category'));
                             if (magixcjquery_filter_request::isGet('json_uri_category')) {
                                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                 $header->pragma();
                                 $header->cache_control("nocache");
                                 $header->getStatus('200');
                                 $header->json_header("UTF-8");
                                 $this->json_uri_category($data);
                             } elseif (magixcjquery_filter_request::isGet('json_list_subcategory')) {
                                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                 $header->pragma();
                                 $header->cache_control("nocache");
                                 $header->getStatus('200');
                                 $header->json_header("UTF-8");
                                 $this->json_listing_subcategory();
                             } else {
                                 if (isset($this->tab)) {
                                     if ($this->tab === 'image') {
                                         if (isset($this->img_c)) {
                                             $this->update_category_image($data);
                                         } elseif (magixcjquery_filter_request::isGet('ajax_category_image')) {
                                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                             $header->pragma();
                                             $header->cache_control("nocache");
                                             $header->getStatus('200');
                                             $header->html_header("UTF-8");
                                             $this->ajax_category_image($create, $data['img_c']);
                                         } else {
                                             $this->load_category_edit_data($create, $data);
                                             $create->display('catalog/category/edit.tpl');
                                         }
                                     } elseif ($this->tab === 'subcat') {
                                         if (isset($this->slibelle)) {
                                             $this->addSubCategory($create);
                                         } elseif (isset($this->order_pages)) {
                                             $this->update_order_subcategory();
                                         } elseif (isset($this->delete_subcategory)) {
                                             $this->remove_subcategory();
                                         } else {
                                             $this->load_category_edit_data($create, $data);
                                             $create->display('catalog/category/edit.tpl');
                                         }
                                     } elseif ($this->tab === 'product') {
                                         if (isset($this->order_pages)) {
                                             $this->update_order_category_product();
                                         } elseif (magixcjquery_filter_request::isGet('json_category_product')) {
                                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                             $header->pragma();
                                             $header->cache_control("nocache");
                                             $header->getStatus('200');
                                             $header->json_header("UTF-8");
                                             $this->json_listing_category_product();
                                         } elseif (isset($this->delete_product)) {
                                             $this->remove_product_category();
                                         } else {
                                             $this->load_category_edit_data($create, $data);
                                             $create->display('catalog/category/edit.tpl');
                                         }
                                     }
                                 } elseif (isset($this->plugin)) {
                                     // Chargement du plugin dans le produit du catalogue (edition)
                                     $this->load_category_edit_data($create, $data);
                                     $param_arr = array($this->plugin, $this->getlang, $this->edit);
                                     $plugin->extend_module($this->plugin, 'catalog_category', $param_arr);
                                 } else {
                                     if (isset($this->clibelle)) {
                                         $this->update_category($create);
                                     } elseif (isset($this->delete_image)) {
                                         $this->remove_category_image();
                                     } else {
                                         $this->load_category_edit_data($create, $data);
                                         $create->display('catalog/category/edit.tpl');
                                     }
                                 }
                             }
                         } else {
                             if (isset($this->order_pages)) {
                                 $this->update_order_category();
                             }
                         }
                     } elseif ($this->action === 'remove') {
                         $this->remove_category($create);
                     }
                 } else {
                     $create->display('catalog/category/list.tpl');
                 }
             }
         } elseif ($this->section === 'subcategory') {
             if (isset($this->getlang)) {
                 if (isset($this->action)) {
                     if ($this->action === 'add') {
                     } elseif ($this->action === 'edit') {
                         if (isset($this->edit)) {
                             $data = parent::s_catalog_subcategory_data($this->edit);
                             $create->assign('plugin', $plugin->menu_item_plugin('catalog_subcategory'));
                             if (isset($this->tab)) {
                                 if ($this->tab === 'image') {
                                     if (magixcjquery_filter_request::isGet('ajax_subcategory_image')) {
                                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                         $header->pragma();
                                         $header->cache_control("nocache");
                                         $header->getStatus('200');
                                         $header->html_header("UTF-8");
                                         $this->ajax_subcategory_image($create, $data['img_s']);
                                     } elseif (isset($this->img_s)) {
                                         $this->update_subcategory_image($data);
                                     } else {
                                         $this->load_subcategory_edit_data($create, $data);
                                         $create->display('catalog/subcategory/edit.tpl');
                                     }
                                 } elseif ($this->tab === 'product') {
                                     if (isset($this->order_pages)) {
                                         $this->update_order_subcategory_product();
                                     } elseif (magixcjquery_filter_request::isGet('json_subcategory_product')) {
                                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                         $header->pragma();
                                         $header->cache_control("nocache");
                                         $header->getStatus('200');
                                         $header->json_header("UTF-8");
                                         $this->json_listing_subcategory_product();
                                     } elseif (isset($this->delete_product)) {
                                         $this->remove_product_category();
                                     } else {
                                         $this->load_subcategory_edit_data($create, $data);
                                         $create->display('catalog/subcategory/edit.tpl');
                                     }
                                 }
                             } else {
                                 if (magixcjquery_filter_request::isGet('json_uri_subcategory')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_uri_subcategory($data);
                                 } elseif (isset($this->slibelle)) {
                                     $this->update_subcategory($create);
                                 } elseif (isset($this->delete_image)) {
                                     $this->remove_subcategory_image();
                                 } elseif (isset($this->plugin)) {
                                     // Chargement du plugin dans le produit du catalogue (edition)
                                     $this->load_subcategory_edit_data($create, $data);
                                     $param_arr = array($this->plugin, $this->getlang, $this->edit);
                                     $plugin->extend_module($this->plugin, 'catalog_subcategory', $param_arr);
                                 } else {
                                     $this->load_subcategory_edit_data($create, $data);
                                     $create->display('catalog/subcategory/edit.tpl');
                                 }
                             }
                         }
                     }
                 }
             }
         } elseif ($this->section === 'product') {
             if (isset($this->getlang)) {
                 if (isset($this->action)) {
                     if ($this->action === 'list') {
                         if (magixcjquery_filter_request::isGet('json_listing_product')) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_listing_product(20);
                         } elseif (magixcjquery_filter_request::isGet('idclc')) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_idcls($this->getidclc);
                         } elseif (isset($this->title_search)) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_list_product();
                         } elseif (isset($this->name_product)) {
                             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                             $header->pragma();
                             $header->cache_control("nocache");
                             $header->getStatus('200');
                             $header->json_header("UTF-8");
                             $this->json_autocomplete_product();
                         }
                     } elseif ($this->action === 'add') {
                         if (isset($this->titlecatalog)) {
                             $this->addProduct($create);
                         }
                     } elseif ($this->action === 'edit') {
                         $data = parent::s_catalog_data($this->edit);
                         $create->assign('plugin', $plugin->menu_item_plugin('catalog_product'));
                         if (isset($this->tab)) {
                             if ($this->tab === 'image') {
                                 if (isset($this->imgcatalog)) {
                                     $this->update_product_image($data);
                                 } elseif (magixcjquery_filter_request::isGet('ajax_product_image')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->html_header("UTF-8");
                                     $this->ajax_product_image($create, $data['imgcatalog']);
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             } elseif ($this->tab === 'category') {
                                 if (magixcjquery_filter_request::isGet('json_product_category')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_listing_product_category();
                                 } elseif (isset($this->idclc)) {
                                     $this->add_product_category();
                                 } elseif (isset($this->delete_product)) {
                                     $this->remove_product_category();
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->assign('array_list_category', $this->array_list_category());
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             } elseif ($this->tab === 'product') {
                                 if (isset($this->idproduct)) {
                                     $this->addProductRel($create);
                                 } elseif (magixcjquery_filter_request::isGet('json_product_rel')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_listing_product_rel();
                                 } elseif (isset($this->delete_product)) {
                                     $this->remove_product_rel();
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             } elseif ($this->tab === 'galery') {
                                 if (magixcjquery_filter_request::isGet('json_list_galery')) {
                                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                                     $header->pragma();
                                     $header->cache_control("nocache");
                                     $header->getStatus('200');
                                     $header->json_header("UTF-8");
                                     $this->json_list_galery();
                                 } elseif (isset($this->img_order)) {
                                     $this->update_order_galery();
                                 } elseif (isset($this->imgcatalog)) {
                                     $this->add_galery_image();
                                 } elseif (isset($this->delete_galery)) {
                                     $this->remove_product_galery();
                                 } else {
                                     $this->load_product_edit_data($create, $data);
                                     $create->display('catalog/product/edit.tpl');
                                 }
                             }
                         } else {
                             if (isset($this->delete_image)) {
                                 $this->remove_product_image();
                             }
                             if (isset($this->titlecatalog)) {
                                 $this->update_product($create);
                             } elseif (isset($this->plugin)) {
                                 // Chargement du plugin dans le produit du catalogue (edition)
                                 $this->load_product_edit_data($create, $data);
                                 $param_arr = array($this->plugin, $this->getlang, $this->edit);
                                 $plugin->extend_module($this->plugin, 'catalog_product', $param_arr);
                             } else {
                                 $this->load_product_edit_data($create, $data);
                                 $create->display('catalog/product/edit.tpl');
                             }
                         }
                     } elseif ($this->action === 'remove') {
                         $this->remove_product();
                     } elseif ($this->action === 'copy') {
                         if (isset($this->copy)) {
                             $this->copy_product();
                         }
                     } elseif ($this->action === 'move') {
                         if (isset($this->move)) {
                             $this->move_product();
                         }
                     }
                 } else {
                     $create->assign('select_lang', $this->lang_select());
                     $create->assign('pagination', $this->product_pagination(20));
                     $create->display('catalog/product/list.tpl');
                 }
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } elseif (isset($this->product_search)) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_url_product();
         } else {
             $create->display('catalog/index.tpl');
         }
     }
 }
Esempio n. 6
0
 /**
  * execution du module d'accès
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('users'), array('users_'), false);
     $access = $this->model_access->module_access("backend_controller_access");
     $all_access = $this->model_access->all_data_employee($this->model_access->data_session());
     //print_r($all_access);
     $create->assign('access', $access);
     $create->assign('all_access', $all_access);
     //if($access['view'] == 1)
     if ($this->action == 'add') {
         if (isset($this->role_name)) {
             $this->add_profile($this->role_name);
         } elseif (isset($this->id_module)) {
             $this->add_new_access($this->id_module);
         } else {
             $create->display('access/add.tpl');
         }
     } elseif ($this->action == 'list') {
         if (magixcjquery_filter_request::isGet('json_profiles')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->listing_profile();
         } elseif (magixcjquery_filter_request::isGet('json_access')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->listing_access();
         } else {
             $create->display('access/list.tpl');
         }
     } elseif ($this->action == 'edit') {
         if (isset($this->role_name)) {
             $this->edit_profile($this->role_name);
         } elseif ($this->id_access) {
             $this->edit_access();
         } else {
             $this->load_data_profile($create);
             $create->display('access/edit.tpl');
         }
     } elseif ($this->action == 'remove') {
         if (isset($this->delete_role)) {
             $this->remove_role($this->delete_role);
         }
     } else {
         $access = new backend_model_access();
         /*print "<pre>";
           print_r($access->listPlugins());
           print "</pre>";*/
         $create->display('access/list.tpl');
     }
 }
Esempio n. 7
0
 /**
  * 
  * run
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('users'), array('users_'), false);
     if (isset($this->action)) {
         if ($this->action === 'add') {
             if (isset($this->email_admin)) {
                 $this->insert_user();
             }
         } elseif ($this->action === 'list') {
             if (magixcjquery_filter_request::isGet('json_list_user')) {
                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                 $header->pragma();
                 $header->cache_control("nocache");
                 $header->getStatus('200');
                 $header->json_header("UTF-8");
                 $this->json_list_user();
             } else {
                 $create->assign('role_select', $this->role_select($create));
                 $create->display('user/list.tpl');
             }
         } elseif ($this->action === 'edit') {
             if (isset($this->email_admin)) {
                 $this->update_user_data();
             } elseif (isset($this->id_role)) {
                 $this->update_user_role();
             } elseif (isset($this->passwd_admin)) {
                 $this->update_user_password();
             } elseif (isset($this->active_admin)) {
                 $this->edit_active_employee($this->active_admin);
             } else {
                 $this->load_data($create);
                 $create->assign('role_select', $this->role_select($create, $this->edit));
                 $create->display('user/edit.tpl');
             }
         } elseif ($this->action === 'remove') {
             if (isset($this->delete_employee)) {
                 $this->remove_user();
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } else {
             $create->display('user/index.tpl');
         }
     }
 }
Esempio n. 8
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     if (isset($this->action)) {
         if ($this->action == 'list') {
             if (magixcjquery_filter_request::isGet('ajax_tpl')) {
                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                 $header->pragma();
                 $header->cache_control("nocache");
                 $header->getStatus('200');
                 $header->html_header("UTF-8");
                 $create->assign('themes', $this->scanTemplateDir($create));
                 $create->display('theming/req.tpl');
             }
         } elseif ($this->action == 'edit') {
             if (isset($this->ptheme)) {
                 $this->update();
             }
         }
     } else {
         $create->assign('themes', $this->scanTemplateDir($create));
         $create->display('theming/index.tpl');
     }
 }
Esempio n. 9
0
 /**
  * Execute le module dans l'administration
  * @access public
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('home'), array('home_'), false);
     $access = $this->model_access->module_access("backend_controller_home");
     $create->assign('access', $access);
     if (isset($this->action)) {
         if ($this->action == 'list') {
             if (magixcjquery_filter_request::isGet('json_list_home')) {
                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                 $header->pragma();
                 $header->cache_control("nocache");
                 $header->getStatus('200');
                 $header->json_header("UTF-8");
                 $this->json_list_home();
             } else {
                 $create->assign('select_lang', $this->lang_select($create));
                 $create->display('home/list.tpl');
             }
         } elseif ($this->action == 'add') {
             if (isset($this->subject)) {
                 $this->insert_new_page();
             }
         } elseif ($this->action == 'edit') {
             if (magixcjquery_filter_request::isGet('edit')) {
                 if (isset($this->subject)) {
                     $this->update_data_page();
                 } else {
                     $this->load_data_page($create);
                     $create->display('home/edit.tpl');
                 }
             }
         } elseif ($this->action == 'remove') {
             if (isset($this->delete_home)) {
                 $this->remove_home();
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } else {
             $create->display('home/index.tpl');
         }
     }
 }
Esempio n. 10
0
 /**
  * @access public
  * Execution de la structure
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('language'), array('language_'), false);
     if (isset($this->action)) {
         if ($this->action == 'list') {
             if (magixcjquery_filter_request::isGet('json_list_lang')) {
                 $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                 $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                 $header->pragma();
                 $header->cache_control("nocache");
                 $header->getStatus('200');
                 $header->json_header("UTF-8");
                 $this->json_listing_language();
             } else {
                 $iso = backend_model_forms::code_iso("iso");
                 $create->assign('iso', $iso);
                 $create->display('lang/list.tpl');
             }
         } elseif ($this->action == 'add') {
             if (isset($this->iso)) {
                 $this->insert_new_lang($create);
             }
         } elseif ($this->action == 'edit') {
             if (magixcjquery_filter_request::isGet('edit')) {
                 if (isset($this->iso)) {
                     $this->edit_lang();
                 } else {
                     $this->load_data_language($create);
                     backend_controller_template::display('lang/edit.tpl');
                 }
             } else {
                 if (isset($this->active_lang)) {
                     $this->update_activate_lang();
                 }
             }
         } elseif ($this->action == 'remove') {
             if (magixcjquery_filter_request::isPost('delete_lang')) {
                 $this->delete_lang_record($create);
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } else {
             $iso = backend_model_forms::code_iso("iso");
             backend_controller_template::assign('iso', $iso);
             backend_controller_template::display('lang/index.tpl');
         }
     }
 }
Esempio n. 11
0
 /**
  * execute la fonction run pour l'administration CMS
  * @access public 
  */
 public function run()
 {
     $header = new magixglobal_model_header();
     $create = new backend_controller_template();
     $create->addConfigFile(array('cms'), array('pages_'), false);
     $access = $this->model_access->module_access("backend_controller_cms");
     $create->assign('access', $access);
     if (magixcjquery_filter_request::isGet('getlang')) {
         if (isset($this->action)) {
             if ($this->action == 'list') {
                 if (magixcjquery_filter_request::isGet('json_page_p')) {
                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                     $header->pragma();
                     $header->cache_control("nocache");
                     $header->getStatus('200');
                     $header->json_header("UTF-8");
                     $this->json_parent_p();
                 } elseif (magixcjquery_filter_request::isGet('title_p_lang')) {
                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                     $header->pragma();
                     $header->cache_control("nocache");
                     $header->getStatus('200');
                     $header->json_header("UTF-8");
                     $this->json_cat_p_lang();
                 } elseif (magixcjquery_filter_request::isGet('title_search')) {
                     $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                     $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                     $header->pragma();
                     $header->cache_control("nocache");
                     $header->getStatus('200');
                     $header->json_header("UTF-8");
                     $this->json_autocomplete();
                 } elseif (isset($this->get_page_p)) {
                     if (magixcjquery_filter_request::isGet('json_child_p')) {
                         $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
                         $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
                         $header->pragma();
                         $header->cache_control("nocache");
                         $header->getStatus('200');
                         $header->json_header("UTF-8");
                         $this->json_child_page();
                     } else {
                         $create->assign('parent_title', $this->parent_page($this->get_page_p));
                         $create->assign('language', $this->parent_language($this->getlang));
                         $create->display('cms/child_page.tpl');
                     }
                 } elseif (isset($this->order_pages)) {
                     $this->update_order_page();
                 } elseif (magixcjquery_filter_request::isPost('idpage')) {
                     $this->update_sidebar_status();
                 } else {
                     $create->assign('selectlang', null);
                     $create->assign('language', $this->parent_language($this->getlang));
                     $create->display('cms/parent_page.tpl');
                 }
             } elseif ($this->action == 'add') {
                 if (isset($this->get_page_p)) {
                     if (isset($this->title_page)) {
                         $this->insert_new_child_page($create, $this->title_page, $this->get_page_p);
                     }
                 } elseif (magixcjquery_filter_request::isGet('add_parent_p')) {
                     $this->insert_new_page_p($this->title_page, $this->idlang);
                 } elseif (isset($this->title_page)) {
                     $this->insert_new_page_p($this->title_page);
                 }
             } elseif ($this->action == 'edit') {
                 if (isset($this->edit)) {
                     if (magixcjquery_filter_request::isPost('idlang_p')) {
                         $this->insert_new_rel_lang_p($this->idlang_p);
                     } elseif (magixcjquery_filter_request::isPost('title_page')) {
                         $this->update_page($this->title_page);
                     } elseif (magixcjquery_filter_request::isPost('del_relang_p')) {
                         $this->delete_related_lang();
                     } elseif (magixcjquery_filter_request::isGet('json_uricms')) {
                         $this->json_uricms($this->edit);
                     } elseif (magixcjquery_filter_request::isGet('json_child_lang_page')) {
                         $this->json_other_language_page($this->edit);
                     } else {
                         $this->load_edit_page($this->edit);
                         $create->display('cms/edit.tpl');
                     }
                 }
             } elseif ($this->action == 'move') {
                 if (magixcjquery_filter_request::isPost('idlang')) {
                     $this->update_move_page($create);
                 } else {
                     $this->load_data_move_page($create, $this->edit);
                     $create->display('cms/move.tpl');
                 }
             } elseif ($this->action == 'remove') {
                 if (magixcjquery_filter_request::isPost('delpage')) {
                     $this->delete_page();
                 }
             }
         }
     } else {
         if (magixcjquery_filter_request::isGet('json_graph')) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_graph();
         } elseif (isset($this->page_search)) {
             $header->head_expires("Mon, 26 Jul 1997 05:00:00 GMT");
             $header->head_last_modified(gmdate("D, d M Y H:i:s") . "GMT");
             $header->pragma();
             $header->cache_control("nocache");
             $header->getStatus('200');
             $header->json_header("UTF-8");
             $this->json_url_page();
         } else {
             $create->display('cms/index.tpl');
         }
     }
 }