1/* 2 íì´ì§ìì ì¼ì´ëë ì´ë²¤í¸(í´ë¦, ì´ë, ì ë ¥ ë±ë±)ì ëí ì²´í¬ë¥¼ ìí js (ì¶í ì¬ì©ìì ì´ë²¤í¸ ì²´í¬ í ë°ì´í° ìì§ì ìí´ ë¶ë¦¬ìì±) 3 */ 4var SECURITY_PRIVACY = function(){ //ê°ì¸ì ë³´ ë³´í¸ ì¤ì ê´ë ¨ ì´ë²¤í¸ 5 6 var ONE_MINUTE = 60 * 1000; //1ë¶ 7 var TWO_MINUTES = 2 * 60 * 1000; //2ë¶ 8 var NEXT_ACTION_TIME_LOCAL_STORAGE_KEY = 'NEXT_ACTION_TIME'; 9 10 var event_setting_timer; //ë§ì°ì¤, í¤ë³´ë ì´ë²¤í¸ ë±ë¡ë기ê¹ì§ì íì´ë¨¸ 11 var logout_warning_timer; //ë¡ê·¸ìì ê²½ê³ ì¶ë ¥ë기ê¹ì§ì íì´ë¨¸ 12 var auto_logout_timer; //ìë ë¡ê·¸ìì ë기ê¹ì§ íì´ë¨¸ 13 14 var setAutoLogoutEvent = function(auto_logout_time){ 15 16 if(IS_IE){ 17 if(typeof event_setting_timer !== 'undefined'){ 18 clearTimeout(event_setting_timer); 19 } 20 if(typeof logout_warning_timer !== 'undefined'){ 21 clearTimeout(logout_warning_timer); 22 } 23 if(typeof auto_logout_timer !== 'undefined'){ 24 clearTimeout(auto_logout_timer); 25 } 26 27 window.addEventListener('storage', function(e){ 28 //IEì¼ ê²½ì° localstorage ë기í ì²ë¦¬ë¥¼ ìí´ ë¦¬ì¤ë를 ë±ë¡ - ë±ë¡íë©´ ìëì¼ë¡ ë기í ì²ë¦¬ë¨ 29 }); 30 }else{ 31 deleteTimeout(); 32 } 33 34 removeFocusListner(); //ì°½ì´ 2ê°ì´ìì¼ê²½ì° ìë¡ íìì´ ì í ë ë í¬ì»¤ì¤ 리ì¤ë ì ê±° 35 36 //ê°ì ë¸ë¼ì°ì ì ì°½ì´ ì¬ë¬ê°ì¼ ê²½ì° íëë¼ë ì¬ì©ì¤ì´ë©´ 미ì¬ì©ì¤ì¸ ë¸ë¼ì°ì ì timeoutì´ ëììëëë¡ ë¹êµí기ìí ìê° ì ì¥ 37 var next_action_time = new Date(); 38 next_action_time.setMinutes(next_action_time.getMinutes() + 1); 39 40 LOCAL_STORAGE.setLocalStorage(NEXT_ACTION_TIME_LOCAL_STORAGE_KEY, next_action_time); 41 42 event_setting_timer = setTimeout(function(){ 43 setActionEvent(auto_logout_time); // ë¡ê·¸ììíì = 1 44 }, ONE_MINUTE); 45 }; 46 47 var openChangePasswordNotice = function(month_notice){ 48 $.cocoaDialog.close(); 49 $.ajax({ 50 type : "POST", 51 url : ("/ajax/change_password_notice.cm"), 52 data : {month_notice : month_notice}, 53 dataType : "html", 54 async : true, 55 cache : false, 56 success : function(html){ 57 58 var $html = $(html); 59 var change_password_btn = $html.find("._change_password_btn"); // ë³ê²½í기 ë²í¼ 60 var not_change_password_btn = $html.find("._not_change_password_btn"); //ë¤ìì ë³ê²½í기 ë²í¼ 61 62 change_password_btn.off("click").on("click", function(e){ 63 64 changePassword(); 65 e.preventDefault(); 66 return false; 67 }); 68 69 not_change_password_btn.off("click").on("click", function(e){ 70 71 notChangePassword(); 72 e.preventDefault(); 73 return false; 74 }); 75 76 $.cocoaDialog.open({type : "admin_change_password", custom_popup : $html, "close_block" : true}); 77 } 78 }); 79 }; 80 81 function resetAutoLogoutEvent(auto_logout_time){ 82 removeActionEvent(); 83 deleteTimeout(logout_warning_timer); //ë¡ê·¸ìì ê²½ê³ íì´ë¨¸ í´ì 84 deleteTimeout(auto_logout_timer); //ë¡ê·¸ìì ê²½ê³ ë´ìì ì¤ì í ìëë¡ê·¸ìì íì´ë¨¸ í´ì 85 86 setAutoLogoutEvent(auto_logout_time); 87 } 88 89 //*-------------------------------------------------------------------- 90 //** ë´ë¶ì¬ì© í¨ì 91 //*-------------------------------------------------------------------- 92 93 /** 94 * ë§ì°ì¤, í¤ë³´ëë± ì¬ì©ì ì¡ì ì´ë²¤í¸ ì í 95 * @param auto_logout_time 96 */ 97 function setActionEvent(auto_logout_time){ 98 99 var action_time = LOCAL_STORAGE.getLocalStorage(NEXT_ACTION_TIME_LOCAL_STORAGE_KEY); //ì¸í ë ìê°ì¼ë¡ë¶í°(íì¬ ìê°) 1ë¶ ë¤ 100 101 if(new Date(action_time).getTime() <= new Date().getTime()){ //Time out í ì¡ì ì´ ë°ìí´ì¼ëë ìê°ì´ íì¬ìê°ë³´ë¤ ììëë§ ì¤í (ì¡ì ë°ì ìê°ì´ íì¬ ìê°ë³´ë¤ í¬ë©´ ë¤ë¥¸ íì ì´ì©ì¤ì¸ ê²½ì°) 102 //ìëë¡ê·¸ìì 1ë¶ì ë¡ê·¸ìì ê²½ê³ ì í 103 logout_warning_timer = setTimeout(function(){ 104 removeActionEvent(); 105 showLogoutWarning(auto_logout_time); 106 }, (auto_logout_time * ONE_MINUTE) - TWO_MINUTES); 107 108 $(document).off("mousemove keydown").on("mousemove keydown", function(){ 109 110 removeActionEvent(); 111 deleteTimeout(logout_warning_timer); //ë¡ê·¸ìì ê²½ê³ íì´ë¨¸ í´ì 112 deleteTimeout(auto_logout_timer); //ë¡ê·¸ìì ê²½ê³ ë´ìì ì¤ì í ìëë¡ê·¸ìì íì´ë¨¸ í´ì 113 114 setAutoLogoutEvent(auto_logout_time); 115 }); 116 }else{ 117 118 //ë¤ë¥¸ ì°½ìì ë¤ì ëìì¬ ê²½ì° ë¡ê·¸ìì ìê°ì ë¤ì ì í í´ì¼í¨(íì´ì§ ì´ëììë ìëì í íë ì°½ì¼ë¡ ëìë§ììê²½ì°ë ì í ì´ íì) 119 $(document).off("focus").on("focus", function(){ 120 setAutoLogoutEvent(auto_logout_time); 121 }); 122 } 123 } 124
125 /** 126 * ìë ë¡ê·¸ìì 1ë¶ì ê²½ê³ ì¶ë ¥ ì´ë²¤í¸ 127 * @param auto_logout_time 128 */ 129 function showLogoutWarning(auto_logout_time){ 130 131 //ìë ë¡ê·¸ìì ì림 ì í 132 auto_logout_timer = setTimeout(function(){ 133 134 removeActionEvent(); 135 $.cocoaDialog.hide(); 136 LOCAL_STORAGE.setLocalStorage("IS_AUTO_LOGOUT", "Y"); //ë¡ê·¸ìì í ìëë¡ê·¸ììì´ë©´ ìë´ ì¼ë¿ ëì주기ìí´ ì í 137 location.href = "/logout.cm"; 138 }, ONE_MINUTE); 139 140 showAutoLogoutAlert(auto_logout_time); 141 } 142 143 /** 144 * ìëë¡ê·¸ìì ê´ë ¨ ì¼ë¿ì°½ 145 * @param auto_logout_time 146 */ 147 function showAutoLogoutAlert(auto_logout_time){ 148 149 $.ajax({ 150 type : "POST", 151 url : ("/ajax/auto_logout_alert.cm"), 152 data : {auto_logout_time : auto_logout_time}, 153 dataType : "html", 154 async : false, 155 cache : false, 156 success : function(html){ 157 $.cocoaDialog.open({type : "site_alert", custom_popup : html, "close_block" : true}); 158 } 159 }); 160 } 161 162 /** 163 * ì¤ì ë íììì ì ê±° 164 * @param timer_id 165 */ 166 function deleteTimeout(timer_id){ 167 if(!timer_id){ 168 clearTimeout(); 169 }else{ 170 clearTimeout(timer_id); 171 } 172 } 173 174 /** 175 * ë§ì°ì¤, í¤ë³´ë ë± ì¬ì©ì ì¡ì ì´ë²¤í¸ ì ê±° 176 */ 177 function removeActionEvent(){ 178 $(document).off("mousemove keydown"); 179 } 180 181 /** 182 * í¬ì»¤ì¤ 리ì¤ë ì´ë²¤í¸ ì ê±° 183 */ 184 function removeFocusListner(){ 185 $(document).off("focus"); 186 } 187 188 /** 189 * ë¹ë°ë²í¸ ë³ê²½ í´ë¦ì ëì 190 */ 191 function changePassword(){ 192 193 var data = $("#change_password_notice").serializeObject(); 194 195 $.ajax({ 196 type : "POST", 197 url : ("/ajax/change_password.cm"), 198 data : data, 199 dataType : "json", 200 async : false, 201 cache : false, 202 success : function(res){ 203 204 if(res.msg === "SUCCESS"){ 205 206 window.location.reload(); 207 208 }else{ 209 210 var join_form = $("#change_password_notice"); 211 var object = join_form.find("._" + res.type); 212 213 join_form.find("._item").toggleClass("triangle", false); 214 join_form.find("._msg").text(""); 215 object.toggleClass("triangle", true); 216 object.find("input").focus(); 217 object.find("._msg").text(res.msg); 218 } 219 } 220 }); 221 } 222 223 /** 224 * ë¤ìì ë³ê²½í기 í´ë¦ì ëì 225 */ 226 function notChangePassword(){ 227 228 $.ajax({ 229 type : "POST", 230 url : ("/ajax/not_change_password.cm"), 231 dataType : "json", 232 async : false, 233 cache : false, 234 success : function(res){ 235 236 if(res.msg === "SUCCESS"){ 237 $.cocoaDialog.close(); 238 } 239 } 240 }); 241 } 242 243 return { 244 "setAutoLogoutEvent" : function(auto_logout_time){ 245 setAutoLogoutEvent(auto_logout_time); 246 }, 247 "openChangePasswordNotice" : function(month_notice){ 248 openChangePasswordNotice(month_notice); 249 }, 250 "resetAutoLogoutEvent" : function(auto_logout_time){ 251 resetAutoLogoutEvent(auto_logout_time); 252 } 253 }; 254}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.