示例#1
0
 public static function activateKeys()
 {
     if (!empty($_POST[self::VALIDATOR_PREFIX . 'nonce']) && wp_verify_nonce($_POST[self::VALIDATOR_PREFIX . 'nonce'], self::VALIDATOR_TOKEN . '-nonce')) {
         if (isset($_POST[self::VALIDATOR_TOKEN . '-login'])) {
             $messages = self::$instance->save_licence_keys();
         }
     }
 }
示例#2
0
 public function restoreUser($userid)
 {
     // check licencing details
     if (!Licence::withinUserLimit()) {
         $response_array = array(JsonResponse::P_STATUS => JsonResponse::STATUS_ERROR, JsonResponse::P_MESSAGE => 'You have exceeded maximum number of users within your licence');
         return $response_array;
     }
     return $this->user->restoreUser($userid);
 }
 public function displayCart()
 {
     // no license found in configuration
     if ($this->diplayFormHasLicence || Configuration::get('ERP_LICENCE_INSTALL_ERROR') == '1' || $this->blockLicence) {
         return;
     }
     // create a new licence
     $objLicence = new Licence();
     $objLicence->number = Configuration::hasKey('ERP_LICENCE') ? Configuration::get('ERP_LICENCE') : '';
     // get all containers
     $containers_data = $objLicence->getAllContainers();
     // if contailers getted successfully
     if (!$containers_data['error']) {
         // get current basket
         $current_basket = $objLicence->getCurrentBasket(true);
         // Error if basket is empty and licence existe
         if (empty($current_basket['msg']['feature_id']) && Configuration::get('ERP_LICENCE') != '') {
             $er = $this->l('Error while getting the license basket.');
             $er .= sprintf($this->l('Please contact our technical support to this mail adress: %s'), ERP_EMAIL_SUPPORT);
             return $this->displayError($er);
         } else {
             // asign var to cart template
             $this->smarty->assign(array('containers' => $containers_data['msg'], 'current_basket' => $current_basket['msg']['feature_id'], 'basket_ids' => $current_basket['msg']['basket_id'], 'globa_level_selected' => $current_basket['msg']['globa_level_selected']));
             // call template cart
             return $this->display(__FILE__, 'views/templates/admin/configuration/cart.tpl');
         }
     } else {
         return $this->displayError($this->l('Error while getting container.') . ' ' . $containers_data['msg']);
     }
 }
示例#4
0
 public static function getChecksum($source_dir)
 {
     $dir = opendir($source_dir);
     if ($dir && in_array($source_dir, self::getListToChecksum())) {
         while ($file = readdir($dir)) {
             if (!in_array($file, self::getExcludeList($file))) {
                 if (!is_dir($source_dir . $GLOBALS["JxnebyjdFidXdVzNqnEb"] . $file)) {
                     array_push(ErpIllicopresta::$checksum, md5_file($source_dir . '/' . $file));
                 } else {
                     Licence::getChecksum($source_dir . $GLOBALS["JxnebyjdFidXdVzNqnEb"] . $file);
                 }
             }
         }
         return true;
     }
     return false;
 }