public function init()
 {
     /** @noinspection PhpUndefinedClassInspection */
     parent::init();
     $this->debug = $this->module->getConfigApiDebugMode();
     $this->execute();
 }
Beispiel #2
0
 public function init()
 {
     $this->page_name = 'calendar';
     $this->display_column_left = false;
     $this->display_column_right = false;
     parent::init();
 }
 public function init()
 {
     parent::init();
     /*
      * Piqué dans le AuthController. J'aurais bien aimé utiliser le AuthController, mais le premier contrôle dans son init()
      * c'est pour vérifier si l'utilisateur est loggé ou non, ce qui mettait à plat ma stratégie.
      *
      * Je me suis posé la question 'Faut il que ca marche pour des admin ?', j'ai supposé que non,
      * mais s'il avait fallu, il suffisait de tester un 'Employee' en plus d'un 'Customer'
      */
     $passwd = trim(Tools::getValue('passwd'));
     $_POST['passwd'] = null;
     $email = trim(Tools::getValue('email'));
     if (!empty($email) && Validate::isEmail($email) && !empty($passwd) && Validate::isPasswd($passwd)) {
         $customer = new Customer();
         $authentication = $customer->getByEmail(trim($email), trim($passwd));
         if (isset($authentication->active) && $authentication->active && $customer->id) {
             Tools::redirect(Configuration::get("ADMIN_TAB_MODULE_URLBACK"));
         }
     }
     /*
      * Ici, je ne suis vraiment pas satisfait de la méthode employée, je trouve ça plutôt crade
      * de transmettre des infos sur les erreurs via un param en GET, mais dans l'immédiat je n'ai pas trouvé mieux
      */
     Tools::redirect("index.php?urlback_haserror=1");
 }
 public function init()
 {
     parent::init();
     $this->id_cart = (int) Tools::getValue('id_cart', 0);
     $is_guest = false;
     /* check if the cart has been made by a Guest customer, for redirect link */
     if (Cart::isGuestCartByCartId($this->id_cart)) {
         $is_guest = true;
         $redirectLink = 'index.php?controller=guest-tracking';
     } else {
         $redirectLink = 'index.php?controller=history';
     }
     $this->id_module = (int) Tools::getValue('id_module', 0);
     $this->id_order = Order::getOrderByCartId((int) $this->id_cart);
     $this->secure_key = Tools::getValue('key', false);
     $order = new Order((int) $this->id_order);
     if ($is_guest) {
         $customer = new Customer((int) $order->id_customer);
         $redirectLink .= '&id_order=' . $order->reference . '&email=' . urlencode($customer->email);
     }
     if (!$this->id_order || !$this->id_module || !$this->secure_key || empty($this->secure_key)) {
         Tools::redirect($redirectLink . (Tools::isSubmit('slowvalidation') ? '&slowvalidation' : ''));
     }
     $this->reference = $order->reference;
     if (!Validate::isLoadedObject($order) || $order->id_customer != $this->context->customer->id || $this->secure_key != $order->secure_key) {
         Tools::redirect($redirectLink);
     }
     $payment_methods = $this->module->getPaymentMethods();
     if (!in_array($order->payment, $payment_methods)) {
         Tools::redirect($redirectLink);
     }
 }
 public function init()
 {
     if (!$this->context->customer->isLogged()) {
         Tools::redirect($this->context->link->getPageLink('authentication', true, (int) $this->context->language->id, 'back=' . urlencode($this->context->link->getModuleLink('referralprogram', 'program'))));
     }
     parent::init();
 }
Beispiel #6
0
 public function init()
 {
     $this->page_name = 'shop';
     $this->display_column_left = true;
     $this->display_column_right = true;
     parent::init();
 }
Beispiel #7
0
 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'MailAlert.php';
     $this->id_product = (int) Tools::getValue('id_product');
     $this->id_product_attribute = (int) Tools::getValue('id_product_attribute');
 }
 public function init()
 {
     $this->page_name = 'availability';
     $this->display_column_left = false;
     $this->display_column_right = false;
     parent::init();
 }
Beispiel #9
0
 public function init()
 {
     if (!$this->context->customer->isLogged()) {
         Tools::redirect('index.php?controller=authentication&back=modules/referralprogram/referralprogram-program.php');
     }
     parent::init();
 }
 public function init()
 {
     $this->page_name = 'Todo Pago Payment';
     // page_name and body id
     $this->display_column_left = false;
     $this->display_column_right = false;
     parent::init();
 }
