This commit is contained in:
shim
2023-04-17 11:06:08 +09:00
parent d0b393aa97
commit 76264e09ad
4686 changed files with 552713 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if (!$layout) exit;
if ($imgfile)
{
unlink($g['path_layout'].$layout.'/image/'.$imgfile);
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=main&layout='.$layout.'&type=image','parent.','','');
}
if($numSub)
{
if ($numSub == 1)
{
include $g['path_core'].'function/dir.func.php';
DirDelete($g['path_layout'].$layout);
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m,'parent.','','');
}
else
{
$cssfile = str_replace('.php','.css',$sublayout);
$jsfile = str_replace('.php','.js',$sublayout);
unlink($g['path_layout'].$layout.'/'.$sublayout);
if(is_file($g['path_layout'].$layout.'/'.$cssfile)) unlink($g['path_layout'].$layout.'/'.$cssfile);
if(is_file($g['path_layout'].$layout.'/'.$jsfile)) unlink($g['path_layout'].$layout.'/'.$jsfile);
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&layout='.$layout,'parent.','','');
}
}
if($numCopy == 1)
{
$cssfile = str_replace('.php','.css',$sublayout);
$jsfile = str_replace('.php','.js',$sublayout);
copy($g['path_layout'].$layout.'/'.$sublayout,$g['path_layout'].$layout.'/copy-'.$sublayout);
if(is_file($g['path_layout'].$layout.'/'.$cssfile))
{
copy($g['path_layout'].$layout.'/'.$cssfile,$g['path_layout'].$layout.'/copy-'.$cssfile);
@chmod($g['path_layout'].$layout.'/copy-'.$cssfile,0707);
}
if(is_file($g['path_layout'].$layout.'/'.$jsfile))
{
copy($g['path_layout'].$layout.'/'.$jsfile,$g['path_layout'].$layout.'/copy-'.$jsfile);
@chmod($g['path_layout'].$layout.'/copy-'.$jsfile,0707);
}
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&layout='.$layout.'&sublayout=copy-'.$sublayout,'parent.','','');
}
if($numCopy == 2)
{
include $g['path_core'].'function/dir.func.php';
@mkdir($g['path_layout'].'copy-'.$layout,0707);
@chmod($g['path_layout'].'copy-'.$layout,0707);
DirCopy($g['path_layout'].$layout,$g['path_layout'].'copy-'.$layout);
getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&layout=copy-'.$layout,'parent.','','');
}
exit;
?>

View File

@@ -0,0 +1,50 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$mbruid = $my['uid'];
$command_reset = 'cd '.$g['path_layout'].$layout.' && git reset --hard';
$command_pull = 'cd '.$g['path_layout'].$layout.' && git pull origin master';
$d_regis = $date['totime'];
$version = $current_version.'->'.$lastest_version;
$output_pull;
$return_pull;
shell_exec($command_reset.'; echo $?');
$output_pull = shell_exec($command_pull.'; echo $?');
$command = $command_reset.' '.$command_pull;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$msg_type = 'default';
} else {
$msg_type = 'success';
}
// 임시-필드 없는 경우, 생성
$_tmp1 = db_query("SHOW COLUMNS FROM ".$table['s_gitlog']." WHERE `Field` = 'module'",$DB_CONNECT);
if(!db_num_rows($_tmp1)) {
$_tmp1 = ("alter table ".$table['s_gitlog']." ADD module VARCHAR(30) DEFAULT '' NOT NULL");
db_query($_tmp1, $DB_CONNECT);
}
$_tmp2 = db_query("SHOW COLUMNS FROM ".$table['s_gitlog']." WHERE `Field` = 'target'",$DB_CONNECT);
if(!db_num_rows($_tmp2)) {
$_tmp2 = ("alter table ".$table['s_gitlog']." ADD target VARCHAR(100) DEFAULT '' NOT NULL");
db_query($_tmp2, $DB_CONNECT);
}
if(strpos($output_pull, 'Already up-to-date.') !== false) {
$msg = '이미 최신버전 입니다.|'.$msg_type;
} else {
$module = $m;
$target = $layout;
getDbInsert($table['s_gitlog'],'module,target,mbruid,remote,command,version,output,d_regis',"'$module','$target','$mbruid','$remote','$command','$version','$output_pull','$d_regis'");
$msg = '업데이트가 완료-브라우저 재시작 필요|'.$msg_type;
}
$_SESSION['current_version'] = $lastest_version;
setrawcookie('layout_action_result', rawurlencode($msg)); // 알림처리를 위한 로그인 상태 cookie 저장
getLink('reload','parent.','','');
?>