// 메일 페이지 이동 History function historyLoad(hash) { checkUnload = false; hash = hash.replace(/%5E/g, "^"); var agt = navigator.userAgent.toLowerCase(); var bro = ""; if (agt.indexOf("msie") != -1 || agt.indexOf("trident") != -1) bro = 'IE'; if(hash) { if(hash == "maillist_INBOX_1_UNSEEN") hash = hash.replace(/_/g, "^"); var arr = hash.split("^"); var check_pagecode = $("#pagecode").val(); if(check_pagecode=="mailwrite" && arr[0]!="sendmailcomplete") { if(!confirm(LANGUAGE[120][LANGTYPE]+"\n"+LANGUAGE[121][LANGTYPE])) { return false; } else { clearInterval(mailautosave_Interval); } } clearInterval(boardautosave_Interval); var mbox = $.URLDecode($("#mbox").val()); // 2020-06-02 firefox patch if(arr[1]!=undefined && agt.indexOf("firefox") != -1) { arr[1] = $.URLDecode(arr[1]); } if(mbox == "" || mbox == undefined) { mbox = arr[1]; $("#mbox").val(mbox); } else if(arr[1]!="" && arr[1]!=undefined) { mbox = arr[1]; if(bro=="IE") { //$("#mbox").val(mbox.replace("%20", " ")); $("#mbox").val(mbox.replace(/%20/g, " ")); } else { $("#mbox").val(mbox); } } var menucode = $("#menucode").val(); if(arr[0] == "main") { var mbox = $.URLDecode($("#mbox").val()); var dashboard_layout = $("#dashboard_layout").val(); if(mbox == "" || mbox == undefined) { mbox = "INBOX"; $("#mbox").val(mbox); } menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); if(dashboard_layout!="VERTICAL") { $("#content-wrapper").load("/inc/main.php"); } else { $("#content-wrapper").load("/inc/main_vertical.php"); } } else if(arr[0] == "maillist") { var mbox = $.URLDecode($("#mbox").val()); if(mbox == "" || mbox == undefined) { mbox = "INBOX"; $("#mbox").val(mbox); } else if(arr[1]!="" && arr[1]!=undefined) { mbox = arr[1]; $("#mbox").val(mbox); } $("#page").val(arr[2]); $("#showtype").val(arr[3]); $("#hash").val(arr[0]); if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(mbox!="Reserved") { if(mbox=="Sent") { $("#list-header-date").html(LANGUAGE[103][LANGTYPE]); } else { $("#list-header-date").html(LANGUAGE[104][LANGTYPE]); } var pagecode = $("#pagecode").val(); if(pagecode!="maillist") { $("#content-wrapper").load("/inc/maillist.php"); } else { maillist_Init(); } } else { var pagecode = $("#pagecode").val(); if(pagecode!="reservelist") { $("#content-wrapper").load("/inc/reservemail.php"); } else { reservelist_Init(); } } } else if(arr[0] == "maillist_unseen") { var mbox = $.URLDecode($("#mbox").val()); if(mbox == "" || mbox == undefined) { mbox = "INBOX"; $("#mbox").val(mbox); } else if(arr[1]!="" && arr[1]!=undefined) { mbox = arr[1]; $("#mbox").val(mbox); } $("#page").val(arr[2]); $("#showtype").val(arr[3]); $("#hash").val(arr[0]); if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } $("#list-header-date").html(LANGUAGE[104][LANGTYPE]); var pagecode = $("#pagecode").val(); if(pagecode!="maillist_unseen") { $("#content-wrapper").load("/inc/maillist_unseen.php"); } else { maillistUnseen_Init(); } } else if(arr[0] == "confirm") { $("#page").val(arr[2]); var pagecode = $("#pagecode").val(); if(pagecode!="confirm") { $("#showtype").val(arr[3]); $("#content-wrapper").load("/inc/confirm.php"); } else { confirmlist(); } $("#hash").val(arr[0]); if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } } else if(arr[0] == "mailview") { var msgid = arr[2]; $("#msgid").val(msgid); $("#content-wrapper").load("/inc/mailview.php"); $("#showtype").val(arr[3]); $("#hash").val(arr[0]); if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } } else if(arr[0] == "mailview_unseen") { var msgid = arr[2]; $("#msgid").val(msgid); $("#content-wrapper").load("/inc/mailview_unseen.php"); $("#showtype").val(arr[3]); $("#hash").val(arr[0]); if(menucode==undefined || menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } } else if(arr[0] == "mailview_popup") { var msgid = arr[2]; $("#msgid").val(msgid); $("#popup-content-wrapper").load("/inc/mailview_popup.php"); $("#showtype").val(arr[3]); $("#hash").val(arr[0]); } else if(arr[0] == "mailwrite") { var mbox = arr[1]; var mode = arr[2]; var msgid = arr[4]; $("#mbox").val(mbox); $("#msgid").val(msgid); if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(arr[2]=="REPLY" || arr[2]=="REPLYALL" || arr[2]=="FORWARDMAIL" || arr[2]=="RESEND" || arr[2]=="VIEWDRAFT" || arr[2]=="MULTIFORWARD") { $("#content-wrapper").load("/inc/mailwrite.php?mode="+mode+"&mbox="+mbox+"&msgid="+msgid); } else if(arr[2]=="SENDMAILME") { $("#content-wrapper").load("/inc/mailwrite.php?mode="+mode); } else if(arr[6]!=undefined && arr[2]=="NEWSENDMAIL") { $("#content-wrapper").load("/inc/mailwrite.php?subject="+arr[6]); } else { $("#content-wrapper").load("/inc/mailwrite.php"); } $("#hash").val(arr[0]); if(arr[5]!=undefined && arr[2]=="NEWSENDMAIL") { $("#receiver").val($.URLDecode(arr[5])); } else { $("#receiver").val(""); } } else if(arr[0] == "mailwrite_popup") { var mbox = arr[1]; var mode = arr[2]; var msgid = arr[4]; $("#mbox").val(mbox); $("#msgid").val(msgid); if(arr[2]=="REPLY" || arr[2]=="REPLYALL" || arr[2]=="FORWARDMAIL" || arr[2]=="RESEND" || arr[2]=="VIEWDRAFT" || arr[2]=="MULTIFORWARD") { $("#popup-content-wrapper").load("/inc/mailwrite_popup.php?mode="+mode+"&mbox="+$.URLEncode(mbox)+"&msgid="+msgid); } else if(arr[2]=="SENDMAILME") { $("#popup-content-wrapper").load("/inc/mailwrite_popup.php?mode="+mode); } else { $("#popup-content-wrapper").load("/inc/mailwrite_popup.php"); } $("#hash").val(arr[0]); if(arr[5]!=undefined && arr[2]=="NEWSENDMAIL") { $("#receiver").val($.URLDecode(arr[5])); } else { $("#receiver").val(""); } } else if(arr[0] == "orgtree") { var msgid = arr[2]; $("#msgid").val(""); $("#content-wrapper").load("/inc/orgtree.php"); $("#showtype").val(arr[3]); $("#hash").val(arr[0]); menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } else if(arr[0] == "orgtree_popup") { $("#popup-content-wrapper").load("/inc/orgtree_popup.php"); } else if(arr[0] == "sendmailcomplete") { var mbox = arr[1]; if($("#pagetype").val()=="popup") { $("#popup-content-wrapper").load("/inc/sendmailcomplete_popup.php"); } else { if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if($("#completeSubject").val()=="") { gotoMbox("INBOX"); } $("#content-wrapper").load("/inc/sendmailcomplete.php"); } } else if(arr[0] == "addressbook") { var pagecode = $("#pagecode").val(); $("#addrbook_page").val(arr[2]); $("#addrbook_showtype").val(arr[1]); $("#addrbook_groupidx").val(arr[3]); if(pagecode!="addrbooklist") { $("#content-wrapper").load("/inc/addrbook.php"); } else { addrbookList(); } } else if(arr[0] == "company_address") { var pagecode = $("#pagecode").val(); $("#addrbook_page").val(arr[2]); $("#addrbook_showtype").val(arr[1]); $("#content-wrapper").load("/inc/addrbook_company.php"); } else if(arr[0] == "addressbook_export") { var addrbook_export_option = $("#addrbook_export_option").val(); if(addrbook_export_option!="YES") { history.go(-1); return; } var pagecode = $("#pagecode").val(); $("#addrbook_page").val(arr[2]); $("#addrbook_showtype").val(arr[1]); $("#content-wrapper").load("/inc/addrbook_export.php"); } else if(arr[0] == "addressbook_import") { var addrbook_import_option = $("#addrbook_import_option").val(); if(addrbook_import_option!="YES") { history.go(-1); return; } var pagecode = $("#pagecode").val(); $("#addrbook_page").val(arr[2]); $("#addrbook_showtype").val(arr[1]); $("#content-wrapper").load("/inc/addrbook_import.php"); } else if(arr[0] == "addressbook_importcomplete") { var pagecode = $("#pagecode").val(); $("#addrbook_page").val(arr[2]); $("#addrbook_showtype").val(arr[1]); $("#content-wrapper").load("/inc/addrbook_importcomplete.php"); } else if(arr[0] == "schedule") { LayerOpen("open"); var pagecode = $("#pagecode").val(); $("#schedule_page").val(arr[2]); $("#schedule_showtype").val(arr[1]); $("#content-wrapper").load("/inc/schedule.php"); } else if(arr[0] == "boardlist") { LayerOpen("open"); var pagecode = $("#pagecode").val(); //boardlist^list^1^mailwood8mailwoodcom_1335502389^1498567616 $("#board_showtype").val(arr[1]); $("#board_page").val(arr[2]); $("#board_code").val(arr[3]); if(menucode==undefined || menucode!="board") { menuInit("board"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagecode!="boardlist") { $("#content-wrapper").load("/inc/boardlist.php"); } else { boardInit(arr[3]); } } else if(arr[0] == "boardview") { LayerOpen("open"); var pagecode = $("#pagecode").val(); var idx = arr[5]; $("#board_showtype").val(arr[1]); $("#board_page").val(arr[2]); $("#board_code").val(arr[3]); $("#board_idx").val(idx); if(menucode==undefined || menucode!="board") { menuInit("board"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagecode!="boardview") { $("#content-wrapper").load("/inc/boardview.php"); } else { boardViewInit(); } } else if(arr[0] == "boardwrite") { LayerOpen("open"); var pagecode = $("#pagecode").val(); $("#board_showtype").val(arr[1]); $("#board_page").val(arr[2]); $("#board_code").val(arr[3]); $("#board_writemode").val(arr[5]); $("#board_idx").val(arr[6]); if(menucode==undefined || menucode!="board") { menuInit("board"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } //if(pagecode!="boardwrite") { $("#content-wrapper").load("/inc/boardwrite.php"); //} else { // boardWriteInit(); //} } else if(arr[0] == "smssend") { LayerOpen("open"); var pagecode = $("#pagecode").val(); if(menucode==undefined || menucode!="sms") { menuInit("sms"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagecode!="smssend") { $("#content-wrapper").load("/inc/smssend.php"); } else { smsSendInit(); } } else if(arr[0] == "smslist") { LayerOpen("open"); var pagecode = $("#pagecode").val(); $("#smslist_page").val(arr[2]); if(menucode==undefined || menucode!="sms") { menuInit("sms"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagecode!="smslist") { $("#content-wrapper").load("/inc/smslist.php"); } else { smsListInit(); } } else if(arr[0] == "smsreserve") { LayerOpen("open"); var pagecode = $("#pagecode").val(); $("#smslist_page").val(arr[2]); if(menucode==undefined || menucode!="sms") { menuInit("sms"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagecode!="smsreserve") { $("#content-wrapper").load("/inc/smsreserve.php"); } else { smsReserveInit(); } } else if(arr[0] == "smsnumber") { LayerOpen("open"); var pagecode = $("#pagecode").val(); if(menucode==undefined || menucode!="sms") { menuInit("sms"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagecode!="smsnumber") { $("#content-wrapper").load("/inc/smsnumber.php"); } else { smsNumberInit(); } } else if(arr[0] == "setting") { var pagemode = arr[1]; LayerOpen("open"); var pagecode = $("#pagecode").val(); if(menucode==undefined || menucode!="setting") { menuInit("setting"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } if(pagemode=="general") { if(pagecode!="setting_general") { $("#content-wrapper").load("/inc/setting_general.php"); } else { settingGeneralInit(); } } else if(pagemode=="autoreply") { if(pagecode!="setting_autoreply") { $("#content-wrapper").load("/inc/setting_autoreply.php"); } else { settingReplyInit(); } } else if(pagemode=="autoforward") { if($("#permission_forward").val()=="NO") { history.go(-1); return; } if(pagecode!="setting_autoforward") { $("#content-wrapper").load("/inc/setting_autoforward.php"); } else { settingForwardInit(); } } else if(pagemode=="signature") { $("#content-wrapper").load("/inc/setting_signature.php"); } else if(pagemode=="mailbox") { if(pagecode!="setting_mailbox") { $("#content-wrapper").load("/inc/setting_mailbox.php"); } else { settingMailboxInit(); } } else if(pagemode=="externalmail") { if(pagecode!="setting_externalmail") { $("#content-wrapper").load("/inc/setting_externalmail.php"); } else { settingExternalmailInit(); } } else if(pagemode=="user") { if(pagecode!="setting_user") { $("#content-wrapper").load("/inc/setting_user.php"); } else { settingUserInit(); } } else if(pagemode=="spam") { if(pagecode!="setting_spam") { $("#content-wrapper").load("/inc/setting_spam.php"); } else { settingSpamInit(); } } else if(pagemode=="filter") { if(pagecode!="setting_filter") { $("#content-wrapper").load("/inc/setting_filter.php"); } else { settingFilterInit(); } } else if(pagemode=="security") { if(pagecode!="setting_security") { $("#content-wrapper").load("/inc/setting_security.php"); } else { settingSecurityInit(); } } else if(pagemode=="login_management") { if(pagecode!="setting_security_loginlist") { $("#content-wrapper").load("/inc/setting_security_loginlist.php"); } else { settingSecurityLoginInit(); } } else if(pagemode=="action_history") { if(pagecode!="setting_security_actionlog") { $("#content-wrapper").load("/inc/setting_security_actionlog.php"); } else { settingSecurityActionInit(); } } } if((arr[0]=="maillist" || arr[0]=="maillist_unseen" || arr[0]=="confirm" || arr[0]=="mailview" || arr[0]=="mailwrite" || arr[0]=="sendmailcomplete") && $("#navigation_code").val()==undefined) { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } } else { /*** if(menucode!=undefined && menucode!="mail") { menuInit("mail"); $("#main-menu-inner").css("transform", "translate(0, 0)"); } $.history.load("maillist^INBOX^1^ALL^"); ***/ var dashboard = $("#dashboard").val(); if(dashboard=="Y") { $.history.load("main^INBOX^1^ALL^"); } else { $.history.load("maillist^INBOX^1^ALL^"); } } var pagetime = tstamp(); $("#pagetime").val(pagetime); $("html, body").animate({scrollTop:0},'slow'); return; } function loginCheck() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var userid = $("#inputUserid").val(); var passwd = $("#inputPassword").val(); var domain = $("#inputDomain").val(); var tocken = $("#inputTocken").val(); if(userid=="") { //loginAlert("아이디를 입력해 주세요.", "alert-danger"); loginAlertModal(LANGUAGE[5][LANGTYPE]); $("#inputUserid").focus(); return; } if(passwd=="") { //loginAlert("비밀번호를 입력해 주세요.", "alert-danger"); loginAlertModal(LANGUAGE[6][LANGTYPE]); $("#inputPassword").focus(); return; } loginAlert(LANGUAGE[9][LANGTYPE], "alert-info"); //alert(tocken); var ajaxdata = "userid="+$.URLEncode(userid)+"&passwd="+$.URLEncode(passwd)+"&domain="+domain+"&tocken="+tocken; var ajaxurl = "/module/loginAction.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port; } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var second_auth = $.URLDecode(xmldata.find("SECOND_AUTH").text()); var second_auth_type = $.URLDecode(xmldata.find("SECOND_AUTH_TYPE").text()); var tocken = $.URLDecode(xmldata.find("TOCKEN").text()); var mailinfo = $.URLDecode(xmldata.find("LOGININFO").text()); if(result=="SUCCESS") { loginAlert(LANGUAGE[10][LANGTYPE], "alert-info"); //alert(tocken); //setCookie("Tocken", tocken, 0); //setCookie("MailInfo", mailinfo, 0); $("#inputCTocken").val(tocken); $("#inputMailInfo").val(mailinfo); if(second_auth=="Y" && second_auth_type=="EMAIL") { $(location).attr("href", "/loginproc_second.php?type=EMAIL"); } else if(second_auth=="Y" && second_auth_type=="OTP") { $(location).attr("href", "/loginproc_second.php?type=OTP"); } else { loginProc(); return; } } else { if(message=="" || message==undefined) { message = LANGUAGE[11][LANGTYPE]+"
"+LANGUAGE[12][LANGTYPE]; } //loginAlert(message, "alert-danger"); loginAlertModal(message); return; } }, error: function(e) { loginAlertModal(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]); return; } }); } function secondAuthNumCheck() { var auth_num = $("#auth_num").val(); var auth_type = $("#auth_type").val(); var loginTocken = $("#loginTocken").val(); if(auth_num=="") { loginAlertModal(LANGUAGE[511][LANGTYPE]); return; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "mode=authnum_check&auth_type="+auth_type+"&auth_num="+auth_num+"&tocken="+tocken+"&loginTocken="+loginTocken; var ajaxurl = "/module/loginAction.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = xmldata.find("MESSAGE").text(); if(result=="SUCCESS") { loginAlertModal(LANGUAGE[958][LANGTYPE]); loginProc(); return; } else { if(message=="TIMEOUT") { message = LANGUAGE[959][LANGTYPE]+"
"+LANGUAGE[960][LANGTYPE]; bootbox.dialog({ message: message, buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); } else if(message=="AUTHNUM_FAIL") { message = LANGUAGE[961][LANGTYPE]; loginAlertModal(message); return; } else if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]; loginAlertModal(message); return; } } }, error: function(e) { loginAlertModal(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]); return; } }); } function loginProc() { var ajaxurl = "/module/loginproc.php"; var tocken = $.URLEncode($("#inputCTocken").val()); var mailinfo = $("#inputMailInfo").val(); var ajaxdata = "Tocken="+tocken+"&MailInfo="+mailinfo; loginAlert(LANGUAGE[9][LANGTYPE], "alert-info"); if($("#saveid").is(":checked")) { saveLogin($("#inputUserid").val()); } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var passwd_change = xmldata.find("PASSWD_CHANGE").text(); var passwd_change_paycode = xmldata.find("PASSWD_CHANGE_PAYCODE").text(); if(result=="SUCCESS") { if(passwd_change=="Y") { $(location).attr("href", "/passwd_change.php"); } else if(passwd_change_paycode=="Y") { $(location).attr("href", "/passwd_change_paycode.php"); } else { $(location).attr("href", "/"); } return; } else { if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]; } //loginAlert(message, "alert-danger"); loginAlertModal(message); return; } }, error: function(e) { //loginAlert("서버에 일시적인 오류가 발생하였습니다..
잠시 후 다시 시도해 주시기 바랍니다.", "alert-danger"); loginAlertModal(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]); return; } }); } function logoutCheck() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#requestTocken").val(); var ajaxdata = "tocken="+tocken; var ajaxurl = "/module/loginout.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { $(location).attr("href", "/"); return; } }, error: function(e) { loginAlert(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE], "alert-danger"); return; } }); } function loginPasswdCheckAction() { var domain = $("#inputCheckDomain").val(); var tocken = $("#inputCheckTocken").val(); var userid = $("#inputCheckUserid").val(); var email = $("#inputCheckEmail").val(); $("#passwd_check_message").html(""); if(userid=="") { $("#passwd_check_message").html("아이디를 입력해 주세요."); return; } if(email=="") { $("#passwd_check_message").html("이메일 주소를 입력해 주세요."); return; } if(!checkEmail(email)) { $("#passwd_check_message").html("이메일 주소를 정확히 입력해 주세요."); return; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=passwd_check&checkUserid="+$.URLEncode(userid)+"&checkEmail="+$.URLEncode(email)+"&checkDomain="+$.URLEncode(domain)+"&checkTocken="+$.URLEncode(tocken); var ajaxurl = "/module/loginPasswdCheck.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var html = "
"; html+= " 등록하신 외부 이메일 주소로 임시 비밀번호가 발급되었습니다.
"; html+= " 개인정보보호를 위해 웹메일 로그인 후 반드시 비밀번호를 변경 후 사용해 주시기 바랍니다."; html+= "
"; html+= "
"; html+= "
"; html+= " "; html+= "
"; html+= "
"; $("#passwd_modal_message").html(html); } else { $("#passwd_check_message").html(""+message+""); //popupModal(message); } } }); } function checkClassInfo() { var classType = $("#select_type").val(); var className = $("#select_depart").val(); var classUserNo = $("#inputClassNo").val(); var classUserName = $("#inputClassName").val(); if(classType=="" || className=="" || classUserNo=="" || classUserName=="") { $("#emailclass_check_message").html("소속구분/소속학과/학번/이름을 입력해 주세요."); setTimeout(function(){ $("#emailclass_check_message").html(""); }, 5000); return; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=classcheck&type="+classType+"&depart="+$.URLEncode(className)+"&classno="+classUserNo+"&name="+$.URLEncode(classUserName); var ajaxurl = "/module/classemailregist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { $("#select_type").attr("disabled", true); $("#select_depart").attr("disabled", true); $("#inputClassNo").attr("disabled", true); $("#inputClassName").attr("disabled", true); $("#emailclass_check_message").html(""); $("#divEmailChkBtn").html("인증 완료되었습니다. 아래 이메일 발급신청서를 작성해 주시기 바랍니다."); $("#emailRegistClassCheck").val("SUCCESS"); } else { $("#emailclass_check_message").html(""+message+""); setTimeout(function(){ $("#emailclass_check_message").html(""); }, 3000); } } }); } function emailRegistAction() { var emailRegistClassCheck = $("#emailRegistClassCheck").val(); if(emailRegistClassCheck!="SUCCESS") { $("#emailregist_check_message").html("재학생 확인을 먼저 진행해 주세요."); setTimeout(function(){ $("#emailregist_check_message").html(""); }, 3000); return; } var classType = $("#select_type").val(); var className = $("#select_depart").val(); var classUserNo = $("#inputClassNo").val(); var classUserName = $("#inputClassName").val(); var userid = $("#inputRegistUserid").val(); var passwd1 = $("#inputRegistPass1").val(); var passwd2 = $("#inputRegistPass2").val(); var domain = $("#inputCheckDomain").val(); var email_id = $("#inputRegistEmailId").val(); var email_domain = $("#inputRegistEmailDomain").val(); console.log("email_id: "+email_id+", email_domain: "+email_domain); if(userid=="" || email_id=="" || email_domain=="" || passwd1=="" || passwd2=="") { $("#emailregist_check_message").html("등록정보를 모두 입력해 주세요."); setTimeout(function(){ $("#emailregist_check_message").html(""); }, 3000); return; } var useridCheck = useridVerifyCheck(userid).split("|"); if(useridCheck[0]!="SUCCESS") { $("#emailregist_check_message").html(""+useridCheck[1]+""); setTimeout(function(){ $("#emailregist_check_message").html(""); }, 3000); return; } if(passwd1!=passwd2) { $("#emailregist_check_message").html("비밀번호가 일치하지 않습니다."); setTimeout(function(){ $("#emailregist_check_message").html(""); }, 3000); return; } var passwdCheck = passwdVerifyCheck(userid, passwd1).split("|"); if(passwdCheck[0]!="SUCCESS") { $("#emailregist_check_message").html(""+passwdCheck[1]+""); setTimeout(function(){ $("#emailregist_check_message").html(""); }, 3000); return; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=emailregist&domain="+domain+"&userid="+$.URLEncode(userid)+"&passwd="+$.URLEncode(passwd1)+"&type="+classType+"&depart="+$.URLEncode(className)+"&classno="+classUserNo+"&name="+$.URLEncode(classUserName)+"&email_id="+$.URLEncode(email_id)+"&email_domain="+$.URLEncode(email_domain); var ajaxurl = "/module/classemailregist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { emailRegistCancel(); popupModal("이메일 아이디가 발급되었습니다."); } else { $("#emailregist_check_message").html(""+message+""); setTimeout(function(){ $("#emailregist_check_message").html(""); }, 3000); } } }); } var recentMail_Interval; function recentMailCheck() { recentMail_Interval = setInterval(recentMailInit, 1000*30) } function recentMailInit() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=recentmail"; var ajaxurl = "/module/mailsync.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var recentmail = xmldata.find("RECENTMAIL").text(); if(recentmail>0) { growlNotice("default", "메일알림!!", sprintf(LANGUAGE[236][LANGTYPE], recentmail)); } } } }); } var sessiontime_Interval; function sessiontimeCheck() { //console.log("sessiontimeCheck ====="); sessiontime_Interval = setInterval(sessiontime_Init, 1000*60); } function sessiontime_Init() { //console.log("sessiontime_Init ====="); if($("#screenlock_modal").css("display")=="block") { return; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command="; var ajaxurl = "/module/WebmailUser.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var remain_time = $.URLDecode(xmldata.find("SESSION_REMAIN_TIME").text()); var current_time = $.URLDecode(xmldata.find("CURRENT_TIME").text()); var recentmail = parseInt(xmldata.find("RECENTMAIL").text()); if(recentmail>0) { growlNotice("default", "메일알림!!", sprintf(LANGUAGE[236][LANGTYPE], recentmail)); } //console.log("current_time: "+current_time+", remain_time1 : "+remain_time); if(remain_time<90) { clearInterval(sessiontime_Interval); var screenlock_mode = $("#screenlock_mode").val(); if(screenlock_mode=="Y") { sessionScreenLockConfirm(); } else { sessionTimeoutConfirm(); } } } }); } function sessionScreenLockConfirm() { //console.log("sessionScreenLockConfirm ====="); if($("#popup_modal").css("display")=="block") { $("#popup_modal").modal("hide"); } if($("#popup_modal2").css("display")=="block") { $("#popup_modal2").modal("hide"); } if($("#popup_receiver").css("display")=="block") { $("#popup_receiver").modal("hide"); } if($("#reservedate_popup_modal").css("display")=="block") { $("#reservedate_popup_modal").modal("hide"); } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command="; var ajaxurl = "/module/WebmailUser.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var remain_time = $.URLDecode(xmldata.find("SESSION_REMAIN_TIME").text()); var current_time = $.URLDecode(xmldata.find("CURRENT_TIME").text()); var recentmail = parseInt(xmldata.find("RECENTMAIL").text()); if(recentmail>0) { growlNotice("default", "메일알림!!", sprintf(LANGUAGE[236][LANGTYPE], recentmail)); } if(remain_time<90 && remain_time>50) { //console.log("current_time1: "+current_time+", remain_time1 : "+remain_time); clearInterval(sessiontime_Interval); var screenlock_mode = $("#screenlock_mode").val(); var html = "
"+LANGUAGE[122][LANGTYPE]+" ("+LANGUAGE[123][LANGTYPE]+" : 60"+LANGUAGE[124][LANGTYPE]+")
"+LANGUAGE[125][LANGTYPE]+"
"; html += "
"; $("#screenlock_modal_message").html(html); $("#screenlock_modal").modal({backdrop: 'static', keyboard: false, toggle: true}); var timer = 60; var seconds; interval = setInterval(function() { seconds = timer; $("#screenlock_countdown").html(seconds); if(--timer < 0) { timer = 0; clearInterval(interval); screenLock(); return false; } }, 1000); } else if(remain_time<50) { //console.log("current_time2: "+current_time+", remain_time2 : "+remain_time); clearInterval(interval); screenLock(); return false; } } }); } function sessionTimeoutConfirm() { //console.log("sessionTimeoutConfirm ====="); if($("#popup_modal").css("display")=="block") { $("#popup_modal").modal("hide"); } if($("#popup_modal2").css("display")=="block") { $("#popup_modal2").modal("hide"); } if($("#popup_receiver").css("display")=="block") { $("#popup_receiver").modal("hide"); } if($("#reservedate_popup_modal").css("display")=="block") { $("#reservedate_popup_modal").modal("hide"); } var html = "
"+LANGUAGE[824][LANGTYPE]+" ("+LANGUAGE[123][LANGTYPE]+" : 60"+LANGUAGE[124][LANGTYPE]+")
"+LANGUAGE[125][LANGTYPE]+"
"; html += "
"; $("#sessiontime_modal_message").html(html); $("#sessiontime_modal").modal({backdrop: 'static', keyboard: false, toggle: true}); var timer = 60; var seconds; interval = setInterval(function() { seconds = timer; $("#sessiontime_countdown").html(seconds); if(--timer < 0) { timer = 0; clearInterval(interval); sessionTimeout(); return false; } }, 1000); } function sessionTimeout() { //console.log("sessionTimeout ====="); if($("#screenlock_modal").css("display")=="block") { //console.log("sessionTimeout() => screenlock_modal display is blocked!!"); return false; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=session_timeout_action"; var ajaxurl = "/module/WebmailUser.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var html = ""; html += "
"; html += " "+LANGUAGE[825][LANGTYPE]+"
"; html += " "+LANGUAGE[826][LANGTYPE]+"
"; html += " "+LANGUAGE[129][LANGTYPE]+""; html += "
"; html += "
"; $("#sessiontime_modal_message").html(html); } }); } function sessionTimeoutCancel() { if($("#screenlock_modal").css("display")=="block") { return; } var newpagetime = tstamp(); $("#pagetime").val(newpagetime); clearInterval(interval); var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=session_timeout_cancel"; var ajaxurl = "/module/WebmailUser.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { sessiontimeCheck(); $("#sessiontime_modal").modal("hide"); } }, error: function(e) { loginAlert(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE], "alert-danger"); return; } }); } function gotoLogin() { $(location).attr('href', '/login.php'); } var screenlock_watch; var interval; function screenLockReady() { var screenlock_mode = $("#screenlock_mode").val(); /*** 2019-08-28 if(screenlock_mode=="Y") { screenlock_watch = setInterval(screenLockCheck, 10000); } ***/ } function screenLockCheck() { var pagetime = $("#pagetime").val(); var chktime = tstamp(); if($("#screenlock_modal").css("display")=="none" && (chktime - pagetime) > (60*30)) { $("#popup_modal").modal("hide"); $("#popup_modal2").modal("hide"); $("#popup_receiver").modal("hide"); clearInterval(screenlock_watch); screenLockConfirm(); return false; } } function screenLockConfirm() { var html = "
"+LANGUAGE[122][LANGTYPE]+" ("+LANGUAGE[123][LANGTYPE]+" : 60"+LANGUAGE[124][LANGTYPE]+")
"+LANGUAGE[125][LANGTYPE]+"
"; html += "
"; $("#screenlock_modal_message").html(html); $("#screenlock_modal").modal({backdrop: 'static', keyboard: false, toggle: true}); var timer = 60; var seconds; interval = setInterval(function() { seconds = timer; $("#screenlock_countdown").html(seconds); if(--timer < 0) { timer = 0; clearInterval(interval); screenLock(); return false; } }, 1000); } function screenLockCancel() { var newpagetime = tstamp(); $("#pagetime").val(newpagetime); clearInterval(interval); var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=screenlock_cancel"; var ajaxurl = "/module/screenlock.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { sessiontimeCheck(); screenLockReady(); $("#screenlock_modal").modal("hide"); } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } } }, error: function(e) { loginAlert(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE], "alert-danger"); return; } }); } function screenLock() { //console.log("screenLock ====="); if($("#screenlock_modal").css("display")=="block") { //console.log("screenLock() => screenlock_modal display is blocked!!"); //return false; } var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=screenlock_action"; var ajaxurl = "/module/screenlock.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } clearInterval(recentMail_Interval); clearInterval(interval); $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var html = ""; html += "
"; html += " "+LANGUAGE[127][LANGTYPE]+"
"; html += " "+LANGUAGE[128][LANGTYPE]+"
"; html += " "+LANGUAGE[129][LANGTYPE]+""; html += "
"; html += "
"; html += " "+LANGUAGE[130][LANGTYPE]+"   "; html += "
"; html += "
"; html += "
"; $("#screenlock_modal_message").html(html); $("#screenlock_modal").modal({backdrop: 'static', keyboard: false, toggle: true}); }, error: function(e) { loginAlert(LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE], "alert-danger"); return; } }); } function screenLockKeyEvent(e) { var evt = e ? e : window.event var ck=evt.keyCode; if(ck==13) { screenLockClear(); } } function screenLockClear() { var paycodeLoginOption = $("#paycodeLoginOption").val(); var tocken = $("#inputTocken").val(); if(paycodeLoginOption=="YES") { var userid = $("#login_paycode").val(); } else { var userid = $("#login_userid").val(); } var passwd = $("#login_passwd").val(); var domain = $("#login_domain").val(); var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); if(passwd=="") { $("#screenlock_message").html(""+LANGUAGE[6][LANGTYPE]+""); setTimeout(function () { $("#screenlock_message").html(""); }, 5000); return; } var ajaxdata = "mode=screenlock&userid="+$.URLEncode(userid)+"&passwd="+$.URLEncode(passwd)+"&domain="+domain+"&tocken="+tocken; var ajaxurl = "/module/loginAction.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var tocken = $.URLDecode(xmldata.find("TOCKEN").text()); var mailinfo = $.URLDecode(xmldata.find("LOGININFO").text()); var loginblock = xmldata.find("LOGINBLOCK").text(); if(result=="SUCCESS") { $("#inputCTocken").val(tocken); $("#inputMailInfo").val(mailinfo); screenLockClearComplete(); return; } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[11][LANGTYPE]+"
"+LANGUAGE[12][LANGTYPE]; } $("#screenlock_message").html(""+message+""); if(loginblock=="TRUE") { alert(message.replace("
", "\r\n")); $(location).attr('href', '/login.php'); } else { setTimeout(function () { $("#screenlock_message").html(""); }, 5000); } return; } }, error: function(e) { var message = LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]; $("#screenlock_message").html(""+message+""); setTimeout(function () { $("#screenlock_message").html(""); }, 5000); return; } }); } function screenLockClearComplete() { var ajaxurl = "/module/loginproc.php"; var tocken = $.URLEncode($("#inputCTocken").val()); var mailinfo = $("#inputMailInfo").val(); var ajaxdata = "Tocken="+tocken+"&MailInfo="+mailinfo; $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var newpagetime = tstamp(); $("#pagetime").val(newpagetime); $("#screenlock_modal").modal("hide"); sessiontimeCheck(); screenLockReady(); //recentMailCheck(); return; } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]; } $("#screenlock_message").html(""+message+""); setTimeout(function () { $("#screenlock_message").html(""); }, 5000); return; } }, error: function(e) { var message = LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]; $("#screenlock_message").html(""+message+""); setTimeout(function () { $("#screenlock_message").html(""); }, 5000); return; } }); } function viewMainNotice(no) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var ajaxdata = "command=view&no="+no; var ajaxurl = "/module/notice.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var title = $.URLDecode(xmldata.find("TITLE").text()); var writer = $.URLDecode(xmldata.find("WRITER").text()); var email = $.URLDecode(xmldata.find("EMAIL").text()); var visited = $.URLDecode(xmldata.find("VISITED").text()); var content = $.URLDecode(xmldata.find("CONTENT").text()); var regdate = $.URLDecode(xmldata.find("REGDATE").text()); var html = ""; html = "
"; html += "
작성일 : "+regdate+"
"; html += "
"; html += content; html += "
"; html += "
"; $("#popup_modal2_message").html(html); $("#popup_modal2_div").css("width", "750px"); $("#popup_modal2").modal('toggle'); } }, error: function(e) { var message = LANGUAGE[13][LANGTYPE]+"
"+LANGUAGE[14][LANGTYPE]; popupModal(message); return; } }); } function menuInit(command) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command="+command; var ajaxurl = "/module/menulist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } if(command=="mail") { $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var html = ""; html += "
\r\n"; html += "
\r\n"; html += " \r\n"; html += " \r\n"; html += "
\r\n"; html += "
\r\n"; html += " \r\n"; /*** 2022-04-12 html += "
\r\n"; html += "
"; ***/ /*** 사용자메일함을 zTree 이용하는 경우 ********************************/ /* html += "
\r\n"; html += "
    \r\n"; html += "
    \r\n"; */ /**********************************************************/ html += "
    \r\n"; html += "
      \r\n"; if($("#orgchart").val()=="Y" && $("#orgchart_menu").val()=="Y") { html += "
    • \r\n"; html += " "+LANGUAGE[21][LANGTYPE]+"\r\n"; html += "
    • \r\n"; } html += "
    • \r\n"; html += " "+LANGUAGE[22][LANGTYPE]+"\r\n"; html += "
    • \r\n"; html += "
    • \r\n"; html += " "+LANGUAGE[814][LANGTYPE]+"\r\n"; html += "
    • \r\n"; html += "
      \r\n"; html += "
      \r\n"; html += "
      \r\n"; html += "
      \r\n"; html += "

      \r\n"; html += " "+LANGUAGE[51][LANGTYPE]+"  0B / 0B\r\n"; html += "

      \r\n"; html += "
      \r\n"; html += "
      \r\n"; html += "
      \r\n"; html += "
    \r\n"; html += ""; var custom_banner = $("#custom_banner").val(); if(custom_banner=="Y") { var custom_bannerinfo = JSON.parse($("#custom_bannerinfo").val()); if(custom_bannerinfo.length>0) { html += "
      \r\n"; for(i=0; i
    "; } html += ""; } } var custom_menu = $("#custom_menu").val(); if(custom_menu=="Y") { var custom_menuinfo = JSON.parse($("#custom_menuinfo").val()); if(custom_menuinfo.length>0) { html += "
    "; } html += "
    \r\n"; html += ""; } } var custom_jeonjupaper_banner = $("#custom_jeonjupaper_banner").val(); if(custom_jeonjupaper_banner=="Y") { var custom_jeonjupaper_bannerinfo = JSON.parse($("#custom_jeonjupaper_bannerinfo").val()); if(custom_jeonjupaper_bannerinfo.length>0) { html += "
      \r\n"; for(i=0; i
    "; html += "
    "; } html += "
    \r\n"; html += ""; } } $("#main-menu-inner").html(html); var mailboxinfo_html = ""; var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); $("#menu-user-mailbox").html(null); var xmldata_mailbox = xmldata.find("MAILBOX"); xmldata_mailbox.find("ITEM").each(function() { var boxname = $.URLDecode($(this).find("BOXNAME").text()); var boxnameid = boxname.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); var boxrawname = $.URLDecode($(this).find("BOXRAWNAME").text()); var boxkoname = $.URLDecode($(this).find("BOXKONAME").text()); var boxrawkoname = $.URLDecode($(this).find("BOXRAWKONAME").text()); var unseen = $.URLDecode($(this).find("UNSEEN").text()); var boxtype = $.URLDecode($(this).find("BOXTYPE").text()); var boxid = $.URLDecode($(this).find("BOXID").text()); var folder_type = $.URLDecode($(this).find("FOLDER_TYPE").text()); if(boxname!="Sent" && boxtype!="USER" && unseen != 0) { $("#COUNT_"+boxnameid).html(unseen); } if(boxtype=="BASIC") { if(boxrawname!="Reserved" && boxrawname!="UPUBLICMAIL") { mailboxinfo_html += "
  • " + boxkoname.replace(".", "/"); + "
  • "; } } else { mailboxinfo_html += "
  • " + boxrawkoname.replace(".", "/"); + "
  • "; } /*** 2017-11-06 사용자메일함을 dropdown으로 이용하는 경우 ************/ var userbox_html = ""; if(boxtype=="USER" && folder_type!="SUBFOLDER") { if(folder_type=="ROOT") { //2022-04-12 userbox_html += "
      "; userbox_html += "
    • "; } else { //2022-04-12 userbox_html += ""; $("#menu-user-mailbox").append(userbox_html); } else { userbox_html += "
    • "; userbox_html += ""; userbox_html += ""+boxkoname+""; userbox_html += ""; if(unseen>0) userbox_html += unseen; userbox_html += ""; userbox_html += ""; userbox_html += "
    • "; $("#menu_userbox_"+boxid).append(userbox_html); } /******************************************************/ }); $("#mailbox_info").val(mailboxinfo_html); $("#mailmove_boxinfo").html(mailboxinfo_html); var mailbox_data = $.URLDecode(xmldata.find("MAILBOX_DATA").text()); $("#MailboxData").val(mailbox_data); /**** 2017-11-06 사용자메일함을 zTree 이용하는 경우 ********************/ /* var userboxNodes = JSON.parse($.URLDecode(xmldata.find("USERBOXINFO").text())); var userboxTreeObj; var userboxSetting = { callback: { beforeExpand: true }, view: { nameIsHTML: true, showLine: false }, data: { simpleData: { enable: true } } }; userboxTreeObj = $.fn.zTree.init($("#menu-user-mailbox2"), userboxSetting, userboxNodes); //userboxTreeObj.expandAll(true); //userboxTreeObj = $.fn.zTree.init($("#userboxTree"), userboxSetting, userboxNodes); */ /**********************************************************/ $("#delete-spambox-confirm").tooltip(); $("#delete-trashbox-confirm").tooltip(); //$("#userbox_dropdown").addClass("open"); $("#userbox_btn").trigger("click"); return; } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[54][LANGTYPE]+"
      "+LANGUAGE[14][LANGTYPE]; } popupModal(message); return; } }, error: function(e) { popupModal(LANGUAGE[13][LANGTYPE]+"
      "+LANGUAGE[14][LANGTYPE]); return; } }); } else if(command=="addrbook") { var addressBookUser_Data = JSON.parse($("#addressBookUser_Data").val()); var addressBookShared_Data = JSON.parse($("#addressBookShared_Data").val()); var addressBookSharedAuth_Data = JSON.parse($("#addressBookSharedAuth_Data").val()); var addrbook_export_option = $("#addrbook_export_option").val(); var addrbook_import_option = $("#addrbook_import_option").val(); var html = ""; html += "
      \r\n"; html += "
      \r\n"; html += " \r\n"; html += " "; html += "
      \r\n"; html += "
      \r\n"; html += " \r\n"; html += " \r\n"; html += " \r\n"; html += "
        \r\n"; if(addrbook_export_option=="YES" || addrbook_import_option=="YES") { html += "
        \r\n"; } /*** html += "
      • \r\n"; html += " 공유관리\r\n"; html += "
      • \r\n"; ***/ if(addrbook_import_option=="YES") { html += "
      • \r\n"; html += " "+LANGUAGE[60][LANGTYPE]+"\r\n"; html += "
      • \r\n"; } if(addrbook_export_option=="YES") { html += "
      • \r\n"; html += " "+LANGUAGE[61][LANGTYPE]+"\r\n"; html += "
      • \r\n"; } html += "
        \r\n"; if($("#orgchart").val()=="Y" && $("#orgchart_menu").val()=="Y") { html += "
      • \r\n"; html += " "+LANGUAGE[21][LANGTYPE]+"\r\n"; html += "
      • \r\n"; } html += "
      • \r\n"; html += " "+LANGUAGE[22][LANGTYPE]+"\r\n"; html += "
      • \r\n"; html += "
      • \r\n"; html += " "+LANGUAGE[814][LANGTYPE]+"\r\n"; html += "
      • \r\n"; html += "
      \r\n"; var custom_banner = $("#custom_banner").val(); if(custom_banner=="Y") { var custom_bannerinfo = JSON.parse($("#custom_bannerinfo").val()); if(custom_bannerinfo.length>0) { html += "
      \r\n"; html += "
        \r\n"; for(i=0; i
    "; } html += ""; } } var custom_menu = $("#custom_menu").val(); if(custom_menu=="Y") { var custom_menuinfo = JSON.parse($("#custom_menuinfo").val()); if(custom_menuinfo.length>0) { html += "
    \r\n"; html += "
    "; } html += "
    \r\n"; html += ""; } } var custom_jeonjupaper_banner = $("#custom_jeonjupaper_banner").val(); if(custom_jeonjupaper_banner=="Y") { var custom_jeonjupaper_bannerinfo = JSON.parse($("#custom_jeonjupaper_bannerinfo").val()); if(custom_jeonjupaper_bannerinfo.length>0) { html += "
    \r\n"; html += "
    "; } html += "
    \r\n"; html += ""; } } html += ""; $("#main-menu-inner").html(html); var user_addrbook = ""; user_addrbook += "
  • "; user_addrbook += " "; user_addrbook += " "+LANGUAGE[57][LANGTYPE]+""; user_addrbook += " "; user_addrbook += "
  • "; user_addrbook += "
  • "; user_addrbook += " "; user_addrbook += " "+LANGUAGE[58][LANGTYPE]+""; user_addrbook += " "; user_addrbook += "
  • "; var i = 0; for(i=0; i"; user_addrbook += " "; user_addrbook += " " + addressBookUser_Data[i].GROUPNAME + ""; user_addrbook += " \r\n"; user_addrbook += " \r\n"; user_addrbook += " "; user_addrbook += ""; } $("#menu-addrbook-user").append(user_addrbook); var shared_addrbook = ""; shared_addrbook += "
  • "; shared_addrbook += " "; shared_addrbook += " "+LANGUAGE[57][LANGTYPE]+""; shared_addrbook += " "; shared_addrbook += "
  • "; shared_addrbook += "
  • "; shared_addrbook += " "; shared_addrbook += " "+LANGUAGE[58][LANGTYPE]+""; shared_addrbook += " "; shared_addrbook += "
  • "; for(i=0; i"; shared_addrbook += " "; shared_addrbook += " " + addressBookShared_Data[i].GROUPNAME + ""; shared_addrbook += " \r\n"; shared_addrbook += " "; shared_addrbook += ""; } $("#menu-addrbook-shared").append(shared_addrbook); if($("#pagecode").val()!="addrbook_company") { var addrbook_list_html = ""; addrbook_list_html += ""; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += " "; addrbook_list_html += ""; $("#addrbook_list_body").html(addrbook_list_html); } } else if(command=="schedule") { var html = ""; html += "
    \r\n"; html += "
    \r\n"; html += " \r\n"; //html += " "; html += "
    \r\n"; html += "
    \r\n"; html += "
    "; html += " \r\n"; var custom_banner = $("#custom_banner").val(); if(custom_banner=="Y") { var custom_bannerinfo = JSON.parse($("#custom_bannerinfo").val()); if(custom_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_menu = $("#custom_menu").val(); if(custom_menu=="Y") { var custom_menuinfo = JSON.parse($("#custom_menuinfo").val()); if(custom_menuinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_jeonjupaper_banner = $("#custom_jeonjupaper_banner").val(); if(custom_jeonjupaper_banner=="Y") { var custom_jeonjupaper_bannerinfo = JSON.parse($("#custom_jeonjupaper_bannerinfo").val()); if(custom_jeonjupaper_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } html += ""; $("#main-menu-inner").html(html); } else if(command=="board") { var boardcode = $("#board_code").val(); $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var boardcount = xmldata.find("BOARDCOUNT").text(); var firstboardcode = $.URLDecode(xmldata.find("FIRSTBOARDCODE").text()); if(boardcode=="") boardcode = firstboardcode; $("#board_code").val(boardcode); $("#board_firstcode").val(boardcode); if(result=="SUCCESS") { if(boardcount<1) { bootbox.dialog({ message: LANGUAGE[132][LANGTYPE], buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { gotoMbox("INBOX"); } } }, className: "bootbox-sm" }); return; } var html = ""; html += "
    \r\n"; html += "
    \r\n"; html += " \r\n"; html += "
    \r\n"; html += "
    \r\n"; html += " \r\n"; var custom_banner = $("#custom_banner").val(); if(custom_banner=="Y") { var custom_bannerinfo = JSON.parse($("#custom_bannerinfo").val()); if(custom_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_menu = $("#custom_menu").val(); if(custom_menu=="Y") { var custom_menuinfo = JSON.parse($("#custom_menuinfo").val()); if(custom_menuinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_jeonjupaper_banner = $("#custom_jeonjupaper_banner").val(); if(custom_jeonjupaper_banner=="Y") { var custom_jeonjupaper_bannerinfo = JSON.parse($("#custom_jeonjupaper_bannerinfo").val()); if(custom_jeonjupaper_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } html += ""; $("#main-menu-inner").html(html); //boardInit(boardcode); return; } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]; } popupModal(message); return; } }, error: function(e) { popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); } else if(command=="sms") { var html = ""; html += "
    \r\n"; html += "
    \r\n"; html += " \r\n"; html += "
    \r\n"; html += "
    \r\n"; html += " \r\n"; var custom_banner = $("#custom_banner").val(); if(custom_banner=="Y") { var custom_bannerinfo = JSON.parse($("#custom_bannerinfo").val()); if(custom_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_menu = $("#custom_menu").val(); if(custom_menu=="Y") { var custom_menuinfo = JSON.parse($("#custom_menuinfo").val()); if(custom_menuinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_jeonjupaper_banner = $("#custom_jeonjupaper_banner").val(); if(custom_jeonjupaper_banner=="Y") { var custom_jeonjupaper_bannerinfo = JSON.parse($("#custom_jeonjupaper_bannerinfo").val()); if(custom_jeonjupaper_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } $("#main-menu-inner").html(html); LayerOpen("close"); } else if(command=="setting") { var permission_forward = $("#permission_forward").val(); var permission_userinfo = $("#userinfo_modify_control").val(); var html = ""; html += " \r\n"; html += " \r\n"; html += " \r\n"; var custom_banner = $("#custom_banner").val(); if(custom_banner=="Y") { var custom_bannerinfo = JSON.parse($("#custom_bannerinfo").val()); if(custom_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_menu = $("#custom_menu").val(); if(custom_menu=="Y") { var custom_menuinfo = JSON.parse($("#custom_menuinfo").val()); if(custom_menuinfo.length>0) { html += "
    \r\n"; html += ""; } } var custom_jeonjupaper_banner = $("#custom_jeonjupaper_banner").val(); if(custom_jeonjupaper_banner=="Y") { var custom_jeonjupaper_bannerinfo = JSON.parse($("#custom_jeonjupaper_bannerinfo").val()); if(custom_jeonjupaper_bannerinfo.length>0) { html += "
    \r\n"; html += ""; } } $("#main-menu-inner").html(html); } } function menuMailCountInit() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "command=mailcount"; var ajaxurl = "/module/menulist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var mailboxinfo_html = ""; var xmldata_mailbox = xmldata.find("MAILBOX"); xmldata_mailbox.find("ITEM").each(function() { var boxname = $.URLDecode($(this).find("BOXNAME").text()); var boxnameid = boxname.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); var boxrawname = $.URLDecode($(this).find("BOXRAWNAME").text()); var boxkoname = $.URLDecode($(this).find("BOXKONAME").text()); var boxrawkoname = $.URLDecode($(this).find("BOXRAWKONAME").text()); var unseen_count = $.URLDecode($(this).find("UNSEEN").text()); var boxtype = $.URLDecode($(this).find("BOXTYPE").text()); var boxid = $.URLDecode($(this).find("BOXID").text()); var folder_type = $.URLDecode($(this).find("FOLDER_TYPE").text()); if(boxname!="Sent") { if(unseen_count!=0) $("#COUNT_"+boxnameid).text(unseen_count); else $("#COUNT_"+boxnameid).text(""); } }); return; } }, error: function(e) { return; } }); } // 대시보드 function dashboardInit() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var ajaxdata = "mode=main"; var ajaxurl = "/module/dashboard.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { // dashboard maillist var mail_cnt = xmldata.find("LIST_ROW").length; var maillist_html = ""; if(mail_cnt > 0) { var x = 0; xmldata.find("LIST_ROW").each(function(msgno) { var boxname = $.URLDecode($(this).find("BOXNAME").text()); var msgno = $(this).find("MSGNO").text(); var priority = $(this).find("PRIORITY").text(); if(priority == 1) { priority_icon = "!"; } var sender_name = $.URLDecode($(this).find("SENDER").find("SENDER_NAME").text()); var sender_email = $.URLDecode($(this).find("SENDER").find("SENDER_EMAIL").text()); var sender_all = $.URLDecode($(this).find("SENDER").find("SENDER_ALL").text()); var subject = $.URLDecode($(this).find("SUBJECT").text()); var datetime = $.URLDecode($(this).find("DATE").text()); var size = $(this).find("SIZE").text(); var chk_hidden = msgno+"_"; var attach = $(this).find("ATTACH").text(); var attach_icon = ""; if(attach == "ATTACH") { attach_icon = "/images/ico_mail_attach.png"; chk_hidden += "A_"; } else { chk_hidden += "N_"; } var mail_status = $(this).find("STATUS").text(); var status_class = ""; var status_image = "/images/ico_mail_seen.png"; if(mail_status=="UNSEEN") { status_class = " dashboard_maillist_unread"; status_image = "/images/ico_mail_unseen.png"; if(mbox == "Sent") { chk_hidden += "S"; } else { chk_hidden += "U"; } } else if(mail_status=="REPLY") { status_image = "/images/ico_mail_reply.png"; chk_hidden += "S"; } else if(mail_status=="FORWARD") { status_image = "/images/ico_mail_forward.png"; chk_hidden += "S"; } else { chk_hidden += "S"; } var starstate = $(this).find("STARSTATE").text(); var starred_class = ""; if(starstate=="X") { starred_class = " starred"; } var staricon = $(this).find("STARICON").text(); chk_hidden += "_"+starstate; maillist_html += "
    "; maillist_html += "
    "; maillist_html += "
    "; maillist_html += "  "+sender_name+""; maillist_html += "
    "; maillist_html += "
    "; maillist_html += " "+datetime+""; maillist_html += "
    "; maillist_html += "
    "; maillist_html += "
    "; maillist_html += " "+subject+""; maillist_html += "
    "; maillist_html += "
    "; if((x+1)!=mail_cnt) maillist_html += "
    "; maillist_html += "
    "; x++; }) } else { maillist_html = "
    "+LANGUAGE[111][LANGTYPE]+"
    "; } $("#dashboard_recentmail_list").html(maillist_html); if($("#dashboard_recentmail_mailbox").val()!="ALL") { $("#dashboard_recentmail_link").attr("href", "javascript:gotoMbox('INBOX')"); } else { $("#dashboard_recentmail_link").attr("href", "javascript:gotoMbox('ALL')"); } //$("#dashboard_maillist").slimScroll({ height: 210, alwaysVisible: true, color: '#888', allowPageScroll: true }); // dashboard schedule var schedule_cnt = xmldata.find("SCHEDULE_ROW").length; var schedule_html = ""; if(schedule_cnt > 0) { var x = 0; xmldata.find("SCHEDULE_ROW").each(function() { var schedule_jointype = $(this).find("SCHEDULE_JOINTYPE").text(); var schedule_idx = $(this).find("SCHEDULE_IDX").text(); var schedule_title = $.URLDecode($(this).find("SCHEDULE_TITLE").text()); var schedule_flag = $(this).find("SCHEDULE_FLAG").text(); if(schedule_jointype=="1") { var type_color = "#8ec462"; } else if(schedule_jointype=="2") { var type_color = "#58a0d3"; } else if(schedule_jointype=="3") { var type_color = "#b279b7"; } schedule_html += "
    "; //schedule_html += "
    "; //schedule_html += "
    "; //schedule_html += "  "; //schedule_html += "
    "; //schedule_html += "
    "; //schedule_html += " "; //schedule_html += "
    "; //schedule_html += "
    "; schedule_html += "
    "; schedule_html += "  "+schedule_title+""; schedule_html += "
    "; schedule_html += "
    "; if((x+1)!=schedule_cnt) schedule_html += "
    "; schedule_html += "
    "; }); } if(schedule_html=="") { schedule_html += "
    "+LANGUAGE[855][LANGTYPE]+"
    "; } $("#dashboard_schedulelist").html(schedule_html); // dashboard environment var spam_flag = xmldata.find("SPAM_FLAG").text(); var spam_level = xmldata.find("SPAM_LEVEL").text(); var forward_flag = xmldata.find("FORWARD_FLAG").text(); var reply_flag = xmldata.find("REPLY_FLAG").text(); var filter_flag = xmldata.find("FILTER_FLAG").text(); // dashboard notice var noticeboard_cnt = xmldata.find("NOTICEBOARD_CNT").text(); var board_data = JSON.parse($.URLDecode(xmldata.find("NOTICEBOARD_DATA").text())); for(i=0; i"; html += "
    "; html += "
    "; html += " "+boardlist[j]["WRITER"]+""; html += "
    "; html += "
    "; html += " "+boardlist[j]["REGDATE"]+""; html += "
    "; html += "
    "; html += "
    "; html += " "+boardlist[j]["TITLE"]+""; html += "
    "; html += "
    "; if((j+1)!=boardlist.length) html += "
    "; html += ""; } if(html=="") { html += "
    "+LANGUAGE[854][LANGTYPE]+"
    "; } $("#dashboard_notice"+n+"_title").html(boardname); $("#dashboard_notice"+n+"_list").html(html); $("#dashboard_notice"+n+"_link").attr("href", "javascript:gotoBbs('"+boardcode+"')"); $("#dashboard_notice"+n).removeClass("hide"); $("#dashboard_notice"+n).addClass("show"); } LayerOpen("clase", ""); return; } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]; } $("html, body").animate({scrollTop:0}, 100); popupModal(message); return; } }, error: function(e) { LayerOpen("close", ""); $("html, body").animate({scrollTop:0}, 100); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); } // 메일리스트 function maillist_Init() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var command = ""; $("#msgid").val(""); //2020-01-31// var mbox = $.URLDecode($("#mbox").val()); var mbox = $("#mbox").val(); if(mbox=="" || mbox==undefined) { mbox = "INBOX"; $("#mbox").val(mbox); } var page = $("#page").val(); var page_tocken = $("#page_tocken").val(); var showtype = $("#showtype").val(); var listscale = $("#listscale").val(); var sort = $("#sort").val(); var sfrom = $("#sfrom").val(); var sto = $("#sto").val(); var ssubject = $("#ssubject").val(); var sdatetype = $("#sdatetype").val(); var startdate = $("#sdatestart").val(); var enddate = $("#sdateend").val(); var search_content = $("#scontent").val(); var search_type = $("#stype").val(); var scommand = $("#scommand").val(); if(scommand == "DEFAULT" || scommand == "DETAIL") { command = scommand; } if(sfrom != "" || sto != "" || ssubject != "" || sdatetype != "") { command = "DETAIL"; } else if(scontent != "") { command = "DEFAULT"; } if(mbox=="Spam") { $("#addspam_btn").css("display", "none"); $("#addwhite_btn").css("display", "block"); } else { $("#addspam_btn").css("display", "block"); $("#addwhite_btn").css("display", "none"); } if(search_content=="") search_type = "SUBJECT"; $("#search_type").val(search_type); $("#search_content").val(search_content); $("#search_type").select2({ minimumResultsForSearch: Infinity }); var ajaxdata = "mbox="+$.URLEncode(mbox)+"&page="+page+"&page_tocken="+page_tocken+"&listscale="+listscale+"&sort="+sort+"&showtype="+showtype+"&command="+command+"&search_content="+$.URLEncode(search_content)+"&search_type="+search_type; var ajaxurl = "/module/maillist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } if(search_content!="") { var load_msg = LANGUAGE[133][LANGTYPE]; } else { var load_msg = ""; } LayerOpen("open", load_msg); showMaillistBtn("hide"); $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { // 메일함 이름 var mailboxkoname = $.URLDecode(xmldata.find("MAILBOXNAME").text()); var boxname = $.URLDecode(xmldata.find("BOXRAWNAME").text()); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); $("#mailbox_title").html(mailboxkoname); // 안읽은메일 갯수/전체메일 갯수 var total_count = xmldata.find("TOTAL_COUNT").text(); var unseen_count = xmldata.find("UNSEEN_COUNT").text(); $("#total_count").text(total_count); $("#unseen_count").text(unseen_count); //$("#COUNT_"+boxnameid).text(unseen_count); /* if(unseen_count!=0) $("#COUNT_"+boxnameid).text(unseen_count); else $("#COUNT_"+boxnameid).text(""); */ // 메일리스트 정렬 태그 if(mbox=="Sent") { var sender_order_val ="20"; } else { var sender_order_val ="11"; } var subject_order_val ="10"; var date_order_val ="9"; var size_order_val ="13"; $("#list-header-from").removeClass("uplus-maillist-header-on"); $("#list-header-subject").removeClass("uplus-maillist-header-on"); $("#list-header-size").removeClass("uplus-maillist-header-on"); $("#list-header-date").removeClass("uplus-maillist-header-on"); $("#list-header-from-sort").removeClass("fa fa-sort-down fa-sort-up"); $("#list-header-subject-sort").removeClass("fa fa-sort-down fa-sort-up"); $("#list-header-size-sort").removeClass("fa fa-sort-down fa-sort-up"); $("#list-header-date-sort").removeClass("fa fa-sort-down fa-sort-up"); if(sort=="11") { // 보낸사람 sender_order_val ="3"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-from").addClass("uplus-maillist-header-on"); $("#list-header-from-sort").addClass("fa fa-sort-up"); } else if(sort=="3") { sender_order_val ="11"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-from").addClass("uplus-maillist-header-on"); $("#list-header-from-sort").addClass("fa fa-sort-down"); } if(sort=="20") { // 보낸사람 sender_order_val ="21"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-from").addClass("uplus-maillist-header-on"); $("#list-header-from-sort").addClass("fa fa-sort-up"); } else if(sort=="21") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-from").addClass("uplus-maillist-header-on"); $("#list-header-from-sort").addClass("fa fa-sort-down"); } else if(sort=="10") { // 제목 sender_order_val ="20"; subject_order_val ="2"; date_order_val ="9"; size_order_val ="13"; $("#list-header-subject").addClass("uplus-maillist-header-on"); $("#list-header-subject-sort").addClass("fa fa-sort-up"); } else if(sort=="2") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-subject").addClass("uplus-maillist-header-on"); $("#list-header-subject-sort").addClass("fa fa-sort-down"); } else if(sort=="9") { // 받은날짜 sender_order_val ="20"; subject_order_val ="10"; date_order_val ="1"; size_order_val ="13"; $("#list-header-date").addClass("uplus-maillist-header-on"); $("#list-header-date-sort").addClass("fa fa-sort-up"); } else if(sort=="1") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-date").addClass("uplus-maillist-header-on"); $("#list-header-date-sort").addClass("fa fa-sort-down"); } else if(sort=="13") { // 파일크기 sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="5"; $("#list-header-size").addClass("uplus-maillist-header-on"); $("#list-header-size-sort").addClass("fa fa-sort-up"); } else if(sort=="5") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-size").addClass("uplus-maillist-header-on"); $("#list-header-size-sort").addClass("fa fa-sort-down"); } else { $("#list-header-date-sort").addClass("fa fa-sort-down"); } $("#list-header-from").attr("href", "javascript:sortlist('" + sender_order_val + "');"); $("#list-header-subject").attr("href", "javascript:sortlist('" + subject_order_val + "');"); $("#list-header-date").attr("href", "javascript:sortlist('" + date_order_val + "');"); $("#list-header-size").attr("href", "javascript:sortlist('" + size_order_val + "');"); if(mbox!="Sent") { $("#maillist_from_title").html(LANGUAGE[86][LANGTYPE]); } else { $("#maillist_from_title").html(LANGUAGE[85][LANGTYPE]); } // 메일 리스트 출력 var list_cnt = xmldata.find("LIST_ROW").length; $("#mail-list").html(""); if(list_cnt > 0) { var x = 0; xmldata.find("LIST_ROW").each(function(msgno) { var list = ""; var boxname = $.URLDecode($(this).find("BOXNAME").text()); var msgno = $(this).find("MSGNO").text(); var priority = $(this).find("PRIORITY").text(); var priority_icon = ""; if(priority == 1) { priority_icon = "!"; } var sender_name = $.URLDecode($(this).find("SENDER").find("SENDER_NAME").text()); var sender_email = $.URLDecode($(this).find("SENDER").find("SENDER_EMAIL").text()); var sender_all = $.URLDecode($(this).find("SENDER").find("SENDER_ALL").text()); var subject = $.URLDecode($(this).find("SUBJECT").text()); var datetime = $.URLDecode($(this).find("DATE").text()); var size = $(this).find("SIZE").text(); var chk_hidden = msgno+"_"; var attach = $(this).find("ATTACH").text(); var attach_icon = ""; if(attach == "ATTACH") { attach_icon = "/images/ico_mail_attach.png"; chk_hidden += "A_"; } else { chk_hidden += "N_"; } var mail_status = $(this).find("STATUS").text(); var status_class = ""; var status_image = "/images/ico_mail_seen.png"; if(mail_status=="UNSEEN") { status_class = " unread"; status_image = "/images/ico_mail_unseen.png"; if(mbox == "Sent") { chk_hidden += "S"; } else { chk_hidden += "U"; } } else if(mail_status=="REPLY") { status_image = "/images/ico_mail_reply.png"; chk_hidden += "S"; } else if(mail_status=="FORWARD") { status_image = "/images/ico_mail_forward.png"; chk_hidden += "S"; } else { chk_hidden += "S"; } var starstate = $(this).find("STARSTATE").text(); var starred_class = ""; if(starstate=="X") { starred_class = " starred"; } var staricon = $(this).find("STARICON").text(); chk_hidden += "_"+starstate; list += "
  • "; list += "
    "; list += " "; list += "
    "; list += " "; list += "
    "; list += "
    "; list += "
    "; list += "
    "; list += " \">
    "+sender_name+"
    "; list += " "; list += "
    "; list += "
    "; list += "
    "; if(attach_icon!="") { list += " "; } list += "
    "; list += "
    "+priority_icon+"
    "; //list += "
    "; list += "
    "; list += " "; list += " "+subject+""; list += "
    "; list += "
    "; list += " "; list += "   "; list += "   "; list += "   "; list += "
    • userobx
    "; list += "   "; list += "
    "; list += "
    "; //list += "
    "; list += "
    "+size+"
    "; list += "
    "+datetime+"
    "; list += "
  • "; x++; $("#mail-list").append(list); }); var paging_html = $.URLDecode(xmldata.find("PAGING").text()); if(paging_html == "" || paging_html == undefined || paging_html == "undefined") { $("#mail_page").html(null); } else { $("#mail_page").html(paging_html); } } else { $("#mail-list").append("
  • "+LANGUAGE[111][LANGTYPE]+"
  • "); $("#mail_page").html(null); } LayerOpen("close", ""); //$("html, body").animate({scrollTop:0}, 100); $("#maillist_chkbox_all").attr("checked", false); //$("#mail-list li div span").tooltip(); $(".fa-file-o").tooltip(); $(".m-popup").tooltip(); menuMailCountInit() return; } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]; } $("html, body").animate({scrollTop:0}, 100); popupModal(message); return; } }, error: function(e) { LayerOpen("close", ""); $("html, body").animate({scrollTop:0}, 100); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); $("#mailmove_boxinfo").html($("#mailbox_info").val()); } // 읽지 않은 메일 리스트 function maillistUnseen_Init() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var command = ""; $("#msgid").val(""); //2020-01-31// var mbox = $.URLDecode($("#mbox").val()); /*** 2021-05-27 var mbox = $("#mbox").val(); if(mbox=="" || mbox==undefined) { mbox = "INBOX"; $("#mbox").val(mbox); } var page = $("#page").val(); var page_tocken = $("#page_tocken").val(); var showtype = $("#showtype").val(); var listscale = $("#listscale").val(); var sort = $("#sort").val(); var sfrom = $("#sfrom").val(); var sto = $("#sto").val(); var ssubject = $("#ssubject").val(); var sdatetype = $("#sdatetype").val(); var startdate = $("#sdatestart").val(); var enddate = $("#sdateend").val(); var search_content = $("#scontent").val(); var search_type = $("#stype").val(); var scommand = $("#scommand").val(); if(scommand == "DEFAULT" || scommand == "DETAIL") { command = scommand; } if(sfrom != "" || sto != "" || ssubject != "" || sdatetype != "") { command = "DETAIL"; } else if(scontent != "") { command = "DEFAULT"; } if(mbox=="Spam") { $("#addspam_btn").css("display", "none"); $("#addwhite_btn").css("display", "block"); } else { $("#addspam_btn").css("display", "block"); $("#addwhite_btn").css("display", "none"); } $("#search_content").val(search_content); ***/ /*** 2021-05-27 var ajaxdata = "mbox="+$.URLEncode(mbox)+"&page="+page+"&page_tocken="+page_tocken+"&listscale="+listscale+"&sort="+sort+"&showtype="+showtype+"&command="+command+"&search_content="+$.URLEncode(search_content)+"&search_type="+search_type; var ajaxurl = "/module/maillist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } if(search_content!="") { var load_msg = LANGUAGE[133][LANGTYPE]; } else { var load_msg = ""; } LayerOpen("open", load_msg); ***/ var page = $("#page").val(); var listscale = $("#listscale").val(); var load_msg = ""; var ajaxdata = "mbox=ALL&page="+page+"&listscale="+listscale; var ajaxurl = "/module/maillist_unseen.php"; LayerOpen("open", load_msg); showMaillistBtn("hide"); $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { // 안읽은메일 갯수/전체메일 갯수 var total_count = xmldata.find("TOTAL_COUNT").text(); $("#total_count").text(total_count); //2021-05-27 $("#maillist_from_title").html(LANGUAGE[86][LANGTYPE]); // 메일 리스트 출력 var list_cnt = xmldata.find("LIST_ROW").length; $("#mail-list").html(""); if(list_cnt > 0) { var x = 0; xmldata.find("LIST_ROW").each(function(msgno) { var list = ""; var boxname = $.URLDecode($(this).find("BOXNAME").text()); var boxkoname = $.URLDecode($(this).find("BOXKONAME").text()); var msgno = $(this).find("MSGNO").text(); var priority = $(this).find("PRIORITY").text(); var priority_icon = ""; if(priority == 1) { priority_icon = "!"; } var sender_name = $.URLDecode($(this).find("SENDER").find("SENDER_NAME").text()); var sender_email = $.URLDecode($(this).find("SENDER").find("SENDER_EMAIL").text()); var sender_all = $.URLDecode($(this).find("SENDER").find("SENDER_ALL").text()); var subject = $.URLDecode($(this).find("SUBJECT").text()); var datetime = $.URLDecode($(this).find("DATE").text()); var size = $(this).find("SIZE").text(); var chk_hidden = msgno+"_"; var attach = $(this).find("ATTACH").text(); var attach_icon = ""; if(attach == "ATTACH") { attach_icon = "/images/ico_mail_attach.png"; chk_hidden += "A_"; } else { chk_hidden += "N_"; } var mail_status = $(this).find("STATUS").text(); var status_class = ""; var status_image = "/images/ico_mail_seen.png"; if(mail_status=="UNSEEN") { status_class = " unread"; status_image = "/images/ico_mail_unseen.png"; if(mbox == "Sent") { chk_hidden += "S"; } else { chk_hidden += "U"; } } else if(mail_status=="REPLY") { status_image = "/images/ico_mail_reply.png"; chk_hidden += "S"; } else if(mail_status=="FORWARD") { status_image = "/images/ico_mail_forward.png"; chk_hidden += "S"; } else { chk_hidden += "S"; } var starstate = $(this).find("STARSTATE").text(); var starred_class = ""; if(starstate=="X") { starred_class = " starred"; } var staricon = $(this).find("STARICON").text(); chk_hidden += "_"+starstate; list += "
  • "; list += "
    "; list += " "; list += "
    "; list += " "; list += " "; //list += "
    "; //list += "
    "; list += "
    "; list += "
    "; list += "
    "; list += " \">
    "+sender_name+"
    "; list += " "; list += "
    "; list += "
    "; list += "
    "; if(attach_icon!="") { list += " "; } list += "
    "; list += "
    "+priority_icon+"
    "; //list += "
    "; list += "
    "; list += " "; list += " "+subject+""; list += "
    "; list += "
    "; list += " "; list += "
    "+size+"
    "; list += "
    "+datetime+"
    "; list += "
  • "; x++; $("#mail-list").append(list); }); var paging_html = $.URLDecode(xmldata.find("PAGING").text()); if(paging_html == "" || paging_html == undefined || paging_html == "undefined") { $("#mail_page").html(null); } else { $("#mail_page").html(paging_html); } } else { $("#mail-list").append("
  • "+LANGUAGE[111][LANGTYPE]+"
  • "); $("#mail_page").html(null); } LayerOpen("close", ""); //$("html, body").animate({scrollTop:0}, 100); $("#maillist_chkbox_all").attr("checked", false); //$("#mail-list li div span").tooltip(); $(".fa-file-o").tooltip(); $(".m-popup").tooltip(); menuMailCountInit() return; } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]; } $("html, body").animate({scrollTop:0}, 100); popupModal(message); return; } }, error: function(e) { LayerOpen("close", ""); $("html, body").animate({scrollTop:0}, 100); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); $("#mailmove_boxinfo").html($("#mailbox_info").val()); return; } //예약메일 리스트 function reservelist_Init() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var command = ""; $("#msgid").val(""); var mbox = $.URLDecode($("#mbox").val()); if(mbox=="" || mbox==undefined) { mbox = "INBOX"; $("#mbox").val(mbox); } var page = $("#page").val(); var page_tocken = $("#page_tocken").val(); var showtype = $("#showtype").val(); var listscale = $("#listscale").val(); var sort = $("#sort").val(); var sfrom = $("#sfrom").val(); var sto = $("#sto").val(); var ssubject = $("#ssubject").val(); var sdatetype = $("#sdatetype").val(); var startdate = $("#sdatestart").val(); var enddate = $("#sdateend").val(); var search_content = $("#scontent").val(); var search_type = $("#stype").val(); var scommand = $("#scommand").val(); if(scommand == "DEFAULT" || scommand == "DETAIL") { command = scommand; } if(sfrom != "" || sto != "" || ssubject != "" || sdatetype != "") { command = "DETAIL"; } else if(scontent != "") { command = "DEFAULT"; } $("#search_content").val(search_content); var ajaxdata = "mbox="+$.URLEncode(mbox)+"&&page="+page+"&page_tocken="+page_tocken+"&listscale="+listscale+"&sort="+sort+"&showtype="+showtype+"&command="+command+"&search_content="+$.URLEncode(search_content)+"&search_type="+search_type; var ajaxurl = "/module/maillist.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); showMaillistBtn("hide"); $.ajax({ type: "POST", url: ajaxurl, data: ajaxdata, dataType: "xml", cache: true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { // 메일함 이름 var mailboxkoname = $.URLDecode(xmldata.find("MAILBOXNAME").text()); var boxname = $.URLDecode(xmldata.find("BOXRAWNAME").text()); var boxnameid = boxname.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); $("#mailbox_title").html(mailboxkoname); // 안읽은메일 갯수/전체메일 갯수 var total_count = xmldata.find("TOTAL_COUNT").text(); var unseen_count = xmldata.find("UNSEEN_COUNT").text(); $("#total_count").text(total_count); $("#unseen_count").text(unseen_count); //$("#COUNT_"+boxnameid).text(unseen_count); if(unseen_count!=0) $("#COUNT_"+boxnameid).text(unseen_count); else $("#COUNT_"+boxnameid).text(""); // 메일리스트 정렬 태그 var sender_order_val ="20"; var subject_order_val ="10"; var date_order_val ="9"; var size_order_val ="13"; $("#list-header-from").removeClass("uplus-maillist-header-on"); $("#list-header-subject").removeClass("uplus-maillist-header-on"); $("#list-header-size").removeClass("uplus-maillist-header-on"); $("#list-header-date").removeClass("uplus-maillist-header-on"); $("#list-header-from-sort").removeClass("fa fa-sort-down fa-sort-up"); $("#list-header-subject-sort").removeClass("fa fa-sort-down fa-sort-up"); $("#list-header-size-sort").removeClass("fa fa-sort-down fa-sort-up"); $("#list-header-date-sort").removeClass("fa fa-sort-down fa-sort-up"); if(sort=="20") { // 보낸사람 sender_order_val ="21"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-from").addClass("uplus-maillist-header-on"); $("#list-header-from-sort").addClass("fa fa-sort-up"); } else if(sort=="21") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-from").addClass("uplus-maillist-header-on"); $("#list-header-from-sort").addClass("fa fa-sort-down"); } else if(sort=="10") { // 제목 sender_order_val ="20"; subject_order_val ="2"; date_order_val ="9"; size_order_val ="13"; $("#list-header-subject").addClass("uplus-maillist-header-on"); $("#list-header-subject-sort").addClass("fa fa-sort-up"); } else if(sort=="2") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-subject").addClass("uplus-maillist-header-on"); $("#list-header-subject-sort").addClass("fa fa-sort-down"); } else if(sort=="9") { // 받은날짜 sender_order_val ="20"; subject_order_val ="10"; date_order_val ="1"; size_order_val ="13"; $("#list-header-date").addClass("uplus-maillist-header-on"); $("#list-header-date-sort").addClass("fa fa-sort-up"); } else if(sort=="1") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-date").addClass("uplus-maillist-header-on"); $("#list-header-date-sort").addClass("fa fa-sort-down"); } else if(sort=="13") { // 파일크기 sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="5"; $("#list-header-size").addClass("uplus-maillist-header-on"); $("#list-header-size-sort").addClass("fa fa-sort-up"); } else if(sort=="5") { sender_order_val ="20"; subject_order_val ="10"; date_order_val ="9"; size_order_val ="13"; $("#list-header-size").addClass("uplus-maillist-header-on"); $("#list-header-size-sort").addClass("fa fa-sort-down"); } else { $("#list-header-date-sort").addClass("fa fa-sort-down"); } $("#list-header-from").attr("href", "javascript:sortlist('" + sender_order_val + "');"); $("#list-header-subject").attr("href", "javascript:sortlist('" + subject_order_val + "');"); $("#list-header-date").attr("href", "javascript:sortlist('" + date_order_val + "');"); $("#list-header-size").attr("href", "javascript:sortlist('" + size_order_val + "');"); // 메일 리스트 출력 var list_cnt = xmldata.find("LIST_ROW").length; $("#mail-list").html(""); if(list_cnt > 0) { var x = 0; xmldata.find("LIST_ROW").each(function(msgno) { var list = ""; var boxname = $.URLDecode($(this).find("BOXNAME").text()); var msgno = $(this).find("MSGNO").text(); var priority = $(this).find("PRIORITY").text(); var priority_icon = ""; if(priority == 1) { priority_icon = "!"; } var sender_name = $.URLDecode($(this).find("SENDER").find("SENDER_NAME").text()); var sender_email = $.URLDecode($(this).find("SENDER").find("SENDER_EMAIL").text()); var sender_all = $.URLDecode($(this).find("SENDER").find("SENDER_ALL").text()); var subject = $.URLDecode($(this).find("SUBJECT").text()); var datetime = $.URLDecode($(this).find("DATE").text()); var rdatetime = $.URLDecode($(this).find("RDATE").text()); var rstatus = $.URLDecode($(this).find("RSTATUS").text()); var size = $(this).find("SIZE").text(); var chk_hidden = msgno+"_"; var attach = $(this).find("ATTACH").text(); var attach_icon = ""; if(attach == "ATTACH") { attach_icon = "/images/ico_mail_attach.png"; chk_hidden += "A_"; } else { chk_hidden += "N_"; } var mail_status = $(this).find("STATUS").text(); var status_class = ""; var status_image = "/images/ico_mail_seen.png"; if(mail_status=="UNSEEN") { status_class = " unread"; status_image = "/images/ico_mail_unseen.png"; if(mbox == "Sent") { chk_hidden += "S"; } else { chk_hidden += "U"; } } else if(mail_status=="REPLY") { status_image = "/images/ico_mail_reply.png"; chk_hidden += "S"; } else if(mail_status=="FORWARD") { status_image = "/images/ico_mail_forward.png"; chk_hidden += "S"; } else { chk_hidden += "S"; } var starstate = $(this).find("STARSTATE").text(); var starred_class = ""; if(starstate=="X") { starred_class = " starred"; } var staricon = $(this).find("STARICON").text(); chk_hidden += "_"+starstate; var rstatus_tag = ""; if(rstatus=="C") { rstatus_tag = ""+LANGUAGE[134][LANGTYPE]+""; } else if(rstatus=="S") { rstatus_tag = ""+LANGUAGE[135][LANGTYPE]+""; } else if(rstatus=="F") { rstatus_tag = ""+LANGUAGE[136][LANGTYPE]+""; } else { rstatus_tag = ""+LANGUAGE[137][LANGTYPE]+""; } list += "
  • "; list += "
    "; list += " "; list += "
    "; list += " "; list += "
    "; list += "
    "; list += "
    "; list += "
    "; list += "
    "+sender_name+"
    "; list += " "; list += "
    "; list += "
    "; list += "
    "; list += "
    "+priority_icon+"
    "; list += "
    "+rstatus_tag+" "+subject+"
    "; list += "
    "+size+"
    "; list += "
    "+rdatetime+"
    "; list += "
    "+datetime+"
    "; list += "
  • "; x++; $("#mail-list").append(list); }); var paging_html = $.URLDecode(xmldata.find("PAGING").text()); if(paging_html == "" || paging_html == undefined || paging_html == "undefined") { $("#mail_page").html(null); } else { $("#mail_page").html(paging_html); } } else { $("#mail-list").append("
  • "+LANGUAGE[111][LANGTYPE]+"
  • "); $("#mail_page").html(null); } $("html, body").animate({scrollTop:0}, 100); return; } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { message = LANGUAGE[54][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]; } $("html, body").animate({scrollTop:0}, 100); popupModal(message); return; } }, error: function(e) { $("html, body").animate({scrollTop:0}, 100); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); $("#mailmove_boxinfo").html($("#mailbox_info").val()); LayerOpen("close", ""); } //예약메일 수정 확인 function reservemailEdit() { var message_id = $("#message_id").val(); var mbox = $.URLDecode($("#mbox").val()); var msgid = $("#msgid").val(); bootbox.dialog({ message: LANGUAGE[138][LANGTYPE]+"
    "+LANGUAGE[139][LANGTYPE], buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { reservemailCancel('one'); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } //예약메일 취소 function reservemailCancel(mode) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var mbox = $.URLDecode($("#mbox").val()); if(mode=="one") { var command = "reservecancel"; var message_id = $("#message_id").val(); var msgid = $("#msgid").val(); var ajaxdata = "mbox="+$.URLEncode(mbox)+"&msgid="+msgid+"&message_id="+$.URLEncode(message_id)+"&command="+command; var ajaxurl = "/module/reservemail.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { var timestamp = tstamp(); $.history.load("mailwrite^"+mbox+"^VIEWDRAFT^"+timestamp+"^"+msgid); } }, error: function(e) { popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); } else { } } //메일 읽음/안읽음 으로 변경 function mailread(val) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var msgid = ""; var command = ""; var checkedlist = getChecked(); if(checkedlist.length == "") { bootbox.confirm({ message: LANGUAGE[140][LANGTYPE], callback: function(result) { return; }, className: "bootbox-sm" }); return; } msgid = checkedlist; if(val == "read") { command = "SETMAILREAD"; } else if(val == "unread") { command = "SETMAILUNREAD"; } var mbox = $.URLDecode($("#mbox").val()); var ajaxdata = "mbox="+$.URLEncode(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { //2020-02-21// showMaillistBtn("hide"); //2020-02-21// maillist_Init(); var xmldata = $(xml).find("DATA"); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); var unseen = xmldata.find("UNSEEN").text(); if(unseen!=0) $("#COUNT_"+boxnameid).text(unseen); else $("#COUNT_"+boxnameid).text(""); $("#unseen_count").text(unseen); LayerOpen("close", ""); var checkedlist = getChecked2(); var msgid_arr = checkedlist.split("|"); for(i=0; i<(msgid_arr.length - 1); i++) { var muid = msgid_arr[i]; if(command=="SETMAILREAD") { $("#mailimg_"+muid).attr("src", "/images/ico_mail_seen.png"); $("#mailuid_"+muid).removeClass("unread"); } else { $("#mailimg_"+muid).attr("src", "/images/ico_mail_unseen.png"); $("#mailuid_"+muid).addClass("unread"); } } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); } function mailread2(val) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var msgid = $("#msgid").val(); if(val == "read") { command = "SETMAILREAD"; } else if(val == "unread") { command = "SETMAILUNREAD"; } //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var boxname = $.URLDecode(xmldata.find("BOXNAME").text()); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); var unseen = xmldata.find("UNSEEN").text(); //$("#COUNT_"+boxnameid).text(unseen); var pagetype = $("#pagetype").val(); if(pagetype=="popup") { if(unseen!=0) $("#COUNT_"+boxnameid, opener.document).text(unseen); else $("#COUNT_"+boxnameid, opener.document).text(""); $("#unseen_count", opener.document).text(unseen); var pagecode = $("#pagecode", opener.document).val(); if(pagecode=="maillist") { setMailreadFlag2(msgid, command); } } else { if(unseen!=0) $("#COUNT_"+boxnameid).text(unseen); else $("#COUNT_"+boxnameid).text(""); $("#unseen_count").text(unseen); } }, error: function(e) { popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); return; } }); LayerOpen("close", ""); } // 메일상태 개별변경 function setMailreadFlag(muid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var chk = $("input:checkbox[name='muid[]']"); var chk_h = $("input:hidden[name='chk_hidden[]']"); var msgid = chk[muid].value; var h = chk_h[muid].value; var arr = h.split("_"); if(arr[2]=="U") { var command = "SETMAILREAD"; $("#mailimg_"+muid).attr("src", "/images/ico_mail_seen.png"); $("#mailuid_"+muid).removeClass("unread"); } else { var command = "SETMAILUNREAD"; $("#mailimg_"+muid).attr("src", "/images/ico_mail_unseen.png"); $("#mailuid_"+muid).addClass("unread"); } //2020-01-31//var mbox = $.URLDecode($("#mbox").val()); var mbox = $("#mbox").val(); var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var boxname = $.URLDecode(xmldata.find("BOXNAME").text()); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); var unseen = xmldata.find("UNSEEN").text(); //$("#COUNT_"+boxnameid).text(unseen); if(unseen!=0) $("#COUNT_"+boxnameid).text(numberSetComma(unseen)); else $("#COUNT_"+boxnameid).text(""); $("#unseen_count").text(unseen); var i = 0; var chk_h = $("input:hidden[id='chk_hidden[]']"); chk_h.each(function(){ var h = this.value; var arr = h.split("_"); if(msgid==arr[0]) { if(command=="SETMAILREAD") { var val = "S"; } else { var val = "U"; } var chk_value = arr[0]+"_"+arr[1]+"_"+val+"_"+arr[3]; chk_h[i].value = chk_value; } i++; }); }, error: function(e) { } }); LayerOpen("close", ""); } // 메일상태 개별변경(팝업) function setMailreadFlag2(msgid, command) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var n = 0; var muid = ""; $("input[name='muid[]']", opener.document).each(function() { if(this.value==msgid) { muid = n; } n++; }) var chk = $("input:checkbox[name='muid[]']", opener.document); var chk_h = $("input:hidden[name='chk_hidden[]']", opener.document); var h = chk_h[muid].value; var arr = h.split("_"); if(command == "SETMAILREAD") { $("#mailimg_"+muid, opener.document).attr("src", "/images/ico_mail_seen.png"); $("#mailuid_"+muid, opener.document).removeClass("unread"); var chk_value = arr[0]+"_"+arr[1]+"_S_"+arr[3]; } else { $("#mailimg_"+muid, opener.document).attr("src", "/images/ico_mail_unseen.png"); $("#mailuid_"+muid, opener.document).addClass("unread"); var chk_value = arr[0]+"_"+arr[1]+"_U_"+arr[3]; } chk_h[muid].value = chk_value; } // 중요메일 설정 function setStarFlag(muid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var chk = $("input:checkbox[name='muid[]']"); var chk_h = $("input:hidden[name='chk_hidden[]']"); var msgid = chk[muid].value; var h = chk_h[muid].value; var arr = h.split("_"); if(arr[3]=="X") { var command = "RESETIMPORTANT"; $("#mailuid_"+muid).removeClass("starred"); } else { var command = "SETIMPORTANT"; $("#mailuid_"+muid).addClass("starred"); } var mbox = $.URLDecode($("#mbox").val()); var ajaxdata = "mbox="+$.URLEncode(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { var i = 0; var chk_h = $("input:hidden[id='chk_hidden[]']"); chk_h.each(function(){ var h = this.value; var arr = h.split("_"); var chk_value = arr[0]+"_"+arr[1]+"_"+arr[2]+"_"; if(msgid==arr[0]) { if(command=="SETIMPORTANT") { chk_value += "X"; } else { chk_value += "N"; } chk_h[i].value = chk_value; } i++ }); LayerOpen("close", ""); }, error: function(e) { LayerOpen("close", ""); } }); } function setStarFlag2(msgid, flag) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var h = $("#chk_hidden_"+msgid).val(); var arr = h.split("_"); if(flag==undefined && flag=="") { if(arr[3]=="X") { var command = "RESETIMPORTANT"; $("#mailuid_"+msgid).removeClass("starred"); } else { var command = "SETIMPORTANT"; $("#mailuid_"+msgid).addClass("starred"); } } else { if(arr[3]=="X") { var command = "RESETIMPORTANT"; $("#mail_headers").removeClass("starred"); } else { var command = "SETIMPORTANT"; $("#mail_headers").addClass("starred"); } } //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { var chk_value = arr[0]+"_"+arr[1]+"_"+arr[2]+"_"; if(command=="SETIMPORTANT") { chk_value += "X"; } else { chk_value += "N"; } $("#chk_hidden_"+msgid).val(chk_value); var pagetype = $("#pagetype").val(); if(pagetype=="popup") { var pagecode = $("#pagecode", opener.document).val(); } else { var pagecode = $("#pagecode").val(); } if(pagetype=="popup" && pagecode=="maillist") { var n = 0; var muid = ""; $("input[name='muid[]']", opener.document).each(function() { if(this.value==msgid) { muid = n; } n++; }) var chk_h = $("input:hidden[name='chk_hidden[]']", opener.document); chk_h[muid].value = chk_value; if(command == "SETIMPORTANT") { $("#mailuid_"+muid, opener.document).addClass("starred"); } else { $("#mailuid_"+muid, opener.document).removeClass("starred"); } } LayerOpen("close", ""); }, error: function(e) { LayerOpen("close", ""); } }); } // 메일삭제 function deleteMails(val) { var command = ""; var msgid = ""; var mode = ""; if(usertypeCheck()==false) return; if($("#pagetype").val()=="popup") { msgid = $("#msgid").val(); } else { if($("#hash").val() == "maillist" || $("#hash").val() == "") { var checkedlist = getChecked(); mode = "maillist"; if(checkedlist.length == "") { bootboxAlert(LANGUAGE[140][LANGTYPE]); return; } msgid = checkedlist; } else if($("#hash").val() == "mailview" || $("#hash").val() == "mailview_unseen") { mode = "mailview"; msgid = $("#msgid").val(); } } //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); if(mbox == "Trash" || mbox == "Spam") val = "REALDELETE"; var delete_msg = ""; if(mbox == "Reserved") { delete_msg = ""; val = "RESERVECANCEL"; } if(val == "DELETE") { bootbox.dialog({ message: LANGUAGE[112][LANGTYPE]+"
    "+LANGUAGE[113][LANGTYPE], buttons: { danger: { label: LANGUAGE[97][LANGTYPE], className: "btn-primary", callback: function() { command = "DELETEMAIL"; deleteMails_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } else if(val == "REALDELETE") { bootbox.dialog({ message: LANGUAGE[117][LANGTYPE]+"
    "+LANGUAGE[112][LANGTYPE], buttons: { danger: { label: LANGUAGE[97][LANGTYPE], className: "btn-primary", callback: function() { command = "DELETEMAILCOMPLETELY"; deleteMails_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } else if(val == "RESERVECANCEL") { if(mode=="mailview") { var reservemail_code = $("#reservemail_code").val(); if(reservemail_code=="N") { var delete_message = LANGUAGE[118][LANGTYPE]+"
    "+LANGUAGE[119][LANGTYPE]; } else { var delete_message = LANGUAGE[112][LANGTYPE]+"
    "+LANGUAGE[113][LANGTYPE]; } } else { var delete_message = LANGUAGE[112][LANGTYPE]+"
    "+LANGUAGE[119][LANGTYPE]; } bootbox.dialog({ message: delete_message, buttons: { danger: { label: LANGUAGE[97][LANGTYPE], className: "btn-primary", callback: function() { command = "RESERVECANCEL"; deleteMails_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } else { bootbox.dialog({ message: LANGUAGE[112][LANGTYPE], buttons: { danger: { label: LANGUAGE[97][LANGTYPE], className: "btn-primary", callback: function() { command = "DELETEMAIL"; deleteMails_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } } function deleteMails_action(command, msgid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); var showtype = $("#showtype").val(); if(showtype == "") { showtype = "ALL"; } var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { LayerOpen("close", ""); if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillist_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); if($("#hash").val() == "maillist") { if($("#mbox").val()!="Reserved") { maillist_Init(); } else { reservelist_Init(); } } else { var timestamp = tstamp(); $.history.load("maillist^"+mbox+"^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[142][LANGTYPE]); } }); } // 읽지 않은 메일 삭제 function deleteUnseenMails(val) { var command = ""; var msgid = ""; var mode = ""; if($("#pagetype").val()=="popup") { msgid = $("#msgid").val(); } else { if($("#hash").val() == "maillist_unseen" || $("#hash").val() == "") { var checkedlist = getChecked3(); mode = "maillist_unseen"; if(checkedlist.length == "") { bootboxAlert(LANGUAGE[140][LANGTYPE]); return; } msgid = checkedlist; } } var mbox = $.URLDecode($("#mbox").val()); if(val == "DELETE") { bootbox.dialog({ message: LANGUAGE[112][LANGTYPE]+"
    "+LANGUAGE[113][LANGTYPE], buttons: { danger: { label: LANGUAGE[97][LANGTYPE], className: "btn-primary", callback: function() { command = "DELETEMAIL"; deleteUnseenMails_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } } function deleteUnseenMails_action(command, msgid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var mbox = $.URLDecode($("#mbox").val()); var showtype = $("#showtype").val(); if(showtype == "") { showtype = "ALL"; } var ajaxdata = "mbox="+$.URLEncode(mbox)+"&msgid="+$.URLEncode(msgid)+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { LayerOpen("close", ""); if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillist_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); var timestamp = tstamp(); $.history.load("maillist_unseen^ALL^"+page+"^"+showtype+"^"+timestamp); showMaillistBtn("hide"); menuMailCountInit(); } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[142][LANGTYPE]); } }); } // 메일함 비우기 function emptyMailbox(boxname) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var hash = $("#hash").val(); var mbox = $("#mbox").val(); var ajaxdata = "mbox="+boxname+"&command=EMPTYMAILBOX"; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", LANGUAGE[141][LANGTYPE]); $.ajax({ type:"POST", url:"/module/mail_action.php", data:ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var boxname = $.URLDecode(xmldata.find("BOXNAME").text()); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); var unseen = xmldata.find("UNSEEN").text(); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); if(boxname==mbox && (mbox=="Trash" || mbox=="Spam")) { maillist_Init(); } else { //$("#COUNT_"+boxnameid).text(unseen); if(unseen>0) $("#COUNT_"+boxnameid).text(unseen); else $("#COUNT_"+boxnameid).text(""); } LayerOpen("close"); }, error: function(e) { LayerOpen("close"); alert(LANGUAGE[143][LANGTYPE]) } }); } //스팸신고 function addBlacklist() { if(usertypeCheck()==false) return; var msgid = ""; if($("#pagetype").val()=="popup") { msgid = $("#msgid").val(); } else { if($("#hash").val() == "maillist" || $("#hash").val() == "") { var checkedlist = getChecked(); if(checkedlist.length == "") { bootboxAlert(LANGUAGE[140][LANGTYPE]); return; } msgid = checkedlist; } else if($("#hash").val() == "mailview" || $("#hash").val() == "mailview_unseen" || $("pagetype").val()=="popup") { msgid = $("#msgid").val(); } } bootbox.dialog({ message: LANGUAGE[116][LANGTYPE], buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { command = "ADDBLACKLIST"; addBlacklist_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } function addBlacklist_Init(email, msgid) { bootbox.dialog({ message: "<"+email+">
    "+LANGUAGE[116][LANGTYPE]+"", title: LANGUAGE[144][LANGTYPE], buttons: { main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } }, danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { addBlacklist_action("ADDBLACKLIST", msgid); } } }, className: "bootbox-sm" }); } function unseenAddBlacklist_Init(email, mbox, msgid) { bootbox.dialog({ message: "<"+email+">
    "+LANGUAGE[116][LANGTYPE]+"", title: LANGUAGE[144][LANGTYPE], buttons: { main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } }, danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { unseenAddBlacklist_action("ADDBLACKLIST", mbox, msgid); } } }, className: "bootbox-sm" }); } function addBlacklist_action(command, msgid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); var showtype = $("#showtype").val(); if(showtype == "") { showtype = "ALL"; } var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { LayerOpen("close", ""); if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillist_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); if($("#hash").val() == "maillist") { maillist_Init(); } else { var timestamp = tstamp(); $.history.load("maillist^"+mbox+"^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[145][LANGTYPE]); } }); } function unseenAddBlacklist_action(command, mbox, msgid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var showtype = $("#showtype").val(); if(showtype == "") { showtype = "ALL"; } var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { LayerOpen("close", ""); if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillistUnseen_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); if($("#hash").val() == "maillist") { maillistUnseen_Init(); } else { var timestamp = tstamp(); $.history.load("maillist_unseen^ALL^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[145][LANGTYPE]); } }); } // 메일리스트 규칙 추가 function addMailFilterPopup_action() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); $("#custom_modal_message").html(""); var mbox = $.URLDecode($("#mbox").val()); var email = $("#addmailfilter_email").val(); if($("#addMailFilter_mbox1").is(":checked")) { var mboxtype = "BASIC"; var destmbox = $("#addMailFilter_filterbox").val(); if(mbox==destmbox) { $("#custom_modal_message").html(""+LANGUAGE[848][LANGTYPE]+""); return; } } else { var mboxtype = "NEW"; var destmbox = $("#addMailFilter_newbox").val(); var checkMailboxName = usermailboxNameCheck(JSON.parse($("#MailboxData").val()), destmbox); var checkResult = checkMailboxName.split("|"); if(checkResult[0]!="RES") { $("#custom_modal_message").html(""+checkResult[1]+""); return; } } if($("#addMailFilter_allmail").is(":checked")) { var ruleapply = "ALL"; } else { var ruleapply = "ONE"; } pattern = /^[A-Za-z0-9\._-]+[@][A-Za-z0-9\._-]+[\.].[A-Za-z0-9]+$/; if (!pattern.test(email)) { $("#custom_modal_message").html(""+LANGUAGE[775][LANGTYPE]+""); return; } var ajaxdata = "command=ADDMAILFILTER&mbox="+encodeURIComponent(mbox)+"&email="+encodeURIComponent(email)+"&mboxtype="+mboxtype+"&destination="+encodeURIComponent(destmbox)+"&ruleapply="+ruleapply; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $("#custom_modal_message").html(""+LANGUAGE[9][LANGTYPE]+""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { $("#custom_modal_message").html(""); $("#popup_modal2").modal("hide"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); if($("#hash").val() == "maillist") { if($("#mbox").val()!="Reserved") { maillist_Init(); } else { reservelist_Init(); } } else { var timestamp = tstamp(); $.history.load("maillist^"+mbox+"^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } if(message=="") { $("#custom_modal_message").html(""+LANGUAGE[671][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]+"
    "); } else { $("#custom_modal_message").html(""+message+""); } } }, error: function(e) { popupModal(LANGUAGE[671][LANGTYPE]); } }); } //수신허용 function addWhitelist() { if(usertypeCheck()==false) return; var msgid = ""; if($("#pagetype").val()=="popup") { msgid = $("#msgid").val(); } else { if($("#hash").val() == "maillist" || $("#hash").val() == "") { var checkedlist = getChecked(); if(checkedlist.length == "") { bootboxAlert(LANGUAGE[140][LANGTYPE]); return; } msgid = checkedlist; } else if($("#hash").val() == "mailview" || $("#hash").val() == "mailview_unseen" || $("pagetype").val()=="popup") { msgid = $("#msgid").val(); } } bootbox.dialog({ message: LANGUAGE[841][LANGTYPE], buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { command = "ADDWHITELIST"; addWhitelist_action(command, msgid); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { } } }, className: "bootbox-sm" }); } function addWhitelist_action(command, msgid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var mbox = $.URLDecode($("#mbox").val()); var showtype = $("#showtype").val(); if(showtype == "") { showtype = "ALL"; } var ajaxdata = "mbox="+$.URLEncode(mbox)+"&msgid="+msgid+"&command="+command; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { /*** if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillist_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { ***/ var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); /*** var page = $("#page").val(); if($("#hash").val() == "maillist") { maillist_Init(); } else { var timestamp = tstamp(); $.history.load("maillist^"+mbox+"^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } ***/ LayerOpen("close", ""); popupModal(LANGUAGE[760][LANGTYPE]); }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[145][LANGTYPE]); } }); } //메일이동 function mailMove(name) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var destmbox = $.URLEncode(name); //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); var msgid = ""; if($("#pagetype").val()=="popup") { msgid = $("#msgid").val(); } else { if($("#hash").val() == "maillist" || $("#hash").val() == "") { var checkedlist = getChecked(); if(checkedlist.length == "") { bootboxAlert(LANGUAGE[140][LANGTYPE]); return; } msgid = checkedlist; } else if($("#hash").val() == "mailview" || $("#hash").val() == "mailview_unseen") { msgid = $("#msgid").val(); } if(mbox == name) { bootboxAlert(LANGUAGE[146][LANGTYPE]); return; } } var command = "MOVEMAILS"; var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&command="+command+"&destination="+destmbox; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { LayerOpen("close", ""); if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillist_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); if($("#hash").val() == "maillist") { maillist_Init(); } else { var timestamp = tstamp(); $.history.load("maillist^"+mbox+"^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[147][LANGTYPE]); } }); } function quickMailMove_action(name, msgid) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var destmbox = $.URLEncode(name); var mbox = $.URLDecode($("#mbox").val()); if(mbox == name) { bootboxAlert(LANGUAGE[146][LANGTYPE]); return; } var command = "MOVEMAIL_ONE"; var ajaxdata = "mbox="+$.URLEncode(mbox)+"&msgid="+msgid+"&command="+command+"&destination="+destmbox; var ajaxurl = "/module/mail_action.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:false, success: function(xml) { if($("#pagetype").val()=="popup") { if($("#pagecode", opener.document).val()=="maillist") { opener.maillist_Init(); } else { if($("#pagecode", opener.document).val()=="mailview" && $.URLDecode($.URLDecode($("#mbox", opener.document).val())) == $.URLDecode($("#mbox").val()) && $("#msgid", opener.document).val()==msgid) { var timestamp = tstamp(); var page = $("#page", opener.document).val(); var showtype = $("#showtype", opener.document).val(); $(opener.location).attr("href", "/main.php#maillist%5E"+mbox+"%5E"+page+"%5E"+showtype+"%5E"+timestamp); } } window.close(); } else { var xmldata = $(xml).find("DATA"); var xmldata_quota = xmldata.find("QUOTA"); var mail_allot_quota = $.URLDecode(xmldata_quota.find("USER_QUOTA").text()); var mail_used_quota = $.URLDecode(xmldata_quota.find("MAIL_QUOTA").text()); var mail_used_percent = $.URLDecode(xmldata_quota.find("MAIL_PERCENT").text()); $("#mail-allot-quota").html(mail_allot_quota); $("#mail-used-quota").html(mail_used_quota); $("#mail-quota-bar").css("width", mail_used_percent+"%"); var page = $("#page").val(); LayerOpen("close", ""); if($("#hash").val() == "maillist") { maillist_Init(); } else { var timestamp = tstamp(); $.history.load("maillist^"+mbox+"^"+page+"^"+showtype+"^"+timestamp); } showMaillistBtn("hide"); menuMailCountInit(); } }, error: function(e) { popupModal(LANGUAGE[147][LANGTYPE]); } }); } function mailview_Init() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var mbox = $.URLDecode($("#mbox").val()); var msgid = $("#msgid").val(); var html = ""; var search_content = $("#scontent").val(); var search_type = $("#stype").val(); var showtype = $("#showtype").val(); var command = $("#scommand").val(); var pagecode = $("#pagecode").val(); $("#resend_btn").removeClass("show"); $("#resend_btn").removeClass("hide"); $("#reserve_btn").removeClass("show"); $("#reserve_btn").removeClass("hide"); $("#reply_btn").removeClass("show"); $("#reply_btn").removeClass("hide"); $("#replyall_btn").removeClass("show"); $("#replyall_btn").removeClass("hide"); $("#forward_btn").removeClass("show"); $("#forward_btn").removeClass("hide"); $("#deletemail_btn").removeClass("show"); $("#deletemail_btn").removeClass("hide"); $("#addspam_btn").removeClass("show"); $("#addspam_btn").removeClass("hide"); $("#addwhite_btn").removeClass("show"); $("#addwhite_btn").removeClass("hide"); $("#movemail_btn").removeClass("show"); $("#movemail_btn").removeClass("hide"); $("#mailview_addfunction").removeClass("show"); $("#mailview_addfunction").removeClass("hide"); $("#mailview_addfunction2").removeClass("show"); $("#mailview_addfunction2").removeClass("hide"); if(mbox=="Sent") { $("#resend_btn").addClass("show"); $("#reply_btn").addClass("show"); $("#replyall_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#addspam_btn").addClass("show"); $("#addwhite_btn").addClass("hide"); $("#movemail_btn").addClass("show"); $("#mailview_addfunction").addClass("show"); $("#reserve_btn").addClass("hide"); $("#mailview_addfunction2").addClass("hide"); } else if(mbox=="Reserved") { $("#reserve_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#mailview_addfunction2").addClass("show"); $("#resend_btn").addClass("hide"); $("#reply_btn").addClass("hide"); $("#replyall_btn").addClass("hide"); $("#addspam_btn").addClass("hide"); $("#addwhite_btn").addClass("hide"); $("#movemail_btn").addClass("hide"); $("#mailview_addfunction").addClass("hide"); } else if(mbox=="Spam") { $("#reply_btn").addClass("show"); $("#replyall_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#movemail_btn").addClass("show"); $("#mailview_addfunction").addClass("show"); $("#addspam_btn").addClass("hide"); $("#addwhite_btn").addClass("show"); $("#resend_btn").addClass("hide"); $("#reserve_btn").addClass("hide"); $("#mailview_addfunction2").addClass("hide"); } else { $("#reply_btn").addClass("show"); $("#replyall_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#addspam_btn").addClass("show"); $("#addwhite_btn").addClass("hide"); $("#movemail_btn").addClass("show"); $("#mailview_addfunction").addClass("show"); $("#resend_btn").addClass("hide"); $("#reserve_btn").addClass("hide"); $("#mailview_addfunction2").addClass("hide"); } var viewheader = $("#viewheader").val(); var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid+"&search_type="+search_type+"&search_content="+$.URLEncode(search_content)+"&showtype="+showtype+"&command="+command; var ajaxurl = "/module/mailview.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $("#search_content").val(search_content); if(search_content=="") search_type = "SUBJECT"; $("#search_type").val(search_type); LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var msgid = $("#msgid").val(); var chk_hidden = ""; if(result=="SUCCESS") { // 메일함 이름 var mailboxkoname = $.URLDecode(xmldata.find("MAILBOXNAME").text()); var boxname = $.URLDecode(xmldata.find("BOXNAME").text()); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); $("#mailbox_title").html(mailboxkoname); // 안읽은메일 갯수/전체메일 갯수 var total_count = xmldata.find("TOTAL_COUNT").text(); var unseen_count = xmldata.find("UNSEEN_COUNT").text(); $("#total_count").text(total_count); $("#unseen_count").text(unseen_count); //$("#COUNT_"+boxnameid).text(unseen_count); if(unseen_count!=0) $("#COUNT_"+boxnameid).html(unseen_count); else $("#COUNT_"+boxnameid).html(""); var starstate = xmldata.find("STARSTATE").text(); chk_hidden += msgid+"_N_S_"; if(starstate=="X") { $("#mail_headers").addClass("starred"); chk_hidden += "X"; } /* 메일 본문 시작 */ // 날짜 var datetime = $.URLDecode(xmldata.find("DATETIME").text()); $("#mailheader_date").html(datetime); $("#print_datetime").val(datetime); // Starred 설정 $("#mailheader_starred").attr("href", "javascript:setStarFlag2('"+msgid+"', 'none');"); $("#mail_headers").append(""); // 제목 var subject = $.URLDecode(xmldata.find("SUBJECT").text()); var popup_view = ""; $("#mailheader_subject").html(subject); $("#mailheader_popupview").html(popup_view); $("#print_subject").val(subject); // Message-ID var message_id = $.URLDecode(xmldata.find("MESSAGE_ID").text()); $("#message_id").val(""); if(message_id!=undefined) { $("#message_id").val(message_id); } // 보낸사람 var sender_name = $.URLDecode(xmldata.find("SENDER").find("SNAME").text()); var sender_email = xmldata.find("SENDER").find("SEMAIL").text(); var sender_html = $.URLDecode(xmldata.find("SENDER").find("SENDER_HTML").text()); var sender_html_layer = $.URLDecode(xmldata.find("SENDER").find("SENDER_HTML_LAYER").text()); $("#mailheader_sender").html(sender_html); $("#print_sender").val(sender_html_layer); // 수신인 var to_html = $.URLDecode(xmldata.find("TO_HTML").text()); var cc_html = $.URLDecode(xmldata.find("CC_HTML").text()); var bcc_html = $.URLDecode(xmldata.find("BCC_HTML").text()); var to_html_all = $.URLDecode(xmldata.find("TO_HTML_ALL").text()); var cc_html_all = $.URLDecode(xmldata.find("CC_HTML_ALL").text()); var bcc_html_all = $.URLDecode(xmldata.find("BCC_HTML_ALL").text()); var print_to = $.URLDecode(xmldata.find("PRINT_TO").text()); var print_cc = $.URLDecode(xmldata.find("PRINT_CC").text()); var print_bcc = $.URLDecode(xmldata.find("PRINT_BCC").text()); $("#to_html").val(to_html); $("#to_html_all").val(to_html_all); $("#cc_html").val(cc_html); $("#cc_html_all").val(cc_html_all); $("#bcc_html").val(bcc_html); $("#bcc_html_all").val(bcc_html_all); $("#mailheader_to").html(to_html); $("#print_to").val(print_to); if(cc_html) { $("#mailheader_cc").html(cc_html); $("#mailheader_cc_dl").css("display", "block"); $("#print_cc").val(print_cc); } if(bcc_html && (mbox == "Sent" || mbox == "Reserved" || mbox == "Drafts")) { $("#mailheader_bcc").html(bcc_html); $("#mailheader_bcc_dl").css("display", "block"); $("#print_bcc").val(print_bcc); } $('#mailheader_to a').tooltip(); $('#mailheader_cc a').tooltip(); $('#mailheader_bcc a').tooltip(); // 메일전달 정보 var forward_email = $.URLDecode(xmldata.find("FORWARD_EMAIL").text()); var sender_check = $.URLDecode(xmldata.find("SENDER_CHECK").text()); if(forward_email!="NONE" && mbox!="Reserved") { $("#mailheader_info_title").html(" "); $("#mailheader_info").html(sprintf(LANGUAGE[148][LANGTYPE], forward_email)); $("#mailheader_info_dl").removeClass("hide"); $("#mailheader_info_dl").addClass("show"); } else if(sender_check!="NONE" && mbox!="Reserved" && mbox!="Sent") { $("#mailheader_info_title").html(" "); $("#mailheader_info").html(sender_check); $("#mailheader_info_dl").removeClass("hide"); $("#mailheader_info_dl").addClass("show"); } // 예약발송 정보 var reservemail_code = ""; if(mbox=="Reserved") { var reservemail_date = $.URLDecode(xmldata.find("RESERVE_DATE").text()); var reservemail_status = $.URLDecode(xmldata.find("RESERVE_STATUS").text()); reservemail_code = $.URLDecode(xmldata.find("RESERVE_CODE").text()); $("#mailheader_info_title").html(LANGUAGE[149][LANGTYPE]); $("#mailheader_info").html(LANGUAGE[150][LANGTYPE]+" : "+reservemail_date+" | "+LANGUAGE[151][LANGTYPE]+" : "+reservemail_status+""); $("#mailheader_info_dl").removeClass("hide"); $("#mailheader_info_dl").addClass("show"); if(reservemail_code!="N") { $("#reserve_btn").removeClass("show"); $("#reserve_btn").addClass("hide"); } } $("#reservemail_code").val(reservemail_code); // 본문 var content = $.URLDecode(xmldata.find("CONTENT").text()); var print_content = $.URLDecode(xmldata.find("PRINT_CONTENT").text()); $("#mail_contents").html(content); $("#print_mail_message").val($.URLEncode(print_content)); var attach_cnt = xmldata.find("ATTACH").find("ROW").length; if(attach_cnt > 0) { $("#attach_box").css("display", ""); var ms_tnef_check = xmldata.find("MS_TNEF_CHECK").text(); var ms_ics_check = xmldata.find("MS_ICS_CHECK").text(); if(ms_tnef_check=="TRUE") { $("#attachfile_info_text").html(LANGUAGE[839][LANGTYPE]); $("#attachfile_info").removeClass("hide"); $("#attachfile_info").addClass("show"); } else if(ms_ics_check=="TRUE") { $("#attachfile_info_text").html(LANGUAGE[850][LANGTYPE]); $("#attachfile_info").removeClass("hide"); $("#attachfile_info").addClass("show"); } } $("#total_att_count").text(attach_cnt+LANGUAGE[152][LANGTYPE]); //$("#print_total_att_count").val(attach_cnt); var total_size = xmldata.find("ATTACH").find("TOTAL_SIZE").text(); if(total_size > 1024) { total_size = total_size/1024; total_size = "("+total_size.toFixed(1) + "MB)"; } else { total_size = "("+total_size+"KB)"; } $("#total_att_size").text(total_size); $("#print_total_att_size").val(total_size); var downloadlist = $.URLDecode(xmldata.find("ATTACH").find("DOWNLOADLIST").text()); var print_downloadlist = $.URLDecode(xmldata.find("ATTACH").find("PRINT_DOWNLOADLIST").text()); var saveall = $.URLDecode(xmldata.find("ATTACH").find("SAVEALL").text()); $("#saveall").html(saveall); $("#attachfile").html(downloadlist); $("#print_attachfile").html(print_downloadlist); var list_html = ""; var next_list = xmldata.find("NEXT_LIST"); if(next_list.length > 0) { var next_msgno = next_list.find("NEXT_MSGNO").text(); var next_subject = $.URLDecode(next_list.find("NEXT_SUBJECT").text()); var next_sender_name = $.URLDecode(next_list.find("NEXT_SENDER").find("NEXT_SENDER_NAME").text()); var next_sender_all = $.URLDecode(next_list.find("NEXT_SENDER").find("NEXT_SENDER_ALL").text()); var next_date = $.URLDecode(next_list.find("NEXT_DATE").text()); var next_status = next_list.find("NEXT_STATUS").text(); var next_starred = next_list.find("NEXT_STARSTATE").text(); var chk_hidden = next_msgno+"_N_"; var mail_icon = ""; list_html += "
  • "; list_html += " "; list_html += "
    "; list_html += "
    "; list_html += "
    "; list_html += "
    "+next_sender_name+"
    "; list_html += "
    "; list_html += "
    "+next_subject+"
    "; list_html += "
    "; list_html += "
    "+next_date+"
    "; list_html += "
  • "; $("#mailview_list_up").html("
  • "+LANGUAGE[198][LANGTYPE]+"
    "); } else { $("#mailview_list_up").html("
  • "+LANGUAGE[198][LANGTYPE]); } var prev_list = xmldata.find("PREV_LIST"); if(prev_list.length > 0) { var prev_msgno = prev_list.find("PREV_MSGNO").text(); var prev_subject = $.URLDecode(prev_list.find("PREV_SUBJECT").text()); var prev_sender_name = $.URLDecode(prev_list.find("PREV_SENDER").find("PREV_SENDER_NAME").text()); var prev_sender_all = $.URLDecode(prev_list.find("PREV_SENDER").find("PREV_SENDER_ALL").text()); var prev_date = $.URLDecode(prev_list.find("PREV_DATE").text()); var prev_status = prev_list.find("PREV_STATUS").text(); var prev_starred = prev_list.find("PREV_STARSTATE").text(); var chk_hidden = next_msgno+"_N_"; var mail_icon = ""; list_html += "
  • "; list_html += " "; list_html += "
    "; list_html += "
    "; list_html += "
    "; list_html += "
    "+prev_sender_name+"
    "; list_html += "
    "; list_html += "
    "+prev_subject+"
    "; list_html += "
    "; list_html += "
    "+prev_date+"
    "; list_html += "
  • "; $("#mailview_list_down").html(""+LANGUAGE[199][LANGTYPE]+"
  • "); } else { $("#mailview_list_down").html(LANGUAGE[199][LANGTYPE]+"
  • "); } if(list_html!="") { list_html = "
      " + list_html + "
    "; } if(pagecode!="mailview_unseen") { $("#maillist").html(list_html); } //alert($("#mail_contents").css("width")); LayerOpen("close", ""); if(viewheader=="1") { showMailinfo(); } } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } else { popupModal(message); } } }, error: function(e) { LayerOpen("close", ""); popupModal(LANGUAGE[153][LANGTYPE]); } }); LayerOpen("close",""); } function mailviewPopup_Init() { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); //2022-03-14//var mbox = $.URLDecode($("#mbox").val()); var mbox = decodeURIComponent($("#mbox").val()); var msgid = $("#msgid").val(); var html = ""; var search_content = $("#scontent").val(); $("#search_content").val(search_content); $("#resend_btn").removeClass("show"); $("#resend_btn").removeClass("hide"); $("#reserve_btn").removeClass("show"); $("#reserve_btn").removeClass("hide"); $("#reply_btn").removeClass("show"); $("#reply_btn").removeClass("hide"); $("#replyall_btn").removeClass("show"); $("#replyall_btn").removeClass("hide"); $("#forward_btn").removeClass("show"); $("#forward_btn").removeClass("hide"); $("#deletemail_btn").removeClass("show"); $("#deletemail_btn").removeClass("hide"); $("#addspam_btn").removeClass("show"); $("#addspam_btn").removeClass("hide"); $("#addwhite_btn").removeClass("show"); $("#addwhite_btn").removeClass("hide"); $("#movemail_btn").removeClass("show"); $("#movemail_btn").removeClass("hide"); $("#mailview_addfunction").removeClass("show"); $("#mailview_addfunction").removeClass("hide"); $("#mailview_addfunction2").removeClass("show"); $("#mailview_addfunction2").removeClass("hide"); if(mbox=="Sent") { $("#resend_btn").addClass("show"); $("#reply_btn").addClass("show"); $("#replyall_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#addspam_btn").addClass("show"); $("#addwhite_btn").addClass("hide"); $("#movemail_btn").addClass("show"); $("#mailview_addfunction").addClass("show"); $("#reserve_btn").addClass("hide"); $("#mailview_addfunction2").addClass("hide"); } else if(mbox=="Reserved") { $("#reserve_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#mailview_addfunction2").addClass("show"); $("#resend_btn").addClass("hide"); $("#reply_btn").addClass("hide"); $("#replyall_btn").addClass("hide"); $("#addspam_btn").addClass("hide"); $("#addwhite_btn").addClass("hide"); $("#movemail_btn").addClass("hide"); $("#mailview_addfunction").addClass("hide"); } else if(mbox=="Spam") { $("#reply_btn").addClass("show"); $("#replyall_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#movemail_btn").addClass("show"); $("#mailview_addfunction").addClass("show"); $("#addspam_btn").addClass("hide"); $("#addwhite_btn").addClass("show"); $("#resend_btn").addClass("hide"); $("#reserve_btn").addClass("hide"); $("#mailview_addfunction2").addClass("hide"); } else { $("#reply_btn").addClass("show"); $("#replyall_btn").addClass("show"); $("#forward_btn").addClass("show"); $("#deletemail_btn").addClass("show"); $("#addspam_btn").addClass("show"); $("#addwhite_btn").addClass("hide"); $("#movemail_btn").addClass("show"); $("#mailview_addfunction").addClass("show"); $("#resend_btn").addClass("hide"); $("#reserve_btn").addClass("hide"); $("#mailview_addfunction2").addClass("hide"); } var viewheader = $("#viewheader").val(); var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid; var ajaxurl = "/module/mailview.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } LayerOpen("open", ""); $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var msgid = $("#msgid").val(); var chk_hidden = ""; if(result=="SUCCESS") { // 메일함 이름 var mailboxkoname = $.URLDecode(xmldata.find("MAILBOXNAME").text()); var boxname = $.URLDecode(xmldata.find("BOXNAME").text()); var boxcountid = $.URLDecode(xmldata.find("BOXCOUNTID").text()); var boxnameid = boxcountid.replace(/\./g, "_"); boxnameid = boxnameid.replace(/\,/g, "_"); boxnameid = boxnameid.replace(/\ /g, "_"); boxnameid = boxnameid.replace(/\(/gi, "BRACKET_"); boxnameid = boxnameid.replace(/\)/gi, "_BRACKET"); boxnameid = boxnameid.replace(/\+/gi, "__PLUS__"); //2018-01-29//$("#mailbox_title").html(mailboxkoname); // 안읽은메일 갯수/전체메일 갯수 var total_count = xmldata.find("TOTAL_COUNT").text(); var unseen_count = xmldata.find("UNSEEN_COUNT").text(); /***2018-01-29 $("#total_count").text(total_count); $("#unseen_count").text(unseen_count); ***/ //$("#COUNT_"+boxnameid).text(unseen_count); if(unseen_count!=0) $("#COUNT_"+boxnameid, opener.document).html(unseen_count); else $("#COUNT_"+boxnameid, opener.document).html(""); var starstate = xmldata.find("STARSTATE").text(); chk_hidden += msgid+"_N_S_"; if(starstate=="X") { $("#mail_headers").addClass("starred"); chk_hidden += "X"; } /* 메일 본문 시작 */ // 날짜 var datetime = $.URLDecode(xmldata.find("DATETIME").text()); $("#mailheader_date").html(datetime); $("#print_datetime").val(datetime); // Starred 설정 $("#mailheader_starred").attr("href", "javascript:setStarFlag2('"+msgid+"', 'none');"); $("#mail_headers").append(""); // 제목 var subject = $.URLDecode(xmldata.find("SUBJECT").text()); $("#mailheader_subject").html(subject); $("#print_subject").val(subject); // Message-ID var message_id = $.URLDecode(xmldata.find("MESSAGE_ID").text()); $("#message_id").val(""); if(message_id!=undefined) { $("#message_id").val(message_id); } // 보낸사람 var sender_name = $.URLDecode(xmldata.find("SENDER").find("SNAME").text()); var sender_email = xmldata.find("SENDER").find("SEMAIL").text(); var sender_html = $.URLDecode(xmldata.find("SENDER").find("SENDER_HTML").text()); var sender_html_layer = $.URLDecode(xmldata.find("SENDER").find("SENDER_HTML_LAYER").text()); $("#mailheader_sender").html(sender_html); $("#print_sender").val(sender_html_layer); // 수신인 var to_html = $.URLDecode(xmldata.find("TO_HTML").text()); var cc_html = $.URLDecode(xmldata.find("CC_HTML").text()); var bcc_html = $.URLDecode(xmldata.find("BCC_HTML").text()); var to_html_all = $.URLDecode(xmldata.find("TO_HTML_ALL").text()); var cc_html_all = $.URLDecode(xmldata.find("CC_HTML_ALL").text()); var bcc_html_all = $.URLDecode(xmldata.find("BCC_HTML_ALL").text()); var print_to = $.URLDecode(xmldata.find("PRINT_TO").text()); var print_cc = $.URLDecode(xmldata.find("PRINT_CC").text()); var print_bcc = $.URLDecode(xmldata.find("PRINT_BCC").text()); $("#mailheader_to").html(to_html); $("#print_to").val(print_to); if(cc_html) { $("#mailheader_cc").html(cc_html); $("#mailheader_cc_dl").css("display", "block"); $("#print_cc").val(print_cc); } if(bcc_html && (mbox == "Sent" || mbox == "Reserved" || mbox == "Drafts")) { $("#mailheader_bcc").html(bcc_html); $("#mailheader_bcc_dl").css("display", "block"); $("#print_bcc").val(print_bcc); } $('#mailheader_to a').tooltip(); $('#mailheader_cc a').tooltip(); $('#mailheader_bcc a').tooltip(); // 메일전달 정보 var forward_email = $.URLDecode(xmldata.find("FORWARD_EMAIL").text()); var sender_check = $.URLDecode(xmldata.find("SENDER_CHECK").text()); if(forward_email!="NONE" && mbox!="Reserved") { $("#mailheader_info_title").html(" "); $("#mailheader_info").html(sprintf(LANGUAGE[148][LANGTYPE], forward_email)); $("#mailheader_info_dl").removeClass("hide"); $("#mailheader_info_dl").addClass("show"); } else if(sender_check!="NONE" && mbox!="Reserved" && mbox!="Sent") { $("#mailheader_info_title").html(" "); $("#mailheader_info").html(sender_check); $("#mailheader_info_dl").removeClass("hide"); $("#mailheader_info_dl").addClass("show"); } // 예약발송 정보 var reservemail_code = ""; if(mbox=="Reserved") { var reservemail_date = $.URLDecode(xmldata.find("RESERVE_DATE").text()); var reservemail_status = $.URLDecode(xmldata.find("RESERVE_STATUS").text()); reservemail_code = $.URLDecode(xmldata.find("RESERVE_CODE").text()); $("#mailheader_info_title").html(LANGUAGE[149][LANGTYPE]); $("#mailheader_info").html(LANGUAGE[150][LANGTYPE]+" : "+reservemail_date+" | "+LANGUAGE[151][LANGTYPE]+" : "+reservemail_status+""); $("#mailheader_info_dl").removeClass("hide"); $("#mailheader_info_dl").addClass("show"); if(reservemail_code!="N") { $("#reserve_btn").removeClass("show"); $("#reserve_btn").addClass("hide"); } } $("#reservemail_code").val(reservemail_code); // 본문 var content = $.URLDecode(xmldata.find("CONTENT").text()); $("#mail_contents").html(content); $("#print_mail_message").val($.URLEncode(content)); var attach_cnt = xmldata.find("ATTACH").find("ROW").length; if(attach_cnt > 0) { $("#attach_box").css("display", ""); var ms_tnef_check = xmldata.find("MS_TNEF_CHECK").text(); var ms_ics_check = xmldata.find("MS_ICS_CHECK").text(); if(ms_tnef_check=="TRUE") { $("#attachfile_info_text").html(LANGUAGE[836][LANGTYPE]); $("#attachfile_info").removeClass("hide"); $("#attachfile_info").addClass("show"); } else if(ms_ics_check=="TRUE") { $("#attachfile_info_text").html(LANGUAGE[850][LANGTYPE]); $("#attachfile_info").removeClass("hide"); $("#attachfile_info").addClass("show"); } } $("#total_att_count").text(attach_cnt+""+LANGUAGE[152][LANGTYPE]); //$("#print_total_att_count").val(attach_cnt); var total_size = xmldata.find("ATTACH").find("TOTAL_SIZE").text(); if(total_size > 1024) { total_size = total_size/1024; total_size = "("+total_size.toFixed(1) + "MB)"; } else { total_size = "("+total_size+"KB)"; } $("#total_att_size").text(total_size); $("#print_total_att_size").val(total_size); var downloadlist = $.URLDecode(xmldata.find("ATTACH").find("DOWNLOADLIST").text()); var print_downloadlist = $.URLDecode(xmldata.find("ATTACH").find("PRINT_DOWNLOADLIST").text()); var saveall = $.URLDecode(xmldata.find("ATTACH").find("SAVEALL").text()); $("#saveall").html(saveall); $("#attachfile").html(downloadlist); $("#print_attachfile").html(print_downloadlist); /*** var list_html = ""; var next_list = xmldata.find("NEXT_LIST"); if(next_list.length > 0) { var next_msgno = next_list.find("NEXT_MSGNO").text(); var next_subject = $.URLDecode(next_list.find("NEXT_SUBJECT").text()); var next_sender_name = $.URLDecode(next_list.find("NEXT_SENDER").find("NEXT_SENDER_NAME").text()); var next_sender_all = $.URLDecode(next_list.find("NEXT_SENDER").find("NEXT_SENDER_ALL").text()); var next_date = $.URLDecode(next_list.find("NEXT_DATE").text()); var next_status = next_list.find("NEXT_STATUS").text(); var next_starred = next_list.find("NEXT_STARSTATE").text(); var chk_hidden = next_msgno+"_N_"; var mail_icon = ""; list_html += "
  • "; list_html += " "; list_html += "
    "; list_html += "
    "; list_html += "
    "; list_html += "
    "+next_sender_name+"
    "; list_html += "
    "; list_html += "
    "+next_subject+"
    "; list_html += "
    "; list_html += "
    "+next_date+"
    "; list_html += "
  • "; $("#mailview_list_up").html("
  • "); } else { $("#mailview_list_up").html("
  • 위"); } var prev_list = xmldata.find("PREV_LIST"); if(prev_list.length > 0) { var prev_msgno = prev_list.find("PREV_MSGNO").text(); var prev_subject = $.URLDecode(prev_list.find("PREV_SUBJECT").text()); var prev_sender_name = $.URLDecode(prev_list.find("PREV_SENDER").find("PREV_SENDER_NAME").text()); var prev_sender_all = $.URLDecode(prev_list.find("PREV_SENDER").find("PREV_SENDER_ALL").text()); var prev_date = $.URLDecode(prev_list.find("PREV_DATE").text()); var prev_status = prev_list.find("PREV_STATUS").text(); var prev_starred = prev_list.find("PREV_STARSTATE").text(); var chk_hidden = next_msgno+"_N_"; var mail_icon = ""; list_html += "
  • "; list_html += " "; list_html += "
    "; list_html += "
    "; list_html += "
    "; list_html += " "; list_html += "
    "; list_html += "
    "+prev_subject+"
    "; list_html += "
    "; list_html += "
    "+prev_date+"
    "; list_html += "
  • "; $("#mailview_list_down").html("아래
  • "); } else { $("#mailview_list_down").html("아래
  • "); } if(list_html!="") { list_html = "
      " + list_html + "
    "; } $("#maillist").html(list_html); ***/ //alert($("#mail_contents").css("width")); if(viewheader=="1") { showMailinfo(); } } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } else { popupModal(message); } } }, error: function(e) { popupModal(LANGUAGE[153][LANGTYPE]); } }); LayerOpen("close",""); } // 메일리스트 간편보기 function mailSimpleLoad(muid) { var offset = $("#mailuid_"+muid).offset(); var id = $("#preview_muid").val(); if(muid!=id) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var chk = $("input:checkbox[name='muid[]']"); var msgid = chk[muid].value; var mbox = $.URLDecode($("#mbox").val()); var html = ""; var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid; var ajaxurl = "/module/mailsimpleview.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { // 본문 var content = $.URLDecode(xmldata.find("CONTENT").text()); $("#mail_simple_preview").text(content); $("#preview_muid").val(muid); $("#mail_simple_load_box").css("top", offset.top + 30); $("#mail_simple_load_box").removeClass("uplus-box-hide"); $("#mail_simple_load_box").addClass("uplus-box-show"); } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } else { popupModal(message); } } }, error: function(e) { popupModal(LANGUAGE[153][LANGTYPE]); } }); } else { if($("#mail_simple_load_box").css("display")=="none") { $("#preview_muid").val(muid); $("#mail_simple_load_box").css("top", offset.top + 30); $("#mail_simple_load_box").removeClass("uplus-box-hide"); $("#mail_simple_load_box").addClass("uplus-box-show"); } else { $("#mail_simple_load_box").removeClass("uplus-box-show"); $("#mail_simple_load_box").addClass("uplus-box-hide"); } } } // 읽지않은 메일 리스트 간편보기 function mailSimpleLoad_unseen(mbox, muid) { var offset = $("#mailuid_"+muid).offset(); var id = $("#preview_muid").val(); if(muid!=id) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var chk = $("input:checkbox[name='muid[]']"); var msgid = chk[muid].value; var mbox = $.URLDecode(mbox); var html = ""; var ajaxdata = "mbox="+encodeURIComponent(mbox)+"&msgid="+msgid; var ajaxurl = "/module/mailsimpleview.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type:"POST", url: ajaxurl, data: ajaxdata, dataType:"xml", cache:true, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { // 본문 var content = $.URLDecode(xmldata.find("CONTENT").text()); $("#mail_simple_preview").text(content); $("#preview_muid").val(muid); $("#mail_simple_load_box").css("top", offset.top + 30); $("#mail_simple_load_box").removeClass("uplus-box-hide"); $("#mail_simple_load_box").addClass("uplus-box-show"); } else { LayerOpen("close", ""); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } else { popupModal(message); } } }, error: function(e) { popupModal(LANGUAGE[153][LANGTYPE]); } }); } else { if($("#mail_simple_load_box").css("display")=="none") { $("#preview_muid").val(muid); $("#mail_simple_load_box").css("top", offset.top + 30); $("#mail_simple_load_box").removeClass("uplus-box-hide"); $("#mail_simple_load_box").addClass("uplus-box-show"); } else { $("#mail_simple_load_box").removeClass("uplus-box-show"); $("#mail_simple_load_box").addClass("uplus-box-hide"); } } } // 메일리스트 간편보기 HIDE function mailSimpleLoadHide() { if($("#mail_simple_load_box").css("display")!="none") { $("#mail_simple_load_box").removeClass("uplus-box-show"); $("#mail_simple_load_box").addClass("uplus-box-hide"); } } function attach_upload() { var agt = navigator.userAgent.toLowerCase(); if(agt.indexOf("msie") != -1) { var form = document.composeForm; $("#attach_uploading").val("1"); $.ajaxFileUpload ({ url:"/module/upload_attachfile.php", secureurl:false, fileElementId:"fileselect", dataType:"json", data:{name:"frm", id:"frm"}, success: function (data, status) { if(typeof(data.error) != 'undefined') { if(data.error != '') { $("#attach_uploading").val("0"); alert(data.error); } else { $("#attach_uploading").val("0"); var filename = decodeURIComponent(data.filename); var filesize = data.filesize; var filesize_org = filesize; var filedir = data.attach_dir; var fileattachtype = data.fileattachtype; var en_filename = data.en_filename; var filetype = data.filetype; var fileattachtype_html = ""; var fileattachtype_change = ""; var attachcount = $("input[name='mail_f']").length; var attach_total_count = parseInt($("#attach_total_count").val()); attach_total_count++; $("#attach_total_count").val(attach_total_count); if(filesize > 1024) { filesize = parseInt(filesize / 1024); if(filesize > 1024) { filesize = parseInt(filesize / 1024); if(filesize > 1024) { filesize = parseInt(filesize / 1024)+"GB"; } else { filesize += "MB"; } } else { filesize += "KB"; } } else { filesize += "B"; } if(fileattachtype == "NORMAL") { fileattachtype_html = LANGUAGE[155][LANGTYPE]; fileattachtype_change = ""+LANGUAGE[237][LANGTYPE]+""; } else { fileattachtype_html = LANGUAGE[156][LANGTYPE]; } var attach_html = ""+ " "+ "
    "+ "
    "+filesize+"
    "+ " "+ "
    "+fileattachtype_html+""+fileattachtype_change+"
    "+ " "+ " "+ " "+ " "+ " "+ " "+ ""; $("#attachfile_list").append(attach_html); $("#messages").css("display","none"); $("#attachfile_box").css("display", ""); } } } }) } } /*** function mailSignChange(n) { } ***/ function popupReceiver(checkTab) { var request_url = $("#requestUrl").val(); var request_type = $("#requestType").val(); var tocken = $("#inputTocken").val(); var receiver_form_type = $("#receiver_form_type").val(); var ajaxdata = "command=popupview"; var ajaxurl = "/module/orgtree.php"; if(request_type=="SSL") { var request_port = $("#requestPort").val(); ajaxdata += "&tocken="+tocken; ajaxurl = "https://"+request_url+ajaxurl; if(request_port!="443") ajaxurl+= ":"+request_port } $.ajax({ type:"POST", url:ajaxurl, data:ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); if(result=="SUCCESS") { $("#popupUserOrgData").val($.URLDecode(xmldata.find("ORGDATA1").text())); $("#popupUserAddrData").val($.URLDecode(xmldata.find("ADDRBOOKDATA").text())); var orgdata = JSON.parse($.URLDecode(xmldata.find("ORGDATA1").text())); var addrdata = JSON.parse($.URLDecode(xmldata.find("ADDRBOOKDATA").text())); var recentdata = JSON.parse($("#recentlist_data").val()); var organizationObj; var addrbookObj; var setting1 = { data: { simpleData: { enable: true } }, callback: { onClick: popupReceiverAddOrg } }; var setting2 = { data: { simpleData: { enable: true } }, callback: { onClick: popupReceiverAddAddr } }; var orgNodes = orgdata; var addrNodes = addrdata; if($("#orgchart").val()=="Y" && $("#orgchart_addressbook").val()=="Y") { organizationObj = $.fn.zTree.init($("#popup_orgtree_box"), setting1, orgNodes); } addrbookObj = $.fn.zTree.init($("#popup_addrtree_box"), setting2, addrNodes); var receiver_to_html = ""; if(receiver_form_type=="INPUT") { var receiver_to = $("input:hidden[name='mail-to_receiver[]']"); receiver_to.each(function() { var email_val = this.value; var email_text = email_val.replace(//g,'>'); receiver_to_html+= ""; }); } else { var optsize = $("#select-to option").size(); for(var i=0; i/g,'>'); receiver_to_html+= ""; } } $("#select_receiverlist_to").html(receiver_to_html); var receiver_cc_html = ""; if(receiver_form_type=="INPUT") { var receiver_cc = $("input:hidden[name='mail-cc_receiver[]']"); receiver_cc.each(function() { var email_val = this.value; var email_text = email_val.replace(//g,'>'); receiver_cc_html+= ""; }); } else { var optsize = $("#select-cc option").size(); for(var i=0; i/g,'>'); receiver_cc_html+= ""; } } $("#select_receiverlist_cc").html(receiver_cc_html); var receiver_bcc_html = ""; if(receiver_form_type=="INPUT") { var receiver_bcc = $("input:hidden[name='mail-bcc_receiver[]']"); receiver_bcc.each(function() { var email_val = this.value; var email_text = email_val.replace(//g,'>'); receiver_bcc_html+= ""; }); } else { var optsize = $("#select-bcc option").size(); for(var i=0; i/g,'>'); receiver_bcc_html+= ""; } } $("#select_receiverlist_bcc").html(receiver_bcc_html); $("#popup_receiver_to_li").removeClass("active"); $("#popup_receiver_cc_li").removeClass("active"); $("#popup_receiver_bcc_li").removeClass("active"); $("#popup_receiver_to").removeClass("active"); $("#popup_receiver_cc").removeClass("active"); $("#popup_receiver_bcc").removeClass("active"); if(checkTab=="to") { $("#popup_receiver_to_li").addClass("active"); $("#popup_receiver_to").addClass("active"); } if(checkTab=="cc") { $("#popup_receiver_cc_li").addClass("active"); $("#popup_receiver_cc").addClass("active"); } if(checkTab=="bcc") { $("#popup_receiver_bcc_li").addClass("active"); $("#popup_receiver_bcc").addClass("active"); } var select_recentlist_html = ""; if(recentdata.length>0) { for(var i=0; i/g,'>'); select_recentlist_html += ""; } } $("#select_recentlist").html(select_recentlist_html); $("#popup_receiver").modal({backdrop: 'static', keyboard: false, toggle: true}); } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } popupModal(message); } }, error: function(e) { popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); } }); } function mailSend(mode) { var command = $("#command").val(); var external_send_check = $("#externalSendCheck").val(); var external_mailsend_permit = $("#external_mailsend_permit").val(); var external_send = $("#external_send").val(); var receiver_form_type = $("#receiver_form_type").val(); //if(command=="SENDMAILME") mode = command; if($("#attach_uploading").val() > 0) { popupModal(LANGUAGE[157][LANGTYPE]); return; } if($("#mailwrite_securityuse").attr("checked")) { if($("#mailwrite_securitypass").val()=="") { popupModal(LANGUAGE[158][LANGTYPE]); return; } } if($("#reserve_date").val()!="") { mode = "RESERVEMAIL"; if($("#mailwrite_securityuse").is(":checked")==true) { popupModal(LANGUAGE[159][LANGTYPE], "400"); return; } //popupModal('메일 예약발송은 현재 서비스 준비중입니다.') //return; } if(receiver_form_type=="INPUT") { if($("#mail-to").val()=="" && mode!="DRAFTS") { popupModal(LANGUAGE[160][LANGTYPE]); return; } } else { if($("#select-to option").size() < 1 && mode!="DRAFTS" && command!="SENDMAILME") { popupModal(LANGUAGE[160][LANGTYPE]); return; } } if(mode!="DRAFTS" && mode!="SENDMAILME" && command!="SENDMAILME") { if(external_send_check=="YES") { var chk_receiver_to = ""; var chk_receiver_cc = ""; var chk_receiver_bcc = ""; if(receiver_form_type=="INPUT") { $("input[name='mail-to_receiver[]']").each(function() { if(chk_receiver_to!="") { chk_receiver_to += "^||^"+$(this).val(); } else { chk_receiver_to += $(this).val(); } }); $("input[name='mail-cc_receiver[]']").each(function() { if(chk_receiver_cc!="") { chk_receiver_cc += "^||^"+$(this).val(); } else { chk_receiver_cc += $(this).val(); } }); $("input[name='mail-bcc_receiver[]']").each(function() { if(chk_receiver_bcc!="") { chk_receiver_bcc += "^||^"+$(this).val(); } else { chk_receiver_bcc += $(this).val(); } }); } else { var optsize_to = $("#select-to option").size(); for(var i=0; i "+$("#loadingLayer2").css("display")); if($("#loadingLayer2").css("display")!="none") { //console.log("loadingLayer2 1=> display: "+$("#loadingLayer2").css("display")); return; } LayerOpen2("open"); $.ajax({ type:"POST", url:ajaxurl, data:ajaxdata, dataType:"xml", cache:false, success: function(xml) { var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var external_send_checkrslt = $.URLDecode(xmldata.find("EXTERNAL_SEND_CHECK").text()); var external_send_message = $.URLDecode(xmldata.find("EXTERNAL_SEND_MESSAGE").text()); if(result=="SUCCESS") { if(external_send_checkrslt=="REMOTE" && external_send_message!=undefined && external_send_message!="") { var check_message = "

    "+external_send_message+"
    "+LANGUAGE[161][LANGTYPE]+"

    "; var boxclass = "bootbox-md"; } else { var check_message = "

    "+LANGUAGE[161][LANGTYPE]+"

    "; var boxclass = "bootbox-sm"; } LayerOpen2("close"); bootbox.dialog({ message: check_message, buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function(e) { e.preventDefault(); //console.log("mailSend ==> 1"); Sendmail(mode); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { return; } } }, className: boxclass }); } else { LayerOpen2("close"); var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } popupModal(message); } }, error: function(e) { LayerOpen2("close"); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); } }); } else if(external_mailsend_permit=="YES" && external_send=="N") { var chk_receiver_to = ""; var chk_receiver_cc = ""; var chk_receiver_bcc = ""; if(receiver_form_type=="INPUT") { $("input[name='mail-to_receiver[]']").each(function() { if(chk_receiver_to!="") { chk_receiver_to += "^||^"+$(this).val(); } else { chk_receiver_to += $(this).val(); } }); $("input[name='mail-cc_receiver[]']").each(function() { if(chk_receiver_cc!="") { chk_receiver_cc += "^||^"+$(this).val(); } else { chk_receiver_cc += $(this).val(); } }); $("input[name='mail-bcc_receiver[]']").each(function() { if(chk_receiver_bcc!="") { chk_receiver_bcc += "^||^"+$(this).val(); } else { chk_receiver_bcc += $(this).val(); } }); } else { var optsize_to = $("#select-to option").size(); for(var i=0; i "+$("#loadingLayer2").css("display")); if($("#loadingLayer2").css("display")!="none") { //console.log("loadingLayer2 2=> display: "+$("#loadingLayer2").css("display")); return; } LayerOpen2("open"); $.ajax({ type:"POST", url:ajaxurl, data:ajaxdata, dataType:"xml", cache:false, success: function(xml) { LayerOpen2("close"); var xmldata = $(xml).find("DATA"); var result = xmldata.find("RESULT").text(); var message = $.URLDecode(xmldata.find("MESSAGE").text()); var external_send_checkrslt = $.URLDecode(xmldata.find("EXTERNAL_SEND_CHECK").text()); var external_send_message = $.URLDecode(xmldata.find("EXTERNAL_SEND_MESSAGE").text()); if(result=="SUCCESS") { if(external_send_checkrslt=="REMOTE" && external_send_message!=undefined && external_send_message!="") { var check_message = "

    "+external_send_message+"

    "; var boxclass = "bootbox-md"; bootbox.dialog({ message: check_message, buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function() { return; } } }, className: boxclass }); } else { var check_message = "

    "+LANGUAGE[161][LANGTYPE]+"

    "; var boxclass = "bootbox-sm"; bootbox.dialog({ message: check_message, buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function(e) { e.preventDefault(); //console.log("mailSend ==> 2"); Sendmail(mode); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { return; } } }, className: boxclass }); } } else { var error_type = $.URLDecode(xmldata.find("ERRORTYPE").text()); if(error_type=="CHECKLOGIN") { bootbox.dialog({ message: LANGUAGE[851][LANGTYPE], buttons: { danger: { label: "확인", className: "btn-primary", callback: function() { $(location).attr("href", "/login.php"); } } }, className: "bootbox-sm" }); return; } popupModal(message); } }, error: function(e) { LayerOpen2("close"); popupModal(LANGUAGE[13][LANGTYPE]+"
    "+LANGUAGE[14][LANGTYPE]); } }); } else { bootbox.dialog({ message: "

    "+LANGUAGE[161][LANGTYPE]+"

    ", buttons: { danger: { label: LANGUAGE[114][LANGTYPE], className: "btn-primary", callback: function(e) { e.preventDefault(); //console.log("mailSend ==> 3"); Sendmail(mode); } }, main: { label: LANGUAGE[115][LANGTYPE], className: "btn-default", callback: function() { return; } } }, className: "bootbox-sm" }); } } else { Sendmail(mode); } return; } // 메일발송 function Sendmail(mode) { //console.log("Sendmail ==>"); LayerOpen2("open", LANGUAGE[162][LANGTYPE]); var receiver_form_type = $("#receiver_form_type").val(); var mailbox = $("#mbox").val(); var contents = CrossEditor.GetBodyValue(); var contents_text = CrossEditor.GetTextValue(); $("#send_mode").val(mode); $("#contents").val(contents); $("#mailbox").val(mailbox); $("#contents_text").val(contents_text); $("#completeSubject").val(""); $("#completeToList").val(""); $("#completeCcList").val(""); $("#completeBccList").val(""); //첨부파일 하나의 hidden 값에 입력 var attach_total_count = $("#attach_total_count").val(); var attach_filename = ""; var attach_dir = ""; var attach_en_filename = ""; var attach_filetype = ""; var attach_fileattachtype = ""; $("input[name='tmp_attach_filename']").each(function() { if($(this).val() != "") { if(attach_filename == "") { attach_filename = $(this).val(); } else { attach_filename += "|"+$(this).val(); } } }); $("input[name='tmp_attach_dir']").each(function() { if($(this).val() != "") { if(attach_dir == "") { attach_dir = $(this).val(); } else { attach_dir += "|"+$(this).val(); } } }); $("input[name='tmp_attach_en_filename']").each(function() { if($(this).val() != "") { if(attach_en_filename == "") { attach_en_filename = $(this).val(); } else { attach_en_filename += "|"+$(this).val(); } } }); $("input[name='tmp_filetype']").each(function() { if($(this).val() != "") { if(attach_filetype == "") { attach_filetype = $(this).val(); } else { attach_filetype += "|"+$(this).val(); } } }); $("input[name='tmp_fileattachtype']").each(function() { if($(this).val() != "") { if(attach_fileattachtype == "") { attach_fileattachtype = $(this).val(); } else { attach_fileattachtype += "|"+$(this).val(); } } }); if(receiver_form_type=="SELECT") { var optsize_to = $("#select-to option").size(); var chk_receiver_to = ""; for(var i=0; i