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,49 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
foreach ($mbrmembers as $val)
{
if ($my['uid'] == $val) continue;
$M=getDbData($table['s_mbrid'],'uid='.$val,'*');
$_M=getDbData($table['s_mbrdata'],'memberuid='.$val,'*');
if($auth)
{
if ($auth == 'D')
{
getDbDelete($table['s_mbrid'],'uid='.$M['uid']);
getDbDelete($table['s_mbrdata'],'memberuid='.$M['uid']);
getDbDelete($table['s_mbrcomp'],'memberuid='.$M['uid']);
getDbDelete($table['s_paper'],'my_mbruid='.$M['uid']);
getDbDelete($table['s_point'],'my_mbruid='.$M['uid']);
getDbDelete($table['s_scrap'],'mbruid='.$M['uid']);
getDbDelete($table['s_friend'],'my_mbruid='.$M['uid'].' or by_mbruid='.$M['memberuid']);
getDbUpdate($table['s_mbrlevel'],'num=num-1','uid='.$_M['level']);
getDbUpdate($table['s_mbrgroup'],'num=num-1','uid='.$_M['sosok']);
getDbDelete($table['s_mbrsns'],'memberuid='.$M['uid']);
if (is_file($g['path_var'].'avatar/'.$M['photo']))
{
unlink($g['path_var'].'avatar/'.$M['photo']);
}
$fp = fopen($g['path_tmp'].'out/'.$M['id'].'.txt','w');
fwrite($fp,$date['totime']);
fclose($fp);
@chmod($g['path_tmp'].'out/'.$M['id'].'.txt',0707);
}
else if ($auth == 'A')
{
getDbUpdate($table['s_mbrdata'],"super=1,admin=1,adm_view='[admin]'",'memberuid='.$M['uid']);
}
else {
getDbUpdate($table['s_mbrdata'],"auth='$auth'",'memberuid='.$M['uid']);
}
}
else {
getDbUpdate($table['s_mbrdata'],"super=0,admin=0,adm_view='',adm_site=''",'memberuid='.$M['uid']);
}
}
setrawcookie('admin_admin_result', rawurlencode('처리 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,126 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$id = trim($_POST['id']);
$pw = trim($_POST['pw1']);
$name = trim($_POST['name']);
$nic = trim($_POST['nic']);
$nic = $nic ? $nic : $name;
$email = trim($_POST['email']);
if (!$id || !$name) getLink('','','정말로 실행하시겠습니까?','');
if (!$check_id || !$check_nic || !$check_email)
{
getLink('','','정말로 실행하시겠습니까?','');
}
$tmpname = $_FILES['upfile']['tmp_name'];
$realname = $_FILES['upfile']['name'];
if ($avatar_delete)
{
$photo = '';
$saveFile1 = $g['path_var'].'avatar/'.$avatar;
}
else {
$photo = $avatar;
if (is_uploaded_file($tmpname))
{
$fileExt = strtolower(getExt($realname));
$fileExt = $fileExt == 'jpeg' ? 'jpg' : $fileExt;
if (strstr('[jpg,png,gif]',$fileExt))
{
$wh = getimagesize($tmpname);
if ($wh[0] > 250 && $wh[1] > 250)
{
$photo = $id.'.'.$fileExt;
$saveFile1 = $g['path_var'].'avatar/'.$photo;
if (is_file($saveFile1)) unlink($saveFile1);
include $g['path_core'].'function/thumb.func.php';
move_uploaded_file($tmpname,$saveFile1);
ResizeWidth($saveFile1,$saveFile1,600);
@chmod($saveFile1,0707);
}
}
}
}
if ($uid)
{
$_M = getDbData($table['s_mbrdata'],'memberuid='.$uid,'d_regis');
if($pw!='')
{
$newPw = password_hash($pw, PASSWORD_DEFAULT);
getDbUpdate($table['s_mbrid'],"pw='".$newPw."'",'uid='.$uid);
if ($my['uid'] == $uid)
{
$_SESSION['mbr_pw'] = $newPw;
}
}
getDbUpdate($table['s_mbrdata'],"super='$super',email='$email',name='$name',nic='$nic',photo='$photo',phone='$phone'",'memberuid='.$uid);
setrawcookie('admin_admin_result', rawurlencode('수정 되었습니다.|success')); // 처리여부 cookie 저장
}
else {
getDbInsert($table['s_mbrid'],'site,id,pw',"'$s','$id','".password_hash($pw, PASSWORD_DEFAULT)."'");
$memberuid = getDbCnt($table['s_mbrid'],'max(uid)','');
$auth = 1;
$mygroup = 1;
$level = 1;
$comp = 0;
$adm_view = $admin ? '[admin]' : '';
$adm_site = '';
$home = '';
$birth1 = 0;
$birth2 = 0;
$birthtype = 0;
$job = '';
$marr1 = 0;
$marr2 = 0;
$sms = 1;
$mailing = 1;
$smail = 0;
$point = 0;
$usepoint = 0;
$money = 0;
$cash = 0;
$num_login = 1;
$bio = '';
$now_log = 0;
$last_log = '';
$last_pw = $date['totime'];
$is_paper = 0;
$d_regis = $date['totime'];
$sns = '';
$noticeconf = '';
$num_notice = 0;
$addfield = '';
$_QKEY = "memberuid,site,auth,mygroup,level,comp,super,admin,adm_view,adm_site,";
$_QKEY.= "email,name,nic,grade,photo,home,sex,birth1,birth2,birthtype,phone,tel,";
$_QKEY.= "job,marr1,marr2,sms,mailing,smail,point,usepoint,money,cash,num_login,bio,now_log,last_log,last_pw,is_paper,d_regis,tmpcode,sns,noticeconf,num_notice,addfield";
$_QVAL = "'$memberuid','$s','$auth','$mygroup','$level','$comp','$super','$admin','$adm_view','$adm_site',";
$_QVAL.= "'$email','$name','$nic','','$photo','$home','$sex','$birth1','$birth2','$birthtype','$phone','$tel',";
$_QVAL.= "'$job','$marr1','$marr2','$sms','$mailing','$smail','$point','$usepoint','$money','$cash','$num_login','$bio','$now_log','$last_log','$last_pw','$is_paper','$d_regis','','$sns','$noticeconf','$num_notice','$addfield'";
getDbInsert($table['s_mbrdata'],$_QKEY,$_QVAL);
getDbUpdate($table['s_mbrlevel'],'num=num+1','uid='.$level);
getDbUpdate($table['s_mbrgroup'],'num=num+1','uid='.$mygroup);
if ($email){
getDbInsert($table['s_mbremail'],'mbruid,email,base,backup,d_regis,d_code,d_verified',"'".$memberuid."','".$email."',1,0,'".$d_regis."','',''");
}
if ($phone) {
getDbInsert($table['s_mbrphone'],'mbruid,phone,base,backup,d_regis,d_code,d_verified',"'".$memberuid."','".$phone."',1,0,'".$d_regis."','',''");
}
setrawcookie('admin_admin_result', rawurlencode($name.'님이 추가 되었습니다.|success')); // 처리여부 cookie 저장
}
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$result = false;
if ($type == 'id')
{
$isId = getDbRows($table['s_mbrid'],"id='".$fvalue."'");
if (!$isId && !is_file($g['path_tmp'].'out/'.$fvalue.'.txt')) $result = true;
if ($result):
?>
<script>
parent.getId('rb-idcheck').innerHTML = '<i class="fa fa-info-circle fa-lg fa-fw"></i>정상';
parent.document.procForm.check_id.value = '1';
parent.submitFlag = false;
</script>
<?php else:?>
<script>
parent.getId('rb-idcheck').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
parent.document.procForm.check_id.value = '0';
parent.submitFlag = false;
</script>
<?php
endif;
}
else if ($type == 'nic')
{
if ($my['admin']) $result = true;
else {
if($my['uid']) $isId = getDbRows($table['s_mbrdata'],"nic='".$fvalue."' and nic<>'".$my['nic']."'");
else $isId = getDbRows($table['s_mbrdata'],"nic='".$fvalue."'");
if (!$isId) $result = true;
}
if ($result):
?>
<script>
parent.getId('rb-nickcheck').innerHTML = '<i class="fa fa-info-circle fa-lg fa-fw"></i>정상';
parent.document.procForm.check_nic.value = '1';
parent.submitFlag = false;
</script>
<?php else:?>
<script>
parent.getId('rb-nickcheck').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
parent.document.procForm.check_nic.value = '0';
parent.submitFlag = false;
</script>
<?php
endif;
}
else if ($type == 'email')
{
if (strpos($fvalue,'@') && strpos($fvalue,'.'))
{
if ($my['admin']) $result = true;
else {
if ($my['uid']) $isId = getDbRows($table['s_mbrdata'],"email='".$fvalue."' and email <> '".$my['email']."'");
else $isId = getDbRows($table['s_mbrdata'],"email='".$fvalue."'");
if (!$isId) $result = true;
}
}
if ($result):
?>
<script>
parent.getId('rb-emailcheck').innerHTML = '<i class="fa fa-info-circle fa-lg fa-fw"></i>정상';
parent.document.procForm.check_email.value = '1';
parent.submitFlag = false;
</script>
<?php else:?>
<script>
parent.getId('rb-emailcheck').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
parent.document.procForm.check_email.value = '0';
parent.submitFlag = false;
</script>
<?php
endif;
}
exit;
?>

View File

@@ -0,0 +1,16 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($my['uid'] != 1 || $memberuid == 1) getLink('','','권한이 없습니다.','');
$perm = '';
foreach($module_members as $mds)
{
$perm .= '['.$mds.']';
}
getDbUpdate($table['s_mbrdata'],"adm_view='".$perm."'",'memberuid='.$memberuid);
setrawcookie('admin_admin_result', rawurlencode('반영 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,16 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($my['uid'] != 1 || $memberuid == 1) getLink('','','권한이 없습니다.','');
$perm = '';
foreach($module_members as $sts)
{
$perm .= '['.$sts.']';
}
getDbUpdate($table['s_mbrdata'],"adm_site='".$perm."'",'memberuid='.$memberuid);
setrawcookie('admin_admin_result', rawurlencode('관리 사이트가 지정 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,47 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$memberuid = $my['uid'];
$url = $g['s'].'/?r='.$r.'&m='.$m.'&module='.$_addmodule.'&front='.$_addfront;
if(getDbRows($table['s_admpage'],'memberuid='.$memberuid." and url='".$url."'"))
{
getLink('','','이미 등록된 북마크입니다.','');
}
$maxgid = getDbCnt($table['s_admpage'],'max(gid)','memberuid='.$memberuid);
$MD = getDbData($table['s_module'],"id='".$_addmodule."'",'*');
include getLangFile($g['path_module'].$_addmodule.'/language/',$d['admin']['syslang'],'/lang.admin-menu.php');
$varfile = $g['path_module'].$_addmodule.'/admin/var/var.menu.php';
if (is_file($varfile))
{
include $varfile;
$name= $MD['name'].' - '.$d['amenu'][$_addfront];
}
else {
$name= $MD['name'];
}
$gid = $maxgid + 1;
getDbInsert($table['s_admpage'],'memberuid,gid,name,url',"'$memberuid','$gid','$name','$url'");
$bookmark_uid = getDbCnt($table['s_admpage'],'max(uid)','');
if ($_addmodule == 'admin' && $_addfront == 'bookmark')
{
getLink('reload','parent.','','');
}
else {
?>
<script>
parent.getId('_bookmark_star_').className = 'fa fa-lg fa-star rb-star-fill text-primary';
parent.getId('_bookmark_notyet_').className = 'btn-group btn-group-sm dropdown hidden';
parent.getId('_bookmark_already_').className = 'btn-group btn-group-sm dropdown';
parent.getId('_add_bookmark_').innerHTML <?php if(getDbRows($table['s_admpage'],'memberuid='.$my['uid'])>1):?>+<?php endif?>= '<a href="<?php echo $url?>" class="list-group-item" id="_now_bookmark_<?php echo $bookmark_uid?>"><i class="fa fa-fw fa-file-text-o"></i><?php echo $name?></a>';
</script>
<?php
exit;
}
?>

View File

@@ -0,0 +1,38 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($deltype == 'hidden')
{
$memberuid = $my['uid'];
$url = $g['s'].'/?r='.$r.'&m='.$m.'&module='.$_addmodule.'&front='.$_addfront;
$bookmark_rcd = getDbData($table['s_admpage'],'memberuid='.$memberuid." and url='".$url."'",'uid');
$bookmark_uid = $bookmark_rcd['uid'];
if (!$bookmark_uid)
{
getLink('','','등록되지 않았거나 이미 삭제된 북마크입니다.','');
}
getDbDelete($table['s_admpage'],'uid='.$bookmark_uid);
?>
<script>
parent.getId('_bookmark_star_').className = 'fa fa-lg fa-star-o';
parent.getId('_bookmark_notyet_').className = 'btn-group btn-group-sm dropdown';
parent.getId('_bookmark_already_').className = 'btn-group btn-group-sm dropdown hidden';
parent.getId('_now_bookmark_<?php echo $bookmark_uid?>').className = 'list-group-item hidden';
<?php if(!getDbRows($table['s_admpage'],'memberuid='.$my['uid'])):?>
parent.getId('_add_bookmark_').innerHTML = '<a class="list-group-item"><i class="fa fa-fw fa-file-text-o"></i>등록된 북마크가 없습니다</a>';
<?php endif?>
</script>
<?php
exit;
}
else {
foreach ($bookmark_pages as $val)
{
getDbDelete($table['s_admpage'],'uid='.$val.' and memberuid='.$my['uid']);
}
getLink('reload','parent.','','');
}
?>

View File

@@ -0,0 +1,14 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$i = 0;
foreach ($bookmark_pages_order as $val)
{
$i++;
getDbUpdate($table['s_admpage'],'gid='.$i,'uid='.$val.' and memberuid='.$my['uid']);
}
getLink('','','','');
?>

View File

@@ -0,0 +1,83 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$fdset = array();
$fdset['config'] = array('themepc','pannellink','cache_flag','mailer','ses_key','ses_sec','ses_region','uninstall','dblclick','codeeidt','editor','syslang','sysmail','sysmodule','sms_tel','sms_id','sms_key','fcm_key','fcm_SenderId','fcm_VAPID','site_cutid');
$fdset['security'] = array('secu_tags','secu_domain','secu_param');
// system -> sys 필드명 변경
$_tmp1 = db_query("SHOW COLUMNS FROM ".$table['s_module']." WHERE `Field` = 'sys'",$DB_CONNECT);
if(!db_num_rows($_tmp1)) {
$_tmp1 = ("alter table ".$table['s_module']." CHANGE system sys TINYINT(4) not null");
db_query($_tmp1, $DB_CONNECT);
}
//제거탭 출력 주의 알림
if (!$d['admin']['uninstall'] && $uninstall)
{
$_message = '시스템 도구에서 <strong>제거</strong>(<code>Uninstall</code>) 탭이 출력되도록 설정되었습니다. 이 설정은 매우 위험할 수 있으니 확인하세요.';
$_referer = $g['s'].'/?r='.$r.'&m=admin&module=admin';
putNotice($my['uid'],$m,0,$_message,$_referer,'');
}
if ($act == 'config')
{
if ($d['admin']['syslang'] != $syslang)
{
$RCD = getDbArray($table['s_module'],'','*','gid','asc',0,1);
while($_R = db_fetch_array($RCD))
{
$new_modulename = $g['path_module'].$_R['id'].'/language/'.$syslang.'/name.module.txt';
getDbUpdate($table['s_module'],"name='".($syslang&&is_file($new_modulename)?implode('',file($new_modulename)):getFolderName($g['path_module'].$_R['id']))."'","id='".$_R['id']."'");
}
$panel_reload = true;
}
}
foreach ($fdset[$act] as $val)
{
$d['admin'][$val] = str_replace("\n",'',trim(${$val}));
}
$_tmpdfile = $g['path_var'].'/system.var.php';
$fp = fopen($_tmpdfile,'w');
fwrite($fp, "<?php\n");
foreach ($d['admin'] as $key => $val)
{
fwrite($fp, "\$d['admin']['".$key."'] = \"".addslashes(stripslashes($val))."\";\n");
}
fwrite($fp, "?>");
fclose($fp);
@chmod($_tmpdfile,0707);
//FCM 연결정보
$_tmpjfile = $g['path_var'].'fcm.info.js';
if ($fcm_SenderId) {
$fp = fopen($_tmpjfile,'w');
fwrite($fp, "var firebase_app_js_src = '".$fcm_app_js_src."'\n");
fwrite($fp, "var firebase_messaging_js_src = '".$fcm_messaging_js_src."'\n");
fwrite($fp, "var fcmSenderId = '".$fcm_SenderId."'\n");
fwrite($fp, "var fcmVAPID = '".$fcm_VAPID."'\n");
fwrite($fp, "var icon = '".$fcm_icon."'\n");
fclose($fp);
@chmod($_tmpjfile,0707);
} else {
unlink($_tmpjfile);
}
if($autosave):
?>
<script>
parent.document.procForm.target = '';
parent.document.procForm.a.value = 'config';
parent.document.procForm.autosave.value = '';
</script>
<?php
exit;
endif;
if ($panel_reload) getLink($g['s'].'/?r='.$r.'&pickmodule='.$m.'&panel=Y','parent.parent.','','');
else {
setrawcookie('admin_config_result', rawurlencode('시스템 설정이 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
}
?>

View File

@@ -0,0 +1,120 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$g['systemVarForSite'] = $g['path_var'].'/system.var.php';
include_once file_exists($g['systemVarForSite']) ? $g['systemVarForSite'] : $g['dir_module'].'var/var.system.php';
if ($type == 'ftpbtn')
{
$FTP_CONNECT = ftp_connect($ftp_host,$ftp_port);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$ftp_user,$ftp_pass);
if ($FTP_CONNECT && $FTP_CRESULT):
$FTP_PASV = true;
if($ftp_pasv)
{
$FTP_PASV = ftp_pasv($FTP_CONNECT, true);
}
$FTP_CHDIR = ftp_chdir($FTP_CONNECT,$ftp_rb);
if (!$FTP_PASV) $_msg = 'Passive Mode 를 확인하세요.';
if (!$FTP_CHDIR || substr($ftp_rb,-1)!='/') $_msg = '킴스큐 경로를 확인하세요.';
if ($FTP_PASV && $FTP_CHDIR):
?>
<script>
alert('정상적으로 FTP 연결이 확인되었습니다.');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-info-circle fa-lg fa-fw"></i>정상';
parent.submitFlag = false;
parent.document.procForm.a.value = 'config';
parent.document.procForm.autosave.value = '1';
parent.document.procForm.ftp.value = '1';
parent.document.procForm.target = '_autosave_';
parent.document.procForm.submit();
</script>
<?php else:?>
<script>
alert('FTP 연결이 되지 않았습니다. <?php echo $_msg?>');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
parent.submitFlag = false;
parent.document.procForm.a.value = 'config';
parent.document.procForm.autosave.value = '1';
parent.document.procForm.ftp.value = '';
parent.document.procForm.target = '_autosave_';
parent.document.procForm.submit();
</script>
<?php endif?>
<?php else:?>
<script>
alert('FTP 연결이 되지 않았습니다. FTP정보를 확인해 주세요.');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
parent.submitFlag = false;
parent.document.procForm.a.value = 'config';
parent.document.procForm.autosave.value = '1';
parent.document.procForm.ftp.value = '';
parent.document.procForm.target = '_autosave_';
parent.document.procForm.submit();
</script>
<?php
endif;
}
else if ($type == 'ftpbtn_uninstall')
{
$FTP_CONNECT = ftp_connect($d['admin']['ftp_host'],$d['admin']['ftp_port']);
$FTP_CRESULT = ftp_login($FTP_CONNECT,$d['admin']['ftp_user'],$pass);
if ($FTP_CONNECT && $FTP_CRESULT):
?>
<script>
alert('정상적으로 FTP 연결이 확인되었습니다.');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-info-circle fa-lg fa-fw"></i>정상';
</script>
<?php else:?>
<script>
alert('FTP 연결이 되지 않았습니다. FTP정보를 확인해 주세요.');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
</script>
<?php
endif;
}
else
{
include $g['path_core'].'function/email.func.php';
$content = '<h4>이메일전송 테스트입니다.</h4><br>';
$content.= '이 화면을 정상적으로 확인하셨다면 이메일 전송이 정상적으로 동작중입니다.<br><br>';
if ($type == 'sendmailbtn')
{
$result = getSendMail($chk_email,$my['email'].'|'.$my['name'],'['.$_HS['name'].'] 이메일 전송 테스트입니다.( Using '.($d['admin']['mailer'] == "ses"?'AWS SES':'Sendmail').' )',$content,'HTML');
}
if ($result):
?>
<script>
alert('이메일이 전송되었습니다. 확인해 보세요.');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-info-circle fa-lg fa-fw"></i>정상';
parent.submitFlag = false;
parent.document.procForm.a.value = 'config';
parent.document.procForm.autosave.value = '1';
parent.document.procForm.<?php echo $type=='sendmailbtn'?'email':'smtp'?>.value = '1';
parent.document.procForm.target = '_autosave_';
parent.document.procForm.submit();
</script>
<?php else:?>
<script>
alert('메일서버가 응답하지 않습니다.');
parent.getId('<?php echo $type?>').innerHTML = '<i class="fa fa-question fa-lg fa-fw"></i>확인요망';
parent.submitFlag = false;
parent.document.procForm.a.value = 'config';
parent.document.procForm.autosave.value = '1';
parent.document.procForm.<?php echo $type=='sendmailbtn'?'email':'smtp'?>.value = '';
parent.document.procForm.target = '_autosave_';
parent.document.procForm.submit();
</script>
<?php
endif;
}
exit;
?>

View File

@@ -0,0 +1,20 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$_email_header = $g['path_module'].$m.'/var/email.header.txt';
$fp = fopen($_email_header,'w');
fwrite($fp, trim(stripslashes($email_header)));
fclose($fp);
@chmod($_email_header,0707);
$_email_footer = $g['path_module'].$m.'/var/email.footer.txt';
$fp = fopen($_email_footer,'w');
fwrite($fp, trim(stripslashes($email_footer)));
fclose($fp);
@chmod($_email_footer,0707);
setrawcookie('admin_config_result', rawurlencode('이메일 양식이 저장 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,20 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$result=array();
$result['error'] = false;
$R = getUidData($table['s_gitlog'],$uid);
$M = getDbData($table['s_mbrdata'],'memberuid='.$R['mbruid'],'*');
$M1 = getUidData($table['s_mbrid'],$M['memberuid']);
$result['version'] = $R['version'];
$result['output'] = $R['output'];
$result['name'] = $M['name'].' ('.$M1['id'].')';
$result['d_regis'] = getDateFormat($R['d_regis'],'Y년 m월 d일 H시 i분');
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,40 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$sort = $sort ? $sort : 'uid';
$orderby= $orderby ? $orderby : 'desc';
$recnum = $recnum && $recnum < 201 ? $recnum : 20;
$listque = 'uid';
$RCD = getDbArray($table['s_gitlog'],$listque,'*',$sort,$orderby,$recnum,$p);
$NUM = getDbRows($table['s_gitlog'],$listque);
$TPG = getTotalPage($NUM,$recnum);
$result=array();
$result['error'] = false;
$html = '';
while ($R=db_fetch_array($RCD)) {
$version_array = explode('->', $R['version']);
$version = $version_array[1];
$html .= '<li class="table-view-cell">
<a class="navigate-right" data-toggle="page"
data-target="#page-software-logview"
data-title="'.$version.'"
data-uid="'.$R['uid'].'"
data-start="#page-software-loglist">
<span class="badge badge-default badge-inverted">'.getDateFormat($R['d_regis'],'Y.m.d H:i').'</span>
<code>'.$version.'</code>
</a>
</li>';
}
$result['list'] = $html;
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,27 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$result=array();
$git_version = shell_exec('git --version');
if ($git_version) {
$command1 = 'git init';
$command2 = 'git remote add origin https://github.com/kimsQ/rb.git';
shell_exec($command1);
shell_exec($command2);
setrawcookie('system_update_result', rawurlencode('업데이트 준비가 되었습니다.'));
$result['error'] = false;
} else {
$result['error'] = true;
$result['msg'] = 'git 설치가 필요합니다. 호스팅 업체 또는 서버관리자에게 문의해주세요.';
}
echo json_encode($result);
exit;
?>

View File

@@ -0,0 +1,14 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$mfile = $g['path_var'].'rbl.key.txt';
$fp = fopen($mfile,'w');
fwrite($fp,stripslashes($key));
fclose($fp);
@chmod($mfile,0707);
setrawcookie('admin_config_result', rawurlencode('라이센스 키가 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,41 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($isdelete)
{
include $g['path_core'].'function/dir.func.php';
foreach($pluginmembers as $plg)
{
if($isdelete == '1')
{
DirDelete($g['path_plugin'].$plg);
}
if($isdelete == '2')
{
if(is_file($g['path_plugin'].$plg.'/size.txt'))
{
unlink($g['path_plugin'].$plg.'/size.txt');
}
DirDelete($g['path_plugin'].$plg.'/'.$ov[$plg]);
}
}
getLink($g['s'].'/?r='.$r.'&m='.$m.'&module='.$m.'&front=plugin&resave=Y','parent.','','');
}
else {
$_tmpdfile = $g['path_var'].'plugin.var.php';
$fp = fopen($_tmpdfile,'w');
fwrite($fp, "<?php\n");
foreach ($ov as $_key_ => $_val_)
{
fwrite($fp, "\$d['ov']['".$_key_."'] = '".trim($_val_)."';\n");
}
fwrite($fp, "?>");
fclose($fp);
@chmod($_tmpdfile,0707);
getLink($g['s'].'/?r='.$r.'&m='.$m.'&module='.$m.'&front=plugin','parent.','','');
}
?>

View File

@@ -0,0 +1,95 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if ($act == 'robots')
{
$rfolder = $_SERVER['DOCUMENT_ROOT'];
if(!is_writable($rfolder))
{
getLink('','',sprintf(_LANG('','admin'),$rfolder),'');
}
$rfile = $rfolder.'/robots.txt';
$fp = fopen($rfile,'w');
fwrite($fp, trim(stripslashes($robotstxt)));
fclose($fp);
@chmod($rfile,0707);
getLink('','','저장 되었습니다.','');
}
if ($act == 'robots_delete')
{
@unlink($_SERVER['DOCUMENT_ROOT'].'/robots.txt');
getLink('reload','parent.','삭제 되었습니다','');
}
if ($act == 'sitemap_delete')
{
@unlink('./sitemap.xml');
getLink('reload','parent.','삭제 되었습니다','');
}
if ($act == 'sitemap_save')
{
$gfile= './sitemap.xml';
$fp = fopen($gfile,'w');
fwrite($fp,trim(stripslashes($configdata)));
fclose($fp);
@chmod($gfile,0707);
getLink('','','저장 되었습니다','');
}
if ($act == 'sitemap_make')
{
function getMenuUrlCode($site,$table,$parent,$depth,$uid,$code)
{
static $string;
$xdepth = $depth+1;
$CD=getDbSelect($table,($site?'site='.$site.' and ':'').'depth='.$xdepth.' and parent='.$parent.' and hidden=0 and reject=0 order by gid asc','*');
while($C=db_fetch_array($CD))
{
$code1 = $code.$C['id'].'/';
$_code = substr($code1,0,strlen($code1)-1);
$string .= "<url><loc>".getRWurl('c='.$_code)."</loc></url>\n";
if ($C['is_child'])
{
getMenuUrlCode($site,$table,$C['uid'],$C['depth'],$uid,$code1);
}
}
return $string;
}
function getRWurl($url)
{
global $_HS,$g;
if ($_HS['rewrite'])
{
return 'http://'.$_SERVER['HTTP_HOST'].str_replace('./','/',RW($url));
}
else {
return $g['url_root'].htmlspecialchars(str_replace('&amp;','&',str_replace('./','/',RW($url))));
}
}
$gfile= './sitemap.xml';
$fp = fopen($gfile,'w');
fwrite($fp,"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
fwrite($fp,"<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n\n");
fwrite($fp,getMenuUrlCode($s,$table['s_menu'],0,0,0,''));
$RCD = getDbArray($table['s_upload'],'type=2 or type=5 and hidden=0','*','gid','asc',0,1);
fwrite($fp,"\n\n");
while($R=db_fetch_array($RCD))
{
fwrite($fp,"<url><loc>".$R['url'].$R['folder'].'/'.$R['tmpname']."</loc></url>\n");
}
fwrite($fp,"\n");
fwrite($fp,"</urlset>\n");
fclose($fp);
@chmod($gfile,0707);
getLink('reload','parent.','사이트맵이 새로 만들어졌습니다.','');
}
exit;
?>

View File

@@ -0,0 +1,16 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
include $g['path_core'].'function/sms.func.php';
$content = '['.$_HS['name'].'] SMS 전송 테스트입니다.';
$result = getSendSMS($testsms,$chk_sms,'',$content,'sms');
if ($result == 'OK') {
getLink('reload','parent.','SMS가 전송 되었습니다. 확인해 보세요.','');
} else {
getLink('reload','parent.',$result,'');
}
?>

View File

@@ -0,0 +1,31 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
if (is_file($g['path_switch'].$switch.'/main.php'))
{
include $g['path_core'].'function/dir.func.php';
DirDelete($g['path_switch'].$switch);
$_switchset = array('start','top','head','foot','end');
$_ufile = $g['path_var'].'switch.var.php';
$fp = fopen($_ufile,'w');
fwrite($fp, "<?php\n");
foreach ($_switchset as $_key)
{
foreach ($d['switch'][$_key] as $name => $sites)
{
if($switch == $_key.'/'.$name) continue;
fwrite($fp, "\$d['switch']['".$_key."']['".$name."'] = \"".$sites."\";\n");
}
}
fwrite($fp, "?>");
fclose($fp);
@chmod($_ufile,0707);
}
getLink($g['s'].'/?r='.$r.'&m=admin&module=admin&front=switch','parent.','삭제 되었습니다.','');
?>

View File

@@ -0,0 +1,41 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$sfile = $g['path_switch'].$switch.'/main.php';
$nfile = $g['path_switch'].$switch.'/name.txt';
$sinfo = explode('/',$switch);
if (is_file($sfile))
{
$fp = fopen($nfile,'w');
fwrite($fp,$name);
fclose($fp);
$fp = fopen($sfile,'w');
fwrite($fp,trim(stripslashes($switch_code)));
fclose($fp);
@chmod($nfile,0707);
@chmod($sfile,0707);
$_newsites = '';
foreach($aply_sites as $sites) $_newsites.= '['.$sites.']';
$_ufile = $g['path_var'].'switch.var.php';
$fp = fopen($_ufile,'w');
fwrite($fp, "<?php\n");
foreach ($d['switch'] as $_key => $_val)
{
foreach ($d['switch'][$_key] as $_val1 => $_val2)
{
if ($switch == $_key.'/'.$_val1)
{
fwrite($fp, "\$d['switch']['".$_key."']['".$_val1."'] = \"".$_newsites."\";\n");
}
else {
fwrite($fp, "\$d['switch']['".$_key."']['".$_val1."'] = \"".$d['switch'][$_key][$_val1]."\";\n");
}
}
}
fwrite($fp, "?>");
fclose($fp);
@chmod($_ufile,0707);
}
setrawcookie('admin_switch_result', rawurlencode('스위치 설정이 변경 되었습니다.|success')); // 처리여부 cookie 저장
getLink('reload','parent.','','');
?>

View File

@@ -0,0 +1,24 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$_switchset = array('start','top','head','foot','end');
$_ufile = $g['path_var'].'switch.var.php';
$fp = fopen($_ufile,'w');
fwrite($fp, "<?php\n");
foreach ($_switchset as $_key)
{
foreach (${'switchmembers_'.$_key} as $_val)
{
fwrite($fp, "\$d['switch']['".$_key."']['".$_val."'] = \"".$d['switch'][$_key][$_val]."\";\n");
}
}
fwrite($fp, "?>");
fclose($fp);
@chmod($_ufile,0707);
getLink('reload','parent.',$auto?'':'스위치 정보가 갱신되었습니다.','');
?>

View File

@@ -0,0 +1,27 @@
<?php
if(!defined('__KIMS__')) exit;
if ($_SESSION['_pwemail_'] > 2) exit;
$_SESSION['_pwemail_'] = $_SESSION['_pwemail_'] + 1;
include $g['path_core'].'function/email.func.php';
$tmpPw = rand(0,999999);
$content = '<h4>'.$tmpPw.'</h4><br><b>임시 패스워드로 로그인 하신 후 반드시 패스워드를 변경해 주세요.</b>';
$firstadmin = getDbData($table['s_mbrdata'],'memberuid=1','name,email,d_regis');
$tmpUpdate = getDbUpdate($table['s_mbrdata'],"tmpcode='".password_hash($tmpPw, PASSWORD_DEFAULT)."'",'memberuid=1');
$to = $firstadmin['email'].'|'.$firstadmin['name'];
$from = $d['admin']['sysmail'];
$result = getSendMail($to,$from,'['.$_HS['name'].'] 요청하신 임시 패스워드입니다.',$content,'HTML');
if ($result)
{
getLink('reload','parent.',$firstadmin['email'].'로 임시 패스워드가 전송 되었습니다.','');
}
else {
getLink('','','이메일이 전송되지 못했습니다.','');
}
?>

View File

@@ -0,0 +1,33 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
// 제거탭 출력 설정 하지 않은 경우 차단
if (!$d['admin']['uninstall'])
{
getLink('','','정상적인 접속이 아닙니다.','');
}
// FTP 삭제
if ($d['admin']['ftp_use']&&$d['admin']['ftp'])
{
getLink('','','죄송합니다. FTP를 이용한 삭제는 아직 지원하지 않습니다.','');
}
// NOBODY 삭제
else {
foreach ($table as $key => $val) db_query('drop table '.$val,$DB_CONNECT);
include $g['path_core'].'function/dir.func.php';
DirDelete('./');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
top.location.href = 'http://<?php echo $_SERVER['HTTP_HOST']?>/';
</script>
</head>
<body></body>
</html>

View File

@@ -0,0 +1,61 @@
<?php
if(!defined('__KIMS__')) exit;
checkAdmin(0);
$ext = '';
$mbruid = $my['uid'];
$command_reset = 'git reset --hard';
$command_pull = 'git pull origin master';
$d_regis = $date['totime'];
$version = $current_version.'->'.$lastest_version;
$output_reset = shell_exec($command_reset);
$output_pull = shell_exec($command_pull.' 2>&1');
$command = $command_reset.' '.$command_pull;
if ($g['mobile']&&$_SESSION['pcmode']!='Y') {
$msg_type = 'default';
} else {
$msg_type = 'success';
}
if(strpos($output_pull, 'Already up-to-date.') !== false) {
$msg = '이미 최신버전 입니다.|'.$msg_type;
} else {
if (strpos($output_pull, 'error') !== false) {
$msg = '에러발생! 로그를 확인해주세요.|danger';
$error = 1;
} else {
$msg = '실행완료! 브라우저 재시작해주세요.|success';
$error = 0;
getDbUpdate($table['s_gitlog'],'error=0','uid>0');
}
// 임시-필드 없는 경우, 생성
$_tmp1 = db_query("SHOW COLUMNS FROM ".$table['s_gitlog']." WHERE `Field` = 'ext'",$DB_CONNECT);
if(!db_num_rows($_tmp1)) {
$_tmp1 = ("alter table ".$table['s_gitlog']." ADD ext 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);
}
$_tmp3 = db_query("SHOW COLUMNS FROM ".$table['s_gitlog']." WHERE `Field` = 'error'",$DB_CONNECT);
if(!db_num_rows($_tmp3)) {
$_tmp3 = ("alter table ".$table['s_gitlog']." ADD error TINYINT DEFAULT '0' NOT NULL");
db_query($_tmp3, $DB_CONNECT);
}
getDbInsert($table['s_gitlog'],'error,ext,target,mbruid,remote,command,version,output,d_regis',"'$error','$ext','$target','$mbruid','$remote','$command','$version','$output_pull','$d_regis'");
}
$_SESSION['current_version'] = $lastest_version;
setrawcookie('system_update_result', rawurlencode($msg));
getLink('reload','parent.','','');
?>