示例#1
0
 function upLicense()
 {
     if ($_FILES) {
         if ($_FILES['enterprise']['name']) {
             $fileName = explode('.', $_FILES['enterprise']['name']);
             if ('CER' != $fileName['1']) {
                 echo "<script>parent.MessageBox.error('" . app::get('entermembercenter')->_('"企业帐号格式不对"') . "');</script>";
                 return;
             } else {
                 $content = file_get_contents($_FILES['enterprise']['tmp_name']);
                 list($entid, $ent_ac, $ent_email) = explode('|||', $content);
                 $result = base_enterprise::set_enterprise_info(array('ent_id' => $entid, 'ent_ac' => $ent_ac, 'ent_email' => $ent_email));
                 if (!$result) {
                     header("Content-type:text/html; charset=utf-8");
                     echo "<script>parent.MessageBox.error('" . app::get('entermembercenter')->_('"企业帐号重置失败,请先上传文件"') . "');</script>";
                 } else {
                     // 删除证书和node_id.
                     base_certificate::del_certificate();
                     $obj = kernel::single('base_shell_buildin');
                     $obj->command_inactive_node_id('ceti_node_id');
                     header("Content-type:text/html; charset=utf-8");
                     echo "<script>parent.MessageBox.success('" . app::get('entermembercenter')->_('"企业帐号上传成功"') . "');</script>";
                 }
             }
         } else {
             echo "<script>parent.MessageBox.error('" . app::get('entermembercenter')->_('"请选择要上传的文件"') . "');</script>";
         }
     }
 }
示例#2
0
 function delete()
 {
     $this->begin();
     base_certificate::del_certificate();
     base_certificate::register();
     $this->end();
 }
示例#3
0
 function clean($type = "clean")
 {
     //清除node_id
     $config = base_setup_config::deploy_info();
     foreach ($config['package']['app'] as $k => $app) {
         $applist[] = $app['id'];
     }
     foreach ($applist as $str_app_id) {
         $app_xml = kernel::single('base_xml')->xml2array(file_get_contents(app::get($str_app_id)->app_dir . '/app.xml'), 'base_app');
         if (isset($app_xml['node_id']) && $app_xml['node_id'] == "true" && base_shopnode::node_id($str_app_id)) {
             // 获取节点.
             base_shopnode::delete_node_id($str_app_id);
         }
     }
     //清除证书
     base_certificate::del_certificate();
     //清除shopex_id
     base_enterprise::set_enterprise_info(null);
 }
示例#4
0
 function command_recover_shopex_id()
 {
     $args = func_get_args();
     $options = $this->get_options();
     if ($options['backup_dir']) {
         $file_name = $args[1];
         $backup_dir = $args[0];
         $backup_file = $backup_dir . "/" . $file_name . "_shopex_id.log";
         if (is_file($backup_file)) {
             if (!($fp = fopen($backup_file, 'r'))) {
                 echo "Failed to read file";
                 exit;
             }
             $content = fgets($fp);
             list($ent_id, $ent_ac, $ent_email) = explode('|||', $content);
             $data = array('ent_id' => $ent_id, 'ent_ac' => $ent_ac, 'ent_email' => $ent_email);
             $result = base_enterprise::set_enterprise_info($data);
             if (!$result) {
                 echo "failed shopex_id recovery.....";
                 exit;
             } else {
                 base_certificate::del_certificate();
                 $obj = kernel::single('base_shell_buildin');
                 $obj->command_inactive_node_id('ceti_node_id');
                 echo "success of the shopex_id recovery......";
                 exit;
             }
         } else {
             echo "File does not exist......";
             exit;
         }
     } else {
         echo "缺少参数,使用-d 指定已经备份好的shopex_id存放的目录?使用-n指定要恢复的项目名称";
     }
 }