first
This commit is contained in:
48
modules/module/action/a.module_delete.php
Normal file
48
modules/module/action/a.module_delete.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$R = getDbData($table['s_module'],"id='".$moduleid."'",'*');
|
||||
if (!$R['id']) getLink('','','존재하지 않는 모듈입니다.','');
|
||||
if ($R['sys'] || $R['system']) getLink('','','시스템모듈은 삭제할 수 없습니다.','');
|
||||
|
||||
getDbDelete($table['s_module'],"id='".$moduleid."'");
|
||||
|
||||
include_once $g['path_core'].'function/dir.func.php';
|
||||
|
||||
$table_db = $g['path_module'].$moduleid.'/_setting/db.table.php.done';
|
||||
$_tmptfile = $g['path_var'].'table.info.php';
|
||||
|
||||
if(is_file($table_db))
|
||||
{
|
||||
$module= $moduleid;
|
||||
$_table= $table;
|
||||
$table = array();
|
||||
include_once $table_db;
|
||||
|
||||
$fp = fopen($_tmptfile,'w');
|
||||
fwrite($fp, "<?php\n");
|
||||
foreach($_table as $key => $val)
|
||||
{
|
||||
if (!$table[$key])
|
||||
{
|
||||
fwrite($fp, "\$table['$key'] = \"$val\";\n");
|
||||
}
|
||||
}
|
||||
fwrite($fp, "?>");
|
||||
fclose($fp);
|
||||
@chmod($_tmptfile,0707);
|
||||
|
||||
foreach($table as $key => $val)
|
||||
{
|
||||
db_query('drop table '.$val,$DB_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DirDelete($g['path_module'].$R['id']);
|
||||
|
||||
getLink($g['s'].'/?r='.$r.'&m=admin&panel=Y&pickmodule='.$m,'parent.parent.','','');
|
||||
|
||||
?>
|
||||
12
modules/module/action/a.moduleinfo_update.php
Normal file
12
modules/module/action/a.moduleinfo_update.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
if ($moduleid)
|
||||
{
|
||||
getDbUpdate($table['s_module'],"name='".trim($name)."',hidden='$hidden',mobile='$mobile',icon='".trim($icon)."',lang='$modulelang'","id='".$moduleid."'");
|
||||
}
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
10
modules/module/action/a.modulemobile_update.php
Normal file
10
modules/module/action/a.modulemobile_update.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$mobile = $mobile ? 0 : 1;
|
||||
getDbUpdate($table['s_module'],'mobile='.$mobile,"id='".$moduleid."'");
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
10
modules/module/action/a.moduleorder_update.php
Normal file
10
modules/module/action/a.moduleorder_update.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$i=0;
|
||||
foreach($modulemembers as $val) getDbUpdate($table['s_module'],'gid='.($i++),"id='".$val."'");
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
10
modules/module/action/a.moduleshow_update.php
Normal file
10
modules/module/action/a.moduleshow_update.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
|
||||
$hidden = $hidden ? 0 : 1;
|
||||
getDbUpdate($table['s_module'],'hidden='.$hidden,"id='".$moduleid."'");
|
||||
|
||||
getLink('reload','parent.','','');
|
||||
?>
|
||||
77
modules/module/action/a.update_extension.php
Normal file
77
modules/module/action/a.update_extension.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
getLink('','','죄송합니다. 이 기능은 현재 지원하지 않습니다.','');
|
||||
|
||||
$_upath = str_replace('./','',$extension_path);
|
||||
$_ufile = $extension_path.'update/'.$ufile.'.txt';
|
||||
|
||||
if ($type == 'delete')
|
||||
{
|
||||
unlink($_ufile);
|
||||
getLink('reload','parent.','업데이트 기록이 제거되었습니다.','');
|
||||
}
|
||||
else if ($type == 'manual')
|
||||
{
|
||||
$fp = fopen($_ufile,'w');
|
||||
fwrite($fp,$date['today'].',1');
|
||||
fclose($fp);
|
||||
@chmod($_ufile,0707);
|
||||
getLink('reload','parent.','수동 업데이트 처리되었습니다.','');
|
||||
}
|
||||
else {
|
||||
require $g['path_core'].'opensrc/unzip/ArchiveExtractor.class.php';
|
||||
require $g['path_core'].'function/dir.func.php';
|
||||
include $g['path_core'].'function/rss.func.php';
|
||||
include $g['path_module'].'market/var/var.php';
|
||||
$_serverinfo = explode('/',$d['update']['url']);
|
||||
$_updatedate = getUrlData('http://'.$_serverinfo[2].'/__update/market/'.$_upath.'update.txt',10);
|
||||
$_updatelist = explode("\n",$_updatedate);
|
||||
$_updateleng = count($_updatelist)-1;
|
||||
$_includeup = false;
|
||||
for($i=$_updateleng;$i>=0;$i--)
|
||||
{
|
||||
$_upx = explode(',',trim($_updatelist[$i]));
|
||||
if ($_upx[1]==$ufile)
|
||||
{
|
||||
$_includeup = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$_includeup) getLink('','','업데이트 파일이 존재하지 않습니다.','');
|
||||
$_updatefile = getUrlData('http://'.$_serverinfo[2].'/__update/market/'.$_upath.$ufile.'.zip',10);
|
||||
$folder = './';
|
||||
$extPath = $g['path_tmp'].'app';
|
||||
$extPath1 = $extPath.'/';
|
||||
$saveFile = $extPath1.'rb_update_app.zip';
|
||||
|
||||
$fp = fopen($saveFile,'w');
|
||||
fwrite($fp,$_updatefile);
|
||||
fclose($fp);
|
||||
@chmod($saveFile,0707);
|
||||
|
||||
$extractor = new ArchiveExtractor();
|
||||
$extractor -> extractArchive($saveFile,$extPath1);
|
||||
unlink($saveFile);
|
||||
|
||||
$_updateFile = $extPath1.'/_update.php';
|
||||
if (is_file($_updateFile))
|
||||
{
|
||||
include $_updateFile;
|
||||
unlink($_updateFile);
|
||||
}
|
||||
|
||||
DirCopy($extPath1,$folder);
|
||||
DirDelete($extPath);
|
||||
mkdir($extPath,0707);
|
||||
@chmod($extPath,0707);
|
||||
|
||||
$fp = fopen($_ufile,'w');
|
||||
fwrite($fp,$date['today'].',0');
|
||||
fclose($fp);
|
||||
@chmod($_ufile,0707);
|
||||
|
||||
getLink('reload','parent.','업데이트가 완료되었습니다.','');
|
||||
}
|
||||
?>
|
||||
88
modules/module/action/a.update_plugin.php
Normal file
88
modules/module/action/a.update_plugin.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
if(!defined('__KIMS__')) exit;
|
||||
|
||||
checkAdmin(0);
|
||||
getLink('','','죄송합니다. 이 기능은 현재 지원하지 않습니다.','');
|
||||
|
||||
require $g['path_core'].'function/dir.func.php';
|
||||
|
||||
$_upath = str_replace('./','',$extension_path);
|
||||
$_ufile = $extension_path.'update/'.$ufile.'.txt';
|
||||
$_ufileexp = explode('.',$ufile);
|
||||
|
||||
if ($type == 'delete')
|
||||
{
|
||||
unlink($_ufile);
|
||||
//여기에 실제 테마 삭제처리
|
||||
DirDelete($extension_path.'themes/'.$_ufileexp[0]);
|
||||
getLink('reload','parent.','테마가 제거되었습니다.','');
|
||||
}
|
||||
else if ($type == 'download')
|
||||
{
|
||||
//여기에 다운로드 처리
|
||||
getLink('','','다운로드 처리','');
|
||||
}
|
||||
else {
|
||||
require $g['path_core'].'opensrc/unzip/ArchiveExtractor.class.php';
|
||||
include $g['path_core'].'function/rss.func.php';
|
||||
include $g['path_module'].'market/var/var.php';
|
||||
$_serverinfo = explode('/',$d['update']['url']);
|
||||
$_updatedate = getUrlData('http://'.$_serverinfo[2].'/__update/market/'.$_upath.'theme.txt',10);
|
||||
$_updatelist = explode("\n",$_updatedate);
|
||||
$_updateleng = count($_updatelist)-1;
|
||||
$_includeup = false;
|
||||
for($i=$_updateleng;$i>=0;$i--)
|
||||
{
|
||||
$_upx = explode(',',trim($_updatelist[$i]));
|
||||
if ($_upx[5]==$_ufileexp[1])
|
||||
{
|
||||
$_includeup = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$_includeup) getLink('','','테마가 존재하지 않습니다.','');
|
||||
$_updatefile = getUrlData('http://'.$_serverinfo[2].'/__update/market/'.$_upath.$_ufileexp[1].'.zip',10);
|
||||
$folder = './';
|
||||
$extPath = $g['path_tmp'].'app';
|
||||
$extPath1 = $extPath.'/';
|
||||
$saveFile = $extPath1.'rb_update_app.zip';
|
||||
|
||||
$fp = fopen($saveFile,'w');
|
||||
fwrite($fp,$_updatefile);
|
||||
fclose($fp);
|
||||
@chmod($saveFile,0707);
|
||||
|
||||
$extractor = new ArchiveExtractor();
|
||||
$extractor -> extractArchive($saveFile,$extPath1);
|
||||
unlink($saveFile);
|
||||
|
||||
$_updateFile = $extPath1.'/_update.php';
|
||||
if (is_file($_updateFile))
|
||||
{
|
||||
include $_updateFile;
|
||||
unlink($_updateFile);
|
||||
}
|
||||
|
||||
DirCopy($extPath1,$folder);
|
||||
DirDelete($extPath);
|
||||
mkdir($extPath,0707);
|
||||
@chmod($extPath,0707);
|
||||
|
||||
|
||||
|
||||
// 테스트용
|
||||
mkdir($extension_path.'themes',0707);
|
||||
@chmod($extension_path.'themes',0707);
|
||||
mkdir($extension_path.'themes/'.$_ufileexp[0],0707);
|
||||
@chmod($extension_path.'themes/'.$_ufileexp[0],0707);
|
||||
|
||||
|
||||
|
||||
$fp = fopen($_ufile,'w');
|
||||
fwrite($fp,$date['today']);
|
||||
fclose($fp);
|
||||
@chmod($_ufile,0707);
|
||||
|
||||
getLink('reload','parent.','테마가 설치되었습니다.','');
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user