Пример #1
0
 /**
  * Constructor
  *
  * @global \Cx\Core\Html\Sigma
  * @global array
  */
 public function __construct()
 {
     parent::__construct();
     $this->_objTpl = new \Cx\Core\Html\Sigma(ASCMS_CORE_MODULE_PATH . '/Access/View/Template/Backend');
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
     $this->_objTpl->setErrorHandling(PEAR_ERROR_DIE);
 }
Пример #2
0
 public function __construct($pageContent)
 {
     parent::__construct();
     $this->_objTpl = new \Cx\Core\Html\Sigma('.');
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
     $this->_objTpl->setErrorHandling(PEAR_ERROR_DIE);
     $this->_objTpl->setTemplate($pageContent);
 }
Пример #3
0
 /**
  * Verifies the account data present in the session
  * @param   boolean     $silent     If true, no messages are created.
  *                                  Defaults to false
  * @return  boolean                 True if the account data is complete
  *                                  and valid, false otherwise
  */
 static function verify_account($silent = false)
 {
     global $_ARRAYLANG;
     //\DBG::log("Verify account");
     $status = true;
     //\DBG::log("POST: ".  var_export($_POST, true));
     if (isset($_POST) && !self::verifySessionAddress()) {
         if ($silent) {
             return false;
         }
         $status = \Message::error($_ARRAYLANG['TXT_FILL_OUT_ALL_REQUIRED_FIELDS']);
     }
     // Registered Customers are okay now
     if (self::$objCustomer) {
         return $status;
     }
     if (\Cx\Core\Setting\Controller\Setting::getValue('register', 'Shop') == ShopLibrary::REGISTER_MANDATORY || \Cx\Core\Setting\Controller\Setting::getValue('register', 'Shop') == ShopLibrary::REGISTER_OPTIONAL && empty($_SESSION['shop']['dont_register'])) {
         if (isset($_SESSION['shop']['password']) && !\User::isValidPassword($_SESSION['shop']['password'])) {
             if ($silent) {
                 return false;
             }
             global $objInit;
             $objInit->loadLanguageData('Access');
             $status = \Message::error(\Cx\Core_Modules\Access\Controller\AccessLib::getPasswordInfo());
         }
     } else {
         // User is not trying to register, so she doesn't need a password.
         // Mind that this is necessary in order to avoid passwords filled
         // in automatically by the browser, which may be wrong, or
         // invalid, or both.
         $_SESSION['shop']['password'] = NULL;
     }
     if (isset($_SESSION['shop']['email']) && !\FWValidator::isEmail($_SESSION['shop']['email'])) {
         if ($silent) {
             return false;
         }
         $status = \Message::error($_ARRAYLANG['TXT_INVALID_EMAIL_ADDRESS']);
     }
     if (!$status) {
         return false;
     }
     if (isset($_SESSION['shop']['email'])) {
         // Ignore "unregistered" Customers.  These will silently be updated
         if (Customer::getUnregisteredByEmail($_SESSION['shop']['email'])) {
             return true;
         }
         $objUser = new \User();
         $objUser->setUsername($_SESSION['shop']['email']);
         $objUser->setEmail($_SESSION['shop']['email']);
         \Message::save();
         // This method will set an error message we don't want here
         // (as soon as it uses the Message class, that is)
         if (!($objUser->validateUsername() && $objUser->validateEmail())) {
             //\DBG::log("Shop::verify_account(): Username or e-mail in use");
             \Message::restore();
             $_POST['email'] = $_SESSION['shop']['email'] = NULL;
             if ($silent) {
                 return false;
             }
             return \Message::error(sprintf($_ARRAYLANG['TXT_EMAIL_USED_BY_OTHER_CUSTOMER'], \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'login') . '?redirect=' . base64_encode(\Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'account')))) || \Message::error(sprintf($_ARRAYLANG['TXT_SHOP_GOTO_SENDPASS'], \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', 'sendpass')));
         }
         \Message::restore();
     }
     return $status;
 }
Пример #4
0
 public function __construct()
 {
     global $objTemplate;
     parent::__construct();
     $this->_objTpl =& $objTemplate;
 }