예제 #1
0
 /**
  * main action
  */
 public function mainAction()
 {
     if ($customer_data = $_POST['client']['customer']) {
         require_once 'models/client/client_customer.php';
         $Customer = new client_customer();
         if ($id = $Customer->registerCustomer($customer_data)) {
             onxshop_flush_cache();
             onxshopGoTo("/backoffice/customers/{$id}/detail");
         } else {
             msg("Cannot add user", 'error');
         }
     }
     return true;
 }
예제 #2
0
 /**
  * flushCache
  */
 public function flushCache()
 {
     onxshop_flush_cache();
 }
예제 #3
0
 /**
  * main action
  */
 public function mainAction()
 {
     set_time_limit(0);
     require_once 'models/common/common_file.php';
     $File = new common_file();
     $tool = $this->GET['tool'];
     switch ($tool) {
         case 'uri':
             require_once 'models/common/common_uri_mapping.php';
             $CommonURIMapping = new common_uri_mapping();
             $CommonURIMapping->generateAndSaveURITable();
             msg("Nice URLs has been completely generated");
             break;
         case 'flush_thumb':
             if ($File->rm(ONXSHOP_PROJECT_DIR . "var/thumbnails/*")) {
                 msg("All image thumbnails have been deleted");
             } else {
                 "Flushing thumbnails failed";
             }
             break;
         case 'flush_tmp':
             if ($File->rm(ONXSHOP_PROJECT_DIR . "var/tmp/*")) {
                 msg("Temp directory has been cleaned");
             } else {
                 "Flushing temp dir failed";
             }
             break;
         case 'flush_cache':
             if (onxshop_flush_cache()) {
                 msg("Cache has been refreshed");
             } else {
                 msg("Flushing cache failed");
             }
             break;
         case 'flush_api_cache':
             if (is_numeric($GLOBALS['onxshop_conf']['common_configuration']['api_data_version'])) {
                 $current_api_data_version = $GLOBALS['onxshop_conf']['common_configuration']['api_data_version'];
             } else {
                 $current_api_data_version = 1;
             }
             $api_data_version = $current_api_data_version + 1;
             $Configuration = new common_configuration();
             if ($Configuration->saveConfig('common_configuration', 'api_data_version', $api_data_version)) {
                 msg("Data version of API has increased to {$api_data_version}");
                 if (onxshop_flush_cache()) {
                     msg("Cache has been refreshed");
                 } else {
                     msg("Flushing cache failed");
                 }
             }
             break;
         case 'find_hard_links':
             require_once 'models/common/common_node.php';
             $Node = new common_node();
             $hard_links = $Node->findHardLinks();
             foreach ($hard_links as $hard_link) {
                 $this->tpl->assign('ITEM', $hard_link);
                 $this->tpl->parse('content.hard_links.item');
             }
             $this->tpl->parse('content.hard_links');
             break;
         case 'delete_orphaned_baskets':
             require_once 'models/ecommerce/ecommerce_basket.php';
             $Basket = new ecommerce_basket();
             if ($Basket->deleteOrphanedAnonymouseBaskets()) {
                 msg('Deleted orphaned baskets older than two weeks');
             }
             break;
         case 'backup':
             $_Onxshop = new Onxshop_Request("bo/component/backup");
             $this->tpl->assign('SUB_CONTENT', $_Onxshop->getContent());
             break;
         default:
             $this->tpl->parse('content.menu');
             break;
     }
     return true;
 }