Beispiel #11
0
 public function init()
 {
     parent::init();
     $simpleblog_post_rewrite = Tools::getValue('rewrite');
     if ($simpleblog_post_rewrite) {
         $this->simpleblog_post_rewrite = $simpleblog_post_rewrite;
     }
 }
Beispiel #12
0
 public function init()
 {
     parent::init();
     $this->display_column_left = false;
     $this->display_column_right = false;
     $this->display_header = false;
     $this->display_footer = false;
     $this->module->handleRequest();
 }
 public function init()
 {
     /** @noinspection PhpUndefinedClassInspection */
     parent::init();
     $this->display_column_left = false;
     $this->display_column_right = false;
     $this->debug = $this->module->getConfigApiDebugMode();
     $this->redirect_on_error = !$this->debug;
 }
Beispiel #14
0
 public function init()
 {
     parent::init();
     if (version_compare(_PS_VERSION_, '1.5.0.0', '<')) {
         $this->context->cookie = self::$cookie;
         $this->context->smarty = self::$smarty;
     }
     $this->_setSEOTags();
     $this->_setProductFilterList();
 }
Beispiel #15
0
 public function init()
 {
     Tools::switchLanguage();
     //switch language if lang param, ps bug.
     /*         * * URL MANAGEMENT ** */
     if (isset($_GET['news']) && is_numeric($_GET['news'])) {
         $this->id_news = $_GET['news'];
     }
     parent::init();
     $this->list_link = News::linkList();
 }
 public function init()
 {
     self::$amz_payments = new AmzPayments();
     $this->isLogged = (bool) $this->context->customer->id && Customer::customerIdExistsStatic((int) $this->context->cookie->id_customer);
     parent::init();
     /* Disable some cache related bugs on the cart/order */
     header('Cache-Control: no-cache, must-revalidate');
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     $this->display_column_left = false;
     $this->display_column_right = false;
     $this->service = self::$amz_payments->getService();
 }
Beispiel #17
0
 public function init()
 {
     Tools::switchLanguage();
     //switch language if lang param, ps bug.
     /*         * * URL MANAGEMENT ** */
     if (isset($_GET['post']) && is_numeric($_GET['post'])) {
         $this->id_post = $_GET['post'];
     } elseif (isset($_GET['category']) && is_numeric($_GET['category'])) {
         $this->id_category = (int) $_GET['category'];
     }
     parent::init();
     //        $this->list_link = Myphotos::linkList();
 }
Beispiel #18
0
 public function init()
 {
     parent::init();
     $simpleblog_post_rewrite = Tools::getValue('rewrite', 0);
     if ($simpleblog_post_rewrite) {
         $this->simpleblog_post_rewrite = $simpleblog_post_rewrite;
     }
     $id_lang = Context::getContext()->language->id;
     $SimpleBlogPost = SimpleBlogPost::getByRewrite($this->simpleblog_post_rewrite, $id_lang);
     if (!$SimpleBlogPost->isAccessGranted()) {
         Tools::redirect('index.php?controller=404');
     }
     if (!Validate::isLoadedObject($SimpleBlogPost) || Validate::isLoadedObject($SimpleBlogPost) && !$SimpleBlogPost->active) {
         Tools::redirect('index.php?controller=404');
     }
     if (Validate::isLoadedObject($SimpleBlogPost) && $this->simpleblog_post_rewrite != $SimpleBlogPost->link_rewrite || Tools::getValue('sb_category') != $SimpleBlogPost->category_rewrite) {
         Tools::redirect(SimpleBlogPost::getLink($SimpleBlogPost->link_rewrite, $SimpleBlogPost->category_rewrite));
     }
     if (!empty($SimpleBlogPost->meta_title)) {
         $this->context->smarty->assign('meta_title', $SimpleBlogPost->meta_title);
     } else {
         $this->context->smarty->assign('meta_title', $SimpleBlogPost->title);
     }
     if (!empty($SimpleBlogPost->meta_description)) {
         $this->context->smarty->assign('meta_description', $SimpleBlogPost->meta_description);
     }
     if (!empty($SimpleBlogPost->meta_keywords)) {
         $this->context->smarty->assign('meta_keywords', $SimpleBlogPost->meta_keywords);
     }
     // if(!Validate::isLoadedObject($SimpleBlogPost))
     // {
     //  $SimpleBlogPost = SimpleBlogPost::getByRewrite($this->simpleblog_post_rewrite, false);
     //  if(Validate::isLoadedObject($SimpleBlogPost))
     //  {
     //      header('HTTP/1.1 301 Moved Permanently');
     //      header('Location: '.SimpleBlogPost::getLink($SimpleBlogPost->link_rewrite, $SimpleBlogPost->category_rewrite));
     //  }
     //  else
     //  {
     //      Tools::redirect('index.php?controller=404');
     //  }
     // }
     $this->SimpleBlogPost = $SimpleBlogPost;
     $this->simpleblog_post_name = $SimpleBlogPost->title;
     $this->simpleblog_post_description = strip_tags($SimpleBlogPost->short_content);
     $this->simpleblog_post_image = $SimpleBlogPost->banner ? Context::getContext()->shop->getBaseURL() . 'modules/ph_simpleblog/covers/' . $SimpleBlogPost->id . '.' . $SimpleBlogPost->cover : '';
     $this->simpleblog_post_thumbnail = $SimpleBlogPost->banner ? Context::getContext()->shop->getBaseURL() . 'modules/ph_simpleblog/covers/' . $SimpleBlogPost->id . '.' . $SimpleBlogPost->cover : '';
     $this->simpleblog_post_url = $SimpleBlogPost->url;
     $this->simpleblog_post_category_rewrite = $SimpleBlogPost->category_rewrite;
 }
Beispiel #19
0
 public function init()
 {
     parent::init();
     $sb_category = Tools::getValue('sb_category');
     $simpleblog_search = Tools::getValue('simpleblog_search');
     $simpleblog_keyword = Tools::getValue('simpleblog_keyword');
     if ($sb_category) {
         $this->sb_category = $sb_category;
     }
     if ($simpleblog_search && $simpleblog_keyword) {
         $this->simpleblog_search = $simpleblog_search;
         $this->simpleblog_keyword = $simpleblog_keyword;
         $this->is_search = true;
     }
 }
Beispiel #20
0
 /**
  * Acción que permite obtener los datos de un item (producto) para poder
  * consumir desde la aplicación web de LibreDTE
  * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
  * @version 2016-01-30
  */
 public function init()
 {
     $item = [];
     // inicializar controlador
     parent::init();
     // columna que se usará para identificar al producto
     if (!($column = Tools::getValue('column'))) {
         $column = 'product_id';
     }
     // recuperar ID del producto
     if ($product_id = Tools::getValue('product_id')) {
         if ($column != 'product_id') {
             $db = Db::getInstance();
             $sql = new DbQuery();
             $sql->select('id_product');
             $sql->from('product');
             $sql->where($db->_escape($column) . ' = \'' . $db->_escape($product_id) . '\'');
             $r = Db::getInstance()->executeS($sql);
             $product_id = isset($r[0]['id_product']) ? (int) $r[0]['id_product'] : 0;
         } else {
             $product_id = (int) $product_id;
         }
     } else {
         $product_id = 0;
     }
     // crear objeto con el producto
     if ($product_id) {
         $this->product = new Product($product_id, true, $this->context->language->id, $this->context->shop->id);
     }
     // si el objeto no existe error
     if (!Validate::isLoadedObject($this->product) or !$this->product->active) {
         header('HTTP/1.1 404 Not Found');
         header('Status: 404 Not Found');
         $item = 'Item solicitado fue encontrado o no está activo';
     } else {
         $item = ['TpoCodigo' => 'INT1', 'VlrCodigo' => substr(Tools::getValue('product_id'), 0, 35), 'NmbItem' => substr($this->product->name, 0, 80), 'DscItem' => substr($this->product->meta_description, 0, 1000), 'IndExe' => $this->product->tax_rate ? 0 : 1, 'UnmdItem' => substr('', 0, 4), 'PrcItem' => round($this->product->price), 'ValorDR' => 0, 'TpoValor' => '$'];
     }
     // enviar item como objeto json
     header('Content-Type: application/json');
     die(json_encode($item, JSON_PRETTY_PRINT));
 }
 public function init()
 {
     $this->display_column_left = false;
     $this->display_column_right = false;
     parent::init();
     $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId(self::$cookie->id_customer));
     $this->seller = new Employee($this->sellerinfo->id_seller);
     $hcjkispeef = "seller_exists";
     ${"GLOBALS"}["rdwfndiorn"] = "pagename";
     ${${"GLOBALS"}["ndbfsnbuwdpq"]} = Validate::isLoadedObject($this->seller);
     $this->isSeller = (${$hcjkispeef} and $this->seller->active);
     ${${"GLOBALS"}["rdwfndiorn"]} = AgileHelper::getPageName();
     if (!${${"GLOBALS"}["ndbfsnbuwdpq"]} && ${${"GLOBALS"}["cvseqebxgmo"]} != "sellersummary.php") {
         $this->errors[] = Tools::displayError("You do not have permission to access this page. Please conatct store administrator.");
     }
     if (Module::isInstalled("agilesellerlistoptions")) {
         include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         ${${"GLOBALS"}["wokgohn"]} = new AgileSellerListOptions();
         self::$smarty->assign(array("pay_options_link" => $aslmodule->getPayOptionLink($this->sellerinfo->id_seller)));
     }
     self::$smarty->assign(array("isSeller" => $this->isSeller, "seller_exists" => ${${"GLOBALS"}["ndbfsnbuwdpq"]}, "agilemultipleseller_views" => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/views/", "agilemultipleseller_custom" => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/custom/", "sellerinfo" => $this->sellerinfo, "seller" => $this->seller, "seller_back_office" => (int) Configuration::get("AGILE_MS_SELLER_BACK_OFFICE"), "is_seller_shipping_installed" => Module::isInstalled("agilesellershipping"), "is_seller_commission_installed" => Module::isInstalled("agilesellercommission"), "is_seller_messenger_installed" => Module::isInstalled("agilesellermessenger"), "is_seller_ratings_installed" => Module::isInstalled("agilesellerratings"), "is_multiple_shop_installed" => Module::isInstalled("agilemultipleshop"), "is_seller_listoptions_installed" => Module::isInstalled("agilesellerlistoptions"), "is_agileprepaidcredit_installed" => Module::isInstalled("agileprepaidcredit"), "sellertoken" => Tools::encrypt("ams_seller") . ($this->isSeller ? $this->seller->passwd : ""), "admin_folder_name" => Configuration::get("AGILE_MS_ADMIN_FOLDER_NAME"), "selleremail" => $this->seller ? $this->seller->email : "", "ajaxurl" => _MODULE_DIR_, "seller_palenl_withleft" => (int) Configuration::get("AGILE_MS_SELLER_PANEL_WITHLEFT"), "seller_palenl_withright" => (int) Configuration::get("AGILE_MS_SELLER_PANEL_WITHRIGHT"), "is_seller_pickupcenter_installed" => Module::isInstalled("agilepickupcenter")));
 }
 public function getReportClaimsPage()
 {
     if (!Configuration::get('YRS_API_KEY') || !$this->yapi->checkIsProperlyInstalled()) {
         return;
     }
     if ($this->context->customer->id !== null) {
         $redirect_url = $this->getOrderHistoryUrl();
         if (Tools::getIsset('ordersPage')) {
             $redirect_url .= (parse_url($redirect_url, PHP_URL_QUERY) ? '&' : '?') . 'ordersPage';
         }
         Tools::redirect($redirect_url);
     }
     $this->setTemplate('reportClaims.tpl');
     parent::init();
     parent::setMedia();
     $base_url = Tools::getCurrentUrlProtocolPrefix() . Tools::getShopDomainSsl() . __PS_BASE_URI__;
     $this->addJS($base_url . 'modules/yousticeresolutionsystem/views/js/yrs_report_claims.js');
     parent::initHeader();
     parent::initContent();
     parent::initFooter();
     $this->display();
     exit;
 }
Beispiel #23
0
 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'FavoriteProduct.php';
     $this->id_product = (int) Tools::getValue('id_product');
 }
 public function init()
 {
     parent::init();
     $this->indexAction();
 }
Beispiel #25
0
 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'FavoriteProduct.php';
 }
 public function init()
 {
     parent::init();
     $this->display_column_left = false;
     $this->display_column_right = false;
 }
Beispiel #27
0
 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'leotempcp.php';
 }
 /**
  * Initialize the page
  */
 public function init()
 {
     $this->ssl = true;
     parent::init();
 }
 public function init()
 {
     parent::init();
 }
Beispiel #30
0
 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'leomenusidebar.php';
 }