diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..5754c5e --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..9a1fc1a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..b07a1d6 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/sshConfigs.xml b/.idea/sshConfigs.xml new file mode 100644 index 0000000..1433936 --- /dev/null +++ b/.idea/sshConfigs.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/webServers.xml b/.idea/webServers.xml new file mode 100644 index 0000000..0cd320f --- /dev/null +++ b/.idea/webServers.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/base.kuls.co.kr.iml b/base.kuls.co.kr.iml new file mode 100644 index 0000000..f3736d4 --- /dev/null +++ b/base.kuls.co.kr.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/config/_backup/db_config.php b/config/_backup/db_config.php new file mode 100644 index 0000000..2b473d9 --- /dev/null +++ b/config/_backup/db_config.php @@ -0,0 +1,13 @@ + diff --git a/config/db_config.php b/config/db_config.php new file mode 100644 index 0000000..d8061ec --- /dev/null +++ b/config/db_config.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/config/db_config_my.php b/config/db_config_my.php new file mode 100644 index 0000000..79d4d1a --- /dev/null +++ b/config/db_config_my.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/config/html_config.php b/config/html_config.php new file mode 100644 index 0000000..b7d2b21 --- /dev/null +++ b/config/html_config.php @@ -0,0 +1,109 @@ + 'auth_admin', + 'Group_Uid' => 'auth_admin', + 'Code_Uid' => 'A', + 'Code_Val' => '관리자', + 'Code_Exp' => '관리자', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_admin', + 'Group_Uid' => 'auth_admin', + 'Code_Uid' => 'auth_admin', + 'Code_Val' => 'auth_admin', + 'Code_Exp' => '관리자권한', + 'Code_Idx' => 8, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_admin', + 'Group_Uid' => 'auth_admin', + 'Code_Uid' => 'SA', + 'Code_Val' => '슈퍼관리자', + 'Code_Exp' => '슈퍼관리자', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_area', + 'Group_Uid' => 'auth_area', + 'Code_Uid' => 'auth_area', + 'Code_Val' => 'auth_area', + 'Code_Exp' => '권한 그룹', + 'Code_Idx' => 7, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_area', + 'Group_Uid' => 'auth_area', + 'Code_Uid' => 'G', + 'Code_Val' => '그룹권한', + 'Code_Exp' => '그룹권한', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_area', + 'Group_Uid' => 'auth_area', + 'Code_Uid' => 'M', + 'Code_Val' => '개별권한', + 'Code_Exp' => '개별권한', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_member', + 'Group_Uid' => 'auth_member', + 'Code_Uid' => 'auth_member', + 'Code_Val' => 'auth_member', + 'Code_Exp' => '회원권한', + 'Code_Idx' => 9, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_member', + 'Group_Uid' => 'auth_member', + 'Code_Uid' => 'M', + 'Code_Val' => '회원', + 'Code_Exp' => '회원', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'auth_member', + 'Group_Uid' => 'auth_member', + 'Code_Uid' => 'Y', + 'Code_Val' => '비회원', + 'Code_Exp' => '비회원', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'board_editor', + 'Group_Uid' => 'board_editor', + 'Code_Uid' => 'board_editor', + 'Code_Val' => 'board_editor', + 'Code_Exp' => '작성에디터', + 'Code_Idx' => 11, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'board_editor', + 'Group_Uid' => 'board_editor', + 'Code_Uid' => 'text', + 'Code_Val' => '텍스트', + 'Code_Exp' => '텍스트', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'board_editor', + 'Group_Uid' => 'board_editor', + 'Code_Uid' => 'tinymce', + 'Code_Val' => '웹에디터', + 'Code_Exp' => '웹에디터', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'cate_depth', + 'Code_Val' => '4', + 'Code_Exp' => '분류최대자리수', + 'Code_Idx' => 5, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'cm_var', + 'Code_Val' => 'cm_var', + 'Code_Exp' => '공통변수', + 'Code_Idx' => 3, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'cust_id_len', + 'Code_Val' => '3', + 'Code_Exp' => '소속 코드 최소글자수', + 'Code_Idx' => 6, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'id_len', + 'Code_Val' => '6', + 'Code_Exp' => '아이디 최소글자수', + 'Code_Idx' => 3, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'line_num', + 'Code_Val' => '20', + 'Code_Exp' => '기본라인수', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'page_num', + 'Code_Val' => '5', + 'Code_Exp' => '페이지 출력수', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'cm_var', + 'Group_Uid' => 'cm_var', + 'Code_Uid' => 'pw_len', + 'Code_Val' => '6', + 'Code_Exp' => '비밀번호 최소글자수', + 'Code_Idx' => 4, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'common_status', + 'Group_Uid' => 'common_status', + 'Code_Uid' => '0', + 'Code_Val' => '정지', + 'Code_Exp' => '정지', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'common_status', + 'Group_Uid' => 'common_status', + 'Code_Uid' => '1', + 'Code_Val' => '사용', + 'Code_Exp' => '사용', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'common_status', + 'Group_Uid' => 'common_status', + 'Code_Uid' => 'common_status', + 'Code_Val' => 'common_status', + 'Code_Exp' => '공통 허용상태', + 'Code_Idx' => 10, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'login_result', + 'Group_Uid' => 'login_result', + 'Code_Uid' => '0', + 'Code_Val' => '실패', + 'Code_Exp' => '실패', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'login_result', + 'Group_Uid' => 'login_result', + 'Code_Uid' => '1', + 'Code_Val' => '성공', + 'Code_Exp' => '성공', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'login_result', + 'Group_Uid' => 'login_result', + 'Code_Uid' => 'login_result', + 'Code_Val' => 'login_result', + 'Code_Exp' => '로그인결과코드', + 'Code_Idx' => 5, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'mem_status', + 'Group_Uid' => 'mem_status', + 'Code_Uid' => '1', + 'Code_Val' => '활동중', + 'Code_Exp' => '활동중', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'mem_status', + 'Group_Uid' => 'mem_status', + 'Code_Uid' => '2', + 'Code_Val' => '승인대기', + 'Code_Exp' => '승인대기', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'mem_status', + 'Group_Uid' => 'mem_status', + 'Code_Uid' => '3', + 'Code_Val' => '정지', + 'Code_Exp' => '정지', + 'Code_Idx' => 3, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'mem_status', + 'Group_Uid' => 'mem_status', + 'Code_Uid' => 'mem_status', + 'Code_Val' => 'mem_status', + 'Code_Exp' => '회원승인단계', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'menu_area', + 'Group_Uid' => 'menu_area', + 'Code_Uid' => 'admin', + 'Code_Val' => '관리자', + 'Code_Exp' => '관리자', + 'Code_Idx' => 4, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'menu_area', + 'Group_Uid' => 'menu_area', + 'Code_Uid' => 'menu_area', + 'Code_Val' => 'menu_area', + 'Code_Exp' => '메뉴구분', + 'Code_Idx' => 6, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'menu_area', + 'Group_Uid' => 'menu_area', + 'Code_Uid' => 'partner', + 'Code_Val' => '파트너', + 'Code_Exp' => '파트너', + 'Code_Idx' => 3, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'menu_area', + 'Group_Uid' => 'menu_area', + 'Code_Uid' => 'service', + 'Code_Val' => '서비스', + 'Code_Exp' => '서비스', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1000', + 'Code_Val' => '회장', + 'Code_Exp' => '회장', + 'Code_Idx' => 1, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1010', + 'Code_Val' => '사장', + 'Code_Exp' => '사장', + 'Code_Idx' => 2, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1020', + 'Code_Val' => '부사장', + 'Code_Exp' => '부사장', + 'Code_Idx' => 3, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1030', + 'Code_Val' => '전무이사', + 'Code_Exp' => '전무이사', + 'Code_Idx' => 4, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1040', + 'Code_Val' => '상무이사', + 'Code_Exp' => '상무이사', + 'Code_Idx' => 5, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1050', + 'Code_Val' => '이사', + 'Code_Exp' => '이사', + 'Code_Idx' => 6, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1060', + 'Code_Val' => '수석', + 'Code_Exp' => '수석', + 'Code_Idx' => 7, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1100', + 'Code_Val' => '실장', + 'Code_Exp' => '실장', + 'Code_Idx' => 8, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1110', + 'Code_Val' => '부장', + 'Code_Exp' => '부장', + 'Code_Idx' => 9, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1120', + 'Code_Val' => '차장', + 'Code_Exp' => '차장', + 'Code_Idx' => 10, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1130', + 'Code_Val' => '과장', + 'Code_Exp' => '과장', + 'Code_Idx' => 11, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1140', + 'Code_Val' => '대리', + 'Code_Exp' => '대리', + 'Code_Idx' => 12, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1150', + 'Code_Val' => '주임', + 'Code_Exp' => '주임', + 'Code_Idx' => 13, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => '1160', + 'Code_Val' => '사원', + 'Code_Exp' => '사원', + 'Code_Idx' => 14, + 'Active' => 'Y' + ), + Array( + 'Bran_Uid' => 'position', + 'Group_Uid' => 'position', + 'Code_Uid' => 'position', + 'Code_Val' => 'position', + 'Code_Exp' => '직위', + 'Code_Idx' => 4, + 'Active' => 'Y' + ), +); + + +$table_base_data['menu_list'] = Array( + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_dashboard', + 'cate_code' => '0001', + 'cate_name' => 'Dash Board', + 'cate_data' => '/kadm/', + 'cate_exp' => '서비스의 전반적인 상황을 확인 합니다.', + 'cate_class' => 'bi bi-patch-plus-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_mem', + 'cate_code' => '0002', + 'cate_name' => '회원관리', + 'cate_data' => '/kadm/member/', + 'cate_exp' => '', + 'cate_class' => 'bi bi-people-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_mem_list', + 'cate_code' => '00020001', + 'cate_name' => '회원리스트', + 'cate_data' => '/kadm/member/member_list.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-person-plus-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_mem_log', + 'cate_code' => '00020002', + 'cate_name' => '서비스페이지 로그기록', + 'cate_data' => '/kadm/member/member_log_list.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-person-lines-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_board', + 'cate_code' => '0003', + 'cate_name' => '게시물관리', + 'cate_data' => '/kadm/board', + 'cate_exp' => '', + 'cate_class' => 'bi bi-list-columns-reverse', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_board_list', + 'cate_code' => '00030001', + 'cate_name' => '게시판관리', + 'cate_data' => '/kadm/board/', + 'cate_exp' => '', + 'cate_class' => 'bi bi-list-task', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_board_contents', + 'cate_code' => '00030002', + 'cate_name' => '게시물리스트', + 'cate_data' => '/kadm/board/contents_list.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-list-stars', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_cust', + 'cate_code' => '0004', + 'cate_name' => '소속관리', + 'cate_data' => '/kadm/cust/', + 'cate_exp' => '', + 'cate_class' => 'bi bi-building', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_config', + 'cate_code' => '0005', + 'cate_name' => '환경설정', + 'cate_data' => '/kadm/basecode', + 'cate_exp' => '', + 'cate_class' => 'bi bi-gear-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_basecode', + 'cate_code' => '00050001', + 'cate_name' => '기준정보관리', + 'cate_data' => '/kadm/basecode', + 'cate_exp' => '', + 'cate_class' => 'bi bi-tablet-landscape', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_menu', + 'cate_code' => '00050002', + 'cate_name' => '메뉴관리', + 'cate_data' => '/kadm/menu/menu_service.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-diagram-3-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_menu_service', + 'cate_code' => '000500020001', + 'cate_name' => '서비스화면', + 'cate_data' => '/kadm/menu/menu_service.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-diagram-2-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_menu_admin', + 'cate_code' => '000500020002', + 'cate_name' => '관리자화면', + 'cate_data' => '/kadm/menu/menu_admin.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-diagram-2', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_auth', + 'cate_code' => '00050003', + 'cate_name' => '권한관리', + 'cate_data' => '/kadm/auth', + 'cate_exp' => '', + 'cate_class' => 'bi bi-grid-3x3-gap-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_auth_service', + 'cate_code' => '000500030001', + 'cate_name' => '서비스권한관리', + 'cate_data' => '/kadm/auth/auth_service.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-grid', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_auth_admin', + 'cate_code' => '000500030002', + 'cate_name' => '관리자화면 권한관리', + 'cate_data' => '/kadm/auth/auth_admin.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-grid-fill', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_adm', + 'cate_code' => '00050004', + 'cate_name' => '관리자', + 'cate_data' => '/kadm/admin', + 'cate_exp' => '', + 'cate_class' => 'bi bi-person-video', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_adm_list', + 'cate_code' => '000500040001', + 'cate_name' => '관리자 리스트', + 'cate_data' => '/kadm/admin/', + 'cate_exp' => '', + 'cate_class' => 'bi bi-person-video3', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'admin', + 'cate_id' => 'mnu_adm_log', + 'cate_code' => '000500040002', + 'cate_name' => '관리페이지 로그기록', + 'cate_data' => '/kadm/admin/member_log_list.php', + 'cate_exp' => '', + 'cate_class' => 'bi bi-person-video2', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), + Array( + 'cate_area' => 'service', + 'cate_id' => 'main', + 'cate_code' => '0001', + 'cate_name' => '메인화면', + 'cate_data' => '/', + 'cate_exp' => '', + 'cate_class' => '', + 'cate_auth' => '', + 'cate_use' => 'Y' + ), +); \ No newline at end of file diff --git a/config/info_table_schema.php b/config/info_table_schema.php new file mode 100644 index 0000000..d335298 --- /dev/null +++ b/config/info_table_schema.php @@ -0,0 +1,393 @@ +DB->query_record = false; //query log 기록 금지 + + $this->DB->tableExists($this->TB); + } + + public function getAttachList($fields, $gubun, $nid="", $orderby=""){ + $where = new DB_where("and"); + if( $gubun ){ + $where->add("gubun = ?", $gubun); + } + if( $nid ){ + $where->add("nid = ?", $nid); + } + + $orderby=$orderby?:"file_id desc"; + $limit=array(); + + $rows = $this->getDataList($fields, $where, $orderby, $limit); + for( $a=0 ; $a $gubun, + "nid" => $nid, + "sid" => $sid, + ); + $row = $this->getData("*", $whererow); + $row['file_url'] = _SITE_INC_URL_."/getFile.php?gubun={$row['gubun']}&nid={$row['nid']}&sid={$row['sid']}"; + return $row; + } + public function getAttachId( $file_id ) { + $whererow = Array( + "file_id" => $file_id, + ); + $row = $this->getData("*", $whererow); + $row['file_url'] = _SITE_INC_URL_."/getFile.php?gubun={$row['gubun']}&nid={$row['nid']}&sid={$row['sid']}"; + return $row; + } + + public function putAttach( $upfile, $gubun, $nid, $sid ) { + $target_dir = _UP_PATH_."/{$gubun}"; + if( !file_exists($target_dir) ){ + mkdir($target_dir); + } + $rst = move_uploaded_file($upfile['tmp_name'], "{$target_dir}/{$nid}_{$sid}.dat"); + if( !$rst ) return false; + + if( strpos($upfile['type'], "image") !== false ){ + $iinfo = getimagesize("{$target_dir}/{$nid}_{$sid}.dat"); + $upfile['width'] = $iinfo[0]; + $upfile['height'] = $iinfo[1]; + } + + $sqldata = Array( + "gubun" => $gubun?:"", + "nid" => $nid?:"", + "sid" => $sid?:"", + "file_name" => $upfile['name']?:"", + "file_size" => $upfile['size']?:0, + "file_type" => $upfile['type']?:"", + "file_width" => $upfile['width']?:"", + "file_height" => $upfile['height']?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + ); + + return $this->putData( $sqldata ); + } + + public function setAttach( $upfile, $gubun, $nid, $sid ) { + $target_dir = _UP_PATH_."/{$gubun}"; + if( !file_exists($target_dir) ){ + mkdir($target_dir); + } + $rst = move_uploaded_file($upfile['tmp_name'], "{$target_dir}/{$nid}_{$sid}.dat"); + if( !$rst ) return false; + + if( strpos($upfile['type'], "image") !== false ){ + $iinfo = getimagesize("{$target_dir}/{$nid}_{$sid}.dat"); + $upfile['width'] = $iinfo[0]; + $upfile['height'] = $iinfo[1]; + } + + $sqldata = Array( + "gubun" => $gubun?:"", + "nid" => $nid?:"", + "sid" => $sid?:"", + "file_name" => $upfile['name']?:"", + "file_size" => $upfile['size']?:0, + "file_type" => $upfile['type']?:"", + "file_width" => $upfile['width']?:"", + "file_height" => $upfile['height']?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + ); + + $whererow = Array( + "gubun" => $gubun?:"", + "nid" => $nid?:"", + "sid" => $sid?:"", + ); + + return $this->setData( $sqldata, $whererow ); + } + public function setAttachId( $upfile, $file_id ) { + $ainfo = $this->getAttachId( $file_id ); + if( !$ainfo['file_id'] ) return false; + + return $this->setAttach( $upfile, $ainfo['gubun'], $ainfo['nid'], $ainfo['sid'] ); + } + + public function delAttach( $gubun, $nid, $sid ){ + $urow = Array(); + $urow['gubun'] = $gubun; + $urow['nid'] = $nid; + $urow['sid'] = $sid; + $where = ""; + + $target_dir = _UP_PATH_."/{$gubun}"; + //$rst = @unlink("{$target_dir}/{$nid}_{$sid}.dat"); + $rst = $this->fileRemove("{$target_dir}/{$nid}_{$sid}.dat*"); + if( !$rst ) return false; + + return $this->delData($urow, $where); + } + public function delAttachId( $file_id ){ + $ainfo = $this->getAttachId( $file_id ); + return $this->delAttach( $ainfo['gubun'], $ainfo['nid'], $ainfo['sid'] ); + } + + static function fByte($bytes, $precision=2) { + $unit = ["B", "KB", "MB", "GB"]; + $exp = floor(log($bytes, 1024)) ?: 0; + return round($bytes / (pow(1024, $exp)), $precision).$unit[$exp]; + } + + static function fileRemove($filepath, $unremove=""){ + $glob = glob($filepath); + foreach( $glob as $filename ) { + if( !$unremove || $filename != $unremove ){ + @unlink($filename); + } + } + return true; + } +} \ No newline at end of file diff --git a/lib/app/auth.class.php b/lib/app/auth.class.php new file mode 100644 index 0000000..33ec910 --- /dev/null +++ b/lib/app/auth.class.php @@ -0,0 +1,281 @@ +DB->query_record = false; //query log 기록 금지 + + $this->DB->tableExists(TB_auth_manage); + } + + /** 권한저장 + * @param $cate_area : 권한범위 + * @param $cate_id : 권한 기능(메뉴) + * @param $auth_area : 권한 그룹 + * @param $auth_target : 권한 대상 + * @param $auth : 권한 + * @return bool + */ + public function putAuth( $cate_area, $cate_id, $auth_area, $auth_target, $auth ){ + $sql_row = Array( + "cate_area" => $cate_area?:"", + "cate_id" => $cate_id?:"", + "auth_area" => $auth_area?:"", + "auth_target"=> $auth_target?:"", + "auth" => $auth?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + "mod_date" => $this->DB->sqleval("getdate()"), + "mod_id" => $GLOBALS['_Umem']['member_id']?:"", + ); + + return $this->DB->insert(TB_auth_manage, $sql_row); + } + + /** 권한수정 + * @param $cate_area : 권한범위 + * @param $cate_id : 권한 기능(메뉴) + * @param $auth_area : 권한 그룹 + * @param $auth_target : 권한 대상 + * @param $auth : 권한 + * @param string $old_cate_id : 수정할 id + * @return bool + */ + public function setAuth( $cate_area, $cate_id, $auth_area, $auth_target, $auth, $old_cate_id="" ){ + $sql_row = Array( + "auth" => $auth?:"", + "mod_date" => $this->DB->sqleval("getdate()"), + "mod_id" => $GLOBALS['_Umem']['member_id']?:"", + ); + if( $old_cate_id && $cate_id != $old_cate_id ){ + $sql_row['cate_id'] = $cate_id; + } + + $where = new DB_where("and"); + $where->add("cate_area = ?", $cate_area); + $where->add("cate_id = ?", $old_cate_id?:$cate_id); + $where->add("auth_area = ?", $auth_area); + $where->add("auth_target = ?", $auth_target); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $ins_sql_row = Array( + "cate_area" => $cate_area?:"", + "cate_id" => $cate_id?:"", + "auth_area" => $auth_area?:"", + "auth_target"=> $auth_target?:"", + "auth" => $auth?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + "mod_date" => $this->DB->sqleval("getdate()"), + "mod_id" => $GLOBALS['_Umem']['member_id']?:"", + ); + + return $this->DB->insertupdate(TB_auth_manage, $ins_sql_row, $sql_row, $whereqry, $whererow); + +// $sql = "select count(*) from ".TB_auth_manage." where {$whereqry}"; +// $cnt = $this->DB->queryFirstField($sql, $whererow); +// +// if( $cnt ){ +// return $this->DB->update(TB_auth_manage, $sql_row, $whereqry, $whererow); +// }else{ +// return $this->putAuth($cate_area, $cate_id, $auth_area, $auth_target, $auth); +// } + } + + /* 주석은 시간날때.. 하지만 언제나 시간은 없지 + * 권한추가 + * */ + public function addAuth( $cate_area, $cate_id, $auth_area, $auth_target, $auth ){ + $auth = (int)$auth; + if( $auth > 7 || $auth < 0 ) return false; + + return $this->setAuth( $cate_area, $cate_id, $auth_area, $auth_target, $this->DB->sqleval("auth | {$auth}") ); + } + + /* + * 권한제거 + * */ + public function remAuth( $cate_area, $cate_id, $auth_area, $auth_target, $auth ){ + $auth = (int)$auth; + if( $auth > 7 || $auth < 0 ) return false; + + return $this->setAuth( $cate_area, $cate_id, $auth_area, $auth_target, $this->DB->sqleval("auth & ".(7 ^ $auth)) ); + } + + /* + * 권한삭제 + * */ + public function delAuth( $cate_area, $cate_id, $auth_area="", $auth_target="" ){ + $where = new DB_where("and"); + $where->add("cate_area = ?", $cate_area); + $where->add("cate_id = ?", $cate_id); + if( $auth_area ){ + $where->add("auth_area = ?", $auth_area); + } + if( $auth_target ){ + $where->add("auth_target = ?", $auth_target); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->delete(TB_auth_manage, $whereqry, $whererow); + } + + /** + * @param $cate_area + * @param $cate_id + * @param string $auth_target + * @return int + */ + public function getAuthList( $cate_area="" ){ + $where = new DB_where("and"); + if( $cate_area ){ + $where->add("cate_area = ?", $cate_area); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select cate_id, auth_area, auth_target, auth from ".TB_auth_manage." where {$whereqry}"; + $rst = $this->DB->qry($sql, $whererow); + if( $rst ) { + $rows = array(); + while ($row = $this->DB->fetch_array($rst)) { + $rows[$row['cate_id']][$row['auth_area']][$row['auth_target']] = $this->getAuthToRow($row['auth']); + } + + return $rows; + } + return $rst; + } + + /** 회원권한조회 - 회원이 가진 (현메뉴)에서 가진 권한값 리턴 + * @param $cate_area : 권한범위 + * @param $cate_id : 권한 기능(메뉴) + * @param string $auth_target : member_id, //Todo: 그룹권한만 확인하는 내용은 존재하지 않음 + * @return int + */ + public function getAuth( $cate_area, $cate_id, $auth_target="" ){ + if( !$auth_target ){ + $mem = $GLOBALS['_Umem']; + $auth_target = isset($mem['member_id'])?$mem['member_id']:""; + }else{ + $mobj = new Member(); + $mem = $mobj->getMember($auth_target); + } + if( !isset($mem) || !$mem || !isset($mem['member_id']) || !$mem['member_id'] ){ + if( !is_array($mem) ){ + $mem = array(); + } + $mem['member_auth'] = "Y"; //비회원 + } + + if( $mem['member_auth'] == 'SA' ) return 7; //슈퍼관리자는 무조건 Ok + + $where = new DB_where("and"); + $where->add("cate_area = ?", $cate_area); + $where->add("cate_id = ?", $cate_id); + $subwhere = $where->sub_where("or"); + + $subwhere2 = $subwhere->sub_where("and"); + $subwhere2->add("auth_area = ?","G"); + $subwhere2->add("auth_target = ?",$mem['member_auth']); + + $subwhere3 = $subwhere->sub_where("and"); + $subwhere3->add("auth_area = ?","M"); + $subwhere3->add("auth_target = ?",$mem['member_id']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select auth from ".TB_auth_manage." where {$whereqry}"; + $rows = $this->DB->query($sql, $whererow); + $auth = 0; + foreach( (array)$rows as $row ){ + $auth = $auth | $row['auth']; + } + + //권한 제거 가 존재한다면(예: 레벨권한, 그룹권한으로 권한을 획득했지만 해당 인원만 쓰기 금지.)... 아래 로직을 적절하게 적용한다. + // $dauth <-- 제거할 권한(예: 7->모든 권한 제거, 4->수정삭제권한 제거, 2->쓰기권한제거, 1->읽기권한 제거) + // $auth = $auth & ~$dauth; + return $auth; + } + + /** 권한 Normalize + * @param $auth + * @return int + */ + public function normalAuth($auth){ + $auth = strtolower($auth); + switch( true ){ + case in_array( $auth, Array("r", "read", "1", 1) ) : + $auth = 1; break; + + case in_array( $auth, Array("w", "write", "put", "2", 2) ) : + $auth = 2; break; + + case in_array( $auth, Array("u", "up", "update", "m", "mod", "modify", "set", "d", "del", "delete", "4", 4) ) : + $auth = 4; break; + + default : + $auth = 0; + } + return $auth; + } + + /** 권한확인 + * @param $auth : 권한 + * @param $cate_area : 권한범위 + * @param $cate_id : 권한 기능(메뉴) + * @param string $auth_target : member_id, //Todo: 그룹권한만 확인하는 내용은 존재하지 않음 + * @return int + */ + public function hasAuth( $auth, $cate_area, $cate_id, $auth_target="" ){ + $allow = $this->getAuth($cate_area, $cate_id, $auth_target); + $auth = $this->normalAuth($auth); + return $auth & $allow; + } + + /** 권한 get num -> row + * @param $auth : 권한 + * @return array + */ + public function getAuthToRow($auth){ + $arow = Array(); + + $arow["R"] = (bool)($auth & 1); + $arow["W"] = (bool)($auth & 2); + $arow["D"] = (bool)($auth & 4); + + return $arow; + } + + /* + * 권한 get row(string) -> num + * */ + public function getAuthToNum($read, $write, $delete){ + return ($read?1:0)+($write?2:0)+($delete?4:0); + } + + + /** 해당 권한을 가진 id get + * @param $row : 권한 배열 + * @param $auth : 찾아낼 권한 + * @return array + */ + public function getHasAuthRow( $row, $auth ){ + $auth = $this->normalAuth($auth); + $rerow = array(); + foreach( (array)$row as $k => $v ){ + if( $v & $auth ){ + $rerow[] = $k; + } + } + return $rerow; + } +} \ No newline at end of file diff --git a/lib/app/board.class.php b/lib/app/board.class.php new file mode 100644 index 0000000..65b15ae --- /dev/null +++ b/lib/app/board.class.php @@ -0,0 +1,1101 @@ +DB->tableExists( TB_board_list ); + $this->DB->tableExists( TB_board_contents ); + $this->DB->tableExists( TB_board_attach ); + $this->DB->tableExists( TB_board_opinion ); + $this->DB->tableExists( TB_member ); + $this->board_info = $this->getBoardId($board_id); + } + + function getBoardList($field="*",$where="", $orderby="",$limit=array()){ //게시판 리스트 + if( !$where ){ + $where = new DB_where("and"); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select brd.{$field}, mem.member_name from ". TB_board_list ." as brd left join ". TB_member ." as mem on brd.board_admin = mem.member_id where {$whereqry}".(($orderby)?" order by {$orderby}":""). $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select brd.{$field}, mem.member_name from ". TB_board_list ." as brd left join ". TB_member ." as mem on brd.board_admin = mem.member_id where {$whereqry}",$orderby,$limit[0],$limit[1]); + $rows = $this->DB->query($sql, $whererow); + return $rows; + } + + function getBoardPage($sqldata="", $where=""){ //게시판 리스트(페이징) + if( !$where ){ + $where = new DB_where("and"); + } + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("board_id like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("board_name like ?", "%{$sqldata['stxt']}%"); + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $orderby = "board_name asc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ) $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + + $query = array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum']?:20, + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ); + + $table = "(select brd.*, mem.member_name from ". TB_board_list ." as brd left join ". TB_member ." as mem on brd.board_admin = mem.member_id) as A"; + + $lists = new clist(); + $lists->fld = "*"; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $sqldata['page']?:1; + $lists->linktype = ""; + $lists->viewnum = $query['viewnum']; + $lists->rownum = $sqldata['rownum']?:5; + $lists->getCommonList($table); + + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){ + $lists->rows[$a]['board_id'] = stripslashes($lists->rows[$a]['board_id']); + $lists->rows[$a]['board_name'] = stripslashes($lists->rows[$a]['board_name']); + $lists->rows[$a]['con_num'] = $this->getContentsNum($lists->rows[$a]['board_id']); + } + return $lists; + } + + function getBoard($board_id){ //게시판 불러오기 + return $this->getBoardId($board_id); + } + + function getBoardId($board_id){ //게시판 불러오기 (board_id) + $where = new DB_where("and"); + $where->add("board_id = ?", $board_id); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_board_list ." where {$whereqry}"; + $rst = $this->DB->queryFirstRow($sql, $whererow); + $rst['board_name'] = stripslashes($rst['board_name']); + return $rst; + } + + function putBoard( $sqldata ){ + $sqlrow = array( + "board_id" => $sqldata['board_id']?:"", + "board_name" => $sqldata['board_name']?:"", + "board_admin" => $sqldata['board_admin']?:"", + "board_cate" => $sqldata['board_cate']?:"", + "read_level" => $sqldata['read_level']?:"", + "write_level" => $sqldata['write_level']?:"", + "ness_name" => $sqldata['ness_name']?:"", + "ness_passwd" => $sqldata['ness_passwd']?:"", + "ness_title" => $sqldata['ness_title']?:"", + "ness_homepage" => $sqldata['ness_homepage']?:"", + "ness_mail" => $sqldata['ness_mail']?:"", + "ness_contents" => $sqldata['ness_contents']?:"", + "ness_image" => $sqldata['ness_image']?:"", + "ness_file" => $sqldata['ness_file']?:"", + "use_opinion" => $sqldata['use_opinion']?:"", + "use_spamproof" => $sqldata['use_spamproof']?:"", + "use_webeditor" => $sqldata['use_webeditor']?:"", + "line_num" => $sqldata['line_num']?:"", + "page_num" => $sqldata['page_num']?:"", + "new_num" => $sqldata['new_num']?:1, + "hot_num" => $sqldata['hot_num'], + "skin_name" => $sqldata['skin_name'], + ); + $rst = $this->DB->insert( TB_board_list, $sqlrow ); + if( $rst ){ + return $sqlrow['board_id']; + } + } + + function setBoard( $sqldata ){ + $obrd = $this->getBoard($sqldata['board_id']); + $sqlrow = array( + "board_id" => $sqldata['board_id']?:"", + "board_name" => $sqldata['board_name']?:"", + "board_admin" => $sqldata['board_admin']?:"", + "board_cate" => $sqldata['board_cate']?:"", + "read_level" => $sqldata['read_level']?:"", + "write_level" => $sqldata['write_level']?:"", + "ness_name" => $sqldata['ness_name']?:"", + "ness_passwd" => $sqldata['ness_passwd']?:"", + "ness_title" => $sqldata['ness_title']?:"", + "ness_homepage" => $sqldata['ness_homepage']?:"", + "ness_mail" => $sqldata['ness_mail']?:"", + "ness_contents" => $sqldata['ness_contents']?:"", + "ness_image" => $sqldata['ness_image']?:"", + "ness_file" => $sqldata['ness_file']?:"", + "use_opinion" => $sqldata['use_opinion']?:"", + "use_spamproof" => $sqldata['use_spamproof']?:"", + "use_webeditor" => $sqldata['use_webeditor']?:"", + "line_num" => $sqldata['line_num']?:"", + "page_num" => $sqldata['page_num']?:"", + "new_num" => $sqldata['new_num']?:1, + "hot_num" => $sqldata['hot_num'], + "skin_name" => $sqldata['skin_name'], + ); + $where = new DB_where("and"); + $where->add("board_id = ?", $sqldata['board_id']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $rst = $this->DB->update( TB_board_list, $sqlrow, $whereqry, $whererow); + if( $rst ){ + return $sqldata['board_id']; + } + return 0; + } + + function delBoard( $board_id ){ + $where = new DB_where("and"); + $where->add("board_id = ?", $board_id); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $rst = $this->DB->delete( TB_board_list, $whereqry, $whererow); + $rst = $rst && $this->DB->delete( TB_board_contents, $whereqry, $whererow); + $rst = $rst && $this->DB->delete( TB_board_opinion, $whereqry, $whererow); + + if( $rst ){ + $this->delFiles( "board", array("board_id"=>$board_id) ); + return 1; + } + return 0; + } + + function getContentsList($field="*", $where="", $orderby="", $limit=array(), $dmode=""){ //게시물 리스트 + if( !$where ){ + $where = new DB_where("and"); + } + + if( $dmode != "all" ){ //전체 게시물 리스트 아니면 + $where->add("board_id = ?", $this->board_info['board_id']); + } + + if( !$this->isAdmin() ){ + $where->add("state = ?", 1); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select {$field} from (select brc.*, brl.board_name from ". TB_board_contents ." as brc inner join ". TB_board_list ." as brl on brc.board_id = brl.board_id) as brd where {$whereqry} ".(($orderby)?"order by {$orderby}":""). $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select {$field} from (select brc.*, brl.board_name from ". TB_board_contents ." as brc inner join ". TB_board_list ." as brl on brc.board_id = brl.board_id) as brd where {$whereqry}",$orderby,$limit[0],$limit[1]); + $rst = $this->DB->qry($sql, $whererow); + $rows = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $tmp = $this->getContentsInfo($tmp); + + if( !$this->isAdmin() ){ + unset($tmp['ip_addr']); + } + $rows[] = $tmp; + } + return $rows; + } + + function getContentsPage($sqldata="", $where=""){ //게시물 리스트(페이징) + if( !$where ){ + $where = new DB_where("and"); + } + + if( $sqldata['dmode'] != "all" ){ //전체 게시물 리스트 아니면 + $where->add("board_id = ?", $this->board_info['board_id']); + } + + if( $sqldata['gubun'] ){ + $where->add("gubun = ?", $sqldata['gubun']); + } + if( $sqldata['board_id'] ){ + $where->add("board_id = ?", $sqldata['board_id']); + } + if( !$this->isAdmin() ){ + $where->add("state = ?", 1); + } + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("title like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("contents like ?", "%{$sqldata['stxt']}%"); + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $orderby = "cid desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ) $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + + $query = array( + "mode" => $sqldata['mode'], + "board_id" => $sqldata['board_id'], + "gubun" => $sqldata['gubun'], + "viewnum" => $sqldata['viewnum']?:$this->board_info['line_num']?:30, + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ); + + $table = "(select brc.*, brl.board_name from ". TB_board_contents ." as brc inner join ". TB_board_list ." as brl on brc.board_id = brl.board_id) as brd"; + $lists = new clist(); + $lists->fld = "*"; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $sqldata['page']?:1; + $lists->linktype = ""; + $lists->viewnum = $query['viewnum']; + $lists->rownum = $this->board_info['page_num']?:10; + $lists->getCommonList($table); + + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){ $tmp = $lists->rows[$a]; + $tmp = $this->getContentsInfo($tmp); + + if( !$this->isAdmin() ){ + unset($tmp['ip_addr']); + } + $lists->rows[$a] = $tmp; + } + return $lists; + } + + function getAllContentsList($field="*" ,$where="", $orderby="", $limit=array()){ //전체 게시물 리스트 + return $this->getContentsList($field, $where, $orderby, $limit, "all"); + } + + function getAllContentsPage($sqldata="", $where=""){ //전체 게시물 리스트(페이징) + $sqldata['dmode'] = "all"; + return $this->getContentsPage($sqldata,$where); + } + + function getContents( $cid ){ //게시물 불러오기 + if( !$cid ) return 0; + + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + + $where->add("cid = ?", $cid); + if( !$this->isAdmin() ){ + $where->add("state != ?", 2); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_board_contents ." where {$whereqry}"; + $row = $this->DB->queryFirstRow( $sql, $whererow); + $row = $this->getContentsInfo($row); + + if( !$this->isAdmin() ){ + unset($row['ip_addr']); + } + return $row; + } + + function getContentsInfo( $row ){ + if( !$row['secret'] || $this->chkSecretAuth($row) ){ + $row['title'] = stripslashes($row['title']); + $row['contents'] = stripslashes($row['contents']); + switch( $this->board_info['use_webeditor'] ){ + case "Tinymce" : break; + default : $row['contents'] = nl2br($row['contents']); + } + $row['contents_txt'] = strip_tags($row['contents']); + $row['uname'] = stripslashes($row['uname']); + $row['homepage'] = stripslashes($row['homepage']); + $row['mail'] = $this->lcrypt->dec_secure($row['mail']); + $row['mobile'] = $this->lcrypt->dec_secure($row['mobile']); + }else{ + $row['title'] = "비밀글 입니다."; + $row['contents'] = "비밀글 입니다."; + $row['uname'] = "비밀글"; + $row['homepage'] = "http://xxx.xxx.xxx"; + $row['mail'] = "xxx@xxx.xxx"; + $row['mobile'] = "xxx-xxxx-xxxx"; + } + return $row; + } + + function putContents( $sqldata ){ //게시물 등록 + $sqlrow = array( + "board_id" => $this->board_info['board_id'], + "gubun" => $sqldata['gubun'], + "title" => $sqldata['title'], + "contents" => $sqldata['contents'], + "notice" => $sqldata['notice']?:"", + "views" => 0, + "good" => 0, + "nogood" => 0, + "onum" => 0, + "secret" => $sqldata['secret']?:"", + "markup" => $sqldata['markup']?:"", + "state" => $sqldata['state']?:1, + "member_id" => $GLOBALS['_Umem']['member_id'], + "uname" => $sqldata['uname'], + "passwd" => $this->lcrypt->pw_make($sqldata['passwd']), + "homepage" => $sqldata['homepage'], + "mail" => $sqldata['mail']?$this->lcrypt->enc_secure($sqldata['mail']):"", + "mobile" => $sqldata['mobile']?$this->lcrypt->enc_secure($sqldata['mobile']):"", + "ip_addr" => get_ip(), + "reg_date" => $this->DB->sqleval("getdate()"), + "mod_date" => $this->DB->sqleval("getdate()"), + ); + $rst = $this->DB->insert( TB_board_contents, $sqlrow ); + if( $rst ){ + $cid = $this->DB->insertId(TB_board_contents); + $sqldata['cid'] = $cid; + $this->putFiles( $sqldata ); + return $cid; + } + } + + function setContents( $sqldata ){ //게시물 수정 + $sqlrow = array( + "gubun" => $sqldata['gubun'], + "title" => $sqldata['title'], + "contents" => $sqldata['contents'], + "uname" => $sqldata['uname'], + "homepage" => $sqldata['homepage'], + "mail" => $sqldata['mail']?$this->lcrypt->enc_secure($sqldata['mail']):"", + "mobile" => $sqldata['mobile']?$this->lcrypt->enc_secure($sqldata['mobile']):"", + "mod_date" => $this->DB->sqleval("getdate()"), + ); + + if( $sqldata['state'] ) $sqlrow['state'] = $sqldata['state']; + if( $sqldata['notice'] ) $sqlrow['notice'] = $sqldata['notice']; + if( $sqldata['secret'] ) $sqlrow['secret'] = $sqldata['secret']; + if( $sqldata['markup'] ) $sqlrow['markup'] = $sqldata['markup']; + + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $sqldata['cid']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $rst = $this->DB->update( TB_board_contents, $sqlrow, $whereqry, $whererow ); + if( $rst ){ + $this->delFiles( "file", array("cid"=>$sqldata['cid'], "aid" => $sqldata['DEL_ATTFILES']) ); + $this->putFiles( $sqldata ); + return $sqldata['cid']; + } + return 0; + } + + function delContents( $cid ){ //게시물 삭제 + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + + if( is_array($cid) ){ + $subwhere = $where->sub_where("or"); + foreach( (array)$cid as $v ){ + $subwhere->add("cid = ?", $v); + } + }else{ + $where->add("cid = ?", $cid); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $rst = 1; + $rst = $rst && $this->DB->delete( TB_board_contents, $whereqry, $whererow); + $rst = $rst && $this->DB->delete( TB_board_opinion, $whereqry, $whererow); + if( $rst ){ + $this->delFiles( "contents", array("cid"=>$cid) ); + unset($_SESSION['board_read_'.$this->board_info['board_id']."_".$cid]); + unset($_SESSION['board_secret_'.$this->board_info['board_id']."_".$cid]); + return 1; + } + return 0; + } + + function getContentsNum( $board_id ){ + $where = new DB_where("and"); + $where->add("board_id = ?", $board_id); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select count(*) from ". TB_board_contents ." where {$whereqry}"; + $con_num = $this->DB->queryFirstField($sql, $whererow); + + return $con_num?:0; + } + + function getOpinionList($cid, $limit=array()){ //게시물 리스트 + $where = new DB_where("and"); + $where->add("board_id= ?", $this->board_info['board_id']); + $where->add("cid = ?", $cid); + +// if( !$this->isAdmin() ){ +// $where->add("state = %i", 1); +// } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select A.*, B.snum from ". TB_board_opinion ." as A left join (select uid as sid, count(*)-1 as snum from ". TB_board_opinion ." group by uid) as B on A.oid = B.sid where {$whereqry} order by uid asc, oid asc ". $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select A.*, B.snum from ". TB_board_opinion ." as A left join (select uid as sid, count(*)-1 as snum from ". TB_board_opinion ." group by uid) as B on A.oid = B.sid where {$whereqry}","uid asc, oid asc",$limit[0],$limit[1]); + $rst = $this->DB->qry($sql, $whererow); + $rows = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $rows[] = $this->getFtOpinion($tmp); + } + return $rows; + } + + function getOpinionSubList($cid, $uid){ //게시물 리스트 + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $cid); + $where->add("uid = ?", $uid); + $where->add("oid != uid"); + +// if( !$this->isAdmin() ){ +// $where->add("state = ?", 1); +// } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_board_opinion ." where {$whereqry} order by uid asc, oid asc"; + $rst = $this->DB->qry($sql, $whererow); + $rows = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $rows[] = $this->getFtOpinion($tmp); + } + return $rows; + } + + function getOpinionPage($cid, $page=""){ //게시물 리스트(페이징) + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $cid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $orderby = "uid asc, oid asc"; + $query = array( + "board_id" => $this->board_info['board_id'], + "cid" => $cid, + "viewnum" => $this->board_info['line_num'], + ); + + $lists = new clist(); + $lists->fld = "*"; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $page?:1; + $lists->linktype = ""; + $lists->viewnum = $query['viewnum']; + $lists->rownum = $this->board_info['page_num']; + $lists->getCommonList(TB_board_opinion); + + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){; + $lists->rows[$a] = $this->getFtOpinion($lists->rows[$a]); + } + return $lists; + } + + function getOpinion( $cid, $oid ){ + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $cid); + $where->add("oid = ?", $oid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_board_opinion ." where {$whereqry}"; + $row = $this->DB->queryFirstRow( $sql, $whererow ); + $row = $this->getFtOpinion($row); + return $row; + } + + function getFtOpinion( $row ){ //삭제 및 제한된 게시물조치 + switch( $row['state'] ){ + case "2" : + $row['opinion'] = "관리규정에 의해 제한 조치 됨"; + $row['uname'] = "None"; + break; + case "3" : + $row['opinion'] = "사용자 삭제"; + $row['uname'] = "None"; + break; + default : + $row['opinion'] = stripslashes($row['opinion']); + $row['uname'] = stripslashes($row['uname']); + break; + } + return $row; + } + + function putOpinion( $sqldata ){ + $sqlrow = array( + "board_id" => $this->board_info['board_id'], + "cid" => $sqldata['cid'], + "uid" => $sqldata['uid']?:0, + "idx" => $sqldata['idx']?:"", + "opinion" => $sqldata['opinion'], + "good" => 0, + "nogood" => 0, + "state" => $sqldata['state']?:1, + "member_id" => $GLOBALS['_Umem']['member_id'], + "uname" => $sqldata['uname'], + "passwd" => $this->lcrypt->pw_make($sqldata['passwd']), + "ip_addr" => get_ip(), + "reg_date" => $this->DB->sqleval("getdate()"), + "mod_date" => $this->DB->sqleval("getdate()"), + ); + + $rst = $this->DB->insert( TB_board_opinion, $sqlrow ); + if( $rst ){ + $oid = $this->DB->insertId(TB_board_opinion); + + /*의견글 갯수 확인*/ + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $sqldata['cid']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $onum = $this->DB->queryFirstField("select count(*) from ". TB_board_opinion ." where {$whereqry}",$whererow); + + /*상위 의견글이 없으면 자신의 oid 를 상위 의견글로 지정*/ + if( !$sqldata['uid'] ){ + $sqlrow2 = array( + "uid" => $oid, + ); + $where->add("oid = ?", $oid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->update( TB_board_opinion, $sqlrow2, $whereqry, $whererow ); + } + + /*의견글 갯수 수정*/ + $sqlrow3 = array( + "onum" => $onum, + ); + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $sqldata['cid']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->update( TB_board_contents, $sqlrow3, $whereqry, $whererow ); + return $oid; + } + } + + function setOpinion( $sqldata ){ + $sqlrow = array( + "opinion" => $sqldata['opinion'], + "uname" => $sqldata['uname'], + "mod_date" => $this->DB->sqleval("getdate()"), + ); + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $sqldata['cid']); + $where->add("oid = ?", $sqldata['oid']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $rst = $this->DB->update( TB_board_opinion, $sqlrow, $whereqry, $whererow); + if( $rst ){ + return $sqldata['oid']; + } + } + + function delOpinion( $sqldata ){ + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $sqldata['cid']); + $where->add("oid = ?", $sqldata['oid']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + switch( $sqldata['mode'] ){ + case "rejOpinion": + $sqlrow = array( + "state" => "2", + ); + break; + case "delOpinion": + $sqlrow = array( + "state" => "3", + ); + break; + } + $rst = $this->DB->update( TB_board_opinion, $sqlrow, $whereqry, $whererow); + + return $rst; + } + + function getFiles( $cid ){ + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add("cid = ?", $cid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_board_attach ." where {$whereqry} order by aid asc"; + $rows = $this->DB->query($sql, $whererow); + return $rows; + } + + function putFiles( $sqldata ){ + if( $sqldata['ATTFILES'] ){ + $_SFILES = \Frody\Util\MultiFileUpload::swfFormFileInfo($sqldata['ATTFILES'], _UP_PATH_TMP_, "N"); + $rst = 1; + for( $a = 0 ; $a<@count($_SFILES) ; $a++ ){ + $sqlrow = array( + "board_id" => $this->board_info['board_id'], + "cid" => $sqldata['cid'], + "gubun" => $sqldata['board_id']?:"", + "file_name" => addslashes($_SFILES[$a]['name']), + "file_size" => $_SFILES[$a]['size'], + "file_type" => $_SFILES[$a]['type'], + "file_width" => $_SFILES[$a]['width'], + "file_height" => $_SFILES[$a]['height'], + "reg_date" => $this->DB->sqleval("getdate()"), + ); + $rst = $this->DB->insert(TB_board_attach, $sqlrow); + if( $rst ){ + $aid = $this->DB->insertId(TB_board_attach); + } + + $upload_board_dir = _UP_PATH_."/board"; + if( !file_exists($upload_board_dir) ){ + mkdir($upload_board_dir); + } + $target_dir = $upload_board_dir."/{$this->board_info['board_id']}"; + if( !file_exists($target_dir) ){ + mkdir($target_dir); + } + $file_url = $this->getFileUrl($sqldata['cid'], $aid); + $file_dir = $this->getFileDir($sqldata['cid'], $aid); + + $sqldata['contents'] = preg_replace("/((http).*?){0,1}src_{$_SFILES[$a]['tmp_text']}/ims", $file_url, $sqldata['contents']); + $sqldata['contents'] = str_replace("ctrl_{$_SFILES[$a]['tmp_text']}", "ctrl_{$aid}", $sqldata['contents']); + + \Frody\Util\MultiFileUpload::swfMoveUploadedFile($_SFILES[$a]['tmp_name'], $file_dir); + } + $sqlrow = array( + "board_id" => $sqldata['board_id'], + "cid" => $sqldata['cid'], + "contents" => $sqldata['contents'], + ); + \Frody\Util\MultiFileUpload::swfCleanDir(_UP_PATH_TMP_); + return $this->setContentsParts($sqlrow); + } + } + + function getFileUrl( $cid, $aid ){ + $file_url = _SITE_INC_URL_."/getFile.php?gubun=board&board_id={$this->board_info['board_id']}&cid={$cid}&aid={$aid}"; + return $file_url; + } + + function getFileDir( $cid, $aid ){ + $upload_board_dir = _UP_PATH_."/board"; + if( !file_exists($upload_board_dir) ){ + mkdir($upload_board_dir); + } + $target_dir = $upload_board_dir."/{$this->board_info['board_id']}"; + if( !file_exists($target_dir) ){ + mkdir($target_dir); + } + $file_dir = "{$target_dir}/{$cid}_{$aid}_".strrev(md5("{$cid}_{$aid}")).".data"; + return $file_dir; + } + + function delFiles( $mode, $sqldata="" ){ + $target_dir = _UP_PATH_."/board/{$this->board_info['board_id']}"; + + $where = new DB_where("and"); + $where->add("board_id = ?", $this->board_info['board_id']); + if( $mode == "contents" ){ + $where->add("cid = ?", $sqldata['cid']); + } + if( $mode == "file" ){ + if( is_array($sqldata['aid']) ){ + $subwhere = $where->sub_where("or"); + foreach( (array)$sqldata['aid'] as $v ){ + $subwhere->add("aid = ?", $v); + } + }else{ + $where->add("aid = ?", $sqldata['aid']); + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $row = $this->DB->query("select * from ". TB_board_attach ." where {$whereqry}",$whererow); + foreach( $row as $val ){ + $tgt_file = "{$target_dir}/{$val['cid']}_{$val['aid']}_".strrev(md5("{$val['cid']}_{$val['aid']}")).".data"; + @unlink($tgt_file); + } + return $this->DB->delete(TB_board_attach, $whereqry, $whererow); + } + + function setCommonState( $sqldata ){ + if( $sqldata['oid'] ){ + return $this->setOpinionState( $sqldata ); + }else if( $sqldata['cid'] ){ + return $this->setContentsState( $sqldata ); + } + return 0; + } + + function addCommonGood( $sqldata ){ + if( $sqldata['oid'] ){ + return $this->addOpinionGood( $sqldata['cid'], $sqldata['oid'] ); + }else if( $sqldata['cid'] ){ + return $this->addContentsGood( $sqldata['cid'] ); + } + return 0; + } + + function addCommonNogood( $sqldata ){ + if( $sqldata['oid'] ){ + return $this->addOpinionNogood( $sqldata['cid'], $sqldata['oid'] ); + }else if( $sqldata['cid'] ){ + return $this->addContentsNogood( $sqldata['cid'] ); + } + return 0; + } + + function setContentsParts( $sqldata ){ + $cid = $sqldata['cid']; + unset($sqldata['cid']); + + $where = new DB_where('and'); + if( !$this->table_mode ){ + $where->add("board_id = ?", $this->board_info['board_id']); + } + $where->add('cid = ?', $cid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update( TB_board_contents, $sqldata, $whereqry, $whererow); + } + + function setContentsState( $sqldata ){ + $sql_row = array( + "cid" => $sqldata['cid'], + "state" => $sqldata['state'], + ); + return $this->setContentsParts($sql_row); + } + + function addContentsViews( $cid ){ //조회수 증가 및 세션 생성 + if( !$_SESSION['board_read_'.$this->board_info['board_id']."_".$cid] ){ + $sql_row = array( + "cid" => $cid, + "views" => $this->DB->sqleval("views + 1"), + ); + + $rst = $this->setContentsParts($sql_row);; + if( $rst ){ + $this->setSessRead($cid); + return $rst; + } + } + return 0; + } + + function addContentsGood( $cid ){ + $sql_row = array( + "cid" => $cid, + "good" => $this->DB->sqleval("good + 1"), + ); + return $this->setContentsParts($sql_row); + } + + function addContentsNogood( $cid ){ + $sql_row = array( + "cid" => $cid, + "nogood" => $this->DB->sqleval("nogood + 1"), + ); + return $this->setContentsParts($sql_row); + } + + function getPrevContents( $cid, $num=1 ){ + $where = new DB_where('and'); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add('state = ?', 1); + $where->add('cid < ?', $cid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select * from ". TB_board_contents ." where {$whereqry} order by nid desc ". $this->DB->_limit(0,$num); + $sql = $this->DB->addLimit("select * from ". TB_board_contents ." where {$whereqry}","nid desc",0,$num); + $row = $this->DB->query($sql, $whererow); + return $row; + } + + function getNextContents( $cid, $num=1 ){ + $where = new DB_where('and'); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add('state = ?', 1); + $where->add('cid > ?', $cid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select * from (select * from ". TB_board_contents ." where {$whereqry} order by nid asc ". $this->DB->_limit(0,$num) .") as T order by nid desc"; + $sql = "select * from (". $this->DB->query("select * from ". TB_board_contents ." where {$whereqry}","nid asc",0,$num) .") as T order by nid desc"; + $row = $this->DB->query($sql, $whererow); + return $row; + } + + function getNearContents( $cid, $num){ + $row1 = $this->getNext( $cid, $num ); + $row2 = $this->getPrev( $cid, $num ); + + return array_merge($row1, $row2); + } + + function setOpinionState( $sqldata ){ + $sql_row = array( + "state" => $sqldata['state'] + ); + $where = new DB_where('and'); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add('cid = ?', $sqldata['cid']); + $where->add('oid = ?', $sqldata['oid']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update( TB_board_opinion, $sql_row, $whereqry, $whererow); + } + + function addOpinionGood( $cid, $oid ){ + $sql_row = array( + "good" => $this->DB->sqleval("good + 1") + ); + $where = new DB_where('and'); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add('cid = ?', $cid); + $where->add('oid = ?', $oid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update( TB_board_opinion, $sql_row, $whereqry, $whererow ); + } + + function addOpinionNogood( $cid, $oid ){ + $sql_row = array( + "nogood" => $this->DB->sqleval("nogood + 1") + ); + $where = new DB_where('and'); + $where->add("board_id = ?", $this->board_info['board_id']); + $where->add('cid = ?', $cid); + $where->add('oid = ?', $oid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update( TB_board_opinion, $sql_row, $whereqry, $whererow ); + } + + function isMem(){ //회원권한이 있는지 확인 + return ($this->isMember() || $this->isBoardAdmin() || $this->isAdmin()); + } + + function isAdminAuth(){ //관리자권한이 있는지 확인 + return ($this->isBoardAdmin() || $this->isAdmin()); + } + + function useMemOnly($mode){ //회원전용체크. 권한이 있는 경우 1 리턴 + $mode = "{$mode}_level"; + if( !$this->board_info[$mode] || $this->isMem() ){ + return 1; + } + return 0; + } + + function useAdminOnly($mode){ //관리자전용체크. 권한이 있는 경우 1 리턴 + $mode = "{$mode}_level"; + if( !$this->board_info[$mode] || $this->isAdminAuth() ){ + return 1; + } + return 0; + } + + function chkUseOnly($mode){ //게시판 사용권한 있는지 체크. + switch( $this->board_info["{$mode}_level"] ){ + case "M": + return $this->useMemOnly($mode); + case "A": + return $this->useAdminOnly($mode); + } + return 1; + } + + function isBoardAdmin(){ //게시판 관리자 인지 체크 + if( $this->board_info['board_admin'] && $this->board_info['board_admin'] == $GLOBALS['_Umem']['member_id'] ){ + return 1; + } + return 0; + } + + function chkPasswd( $cid, $passwd ){ //게시물 비밀번호 체크 + $crow = $this->getContents($cid); + if( $this->isBoardAdmin() || $this->isAdmin() || $crow['passwd'] && $this->lcrypt->pw_match( $passwd, $crow['passwd'] ) ){ + $this->setSessSecret($cid); //세션생성 + return 1; + } + return 0; + } + + function chkOpinionPasswd( $cid, $oid, $passwd ){ //의견결 비밀번호 체크 + $orow = $this->getOpinion($cid, $oid); + if( $this->isBoardAdmin() || $this->isAdmin() || $orow['passwd'] && $this->lcrypt->pw_match( $passwd, $orow['passwd'] ) ){ + return 1; + } + return 0; + } + + function chkOpinionAdmin( $cid, $oid ){ //의견글 관리권한 체크 + $orow = $this->getOpinion($cid, $oid); + if( $this->isBoardAdmin() || $this->isAdmin() || $orow['member_id'] === $GLOBALS['_Umem']['member_id'] ){ + return 1; + } + return 0; + } + + function chkSecretAuth($crow){ //게시물 비밀번호 통과 권한이 있는지 체크 (소유자 포함) + if( !$crow ) return 0; + + if( is_numeric($crow) ){ + $crow = $this->getContents($crow); + }else if( is_object($crow) ){ + $crow = (Array)$crow; + } + + if( $_SESSION['board_secret_'.$this->board_info['board_id']."_".$crow['cid']] || $this->isAdminAuth() || $crow['member_id'] && $crow['member_id'] == $GLOBALS['_Umem']['member_id'] ){ + return 1; + } + return 0; + } + + function setSessRead( $cid ){ //게시물 조회 체크 세션 + $_SESSION['board_read_'.$this->board_info['board_id']."_".$cid] = 1; + } + + function setSessSecret( $cid ){ //게시물 비밀번호 체크 세션 + $_SESSION['board_secret_'.$this->board_info['board_id']."_".$cid] = 1; + } + + function chkHasImageFile( $sqldata ){ + if( $sqldata['ATTFILES'] ){ + $_SFILES = \Frody\Util\MultiFileUpload::swfFormFileInfo($sqldata['ATTFILES'], _UP_PATH_TMP_, "N"); + $rst = 1; + for( $a = 0 ; $a<@count($_SFILES) ; $a++ ){ + if( preg_match("/(\.|\/)(gif|jpe?g|png|svg)$/i", $_SFILES[$a]['name']) ){ + return 1; + } + } + } + return 0; + } + + function chkHasFile( $sqldata ){ + if( $sqldata['ATTFILES'] ){ + $_SFILES = \Frody\Util\MultiFileUpload::swfFormFileInfo($sqldata['ATTFILES'], _UP_PATH_TMP_, "N"); + $rst = 1; + for( $a = 0 ; $a<@count($_SFILES) ; $a++ ){ + if( !preg_match("/(\.|\/)(gif|jpe?g|png|svg)$/i", $_SFILES[$a]['name']) ){ + return 1; + } + } + } + return 0; + } + + function isAdmin(){ + if( $GLOBALS['_Umem']['member_auth'] && array_key_exists($GLOBALS['_Umem']['member_auth'], $GLOBALS['_varsAuthAdmin']) ){ + return true; + } + return false; + } + + function isMember(){ + if( $GLOBALS['_Umem']['member_id'] && $GLOBALS['_Umem']['member_status'] == 1 ){ + return true; + } + return false; + } +} \ No newline at end of file diff --git a/lib/app/cust.class.php b/lib/app/cust.class.php new file mode 100644 index 0000000..102ad2f --- /dev/null +++ b/lib/app/cust.class.php @@ -0,0 +1,127 @@ +DB->tableExists(TB_cust_list); + } + + public function getCustList($fields, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("cust_active = ?", 1); + $orderby="cust_name"; + $limit=array(); + + $rows = $this->getDataList($fields, $where, $orderby, $limit); + for( $a=0 ; $a<@count($rows) ; $a++ ){ + if( $rows[$a]['cust_phone'] ) $rows[$a]['cust_phone'] = $this->lcrypt->dec_secure($rows[$a]['cust_phone']); + if( $rows[$a]['cust_mail'] ) $rows[$a]['cust_mail'] = $this->lcrypt->dec_secure($rows[$a]['cust_mail']); + } + return $rows; + } + + public function getCustSelect($key, $val, $where=""){ + $rows = $this->getDataList("{$key}, {$val}", $where, "{$val} asc"); + $selrows = array(); + foreach( (array)$rows as $row ){ + $selrows[$row[$key]] = $row[$val]; + } + return $selrows; + } + + public function getCustPage($sqldata, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("cust_active = ?", 1); + + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("cust_id like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("cust_name like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("cust_fullname like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("cust_charger like ?", "%{$sqldata['stxt']}%"); + } + } + if( hasval($sqldata['cust_status']) ){ + $where->add("cust_status = ?", $sqldata['cust_status']); + } + + $orderby = "reg_date desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ){ + $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + } + + $query = array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum'], + "page" => $sqldata['page'], + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + + "cust_status" => $sqldata['cust_status'], + ); + + $lists = $this->getDataPage("*", $query, $where ,$orderby); + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){ + if( $lists->rows[$a]['cust_phone'] ) $lists->rows[$a]['cust_phone'] = $this->lcrypt->dec_secure($lists->rows[$a]['cust_phone']); + if( $lists->rows[$a]['cust_mail'] ) $lists->rows[$a]['cust_mail'] = $this->lcrypt->dec_secure($lists->rows[$a]['cust_mail']); + } + return $lists; + } + + public function getCust( $cust_id ){ + $urow = Array("cust_id" => $cust_id); + $where = ""; + $row = $this->getData("*", $urow, $where); + $row['cust_phone'] = $this->lcrypt->dec_secure($row['cust_phone']); + $row['cust_mail'] = $this->lcrypt->dec_secure($row['cust_mail']); + return $row; + } + + public function putCust( $sqldata ) { + if( $sqldata['cust_phone'] ){ + $sqldata['cust_phone'] = $this->lcrypt->enc_secure($sqldata['cust_phone']); + } + if( $sqldata['cust_mail'] ){ + $sqldata['cust_mail'] = $this->lcrypt->enc_secure($sqldata['cust_mail']); + } + return $this->putData($sqldata); + } + + public function setCust( $sqldata ) { + $cinfo = $this->getCust($sqldata['cust_id']); + if( $sqldata['cust_id'] && $cinfo['cust_id'] == $sqldata['cust_id'] ){ + if( $sqldata['cust_phone'] ){ + $sqldata['cust_phone'] = $this->lcrypt->enc_secure($sqldata['cust_phone']); + } + if( $sqldata['cust_mail'] ){ + $sqldata['cust_mail'] = $this->lcrypt->enc_secure($sqldata['cust_mail']); + } + $urow = Array("cust_id" => $sqldata['cust_id']); + $where = ""; + unset($sqldata['cust_id']); + return $this->setData($sqldata, $urow, $where); + }else{ + return $this->putCust( $sqldata ); + } + } + + public function setCustParts( $sqldata, $field="", $row="", $where="" ){ + return $this->setDataParts($sqldata, $field, $row, $where); + } + + public function delCust( $cust_id, $where ){ + $urow = Array("cust_id" => $cust_id); + $where = ""; + return $this->delData($urow, $where); + } + +} \ No newline at end of file diff --git a/lib/app/member.class.php b/lib/app/member.class.php new file mode 100644 index 0000000..bd99e19 --- /dev/null +++ b/lib/app/member.class.php @@ -0,0 +1,612 @@ +DB->tableExists(TB_member); + $this->DB->tableExists(TB_member_log); + $this->DB->tableExists(TB_member_union); + + $this->member_id = $member_id?:(isset($GLOBALS['_Umem']['member_id'])?$GLOBALS['_Umem']['member_id']:""); + + $this->TB = " (select mem.*, meu.cust_id, meu.cust_name from ". TB_member ." as mem left join ". TB_member_union . " as meu on mem.member_id = meu.member_id) as m "; + } + + public function getMemberList( $field="*", $where="", $orderby="", $limit=array() ){ + if( !$where ){ + $where = new DB_where("and"); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select {$field} from ".$this->TB." where {$whereqry} ".(($orderby)?"order by {$orderby}":""). $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select {$field} from ".$this->TB." where {$whereqry}", $orderby, $limit[0],$limit[1]); + $rst = $this->DB->qry($sql, $whererow); + $row = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $row[] = $this->getMemberInfo($tmp); + } + return $row; + } + + public function getMemberSel( $field="*", $where="", $orderby="", $limit=array() ){ + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("member_status = ?",1); + + $mlist = $this->getMemberList("member_id, part_name",$where,"part_name, member_name asc", $limit); + $mem_list = array(); + for( $a=0 ; $a<@count($mlist) ; $a++ ){ + $mem_list[] = array( + "id" => $mlist[$a]['member_id'], + "text" => $mlist[$a]['part_name'], + ); + } + return $mem_list; + } + + public function getMemberSelect($key, $val, $where=""){ + $rows = $this->getMemberList("{$key}, {$val}", $where, "member_name asc"); + $selrows = array(); + foreach( (array)$rows as $row ){ + $selrows[$row[$key]] = $row[$val]; + } + return $selrows; + } + + public function getMemberPage($sqldata=array(), $query=array(), $where=""){ //관리자 리스트 (페이징) + if( !$where ){ + $where = new DB_where("and"); + } + + $where->add("reg_date >= ?", ($sqldata['sdate']?$sqldata['sdate']:_SDATENULL_)." 00:00:00.000"); + $where->add("reg_date <= ?", ($sqldata['fdate']?$sqldata['fdate']:_FDATENULL_)." 23:59:59.999"); + + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("member_id like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("member_name like ?", "%{$sqldata['stxt']}%"); + } + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $orderby = "reg_date desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ){ + $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + } + + $query = array_merge(array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum'], + "sdate" => $sqldata['sdate']?:"", + "fdate" => $sqldata['fdate']?:"", + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ), $query); + + $lists = new clist(); + $lists->fld = "*"; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $sqldata['page']?:1; + $lists->linktype = ""; + $lists->viewnum = $query['viewnum']?:$GLOBALS['_varsBaseCode']['line_num']; + $lists->rownum = $query['rownum']?:$GLOBALS['_varsBaseCode']['page_num']; + $lists->getCommonList($this->TB); + + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){ + $lists->rows[$a] = $this->getMemberInfo($lists->rows[$a]); + } + + return $lists; + } + + public function getMemberLogList($field="*",$where="", $orderby="",$limit=array()){ //관리자 리스트 + $tbl = "(select L.*, M.member_name, M.company_name from ".TB_member_log." as L left join ".TB_member." as M on L.member_id = M.member_id) as L"; + + if( !$where ){ + $where = new DB_where("and"); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select {$field} from {$tbl} where {$whereqry} ".(($orderby)?"order by {$orderby}":""). $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select {$field} from {$tbl} where {$whereqry}", $orderby, $limit[0],$limit[1]); + $rst = $this->DB->qry($sql, $whererow); + $row = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $tmp['login_date'] = getDT_datetime($tmp['login_date']); + $row[] = $tmp; + } + return $row; + } + + public function getMemberLogPage($sqldata=array(), $query=array(), $where=""){ //관리자 리스트 (페이징) + $tbl = "(select L.*, M.member_name from ".TB_member_log." as L left join ".TB_member." as M on L.member_id = M.member_id) as L"; + + if( !$where ){ + $where = new DB_where("and"); + } + + $where->add("login_date >= ?", ($sqldata['sdate']?$sqldata['sdate']:_SDATENULL_)." 00:00:00.000"); + $where->add("login_date <= ?", ($sqldata['fdate']?$sqldata['fdate']:_FDATENULL_)." 23:59:59.999"); + + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("member_id like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("member_name like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("ip_addr like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("browser like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("con_domain like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("OS like ?", "%{$sqldata['stxt']}%"); + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $orderby = "login_date desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ){ + $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + } + + $query = array_merge(array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum'], + "sdate" => $sqldata['sdate']?:"", + "fdate" => $sqldata['fdate']?:"", + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ), $query); + + $lists = new clist(); + $lists->fld = "*"; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $sqldata['page']?:1; + $lists->linktype = ""; + $lists->viewnum = $query['viewnum']?:$GLOBALS['_varsBaseCode']['line_num']; + $lists->rownum = $query['rownum']?:$GLOBALS['_varsBaseCode']['page_num']; + $lists->getCommonList($tbl); + + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){ + $lists->rows[$a]['login_date'] = getDT_datetime($lists->rows[$a]['login_date']); + } + + return $lists; + } + + public function getMember( $member_id="", $where="" ) { + $member_id = $member_id?:$this->member_id; + + if( !$member_id ) return 0; + + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("member_id = ?",$member_id); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->query_record = false; //query log 기록 금지 + + $sql = "select * from ".$this->TB." where {$whereqry}"; + $rst = $this->DB->qry($sql, $whererow); + $row = $this->DB->fetch_array($rst); + $row = $this->getMemberInfo($row); + + $where = new DB_where("and"); + $where->add("member_id = ?",$member_id); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + if( $this->isAdmin() ){ //관리자의 경우 회원의 마지막 로그인 정보를 주고, 일반회원은 자신의 현재 로그인 이전의 로그인 정보를 준다. + $sql = "select login_date as last_login, ip_addr as last_ip from ".TB_member_log." where {$whereqry} order by login_date desc"; + $rst = $this->DB->qry($sql, $whererow); + $lrow = $this->DB->fetch_array($rst); + $row['login_ip'] = $lrow['last_ip']?:""; + $row['login_date'] = $lrow['last_login']; + } + + $this->DB->query_record = true; //query log 기록 재개 + + return $row; + } + + public function getMemberWhere( $wrow ) { + $where = new DB_where("and"); + foreach( $wrow as $key => $val ){ + $where->add("{$key} = ?",$val); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ".$this->TB." where {$whereqry}"; + $rst = $this->DB->qry($sql, $whererow); + $row = $this->getMemberInfo($this->DB->fetch_array($rst)); + + return $row; + } + + public function getMemberInfo( $row ){ + if( isset($row['member_mobile']) && $row['member_mobile'] ) $row['member_mobile'] = $this->lcrypt->dec_secure($row['member_mobile']); + if( isset($row['member_mail']) && $row['member_mail'] ) $row['member_mail'] = $this->lcrypt->dec_secure($row['member_mail']); + if( isset($row['member_phone']) && $row['member_phone'] ) $row['member_phone'] = $this->lcrypt->dec_secure($row['member_phone']); + + return $row; + } + + public function putMember( $sqldata=array() ) { //가입 + if( $this->DB->tableExists( TB_member ) ){ + $sql_row = array( + "member_id" => $sqldata['member_id']?:"", + "member_pw" => $sqldata['member_pw']?$this->lcrypt->pw_make($sqldata['member_pw']):"", + "member_name" => $sqldata['member_name']?:"", + "member_mobile" => $sqldata['member_mobile']?$this->lcrypt->enc_secure($sqldata['member_mobile']):"", + "member_mail" => $sqldata['member_mail']?$this->lcrypt->enc_secure($sqldata['member_mail']):"", + "member_certi_key" => $sqldata['member_certi_key']?:"", + "member_status" => $sqldata['member_status']?:1, + "member_auth" => $sqldata['member_auth']?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + "mod_date" => $this->DB->sqleval("getdate()"), + ); + + return $this->DB->insert( TB_member, $sql_row); + } + return 0; + } + + public function setMember( $sqldata ) { //정보 수정 + if( !$this->isAdmin() ){ + $sqldata['member_id'] = $GLOBALS['_Umem']['member_id']; + } + $sql_row = array( + "member_name" => $sqldata['member_name'], + "member_mobile" => $sqldata['member_mobile']?$this->lcrypt->enc_secure($sqldata['member_mobile']):"", + "member_mail" => $sqldata['member_mail']?$this->lcrypt->enc_secure($sqldata['member_mail']):"", + "mod_date" => $this->DB->sqleval("getdate()"), + ); + if( $this->isAdmin() ){ + if( $sqldata['member_certi_key'] ){ + $sql_row['member_certi_key'] = $sqldata['member_certi_key']; + } + } + if( $sqldata['member_status'] ){ + $sql_row['member_status'] = $sqldata['member_status']; + } + if( $sqldata['member_auth'] ){ + $sql_row['member_auth'] = $sqldata['member_auth']; + } + if( $sqldata['member_pw'] ){ + $sql_row["member_pw"] = $this->lcrypt->pw_make($sqldata['member_pw']); + } + + return $this->DB->update( TB_member, $sql_row, "member_id = ?", array($sqldata['member_id'])); + } + + public function setMemberParts( $sqldata ){ + if( !$sqldata['member_id'] || $GLOBALS['_Umem']['member_id'] && !$this->isAdmin() ){ + $sqldata['member_id'] = $GLOBALS['_Umem']['member_id']; + } + $where = new DB_where("and"); + if( is_array($sqldata['member_id']) ){ + //$where->add("member_id in ?",$sqldata['member_id']); + $subwhere = $where->sub_where("or"); + foreach( $sqldata['member_id'] as $val ){ + $subwhere->add("member_id = ?",$val); + } + }else{ + $where->add("member_id = ?",$sqldata['member_id']); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + unset($sqldata['member_id']); + return $this->DB->update( TB_member, $sqldata, $whereqry, $whererow ); + } + + public function delMember( $member_id ) { //회원 삭제 + if( $this->isAdmin() ){ + $where = new DB_where("and"); + $where->add("member_id = ?",$member_id); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->delete( TB_member, $whereqry, $whererow ); + } + return 0; + } + + public function getMemberUnion($member_id, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("member_id = ?", $member_id); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ".TB_member_union." where {$whereqry}"; + return $this->DB->queryFirstRow($sql, $whererow); + } + + public function putMemberUnion($sqldata){ + $sql_row = Array( + "member_id" => $sqldata['member_id'], + "cust_id" => $sqldata['cust_id']?:"", + "cust_name" => $sqldata['cust_name']?:"", + ); + return $this->DB->insert(TB_member_union, $sql_row); + } + + public function setMemberUnion($sqldata){ + $sql_row = Array( + "member_id" => $sqldata['member_id'], + "cust_id" => $sqldata['cust_id']?:"", + "cust_name" => $sqldata['cust_name']?:"", + ); + + $uinfo = $this->getMemberUnion($sql_row['member_id']); + if( $uinfo['member_id'] && $uinfo['member_id'] == $sql_row['member_id'] ){ + $where = new DB_where("and"); + $where->add("member_id = ?", $sql_row['member_id']); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update(TB_member_union, $sql_row, $whereqry, $whererow); + }else{ + return $this->putMemberUnion($sql_row); + } + } + + public function delMemberUnion($member_id){ + $where = new DB_where("and"); + $where->add("member_id = ?", $member_id); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->delete(TB_member_union, $whereqry, $whererow); + } + + public function active( $member_id ) { //활동 + return $this->setMemberParts( array( + "member_id" => $member_id, + "member_status" => 1 + )); + } + + public function pause( $member_id ) { //임시정지 + return $this->setMemberParts( array( + "member_id" => $member_id, + "member_status" => 2 + )); + } + + public function withdraw( $member_id ) { //탈퇴 / 퇴사처리 + return $this->setMemberParts( array( + "member_id" => $member_id, + "member_status" => 3 + )); + } + + public function join( $sqldata ) { //가입 + return $this->putMember( $sqldata ); + } + + public function login($member_id, $member_pw) { // 로그인 + $result = 0; + if( !$member_id || !$member_pw ){ + return $result; + } + + $row = $this->pwCheck($member_id, $member_pw); + if( $row ){ + if( $row['member_status'] == 1 && $row['member_auth'] ){ + $_SESSION['auth_mem_id'] = $member_id; + + // 로그인 시점의 microtime + list ( $usec, $sec ) = explode ( " ", microtime () ); + $rand_no = rand ( 100000, 999999 ); + $login_security_key = str_replace ( '.', '', get_ip() ) . $sec . str_replace ( '.', '', $usec ) . $rand_no; + $_SESSION['auth_login_security_key'] = $login_security_key; + //$result = $row; //가입요청 및 임시중지등 등록된 회원 상태를 알리기 위해 if 밖으로 조정 + + if( class_exists("Visit") && $_SESSION['visit_sess'] ){ //방문세션이 존재하면 방문세션 테이블에 ID를 기록한다. + $vsobj = new Visit(); + $vsobj->setLoginRec(); + } + } + $result = $row; + } + + return $result; + } + + public function loginAforce($member_id) { // 관리자용 회원 강제 로그인 + $result = 0; + if( !$member_id || !$this->isAdmin() ){ + return $result; + } + + $row = $this->getMember($member_id); + if( $row['member_id'] ){ + $where = new DB_where("and"); + $where->add("member_id = ?",$member_id); + $where->add("login_success = ?",1); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select login_security_key from ".TB_member_log." where {$whereqry} order by login_date desc ".$this->DB->_limit(0,1); + $sql = $this->DB->addLimit("select login_security_key from ".TB_member_log." where {$whereqry}","login_date desc",0,1); + $login_security_key = $this->DB->queryFirstField($sql,$whererow); + + $_SESSION['auth_mem_id'] = $member_id; + $_SESSION['auth_login_security_key'] = $login_security_key; + + $result = 1; + }else{ + $result = 0; + } + + return $result; + } + + public function pwCheck( $member_id, $member_pw ){ //비밀번호 체크 + $row = $this->getMember($member_id); + if( $row['member_pw'] ){ + if( $this->lcrypt->pw_match($member_pw, $row['member_pw']) ){ + return $row; + } + } + return 0; + } + + public function logout(){ //로그아웃 + //session_destroy(); + $_SESSION['auth_mem_id'] = ""; + $_SESSION['auth_login_security_key'] = ""; + return 1; + } + + public function logRec( $member_id, $login_page, $log_rst ){ //로그인 기록 + $result = 0; + if( $this->DB->tableExists( TB_member_log ) ){ + $where = new DB_where("and"); + $where->add("member_id = ?",$member_id); + $where->add("login_success = ?",1); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //자신의 현재 로그인 이전의 로그인 정보를 기록한다. + $crow = $this->DB->queryFirstRow( "select count(*)+1 as login_count from ".TB_member_log." where {$whereqry}", $whererow ); + $lrow = $this->DB->queryFirstRow( "select top 1 login_date, ip_addr as last_ip from ".TB_member_log." where {$whereqry} order by login_date desc", $whererow ); + $sql_row = array( + "member_id" => $member_id, + "login_count" => $crow['login_count']?:0, + "login_ip" => $lrow['last_ip']?:"", + "login_date" => getDT_datetime($lrow['login_date']), + ); + $this->setMemberParts($sql_row); + + $connect_info = parse_user_agent(); + if( is_array($connect_info['browser']) ){ + $connect_info['browser'] = substr(json_encode($connect_info['browser']),0,40); + } + $sql_row = array( + "member_id" => $member_id, + "ip_addr" => get_ip(), + "login_page" => $login_page, + "login_success" => $log_rst?1:0, + "login_date" => $this->DB->sqleval("getdate()"), + "login_security_key" => $_SESSION['auth_login_security_key']?:"", + "sess_file_name" => session_id(), + "browser" => "{$connect_info['browser']} | {$connect_info['version']}", + "con_domain" => $_SERVER['HTTP_HOST']?:"", + "os" => $connect_info['platform']?:"", + "os_bit" => "" + ); + $result = $this->DB->insert( TB_member_log, $sql_row); + } + return $result; + } + + public function loginCheck( $member_id="" ){ //로그인 체크 + $member_id = $member_id?:$_SESSION['auth_mem_id']; + if( $member_id ){ + if( !defined('_SINGLE_LOGIN_') || !_SINGLE_LOGIN_ || _SINGLE_LOGIN_ && $this->multiLoginBlock() ){ + $row = $this->getMember( $member_id ); + unset($row['member_pw']); + return $row; + }else{ + return $this->logout(); + } + } + return 0; + } + + public function multiLoginBlock(){ //멀티 로그인 차단 + $where = new DB_where("and"); + $where->add("member_id = ?",$GLOBALS['_Umem']['member_id']); + $where->add("login_success = ?",1); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select login_security_key from ".TB_member_log." where {$whereqry} order by login_date desc ".$this->DB->_limit(0,1); + $sql = $this->DB->addLimit("select login_security_key from ".TB_member_log." where {$whereqry}","login_date desc",0,1); + $match_login_security_key = $this->DB->queryFirstField($sql,$whererow); + + if( $match_login_security_key == $_SESSION['auth_login_security_key'] ){ + return 1; + } + return 0; + } + + public function temp_pw_gen( $len=0 ){ //임시비밀번호 생성 + if( $len < 1 ) $len = 8; + $str = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%&*ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $temp_pw = ""; + for($i=0; $i<$len; $i++) { + $temp_pw .= $str[random_int(0, strlen($str)-1)]; + } + return $temp_pw; + } + + public function isAdmin($admin_id="", $suonly=""){ //관리 권한 있는지 확인 + if( !$admin_id || $admin_id && $admin_id == $GLOBALS['_Umem']['member_id'] ){ + $arow = $GLOBALS['_Umem']; + }else{ + $arow = $this->getMember($admin_id); + } + + if( $suonly ){//기준정보에서 SA 코드자체를 변경할수 있으므로 suonly 는 사용에 주의 + $adminrow = array("SA"); + }else{ + if( is_array($GLOBALS['_varsAuthAdmin']) ){ + $adminrow = array_keys($GLOBALS['_varsAuthAdmin']); + }else{ + $adminrow = array("SA","A"); + } + } + + if( in_array($arow['member_auth'], $adminrow) ){ + return true; + }else{ + return false; + } + } +} \ No newline at end of file diff --git a/lib/app/menu.class.php b/lib/app/menu.class.php new file mode 100644 index 0000000..89b6cbf --- /dev/null +++ b/lib/app/menu.class.php @@ -0,0 +1,453 @@ +DB->tableExists(TB_menu_auth_page); + + $this->set_cate_area(); + $this->AUTH = new Auth(); + } + + public function getMenuList($usage="Y"){ + $where = new DB_where("and"); + $where->add("cate.cate_area = ?", $this->cate_area); + if( $usage ){ + $where->add("cate_use = ?", "Y"); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where cate_area = '{$this->cate_area}' and cate_use != 'Y'"; + $notuse_row = $this->DB->query($sql); + $use_fld = array(); + foreach( (array)$notuse_row as $nrow ){ + $use_fld[] = " cate.cate_code like '{$nrow['cate_code']}%' "; + } + if( count($use_fld) ){ + $add_fld = implode(" or ", $use_fld); + }else{ + $add_fld = " 1!=1 "; + } + + $sql = "select + cate.cate_area, + cate.cate_id, + cate.cate_code, + cate.cate_name, + case when ({$add_fld}) then 'N' else 'Y' end as cate_use + from {$this->cate_table} as cate + left join (select * from {$this->cate_table} where cate_area = '{$this->cate_area}') pa_cate + on substring(cate.cate_code, 1, len(cate.cate_code)-{$this->dmax}) = pa_cate.cate_code + where {$whereqry} order by cate.cate_code asc"; + + $rst = $this->DB->qry($sql, $whererow); + if( $rst ){ + $rows = array(); + while( $row = $this->DB->fetch_array($rst) ){ + $row['level'] = $this->level_cate($row['cate_code']); + $rows[] = Array( + "id" => $row['cate_id'], + "text" => $row['cate_name'], + "parent" => $row['parent'], + "icon" => "", + "data" => $row, + ); + } + return $rows; + }else{ + return 0; + } + } + + public function getMenuAuthList($usage="Y"){ + $where = new DB_where("and"); + $where->add("cate.cate_area = ?", $this->cate_area); + if( $usage ){ + $where->add("cate_use = ?", "Y"); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + /* + $sql = "select + cate.cate_id as id, + cate.cate_code as data, + ifnull(pa_cate.cate_id, '#') as parent, + cate.cate_name as text, + case cate.cate_auth when 'Y' then '' else '' end as icon + from {$this->cate_table} as cate + left join pa_cate + on substring(cate.cate_code, 1, LENGTH(cate_code)-{$this->dmax}) = pa_cate.cate_code where {$whereqry} order by cate.cate_code asc";*/ + + /* 쿼리 2번 실행 */ + $sql = "select cate_area, cate_id, auth_area, auth_target, auth from ".TB_auth_manage." where cate_area = '{$this->cate_area}'"; + $rows = $this->DB->query($sql); + + $auths = array(); + foreach( (array)$rows as $auth ){ + if( !isset($auths[$auth['cate_id']]) ) $auths[$auth['cate_id']] = array(); + if( !isset($auths[$auth['cate_id']][$auth['auth_area']]) ) $auths[$auth['cate_id']][$auth['auth_area']] = array(); + + $auths[$auth['cate_id']][$auth['auth_area']][$auth['auth_target']] = $auth['auth']; + } + + $sql = "select + cate.cate_area, + cate.cate_id, + cate.cate_code, + cate.cate_name, + cate.cate_data, + cate.cate_exp, + cate.cate_class, + cate.cate_auth, + cate.cate_use, + isnull(pa_cate.cate_id, '#') as parent, + pages.cate_filepath + from {$this->cate_table} as cate + left join (select cate_area, cate_id, stuff(( select char(13)+ tagg.filepath from ".TB_menu_auth_page." as tagg where tagg.cate_area = tmap.cate_area for xml path(''), type).value('.','varchar(max)'),1,1,'') as cate_filepath from ".TB_menu_auth_page." as tmap group by cate_area, cate_id) as pages + on cate.cate_area = pages.cate_area and cate.cate_id = pages.cate_id + left join (select cate_id, cate_code from {$this->cate_table} where cate_area = '{$this->cate_area}') pa_cate + on substring(cate.cate_code, 1, len(cate.cate_code)-{$this->dmax}) = pa_cate.cate_code + where {$whereqry} order by cate.cate_code asc"; + + //string_agg 대체 + //stuff(( select char(13)+ tagg.filepath from ".TB_menu_auth_page." as tagg where tagg.cate_area = tmap.cate_area for xml path(''), type).value('.','varchar(max)'),1,1,'') as cate_filepath + //cate_filepath=stuff(( select char(13)+ tagg.filepath from ".TB_menu_auth_page." as tagg where tagg.cate_area = tmap.cate_area for xml path(''), type).value('.','varchar(max)'),1,1,'') + // + //string_agg(filepath,CHAR(13)) as cate_filepath + + /* 서브쿼리 이용 + $sql = "select + cate.cate_area, + cate.cate_id, + cate.cate_code, + cate.cate_name, + cate.cate_data, + cate.cate_exp, + cate.cate_class, + cate.cate_auth, + isnull(pa_cate.cate_id, '#') as parent + from {$this->cate_table} as cate + left join (select * from {$this->cate_table} where cate_area = '{$this->cate_area}') as pa_cate + on substring(cate.cate_code, 1, len(cate.cate_code)-{$this->dmax}) = pa_cate.cate_code + left join (select cate_area, cate_id, auth_area, string_agg(concat(auth_target,':',auth),',') as auths from ".TB_auth_manage." group by cate_area, cate_id, auth_area ) as auth + on cate.cate_area = auth.cate_area and cate.cate_id = auth.cate_id + where cate.cate_area = '{$this->cate_area}' group by cate.cate_area, cate.cate_id, auth_area order by cate.cate_code asc";*/ + + + $rst = $this->DB->qry($sql, $whererow); + if( $rst ){ + $rows = array(); + while( $row = $this->DB->fetch_array($rst) ){ +// foreach( $GLOBALS['_varsAuthArea'] as $auth_area => $name ){ +// $row['cate_auth_read'][$auth_area] = $authObj->getHasAuthRow($auths[$row['cate_id']][$auth_area], "READ"); +// $row['cate_auth_write'][$auth_area] = $authObj->getHasAuthRow($auths[$row['cate_id']][$auth_area], "WRITE"); +// $row['cate_auth_delete'][$auth_area] = $authObj->getHasAuthRow($auths[$row['cate_id']][$auth_area], "DELETE"); +// } + + $row['auth'] = $auths[$row['cate_id']]; + $rows[] = Array( + "id" => $row['cate_id'], + "text" => $row['cate_name'], + "parent" => $row['parent'], + "icon" => "", + "data" => $row, + ); + } + return $rows; + }else{ + return 0; + } + } + + public function getTreeList($cate_code="", $direct=false){ + $temp_ren = strlen($cate_code) + $this->dmax; + + $where = $this->getAreaQry(); + $where = $this->getShowQry($where); + $where->add("cate_code like ?", "{$cate_code}%"); + $where->add("cate_code != ?", $cate_code); + $where->add("len(cate_code) = ?", $temp_ren); + $where->add("cate.cate_use = ?", "Y"); + $subwhere = $where->sub_where("or"); + $subwhere->add("auth.auth_read = ?", 1); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $tb_auth = "select + cate_id, + cast(sum(auth & 4) as bit) as auth_delete, + cast(sum(auth & 2) as bit) as auth_write, + cast(sum(auth & 1) as bit) as auth_read + from ".TB_auth_manage." + where (auth_area = 'G' and auth_target = '".$GLOBALS['_Umem']['member_auth']."') or (auth_area = 'M' and auth_target = '".$GLOBALS['_Umem']['member_id']."') + group by cate_id"; + + $sql = "select cate.cate_id, cate_code, cate_name, cate_data, cate_exp, cate_class from {$this->cate_table} as cate + left join ({$tb_auth}) as auth on cate.cate_id = auth.cate_id + where {$whereqry} order by cate_code"; + $rst = $this->DB->qry($sql, $whererow); + $i = 0; + $rows = Array(); + while( $row = $this->DB->fetch_array($rst) ){ + if( !$direct ){ + $row['child'] = $this->getTreeList($row['cate_code']); + } + $rows[] = $row; + } + return $rows; + } + + public function getTreeListForTreeView($cate_code="", $now_code=""){ + $temp_ren = strlen($cate_code) + $this->dmax; + + $where = $this->getAreaQry(); + $where = $this->getShowQry($where); + $where->add("cate.cate_code like ?", "{$cate_code}%"); + $where->add("cate.cate_code != ?", $cate_code); + $where->add("len(cate.cate_code) = ?", $temp_ren); + $where->add("cate.cate_use = ?", "Y"); + $subwhere = $where->sub_where("or"); + $subwhere->add("auth.auth_read = ?", 1); + $subwhere->add("'SA' = ?", $GLOBALS['_Umem']['member_auth']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $tb_auth = "select + cate_id, + cast(sum(auth & 4) as bit) as auth_delete, + cast(sum(auth & 2) as bit) as auth_write, + cast(sum(auth & 1) as bit) as auth_read + from ".TB_auth_manage." + where (auth_area = 'G' and auth_target = '".$GLOBALS['_Umem']['member_auth']."') or (auth_area = 'M' and auth_target = '".$GLOBALS['_Umem']['member_id']."') + group by cate_id"; + + $sql = "select + cate.cate_id, + cate.cate_code, + cate.cate_name, + cate.cate_data, + cate.cate_exp, + cate.cate_class + from {$this->cate_table} as cate + left join ({$tb_auth}) as auth + on cate.cate_id = auth.cate_id + where {$whereqry} order by cate.cate_code"; + $rst = $this->DB->qry($sql, $whererow); + $i = 0; + $rows = Array(); + while( $row = $this->DB->fetch_array($rst) ){ + $children = $this->getTreeListForTreeView($row['cate_code'], $now_code); + $temp = array( + "id" => $row['cate_id'], + "key" => $row['cate_id'],// + "text" => $row['cate_name'], + "title" => $row['cate_name'],// + "href" => $row['cate_data'], + "icon" => $row['cate_class'], + "selectable" => 0, + "state" => array("expanded"=>false), + "tags" => [''], + "nodes" => $children?:"", + "children" => $children?:"",// + "folder" => $children?true:false,// + ); + if( preg_match( "/^{$row['cate_code']}/", $now_code ) ){ + $temp['state']['expanded'] = true; + $temp['expanded'] = true;// + } + if( $row['cate_code'] == $now_code ){ + $temp['state']['selected'] = true; + $temp['active'] = true;// + } + $rows[] = $temp; + } + return $rows; + } + + public function putMenu($sqldata, $auth_area){ + /* 권한 추가 */ + foreach( (array)$this->authDest as $grpcode => $grpname ){ + $readAuth = in_array($grpcode, (array)$sqldata['cate_auth_read']); + $writeAuth = in_array($grpcode, (array)$sqldata['cate_auth_write']); + $deleteAuth = in_array($grpcode, (array)$sqldata['cate_auth_delete']); + + $this->AUTH->putAuth( + $this->cate_area, + $sqldata['cate_id'], + $auth_area, + $grpcode, + $this->AUTH->getAuthToNum($readAuth, $writeAuth, $deleteAuth) + ); + } + + /* 메뉴 등록 */ + $sql_row = Array( + "cate_area" => $this->cate_area, + "cate_id" => $sqldata['cate_id']?:"", + "cate_name" => $sqldata['cate_name']?:"", + "cate_data" => $sqldata['cate_data']?:"", + "cate_exp" => $sqldata['cate_exp']?:"", + "cate_class" => $sqldata['cate_class']?:"", + "cate_auth" => $sqldata['cate_auth']?:"", + "cate_use" => $sqldata['cate_use']?:"", + ); + + $pa_row = $this->cate_info_id($sqldata['parent_id']); + $cate_code = $this->new_cate($pa_row['cate_code']); + $sql_row['cate_code'] = $cate_code; + + $rst = $this->DB->insert($this->cate_table, $sql_row); + if( $rst ){ + $auth_filepath = explode("\n",preg_replace("\r\n","\n",$sqldata['cate_filepath'])); + foreach( (array)$auth_filepath as $path ){ + if( trim($path) ){ + $sql_row = Array( + "cate_area" => $this->cate_area, + "cate_id" => $sqldata['cate_id']?:"", + "filepath" => $path, + ); + $this->DB->insert(TB_menu_auth_page, $sql_row); + } + } + } + return $rst; + } + + public function setMenu($sqldata, $auth_area){ + /* 권한 수정 */ + foreach( (array)$this->authDest as $grpcode => $grpname ){ + $readAuth = in_array($grpcode, (array)$sqldata['cate_auth_read']); + $writeAuth = in_array($grpcode, (array)$sqldata['cate_auth_write']); + $deleteAuth = in_array($grpcode, (array)$sqldata['cate_auth_delete']); + + $this->AUTH->setAuth( + $this->cate_area, + $sqldata['cate_id'], + $auth_area, + $grpcode, + $this->AUTH->getAuthToNum($readAuth, $writeAuth, $deleteAuth), + $sqldata['parent_id'] + ); + } + + + /* 메뉴 수정 */ + $sql_row = Array( + "cate_area" => $this->cate_area, + "cate_id" => $sqldata['cate_id']?:"", + "cate_name" => $sqldata['cate_name']?:"", + "cate_data" => $sqldata['cate_data']?:"", + "cate_exp" => $sqldata['cate_exp']?:"", + "cate_class" => $sqldata['cate_class']?:"", + "cate_auth" => $sqldata['cate_auth']?:"", + "cate_use" => $sqldata['cate_use']?:"", + ); + + $where = $this->getAreaQry(); + $where->add("cate_id = ?",$sqldata['parent_id']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $rst = $this->DB->update($this->cate_table, $sql_row, $whereqry, $whererow); + if( $rst ){ + $where = new DB_where("and"); + $where->add("cate_area = ?", $this->cate_area); + $where->add("cate_id = ?", $sqldata['cate_id']?:""); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + $this->DB->delete(TB_menu_auth_page, $whereqry, $whererow); + + $auth_filepath = explode("\n",preg_replace("/\r\n/ims","\n",$sqldata['cate_filepath'])); + foreach( (array)$auth_filepath as $path ){ + if( trim($path) ){ + $sql_row = Array( + "cate_area" => $this->cate_area, + "cate_id" => $sqldata['cate_id']?:"", + "filepath" => $path, + ); + $this->DB->insert(TB_menu_auth_page, $sql_row); + } + } + } + return $rst; + } + + public function delMenu($cate_id, $auth_area="", $auth_target=""){ + $caterow = $this->cate_info_id($cate_id); + $rst = $this->drop_cate($caterow['cate_code']); + if( $rst ){ + $rst = $rst && $this->AUTH->delAuth($this->cate_area, $cate_id, $auth_area, $auth_target); + } + return $rst; + } + + public function getMenuIdFromUrl($url){ + $where = new DB_where("and"); + $where->add("cate_area = ?", $this->cate_area); + //$where->add("filepath like ?", "%{$url}%"); + $where->add("CHARINDEX(filepath, ?) <> 0", $url); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select cate_id from ".TB_menu_auth_page." where {$whereqry}"; + return $this->DB->queryFirstField($sql,$whererow); + } + + public function hasMenuAuth($auth, $cate_id=""){ + if( !$cate_id ){ + if( $GLOBALS['_Auth_']['cate_id'] ){ + $cate_id = $GLOBALS['_Auth_']['cate_id']; + }else{ + $cate_id = $this->getMenuIdFromUrl($_SERVER['SCRIPT_URI']); + } + } + return $this->AUTH->hasAuth($auth, $this->cate_area, $cate_id); + } + + public function getMenuBrdcom($cate_id){ + $menu_info = $this->cate_info_id($cate_id); + return $this->history_cate($menu_info['cate_code']); + } + + public function set_cate_area($cate_area=""){ + $this->cate_area = $cate_area?:"service"; + $this->authDest = $this->gsetAuthTarget("all"); + } + + public function gsetAuthTarget( $type="", $include_sa="" ){ + switch( $this->cate_area ){ + case "admin": + $authTarget = $GLOBALS['_varsAuthAdmin']; + break; + + case "service": + if( $type == "all" ){ + $authTarget = array_merge($GLOBALS['_varsAuthAdmin'], $GLOBALS['_varsAuthMember']); + }else{ + $authTarget = $GLOBALS['_varsAuthMember']; + } + break; + } + if( !$include_sa ){ + unset($authTarget['SA']); //슈퍼관리자 제외 + } + return $authTarget; + } +} \ No newline at end of file diff --git a/lib/app/mlang.class.php b/lib/app/mlang.class.php new file mode 100644 index 0000000..090bf67 --- /dev/null +++ b/lib/app/mlang.class.php @@ -0,0 +1,200 @@ +TB = TB_comment; + $this->DB->tableExists($this->TB); + $this->DB->tableExists(TB_comment_lang); + $this->LANG = "KR"; + } + + function loadWord( $str, $lang="" ){ + $tran = $this->getWord( $str, $lang ); + if( !$tran ){ + $this->putWord( $str ); + }else{ + return $tran; + } + return $str; + } + + function getTran( $str, $isId="" ){ + $where = new DB_where("and"); + if( $isId ){ + $where->add("TRAN_ID = ?", $str); + }else{ + $where->add("TRAN_TEXT = ?", $str); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->TB} where {$whereqry}"; + $this->DB->query_record = false; //query log 기록 금지 + $txt = $this->DB->queryFirstRow($sql, $whererow); + $this->DB->query_record = true; //query log 기록 재개 + + if( $txt ){ + $tran = (Array)json_decode($txt['TRAN_DATA']); + return $tran; + } + return false; + } + + function getWordList($fields, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + $orderby="TRAN_TEXT asc"; + $limit=array(); + + $rows = $this->getDataList($fields, $where, $orderby, $limit); + + return $rows; + } + + public function getWordPage($sqldata, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("TRAN_TEXT like ?", "%{$sqldata['stxt']}%"); + } + } + + $orderby = "TRAN_TEXT desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ){ + $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + } + + $query = array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum'], + "sdate" => $sqldata['sdate']?:"", + "fdate" => $sqldata['fdate']?:"", + "page" => $sqldata['page'], + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ); + + $lists = $this->getDataPage("*", $query, $where ,$orderby); + return $lists; + } + + function getWord( $str, $lang ){ + $str = $this->getTran($str); + $lang = $lang ?: $this->LANG; + if( $str ){ + return $str[$lang]; + } + return false; + } + + function getWordId( $id, $lang="" ){ + $str = $this->getTran($id, 1); + $lang = $lang ?: $this->LANG; + if( $str ){ + return $str[$lang]; + } + return false; + } + + function putWord( $str ){ + $sqldata = Array( + "TRAN_TEXT" => $str?:"", + "TRAN_DATA" => json_encode(Array("KR"=>$str)), + ); + $this->DB->insert($this->TB, $sqldata); + } + + function setWord( $str, $stran, $isId="" ){ + $tran = $this->getTran( $str, $isId ); + $tran = array_filter(array_merge($tran, $stran)); + + $where = new DB_where("and"); + if( $isId ){ + $where->add("TRAN_ID = ?", $str); + }else{ + $where->add("TRAN_TEXT = ?", $str); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sqldata = Array( + "TRAN_DATA" => json_encode($tran), + ); + + return $this->DB->update($this->TB, $sqldata, $whereqry, $whererow); + } + + public static function getText( $str, $var=array() ){ + $langObj = new Mlang(); + if( $langObj->TB ){ + $str = $langObj->loadWord( $str ); + } + for( $a=0 ; $a<@count($var) ; $a++ ){ + $str = str_replace("{@".($a+1)."}", $var[$a], $str); + } + return $str; + } + + function getLang ( $slang="" ){ + $where = new DB_where("and"); + $where->add("bc.Bran_Uid = ?", "nation_code"); + $where->add("bc.Code_Uid != ?", "nation_code"); + $where->add("bc.Code_Uid != ?", "KR"); + $where->add("bc.Active = ?", "Y"); + if( $slang ){ + $swhere = $where->sub_where("or"); + foreach( (array)$slang as $lang ){ + $swhere->add("bc.Code_Uid = ?", $lang); + } + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select bc.Code_Uid, bc.Code_Val from ".TB_basecode." as bc left join ".TB_comment_lang." as cl on bc.Code_Uid = cl.LANG_ID where {$whereqry} order by bc.Code_Val"; + $row = $this->DB->query($sql, $whererow); + return $row; + } + + function setLang($params){ + $sql = "delete from ".TB_comment_lang; + $this->DB->qry($sql); + + $rows = $this->getLang($params); + + foreach( $rows as $lang ){ + $qryrow = Array( + "LANG_ID" => $lang['Code_Uid'], + "LANG_NM" => $lang['Code_Val'], + ); + $this->DB->insert(TB_comment_lang, $qryrow); + } + } +} \ No newline at end of file diff --git a/lib/app/qrylog.class.php b/lib/app/qrylog.class.php new file mode 100644 index 0000000..1ac54cf --- /dev/null +++ b/lib/app/qrylog.class.php @@ -0,0 +1,71 @@ +DB->query_record = false; //query log 기록 금지 + + $this->DB->tableExists(TB_query_log); + } + + public function getQueryList($fields, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + $orderby="query_date desc"; + $limit=array(); + + $rows = $this->getDataList($fields, $where, $orderby, $limit); + + return $rows; + } + + public function getQueryPage($sqldata, $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + + $where->add("query_date >= ?", ($sqldata['sdate']?$sqldata['sdate']:_SDATENULL_)." 00:00:00.000"); + $where->add("query_date <= ?", ($sqldata['fdate']?$sqldata['fdate']:_FDATENULL_)." 23:59:59.999"); + + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("host_name like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("db_name like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("query_string like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("member_id like ?", "%{$sqldata['stxt']}%"); + } + } + + $orderby = "query_date desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ){ + $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + } + + $query = array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum'], + "sdate" => $sqldata['sdate']?:"", + "fdate" => $sqldata['fdate']?:"", + "page" => $sqldata['page'], + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ); + + $lists = $this->getDataPage("*", $query, $where ,$orderby); + return $lists; + } + + public function getQuery( $cust_id ){ + $urow = Array("cust_id" => $cust_id); + $where = ""; + $row = $this->getData("*", $urow, $where); + return $row; + } + +} \ No newline at end of file diff --git a/lib/app/realnameattach.class.php b/lib/app/realnameattach.class.php new file mode 100644 index 0000000..b8e08b4 --- /dev/null +++ b/lib/app/realnameattach.class.php @@ -0,0 +1,327 @@ +DB->query_record = false; //query log 기록 금지 + + $this->DB->tableExists($this->TB); + } + +// public function getFilePath( $gubun, $nid, $sid ){ +// $target_dir = _UP_PATH_."/{$gubun}"; +// if( !file_exists($target_dir) ){ mkdir($target_dir); } +// +// return $target_dir; +// } +// +// public function getLoadFileinfo( $gubun, $nid, $sid ){ +// $target_dir = $this->getFilePath($gubun, $nid, $sid); +// +// $frow = Array( +// "target_dir" => $target_dir, +// "file_name" => "{$nid}_{$sid}.dat", +// "file_path" => "{$target_dir}/{$nid}_{$sid}.dat", +// ); +// return $frow; +// } +// +// public function getSaveFileinfo( $gubun, $nid, $sid, $filename="" ){ +// $target_dir = $this->getFilePath($gubun, $nid, $sid); +// +// $new_filename = "{$nid}_{$sid}.dat"; +// $frow = Array( +// "target_dir" => $target_dir, +// "file_name" => $filename, +// "file_path" => $target_dir."/".$new_filename, +// ); +// return $frow; +// } +// +// public function getConvFileinfo( $gubun, $nid, $sid, $filename="" ){ +// $target_dir = $this->getFilePath($gubun, $nid, $sid); +// +// $frow = Array( +// "target_dir" => $target_dir, +// "file_name" => "{$nid}_{$sid}.dat", +// "file_path" => "{$target_dir}/{$nid}_{$sid}.dat?*", +// ); +// return $frow; +// } + + public function getFilePath( $gubun, $nid, $sid="" ){ + $target_dir = _UP_PATH_."/{$gubun}"; + if( !file_exists($target_dir) ){ mkdir($target_dir); } + + if( !is_array($nid) ){ + $nid = explode("/",$nid); + } + + foreach( $nid as $new_dir ){ + $target_dir .= "/{$new_dir}"; + if( !file_exists($target_dir) ){ mkdir($target_dir); } + } + +// $target_dir .= "/{$sid}"; +// if( !file_exists($target_dir) ){ mkdir($target_dir); } + return $target_dir; + } + + public function getLoadFileinfo( $gubun, $nid, $sid ){ + //$target_dir = $this->getFilePath( $gubun, $nid, $sid ); + $target_dir = _UP_PATH_."/{$gubun}/"; + $frow = $this->getAttach( $gubun, $nid, $sid ); + $target_dir .= $frow['nid']; + $frow['target_dir'] = $target_dir; + $frow['file_path'] = "{$target_dir}/{$frow['file_name']}"; + return $frow; + } + + public function getSaveFileinfo( $gubun, $nid, $sid, $filename="" ){ + $target_dir = $this->getFilePath( $gubun, $nid, $sid ); + + $new_filename = $this->getDupFilename($target_dir, $filename); + $frow = Array( + "target_dir" => $target_dir, + "file_name" => $new_filename, + "file_path" => $target_dir."/".$new_filename, + ); + return $frow; + } + + public function getConvFileinfo( $gubun, $nid, $sid, $filename="" ){ + //$target_dir = $this->getFilePath( $gubun, $nid, $sid ); + $target_dir = _UP_PATH_."/{$gubun}/"; + + $frow = $this->getAttach( $gubun, $nid, $sid ); + $target_dir .= $frow['nid']; + $frow['target_dir'] = $target_dir; + $frow['file_path'] = "{$target_dir}/{$frow['file_name']}?*"; + return $frow; + } + + public function getAttachList($fields, $gubun, $nid="", $adfleld=array(), $orderby=""){ + $where = new DB_where("and"); + if( $gubun ){ + $where->add("gubun = ?", $gubun); + } + if( $nid ){ + $where->add("nid = ?", $this->getNidPath($nid)); + } + + if( $adfleld ){ + if( is_array($adfleld) ){ + foreach( $adfleld as $key => $val ){ + $where->add("{$key} = ?", $val); + } + }else{ + $orderby = $orderby ?: $adfleld; + } + } + + $orderby=$orderby?:"file_id desc"; + $limit=array(); + + $rows = $this->getDataList($fields, $where, $orderby, $limit); + for( $a=0 ; $a $gubun, + //"nid" => $this->getNidPath($nid), + "sid" => $sid, + ); + if( $nid ){ + $whererow["nid"] = $this->getNidPath($nid); + } + $row = $this->getData("*", $whererow); + $row['file_url'] = _SITE_INC_URL_."/getFile.php?gubun={$row['gubun']}&sid={$row['sid']}"; + return $row; + } + public function getAttachId( $file_id ) { + $whererow = Array( + "file_id" => $file_id, + ); + $row = $this->getData("*", $whererow); + $row['file_url'] = _SITE_INC_URL_."/getFile.php?gubun={$row['gubun']}&sid={$row['sid']}"; + return $row; + } + + public function getNidPath( $nid ){ + if( !is_array($nid) ){ + $nid = explode("/",$nid); + } + return implode("/",$nid); + } + + public function putAttach( $upfile, $gubun, $nid, $sid="", $adfield=array(), $upload_user_name="", $code_id="") { + $sfile = $this->getSaveFileinfo($gubun, $nid, $sid, $upfile['name']); + $save_file = $sfile['file_path']; + + $rst = move_uploaded_file($upfile['tmp_name'], $save_file); + if( !$rst ) return false; + + if( strpos($upfile['type'], "image") !== false ){ + $iinfo = getimagesize($save_file); + $upfile['width'] = $iinfo[0]; + $upfile['height'] = $iinfo[1]; + } + + $sid = $sid ?: uniqid(); + + $sqldata = Array( + "gubun" => $gubun?:"", + "nid" => $this->getNidPath($nid)?:"", + "sid" => $sid?:"", + "file_name" => $sfile['file_name']?:$upfile['name'], + "file_size" => $upfile['size']?:0, + "file_type" => $upfile['type']?:"", + "file_width" => $upfile['width']?:"", + "file_height" => $upfile['height']?:"", + "file_remk" => $upfile['file_remk']?:"", + "file_sig_flg" => $upfile['file_sig_flg']?:"", + "upload_user_name"=> $upload_user_name?:"", + "code_id" => $code_id?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + ); + + if( $adfield ) { + $sqldata = array_merge($sqldata, $adfield); + } + + return $this->putData( $sqldata ); + } + + public function putAppAttach($upfile, $sid="", $adfield=array(), $upload_user_name=""){ //앱용 업로드 + $nid = $upfile['nid']; + $gubun = $upfile['gubun']; + $code_id = $upfile['code_id']; + $this->putAttach( $upfile, $gubun, $nid, $sid, $adfield, $upload_user_name, $code_id ); + } + + public function setAttach( $upfile, $gubun, $nid, $sid, $adfield=array(), $upload_user_name="", $code_id="" ) { + $sfile = $this->getSaveFileinfo($gubun, $nid, $sid, $upfile['name']); + $save_file = $sfile['file_path']; + + $rst = move_uploaded_file($upfile['tmp_name'], $save_file); + if( !$rst ) return false; + + if( strpos($upfile['type'], "image") !== false ){ + $iinfo = getimagesize($save_file); + $upfile['width'] = $iinfo[0]; + $upfile['height'] = $iinfo[1]; + } + + $sqldata = Array( + "gubun" => $gubun?:"", + "nid" => $this->getNidPath($nid)?:"", + "sid" => $sid?:"", + "file_name" => $sfile['file_name']?:$upfile['name'], + "file_size" => $upfile['size']?:0, + "file_type" => $upfile['type']?:"", + "file_width" => $upfile['width']?:"", + "file_height" => $upfile['height']?:"", + "file_remk" => $upfile['file_remk']?:"", + "file_sig_flg" => $upfile['file_sig_flg']?:"", + "upload_user_name"=> $upload_user_name?:"", + "code_id" => $code_id?:"", + "reg_date" => $this->DB->sqleval("getdate()"), + ); + + if( $adfield ) { + $sqldata = array_merge($sqldata, $adfield); + } + + $whererow = Array( + "gubun" => $gubun?:"", + "nid" => $this->getNidPath($nid)?:"", + "sid" => $sid?:"", + ); + + return $this->setData( $sqldata, $whererow ); + } + public function setAttachId( $upfile, $file_id, $upload_user_name="" ) { + $ainfo = $this->getAttachId( $file_id ); + if( !$ainfo['file_id'] ) return false; + + return $this->setAttach( $upfile, $ainfo['gubun'], $ainfo['nid'], $ainfo['sid'], $upload_user_name ); + } + + public function delAttach( $gubun, $nid, $sid ){ + $urow = Array(); + $urow['gubun'] = $gubun; + $urow['nid'] = $this->getNidPath($nid); + $urow['sid'] = $sid; + $where = ""; + + $load_finfo = $this->getLoadFileinfo($gubun, $this->getNidPath($nid), $sid); + $conv_finfo = $this->getConvFileinfo($gubun, $this->getNidPath($nid), $sid); + $load_file = $load_finfo['file_path']; + $conv_file = $conv_finfo['file_path']; + + $rst = $this->fileRemove("{$load_file}"); + $rst = $rst && $this->fileRemove("{$conv_file}"); + p($remake); + if( !$rst ) return false; + + return $this->delData($urow, $where); + } + public function delAttachId( $file_id ){ + $ainfo = $this->getAttachId( $file_id ); + return $this->delAttach( $ainfo['gubun'], $ainfo['nid'], $ainfo['sid'] ); + } + + static function fByte($bytes, $precision=2) { + $unit = ["B", "KB", "MB", "GB"]; + $exp = floor(log($bytes, 1024)) ?: 0; + return round($bytes / (pow(1024, $exp)), $precision).$unit[$exp]; + } + + static function fileRemove($filepath, $unremove=""){ + $glob = glob($filepath); + foreach( $glob as $filename ) { + if( !$unremove || $filename != $unremove ){ + @unlink($filename); + } + } + return true; + } + + public function getDupFilename( $target_dir, $oriFilename, $cnt=0 ){ + if( !$oriFilename ) return ""; + + if( $cnt === 0 ){ + $chkFilename = $oriFilename; + }else{ + $orin = explode(".",$oriFilename); + if( count($orin) > 1 ){ + $orin[count($orin)-2] .= "({$cnt})"; + }else{ + $orin[count($orin)-1] .= "({$cnt})"; + } + $chkFilename = implode(".", $orin); + } + if( file_exists("{$target_dir}/{$chkFilename}") ){ + $chkFilename = $this->getDupFilename( $target_dir, $oriFilename, ++$cnt ); + } + return $chkFilename; + } + + public function file_reverse( $upfile ){ + $files = Array(); + if( is_array($upfile['name']) ){ + foreach( $upfile as $key => $val ){ + foreach( $val as $k => $v ){ + $files[$k][$key] = $v; + } + } + }else{ + $files[] = $upfile; + } + return $files; + } +} \ No newline at end of file diff --git a/lib/app/visit.class.php b/lib/app/visit.class.php new file mode 100644 index 0000000..b058959 --- /dev/null +++ b/lib/app/visit.class.php @@ -0,0 +1,325 @@ +DB->query_record = false; //query log 기록 금지 + + $this->DB->tableExists( TB_visit_sess ); + $this->DB->tableExists( TB_visit_sess_count ); + $this->DB->tableExists( TB_visit_log ); + $this->DB->tableExists( TB_visit_log_count ); + } + + function getVisitList( $tb, $field="*", $where="", $orderby="", $limit=array() ){ //방문 리스트 (공통) + if( !$where ){ + $where = new DB_where("and"); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select {$field} from {$tb} where {$whereqry} ".(($orderby)?"order by {$orderby}":""). $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select {$field} from {$tb} where {$whereqry}",$orderby,$limit[0],$limit[1]); + $rst = $this->DB->qry($sql, $whererow); + $row = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $tmp['visit_date'] = getDT_datetime($tmp['visit_date']); + $row[] = $tmp; + } + return $row; + } + + function getVisitPage($tb, $sqldata=array(), $query=array(), $where=""){ //방문 리스트 (공통-페이징) + if( !$where ){ + $where = new DB_where("and"); + } + + $where->add("visit_date >= ?", ($sqldata['sdate']?$sqldata['sdate']:_SDATENULL_)." 00:00:00.000"); + $where->add("visit_date <= ?", ($sqldata['fdate']?$sqldata['fdate']:_FDATENULL_)." 23:59:59.999"); + + if( $sqldata['stxt'] ){ + $subwhere = $where->sub_where("or"); + if( $sqldata['sfld'] ){ + $subwhere->add("{$sqldata['sfld']} like ?", "%{$sqldata['stxt']}%"); + }else{ + $subwhere->add("visit_url like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("visit_ref like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("visit_ip like ?", "%{$sqldata['stxt']}%"); + $subwhere->add("visit_sess like ?", "%{$sqldata['stxt']}%"); + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $orderby = "nid desc"; + if( $sqldata['ofld'] && $sqldata['oasc'] ) $orderby = "{$sqldata['ofld']} {$sqldata['oasc']}"; + + $query = array_merge(array( + "mode" => $sqldata['mode'], + "viewnum" => $sqldata['viewnum'], + "sdate" => $sqldata['sdate']?:"", + "fdate" => $sqldata['fdate']?:"", + "sfld" => $sqldata['sfld'], + "stxt" => $sqldata['stxt'], + "ofld" => $sqldata['ofld'], + "oasc" => $sqldata['oasc'], + ), $query); + + $lists = new clist(); + $lists->fld = "*"; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $sqldata['page']?:1; + $lists->linktype = ""; + $lists->viewnum = $query['viewnum']?:20; + $lists->rownum = $query['rownum']?:5; + $lists->getCommonList($tb); + for( $a=0 ; $a<@count($lists->rows) ; $a++ ){; + $lists->rows[$a]['visit_date'] = getDT_datetime($lists->rows[$a]['visit_date']); + } + return $lists; + } + + function getVisitSessList( $field="*", $where="", $orderby="", $limit=array() ){ //사이트 접근 리스트 + return $this->getVisitList(TB_visit_sess, $field, $where, $orderby, $limit); + } + + function getVisitSessPage( $sqldata=array(), $query=array(), $where="" ){ //사이트 접근 리스트 페이지 + return $this->getVisitPage(TB_visit_sess, $sqldata, $query, $where); + } + + function getVisitLogList( $field="*", $where="", $orderby="", $limit=array() ){ //사이트 조회 리스트 + return $this->getVisitList(TB_visit_log, $field, $where, $orderby, $limit); + } + + function getVisitLogPage( $sqldata=array(), $query=array(), $where="" ){ //사이트 조회 리스트 페이지 + return $this->getVisitPage(TB_visit_log, $sqldata, $query, $where); + } + + function putVisitRec($vtype="",$cate_id=""){ //방문자 로그 기록 + $ip = get_ip(); + $time = time(); + + //세션생성 + if( !$_SESSION['visit_sess'] ){ + $_SESSION['visit_sess'] = md5($time.$ip); + } + + if( + $_SESSION['visit_last_urls'] != $_SERVER['REQUEST_URI'] && $_SESSION['visit_last_ajax'] != $_SERVER['REQUEST_URI'] || //새로고침은 기록 안함 + ($_SESSION['visit_last_time'] + ($GLOBALS['_varsBaseCode']['refresh_time']?:3600)) < time() //새로고침이라 할지라도 일정시간 이내의 새로고침은 기록 + ){ + //로그기록 등록 + $this->putVisitDetailRec($vtype,$cate_id); + } + + //마지막 페이지 접근내역 + if( preg_match("/\.ajax\./i", $_SERVER['REQUEST_URI']) ){ + $_SESSION['visit_last_ajax'] = $_SERVER['REQUEST_URI']; + }else{ + $_SESSION['visit_last_urls'] = $_SERVER['REQUEST_URI']; + } + $_SESSION['visit_last_time'] = $time; + } + + function putVisitDetailRec($vtype="",$cate_id=""){ //로그기록 등록 + if( !$_SESSION['visit_sess'] ) return false; + + //세션 로그기록 등록 + $this->putVisitSessRec($vtype); + + //방문 로그 등록 (페이지뷰) + $this->putVisitLogRec($vtype,$cate_id); + } + + function putVisitSessRec($vtype=""){ //방문 세션 기록 + if( !$_SESSION['visit_sess'] ) return false; + + $where = new DB_where("and"); + $where->add("visit_sess = ?", $_SESSION['visit_sess']); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + $sql = "select count(*) from ".TB_visit_sess." where {$whereqry}"; + $cnt = $this->DB->queryFirstField($sql,$whererow); + if( !$cnt ){ //최초 세션 등록 + $this->DB->insert( TB_visit_sess, array("visit_sess"=>$_SESSION['visit_sess'], "member_id"=>($GLOBALS['_Umem']['member_id']?:""), "visit_ip"=>get_ip(), "visit_total"=>1) ); //세션 추가 + + $where = new DB_where("and"); + $where->add("visit_date = ?", date("Y-m-d")); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + $sql = "select count(*) from ".TB_visit_sess_count." where {$whereqry}"; + $cnt = $this->DB->queryFirstField($sql, $whererow); + if( !$cnt ){ //시간별 세션등록통계가 없으면 insert + $this->DB->insert( TB_visit_sess_count, array("visit_week"=>date("w")) ); + } + + $sql = "update ".TB_visit_sess_count." set visit_total = visit_total + 1, h".date("H")." = h".date("H")." + 1 where {$whereqry}"; + $this->DB->qry( $sql, $whererow ); + }else{ //세션이 방문한 페이지수 증가 + $sqladd = ""; + if( $GLOBALS['_Umem']['member_id'] ){ + $sqladd = "member_id = '{$GLOBALS['_Umem']['member_id']}',"; + } + $sql = "update ".TB_visit_sess." set {$sqladd} visit_total = visit_total + 1, visit_fdate = CURRENT_TIMESTAMP where {$whereqry}"; + $this->DB->qry( $sql, $whererow ); + } + } + + function putVisitLogRec($vtype="",$cate_id=""){ //방문페이지(페이지뷰) 기록 + if( !$_SESSION['visit_sess'] ) return false; + + $where = new DB_where("and"); + $where->add("visit_date = ?", date("Y-m-d")); + $where->add("visit_type = ?", $vtype); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + $sql = "select count(*) from ".TB_visit_log_count." where {$whereqry}"; + $cnt = $this->DB->queryFirstField($sql, $whererow); + if( !$cnt ){ //시간별 페이지뷰통계가 없으면 insert + $this->DB->insert( TB_visit_log_count, array("visit_type"=>$vtype,"visit_week"=>date("w")) ); + } + + //시간별 페이지뷰통계 증가 + $sql = "update ".TB_visit_log_count." set visit_total = visit_total + 1, h".date("H")." = h".date("H")." + 1 where {$whereqry}"; + $this->DB->qry( $sql, $whererow ); + + + $connect_info = parse_user_agent(); + $sql_row = array( + "visit_type" => $vtype, + "cate_id" => $cate_id?:"", + "visit_sess" => $_SESSION['visit_sess']?:"", + "visit_url" => $_SERVER['REQUEST_URI']?:"", + "visit_ref" => $_SERVER['HTTP_REFERER']?:"", + "visit_browser" => "{$connect_info['browser']} | {$connect_info['version']}", + "visit_os" => $connect_info['platform']?:"", + "visit_ip" => get_ip(), + ); + + //개별 페이지 방문 기록 + return $this->DB->insert( TB_visit_log, $sql_row ); + } + + function setLoginRec(){ //로그인시 ID 기록 + $where = new DB_where("and"); + $where->add("visit_sess = ?", $_SESSION['visit_sess']); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + $sql = "update ".TB_visit_sess." set member_id = ? where {$whereqry}"; + return $this->DB->qry($sql, array_merge(array($_SESSION['auth_mem_id']?:""),$whererow)); + } + + function getVisitData($mode, $type="LOG", $vtype="", $start_day="", $end_day="", $where=""){ + if( !$end_day ) $end_day = date("Y-m-d"); + if( !$start_day ) $start_day = date("Y-m-d",strtotime($end_day." -1 Month +1 day")); + + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("visit_date >= ?", $start_day); + $where->add("visit_date <= ?", $end_day); + + if( $type == "LOG" ){ + $where->add("visit_type = ?", $vtype); + $tbl = TB_visit_log_count; + }else{ + $tbl = TB_visit_sess_count; + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $row = array(); + switch( $mode ){ + case "hour": + $h_row = array(); + for( $a=0 ; $a<24 ; $a++ ){ + $h_str = "h".str_pad($a, 2, "0", STR_PAD_LEFT); + $h_row[] = "sum({$h_str}) as {$h_str}"; + } + $sql = "select ".implode(",",$h_row)." from {$tbl} where {$whereqry} "; + $row = $this->DB->queryFirstRow($sql, $whererow); + break; + + case "day": + if( (strtotime($end_day) - strtotime($start_day)) > 31*86400 ) $end_day = date("Y-m-d",strtotime($start_day." +1 Month -1 day")); //1개월이내로 제한 + $days = floor((strtotime($end_day) - strtotime($start_day)) / 86400); + + for( $a=0 ; $a<=$days ; $a++ ){ + $nday = date("Y-m-d", strtotime("{$start_day} +{$a} day")); + $row[$nday] = 0; + } + + $sql = "select visit_date as date, visit_total as visit from {$tbl} where {$whereqry} "; + $rst = $this->DB->qry($sql, $whererow); + + while( $tmp = $this->DB->fetch_array($rst) ){ + $row[getDT_date($tmp['date'])] = $tmp['visit']; + } + break; + + case "dayw": + $days = floor((strtotime($end_day) - strtotime($start_day)) / 86400); + + $sql = "select visit_date as date, visit_total as visit from {$tbl} where {$whereqry} order by visit_date asc"; + $rst = $this->DB->qry($sql, $whererow); + + $trow = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $trow[getDT_date($tmp['date'])] = $tmp['visit']; + } + $row = array(); + for( $a=0 ; $a<7 ; $a++ ){ + $dword = date("Y-m-d", strtotime($start_day." +{$a} days")); + $row[] = $trow[$dword] ?: 0; + } + + break; + + case "week": + $h_row = array(); + for( $a=0 ; $a<7 ; $a++ ){ + $h_row[] = "sum(iif(visit_week = {$a}, visit_total, 0)) as w{$a}"; + } + $sql = "select ".implode(",",$h_row)." from {$tbl} where {$whereqry} "; + $row = $this->DB->queryFirstRow($sql, $whererow); + break; + + case "mon": + $sday = explode("-",$start_day); + $eday = explode("-",$end_day); + if( (($eday[0]*12+intval($eday[1])) - ($eday[0]*12+intval($eday[1]))) != 12 ) $start_day = date("Y-m-d",strtotime($end_day." -11 Month")); //12개월이내로 제한 + + $sday = explode("-",$start_day); + $mons = ($eday[0]*12+intval($eday[1])) - ($sday[0]*12+intval($sday[1])); + + $m_row = array(); + for( $a=0 ; $a<=$mons ; $a++ ){ + $m_str = date("Y-m",strtotime("{$sday[0]}-{$sday[1]}-01 +{$a} month")); + $m_row[] = "sum(iif(visit_date like '{$m_str}%', visit_total, 0)) as '{$m_str}'"; + } + $sql = "select ".implode(",",$m_row)." from {$tbl} where {$whereqry} "; + $row = $this->DB->queryFirstRow($sql, $whererow); + break; + } + + return array( + "start_day" => $start_day, + "end_day" => $end_day, + "mons" => $mons, + "days" => $days, + "data" => $row, + ); + } +} \ No newline at end of file diff --git a/lib/base/basecode.class.php b/lib/base/basecode.class.php new file mode 100644 index 0000000..8a2080f --- /dev/null +++ b/lib/base/basecode.class.php @@ -0,0 +1,292 @@ +DB->tableExists(TB_basecode); + } + + public function getAllBaseCodeList($Bran_Uid="", $Group_Uid="", $Code_Uid="", $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + if( $Bran_Uid !== "" ) $where->add("CD.Bran_Uid = ?", $Bran_Uid); + if( $Group_Uid !== "" ) $where->add("CD.Group_Uid = ?", $Group_Uid); + if( $Code_Uid !== "" ) $where->add("CD.Code_Uid = ?", $Code_Uid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select + CD.Bran_Uid + ,BR.Code_Val as Bran_Val + ,CD.Group_Uid + ,GR.Code_Val as Group_Val + ,CD.Code_Uid + ,CD.Code_Val + ,CD.Code_Exp + ,BR.Code_Idx as Bran_Idx + ,case when CD.Bran_Uid = CD.Code_Uid then -1 else GR.Code_Idx end as Group_Idx + ,CD.Code_Idx + ,case when CD.Bran_Uid = CD.Code_Uid then -1 when CD.Group_Uid = CD.Code_Uid then 0 else CD.Code_Idx end as Code_Idx2 + ,BR.Active as Bran_Active + ,GR.Active as Group_Active + ,CD.Active as Code_Active + from ". TB_basecode ." as CD + inner join ". TB_basecode ." as BR on CD.Bran_Uid = BR.Code_Uid + inner Join ". TB_basecode ." as GR on CD.Bran_Uid = GR.Bran_Uid and CD.Group_Uid = GR.Code_Uid + where {$whereqry} + order by Bran_Idx, Bran_Uid, Group_Idx, Group_Uid, Code_Idx2, Code_Uid"; + + $this->DB->query_record = false; //query log 기록 금지 + $rows = $this->DB->query($sql, $whererow); + $this->DB->query_record = true; //query log 기록 재개 + + return $rows; + } + + public function getBaseCodeList($Bran_Uid="", $Group_Uid="", $Code_Uid="", $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + $where->add("BR.Active = ?", 'Y'); + $where->add("GR.Active = ?", 'Y'); + $where->add("CD.Active = ?", 'Y'); + + return $this->getAllBaseCodeList($Bran_Uid, $Group_Uid, $Code_Uid, $where); + } + + public function getBaseCode($Bran_Uid="", $Group_Uid="", $Code_Uid="", $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + if( $Bran_Uid !== "" ) $where->add("Bran_Uid = ?", $Bran_Uid); + if( $Group_Uid !== "" ) $where->add("Group_Uid = ?", $Group_Uid); + if( $Code_Uid !== "" ) $where->add("Code_Uid = ?", $Code_Uid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_basecode ." where {$whereqry}"; + $row = $this->DB->queryFirstRow($sql, $whererow); + + return $row; + } + + public function putBaseCode($sqldata){ + return $this->DB->insert(TB_basecode, $sqldata); + } + + public function setBaseCode($sqldata, $Bran_Uid="", $Group_Uid="", $Code_Uid="", $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + if( $Bran_Uid !== "" ) $where->add("Bran_Uid = ?", $Bran_Uid); + if( $Group_Uid !== "" ) $where->add("Group_Uid = ?", $Group_Uid); + if( $Code_Uid !== "" ) $where->add("Code_Uid = ?", $Code_Uid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update(TB_basecode, $sqldata, $whereqry, $whererow); + } + + public function delBaseCode($Bran_Uid="", $Group_Uid="", $Code_Uid="", $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + if( $Bran_Uid !== "" ) $where->add("Bran_Uid = ?", $Bran_Uid); + if( $Group_Uid !== "" ) $where->add("Group_Uid = ?", $Group_Uid); + if( $Code_Uid !== "" ) $where->add("Code_Uid = ?", $Code_Uid); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->delete(TB_basecode, $whereqry, $whererow); + } + + public function sortBaseCode($Bran_Uid, $Group_Uid, $Code_Uid, $Code_Idx, $adv=1){ //$incl => 코드 추가시 현 Code_Uid의 Code_idx 값보다 +1 씩 해서 sort 값을 줘야 하나, 삭제시에는 Code_Uid 자리부터 시작하므로 +1 하지 않기 위함. + $Code_Idx = $Code_Idx?:1; + + $where = new DB_where("and"); + $where->add("Code_Uid != ?",$Code_Uid); + $where->add("Code_Idx >= ?",$Code_Idx); + if( $Bran_Uid == $Code_Uid ){ + $where->add("Bran_Uid = ?",$this->DB->sqleval("Code_Uid")); + }else if( $Group_Uid == $Code_Uid ){ + $where->add("Bran_Uid = ?",$Bran_Uid); + $where->add("Group_Uid = ?",$this->DB->sqleval("Code_Uid")); + $where->add("Bran_Uid != ?",$this->DB->sqleval("Code_Uid")); + }else{ + $where->add("Bran_Uid = ?",$Bran_Uid); + $where->add("Group_Uid = ?",$Group_Uid); + $where->add("Bran_Uid != ?",$this->DB->sqleval("Code_Uid")); + $where->add("Group_Uid != ?",$this->DB->sqleval("Code_Uid")); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from ". TB_basecode ." where {$whereqry} order by Code_Idx"; + $rst = $this->DB->qry($sql, $whererow); + + $sidx = $Code_Idx + $adv; + + $urst = true; + while( $row = $this->DB->fetch_array($rst) ){ + $sqldata = Array("Code_Idx" => $sidx++); + $uwhere = new DB_where("and"); + + $uwhere->add("Bran_Uid = ?", $row['Bran_Uid']); + $uwhere->add("Group_Uid = ?", $row['Group_Uid']); + $uwhere->add("Code_Uid = ?", $row['Code_Uid']); + + $uwqry = $uwhere->get_where(); + $uwhereqry = $uwqry['qry']; + $uwhererow = $uwqry['val']; + + $urst = $urst && $this->DB->update(TB_basecode, $sqldata, $uwhereqry, $uwhererow); + } + return $urst; + } + + public function getMaxBaseCodeIdx($Bran_Uid="", $Group_Uid="", $where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + if( $Bran_Uid !== "" ){ + $where->add("Bran_Uid = ?", $Bran_Uid); + $where->add("Bran_Uid != ?", $this->DB->sqleval("Code_Uid")); + }else{ + $where->add("Bran_Uid = ?", $this->DB->sqleval("Group_Uid")); + } + if( $Group_Uid !== "" ){ + $where->add("Group_Uid = ?", $Group_Uid); + $where->add("Group_Uid != ?", $this->DB->sqleval("Code_Uid")); + }else{ + $where->add("Group_Uid = ?", $this->DB->sqleval("Code_Uid")); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select max(Code_Idx) from ". TB_basecode ." where {$whereqry}"; + $maxIdx = $this->DB->queryFirstField($sql, $whererow); + + return $maxIdx; + } + + public function getBaseCodeVars($Bran_Uid="", $Group_Uid=""){ + $Bran_Uid = $Bran_Uid?:$Group_Uid; + + $where = new DB_where("and"); + $where->add("CD.Group_Uid != ?", $this->DB->sqleval("CD.Code_Uid")); + + $row = $this->getBaseCodeList($Bran_Uid, $Group_Uid, "", $where); + + $ret = array(); + foreach( (array)$row as $val ){ + $ret[$val['Code_Uid']] = $val['Code_Val']; + } + return $ret; + } + + public function getBaseGroupVars($Bran_Uid){ + $where = new DB_where("and"); + $where->add("CD.Bran_Uid != ?", $this->DB->sqleval("CD.Code_Uid")); + + $row = $this->getBaseCodeList($Bran_Uid, "", "", $where); + $ret = array(); + foreach( (array)$row as $val ){ + if( $val['Group_Uid'] == $val['Code_Uid'] ){ + $ret[$val['Group_Uid']] = $val; + }else{ + $ret[$val['Group_Uid']]['children'][$val['Code_Uid']] = $val['Code_Val']; + } + } + return $ret; + } + + public function getBaseGCodeVars($Bran_Uid="", $Group_Uid=""){ + $Bran_Uid = $Bran_Uid?:$Group_Uid; + + $where = new DB_where("and"); + $where->add("CD.Group_Uid != ?", $this->DB->sqleval("CD.Code_Uid")); + + $row = $this->getBaseCodeList($Bran_Uid, $Group_Uid, "", $where); + + $ret = array(); + foreach( (array)$row as $val ){ + if( !isset($ret[$val['Group_Uid']]) ){ + $ret[$val['Group_Uid']] = array(); + } + $ret[$val['Group_Uid']][$val['Code_Uid']] = $val['Code_Val']; + } + return $ret; + } + + public function getBaseCodeVarsExp($Bran_Uid="", $Group_Uid=""){ + $Bran_Uid = $Bran_Uid?:$Group_Uid; + + $where = new DB_where("and"); + $where->add("CD.Group_Uid != ?", $this->DB->sqleval("CD.Code_Uid")); + + $row = $this->getBaseCodeList($Bran_Uid, $Group_Uid, "", $where); + + $ret = array(); + foreach( (array)$row as $val ){ + $ret[$val['Code_Uid']] = Array($val['Code_Val'],$val['Code_Exp']); + } + return $ret; + } + + public function getBaseCodeVarsAll($Bran_Uid="", $Group_Uid=""){ + $Bran_Uid = $Bran_Uid?:$Group_Uid; + + $where = new DB_where("and"); + $where->add("CD.Group_Uid != ?", $this->DB->sqleval("CD.Code_Uid")); + + $row = $this->getBaseCodeList($Bran_Uid, $Group_Uid, "", $where); + + $ret = array( + "CODE" =>Array(), + "CODEEXP"=>Array(), + ); + foreach( (array)$row as $val ){ + if( !isset($ret['CODE'][$val['Bran_Uid']]) ){ + $ret['CODE'][$val['Bran_Uid']] = Array(); + $ret['CODEEXP'][$val['Bran_Uid']] = Array(); + } + + $ret['CODE'][$val['Bran_Uid']][$val['Code_Uid']] = $val['Code_Val'];; + $ret['CODEEXP'][$val['Bran_Uid']][$val['Code_Uid']] = Array($val['Code_Val'],$val['Code_Exp']); + } + return $ret; + } + +// public static function val2code( $rows, $val ){ +// foreach( $rows as $key => $vrow ){ +// if( is_array($vrow) && $val == $vrow['val'] || $vrow == $val ){ +// return $key; +// } +// } +// return false; +// } +// +// public static function val2txt( $rows, $val ){ +// foreach( $rows as $key => $vrow ){ +// if( is_array($vrow) && $val == $vrow['val'] ){ +// return $vrow['txt']; +// }else if( $vrow == $val ){ +// return $vrow; +// } +// } +// return false; +// } +} diff --git a/lib/base/clist.class.php b/lib/base/clist.class.php new file mode 100644 index 0000000..dd484ac --- /dev/null +++ b/lib/base/clist.class.php @@ -0,0 +1,179 @@ +rows = array(); + $this->pages = array(); + $this->url = $_SERVER['PHP_SELF']; + $this->fld = "*"; + $this->where = "1=1"; + $this->query = array(); + $this->page = 1; + $this->orderby = "1"; + $this->viewnum = $GLOBALS['_varsBaseCode']['line_num']?:10; + $this->rownum = $GLOBALS['_varsBaseCode']['page_num']?:10; + $this->linktype = ""; + } + + public function getCommonList($tb="",$prt=false){//테이블, 필드, where절, order by절, 메인url, urlquery, 현재페이지, 목록수, 페이지수 + if( $tb ){ + $sql = "select count(*) from {$tb} where {$this->where}"; + //if( $prt ) echo $sql; + $this->allcnt = $this->DB->queryFirstField($sql,$this->whererow,array(),$prt); + } + $pobj = new Pagenation(); + $pgobj = $pobj->get_pagenation($this->allcnt, $this->viewnum, $this->rownum, $this->page); + $this->pagenation = $pgobj; + + $this->line_cnt = $pgobj->total_rows - $this->viewnum*($pgobj->current - 1); + $this->pages = $this->getPages($pgobj); + if( $tb ){ + //$sql = "select {$this->fld} from {$tb} where {$this->where} order by {$this->orderby} ". $this->DB->_limit($pgobj->limit[0],$pgobj->limit[1]); + $sql = $this->DB->addLimit("select {$this->fld} from {$tb} where {$this->where}",$this->orderby,$pgobj->limit[0],$pgobj->limit[1]); + $this->rows = $this->DB->query( $sql, $this->whererow ); + if( !$this->rows ){ + $this->rows = Array(); + } + } + } + + public function getCount($tb,$prt=false){//테이블, 필드, where절, order by절, 메인url, urlquery, 현재페이지, 목록수, 페이지수 + $sql = "select count(*) from {$tb} where {$this->where}"; + //if( $prt ) echo $sql; + $allcnt = $this->DB->queryFirstField($sql, $this->whererow,array(),$prt); + return $allcnt; + } + + private function getHref( $url ){ + if( $this->linktype == "script" ){ + return 'href="###" onclick="common_page_move(\''.$url.'\')"'; + }else{ + return 'href='.$url; + } + } + + private function getPages($pgobj){ + $pagehtml = array(); + $query = $this->getQuery($this->query); + if( $pgobj->pages[0] && $pgobj->pages[0] != 1 ){ + $pagehtml[] = "getHref("{$this->url}?{$query}&page=1").">[<"; + $pagehtml[] = "getHref("{$this->url}?{$query}&page={$pgobj->bprev}")."><"; + } + for( $a=0 ; $apages) ; $a++ ){ + if( $pgobj->current == $pgobj->pages[$a] ){ + $pagehtml[] = "getHref("{$this->url}?{$query}&page={$pgobj->pages[$a]}").">{$pgobj->pages[$a]}"; + }else{ + $pagehtml[] = "getHref("{$this->url}?{$query}&page={$pgobj->pages[$a]}").">{$pgobj->pages[$a]}"; + } + } + if( $pgobj->pages[count($pgobj->pages)-1] != $pgobj->last ){ + $pagehtml[] = "getHref("{$this->url}?{$query}&page={$pgobj->bnext}").">>"; + $pagehtml[] = "getHref("{$this->url}?{$query}&page={$pgobj->last}").">>]"; + } + return $pagehtml; + } + + private function getQuery($qrow, $field="",$value=""){ + if( $field ){ + $qrow[$field] = $value; + } + $query = array(); + if( count($qrow) > 0 ){ + foreach( $qrow as $key => $val ){ + if( hasval($val) ){ + $query[] = "{$key}={$val}"; + } + } + } + return implode("&", $query); + } + + public function getUrl( $chgrow ){ //기존 query 에 $chgrow 부분을 변경/적용하여 url 가져오기 + $qrow = $this->query; + if( count($chgrow) > 0 ){ + foreach( $chgrow as $key => $val ){ + $qrow[$key] = $val; + } + } + return $this->url."?".$this->getQuery($qrow); + } + + public function getOrdUrl($field,$oasc=""){ //기존 query에 order용 변경/적용할 부분을 간소화 + $oasc = $oasc?:($this->query['oasc']=="asc"?"desc":"asc"); + return $this->getUrl(array("ofld"=>$field,"oasc"=>$oasc,"page"=>1)); + } + + public function getEcptUrl($fields){ //기존 query 에 $fields 부분을 제외하고 url 가져오기 + $qrow = $this->query; + if( count($qrow) > 0 ){ + foreach( $qrow as $key => $val ){ + if( is_array($fields) ){ + if( in_array($key, $fields) ) unset($qrow[$key]); + }else{ + if( $key == $fields ) unset($qrow[$key]); + } + } + } + + return $this->url."?".$this->getQuery($qrow); + } + + public function getSearchUrl(){ //기존 query에 정렬부분만 남기고 초기화 하여 url 가져오기 + $qrow = $this->query; + if( count($qrow) > 0 ){ + foreach( $qrow as $key => $val ){ + if( $key != "ofld" && $key != "oasc" ) unset($qrow[$key]); + } + } + return $this->url."?".$this->getQuery($qrow); + } + + public function getOrdQueryRow($field,$oasc=""){ //기존 query에 order용 변경/적용할 부분을 간소화하여 배열로 리턴 + $oasc = $oasc?:($this->query['oasc']=="asc"?"desc":"asc"); + return array("ofld"=>$field,"oasc"=>$oasc,"page"=>1); + } + + public function getEcptQueryRow($fields){ //기존 query 에 $fields 부분을 제외하고 배열로 리턴 + $qrow = $this->query; + if( count($qrow) > 0 ){ + foreach( $qrow as $key => $val ){ + if( is_array($fields) ){ + if( in_array($key, $fields) ) unset($qrow[$key]); + }else{ + if( $key == $fields ) unset($qrow[$key]); + } + } + } + + return $qrow; + } + + public function getSearchQueryRow(){ //기존 query에 정렬부분만 남기고 초기화 하여 배열로 리턴 + $qrow = $this->query; + if( count($qrow) > 0 ){ + foreach( $qrow as $key => $val ){ + if( $key != "ofld" && $key != "oasc" ) unset($qrow[$key]); + } + } + return $qrow; + } +} diff --git a/lib/base/cmanage.class.php b/lib/base/cmanage.class.php new file mode 100644 index 0000000..3bbd644 --- /dev/null +++ b/lib/base/cmanage.class.php @@ -0,0 +1,197 @@ +TB = $table; + } + + public function getDataList( $fields="", $where="", $orderby="", $limit=array() ){ //데이터 리스트 + if( !$fields ) $fields = "*"; + if( !$where ){ + $where = new DB_where("and"); + } + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select {$fields} from {$this->TB} where {$whereqry} ".(($orderby)?"order by {$orderby}":""). $this->DB->_limit($limit[0],$limit[1]); + $sql = $this->DB->addLimit("select {$fields} from {$this->TB} where {$whereqry}",$orderby,$limit[0],$limit[1]); + $rst = $this->DB->qry($sql, $whererow); + $row = array(); + while( $tmp = $this->DB->fetch_array($rst) ){ + $row[] = $tmp; + } + return $row; + } + + public function getDataPage($fields="", $query=array(), $where="" ,$orderby=""){ //데이터 리스트 (페이징) + $lists = $this->getDataPageCommon($fields, $query, $where, $orderby); + + $lists->url = $_SERVER['PHP_SELF']; + $lists->linktype = ""; + $lists->getCommonList($this->TB); + + return $lists; + } + + public function getDataPageScript($fields="", $query=array(), $where="" ,$orderby="", $url=""){ //데이터 리스트 (페이징) + $lists = $this->getDataPageCommon($fields, $query, $where, $orderby); + + $lists->linktype = "script"; + $lists->url = $url?:$_SERVER['PHP_SELF']; + $lists->getCommonList($this->TB); + + return $lists; + } + + public function getDataPageCommon($fields="", $sqldata=array(), $where="" ,$orderby=""){ //데이터 리스트 (페이징) + if( !$fields ) $fields = "*"; + if( !$where ){ + $where = new DB_where("and"); + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $query = array_merge(array( + "mode" => $sqldata['mode']?:"", + "viewnum" => $sqldata['viewnum']?:"", + "sfld" => $sqldata['sfld']?:"", + "stxt" => $sqldata['stxt']?:"", + "ofld" => $sqldata['ofld']?:"", + "oasc" => $sqldata['oasc']?:"", + ), $sqldata); + + $page = $sqldata['page']?:1; + unset($query['page']); + + $lists = new clist(); + $lists->DB->query_print = $this->DB->query_print; + $lists->DB->query_record = $this->DB->query_record; + $lists->fld = $fields; + $lists->where = $whereqry; + $lists->whererow = $whererow; + $lists->orderby = $orderby; + $lists->url = $_SERVER['PHP_SELF']; + $lists->query = $query; + $lists->page = $page; + $lists->viewnum = $query['viewnum']?:$GLOBALS['_varsBaseCode']['line_num']; + $lists->rownum = $query['rownum']?:$GLOBALS['_varsBaseCode']['page_num']; + return $lists; + } + + public function getData( $fields="", $urow="", $where="", $orderby="" ) { + if( !$fields ) $fields = "*"; + if( gettype($urow) == "object" && get_class($urow) == "DB_where" ){ + $where = $urow; + } + if( !$where ){ + $where = new DB_where("and"); + } + if( gettype($urow) == "array" ){ + foreach((array)$urow as $key => $val){ + if( $key ){ + $where->add("{$key} = ?",$val); + } + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select {$fields} from ".$this->TB." where {$whereqry}". ($orderby?" order by {$orderby}":""); + return $this->DB->queryFirstRow($sql, $whererow); + } + + public function putData( $sqldata ) { //데이터 등록 + if( $this->DB->tableExists( $this->TB ) ){ + return $this->DB->insert( $this->TB, $sqldata); + } + return 0; + } + + public function setData( $sqldata, $urow="", $where="" ) { //데이터 수정 + if( gettype($urow) == "object" && get_class($urow) == "DB_where" ){ + $where = $urow; + } + if( !$where ){ + $where = new DB_where("and"); + } + if( gettype($urow) == "array" ){ + foreach((array)$urow as $key => $val){ + if( $key ){ + $where->add("{$key} = ?",$val); + } + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update( $this->TB, $sqldata, $whereqry, $whererow ); + } + + public function setDataParts( $sqldata, $field="", $urow="", $where=""){ //데이터 일괄 수정 + $fld = ""; + $arr = array(); + $wre = new DB_where("and"); + + if( gettype($field) == "object" && get_class($field) == "DB_where" ){ + $wre = $field; + }else if( gettype($urow) == "object" && get_class($urow) == "DB_where" ){ + $wre = $urow; + }else if( $where ){ + $wre = $where; + } + + if( gettype($field) == "array" ){ + $arr = $field; + }else if( gettype($urow) == "array" ){ + $arr = $urow; + } + + if( gettype($field) == "string" ){ + $fld = $field; + } + + if( @count($arr) > 0 ){ + $subwhere = $wre->sub_where("or"); + foreach((array)$arr as $key => $val){ + $subwhere->add( ($fld?:$key)." = ?",$val); + } + } + + $wqry = $wre->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update( $this->TB, $sqldata, $whereqry, $whererow ); + } + + public function delData( $urow="", $where="" ) { //데이터 삭제 + if( gettype($urow) == "object" && get_class($urow) == "DB_where" ){ + $where = $urow; + } + if( !$where ){ + $where = new DB_where("and"); + } + if( gettype($urow) == "array" ){ + foreach((array)$urow as $key => $val){ + if( $key ){ + $where->add("{$key} = ?",$val); + } + } + } + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->delete( $this->TB, $whereqry, $whererow ); + } +} \ No newline at end of file diff --git a/lib/base/kcate.class.php b/lib/base/kcate.class.php new file mode 100644 index 0000000..e240d48 --- /dev/null +++ b/lib/base/kcate.class.php @@ -0,0 +1,624 @@ +DB->query_record = false; //query log 기록 금지 + + if( $cate_table ){ + $this->cate_table = $cate_table; + }else{ + $this->cate_table = TB_cate; + } + $this->dmax = 4; + $this->cate_area = ""; + $this->cate_auth = array(""); + + $this->DB->tableExists($this->cate_table); + } + + public function set_cate_area($cate_area){ + $this->cate_area = $cate_area; + } + + public function get_cate_area(){ + return $this->cate_area; + } + + public function getAreaQry($where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + if( $this->cate_area ){ + $where->add("cate_area = ?", $this->cate_area); + } + return $where; + } + + public function getShowQry($where=""){ + if( !$where ){ + $where = new DB_where("and"); + } + + if( $this->cate_auth ){ + $subwhere = $where->sub_where("or"); + foreach( (array)$this->cate_auth as $val ){ + $subwhere->add("cate_auth = ?", $val); + } + } + + return $where; + + /* + switch( $auth ){ + case "1" : + $valrow = Array("Y","M","S","A"); + break; + case "2" : + $valrow = Array("Y","M","S"); + break; + case "3" : + $valrow = Array("Y","M"); + break; + default : + $valrow = Array("Y"); + break; + } + return " and cate_auth in ('".implode("','",$valrow)."') "; + */ + } + + public function new_cate($pa_code, $where=""){ //새 카테고리 추가 + //상위카테고리의 오류확인 + $pa_code = (string)$pa_code; + $new_pa_code = $pa_code; + if( $pa_code != 0 && $pa_code != "" && $pa_code != "0" && strlen($pa_code) % $this->dmax != 0 ){ + for( $i = 0 ; $i < $this->dmax - ( strlen($pa_code) % $this->dmax ) ; $i++ ){ + $new_pa_code = "0{$new_pa_code}"; + } + } + + if( !$where ){ + $where = $this->getAreaQry(); + } + $where->add("cate_code like ?", "{$new_pa_code}%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //주어진 카테고리의 1단계 아래 카테고리 중 최대값 찾음 + $next_len = strlen($new_pa_code) + $this->dmax; + + $sql = "select max(SUBSTRING(cate_code,1,$next_len)) from {$this->cate_table} where {$whereqry}"; + $pre_cate = $this->DB->queryFirstField($sql, $whererow); + if( !$pre_cate ){ + $pre_cate = $new_pa_code; + } + + //1단계 아래 카테고리가 없을때-Y, 있을-N + if( $pre_cate == $new_pa_code ){ + for( $i = 0 ; $i < $this->dmax ; $i++ ){ + $pre_cate = $pre_cate."0"; + } + + $last_up = (string)( (int)substr($pre_cate, -$this->dmax) + 1 ); + $forlen = $this->dmax - ( strlen($last_up) % $this->dmax ); + for( $i = 0 ; $i < $forlen ; $i++ ){ + $last_up = "0".$last_up; + } + + $pre_cate = substr($pre_cate, 0, -$this->dmax).$last_up; + $forlen = ( $this->dmax - ( strlen($pre_cate) % $this->dmax ) ) % $this->dmax; + for( $i = 0 ; $i < $forlen ; $i++ ){ + $pre_cate = "0".$pre_cate; + } + return $pre_cate; + }else{ + $last_up = (int)substr($pre_cate, -$this->dmax) + 1; + if( $last_up < pow(10, $this->dmax) ){ + $last_up = (string)$last_up; + $cnt = $this->dmax - strlen($last_up); + for( $i = 0 ; $i < $cnt ; $i++ ){ + $last_up = "0".$last_up; + } + + $pre_cate = substr($pre_cate, 0, -$this->dmax).$last_up; + return $pre_cate; + }else{ + alert("카테고리 허용한도가 초과되었습니다."); + return false; + } + } + } + + public function up_cate($cate_code){ // 상위카테고리 리턴 + return substr($cate_code, 0, strlen($cate_code) - $this->dmax); + } + + public function sub_cate($cate_code){ // 하위카테고리 배열 리턴 + $where = $this->getAreaQry(); + $where = $this->getShowQry($where); + $where->add("cate_code like ?", "{$cate_code}%"); + $where->add("cate_code != ?", $cate_code?:""); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where {$whereqry} order by cate_code"; + $rst = $this->DB->qry($sql, $whererow); + $i = 0; + $re_row = Array(); + + while( $sub_obj = $this->DB->fetch_array($rst) ){ + foreach( (array)$sub_obj as $key => $val ){ + $re_row[$key][$i] = $val; + } + $i++; + } + return $re_row; + } + + public function sub_direct_cate($cate_code){ // 1단계아래의 하위카테고리 배열만 리턴 + $temp_ren = strlen($cate_code) + $this->dmax; + + $where = $this->getAreaQry(); + $where = $this->getShowQry($where); + $where->add("cate_code like ?", "{$cate_code}%"); + $where->add("cate_code != ?", $cate_code); + $where->add("len(cate_code) = ?", $temp_ren); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where {$whereqry} order by cate_code"; + $rst = $this->DB->qry($sql, $whererow); + $i = 0; + $re_row = Array(); + while( $sub_obj = $this->DB->fetch_array($rst) ){ + foreach( $sub_obj as $key => $val ){ + $re_row[$key][$i] = $val; + } + $i++; + } + return $re_row; + } + + public function history_cate($cate_code){ // $cate_code 의 상위 카테고리 배열 리턴 + $floor = strlen($cate_code) / $this->dmax; + for( $i = $floor ; $i > 0 ; $i-- ){ + $info = $this->cate_info(substr($cate_code, 0, $this->dmax * $i)); + if($info) foreach( $info as $key => $val ){ + $re_row[$key][$i - 1] = $val; + } + } + return $re_row; + } + + public function cate_info($cate_code, $where=""){ // 카테고리정보 리턴 + if( !$where ){ + $where = new DB_where("and"); + } + $where = $this->getAreaQry($where); + $where->add("cate_code = ?", $cate_code); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where {$whereqry}"; + $row = $this->DB->queryFirstRow($sql, $whererow); + return $row; + } + + public function cate_info_id($cate_id, $where=""){ // 카테고리정보 리턴 id + if( !$where ){ + $where = new DB_where("and"); + } + $where = $this->getAreaQry($where); + $where->add("cate_id = ?", $cate_id); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where {$whereqry}"; + $row = $this->DB->queryFirstRow($sql, $whererow); + return $row; + } + + public function cate_info_data(){ // 카테고리정보 리턴 url + if( $_SERVER['REQUEST_URI'] != "/" ){ + $where = $this->getAreaQry(); + $where->add("charindex(?, cate_data) != 0", $_SERVER['REQUEST_URI']); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select * from {$this->cate_table} where cate_data is not null and cate_data != '' and {$whereqry} order by cate_code desc ".$this->DB->_limit(0,1); + $sql = $this->DB->addLimit("select * from {$this->cate_table} where cate_data is not null and cate_data != '' and {$whereqry}","cate_code desc",0,1); + $row = $this->DB->queryFirstRow($sql, $whererow); + return $row; + } + } + + public function cate_name($cate_code, $field_name="cate_name"){ // 카테고리명 리턴 + $where = $this->getAreaQry(); + $where->add("cate_code = ?", $cate_code); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select {$field_name} from {$this->cate_table} where {$whereqry}"; + return $this->DB->queryFirstField($sql, $whererow); + } + + public function move_cate($cate_code, $dest_upcode){ // 카테고리 이동 (단순) + $temp_ren = strlen($cate_code)+1; + $new_code = $this->new_cate($dest_upcode); + $params = Array( + //"cate_code" => $this->DB->sqleval( "CONCAT('{$new_code}',SUBSTRING(cate_code,{$temp_ren},1000))" ), + "cate_code" => $this->DB->sqleval( "'{$new_code}' + SUBSTRING(cate_code,{$temp_ren},1000)" ), + ); + + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "{$cate_code}%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update($this->cate_table, $params, $whereqry, $whererow); + } + + public function move_target_cate_id($cate_id,$dest_id,$pos_num){ // 카테고리 이동 _ id + $cinfo = $this->cate_info_id($cate_id); + $dinfo = $this->cate_info_id($dest_id); + $cate_code = $cinfo['cate_code']; + $dest_code = $dinfo['cate_code']; + + //if( $this->up_cate($cate_code) == $dest_code && substr($cate_code,-$this->dmax) <= $pos_num ){ $pos_num++; } + + return $this->move_target_cate($cate_code, $dest_code, $pos_num); + } + + public function move_target_cate($cate_code,$dest_upcode,$pos_num){ // 카테고리 이동 + $code_len = strlen($cate_code); //코드길이 + $code_parent = substr($cate_code,0,-$this->dmax); //부모코드 + $code_parlen = strlen($code_parent); //부모코드길이 + $dest_len = strlen($dest_upcode); //대상코드길이 + $dest_chilen = strlen($dest_upcode)+$this->dmax; //대상자식코드길이 + + $where = $this->getAreaQry(); + $where->add("cate_code != ?", "{$cate_code}"); + $where->add("cate_code != ?", "{$dest_upcode}"); + $where->add("cate_code like ?", "{$dest_upcode}%"); + $where->add("len(cate_code) = ?", strlen($dest_upcode)+$this->dmax); + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + //$sql = "select cate_code from {$this->cate_table} where {$whereqry} order by cate_code asc ".$this->DB->_limit($pos_num,1); + $sql = $this->DB->addLimit("select cate_code from {$this->cate_table} where {$whereqry}","cate_code asc",$pos_num,1); + $dest_code = $this->DB->queryFirstField($sql, $whererow); + if( $dest_code ){ //대상위치에 존재하는 코드가 있으면 + $tgt_num = (int)substr($dest_code,-$this->dmax); + }else{ //대상위치에 존재하는 코드가 없으면 마지막 코드 +1 + $sql = $this->DB->addLimit("select cate_code from {$this->cate_table} where {$whereqry}","cate_code desc",0,1); + $dest_code = $this->DB->queryFirstField($sql, $whererow); + $tgt_num = (int)substr($dest_code,-$this->dmax) + 1; + } + + if( strpos( $dest_upcode, $code_parent ) !== false && $dest_code > $cate_code ){ //같은 레벨 이동이거나 아래로 이동일 경우. (자신이 빠진것 만큼, 대상 부모의 자신의 레벨 부분을, -1만큼 보상해줘야 함.) + if( $dest_upcode == $code_parent ){ //같은 레벨 이동은 $tgt_num 이 바뀌고, 하위레벨로의 이동은 upcode 가 바뀐다. + $tgt_num--; + }else{ + $code1 = substr($dest_upcode, 0, $code_len); + $code2 = substr($dest_upcode, $code_len); + $dest_upcode = substr($code1,0,-$this->dmax) . addzero((int)substr($code1,-$this->dmax) - 1, $this->dmax) . $code2; + } + } + $new_part = $dest_upcode.addzero($tgt_num,$this->dmax); + $params = Array( + //"cate_code" => $this->DB->sqleval( "CONCAT('xxxxxxxxxx',SUBSTRING(cate_code,".($code_len+1).",1000))" ), + "cate_code" => $this->DB->sqleval( "'xxxxxxxxxx' + SUBSTRING(cate_code,".($code_len+1).",1000)" ), + ); + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "{$cate_code}%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->update($this->cate_table, $params, $whereqry, $whererow); //대상 임시보관 + + + $params = Array( + //"cate_code" => $this->DB->sqleval( "CONCAT(SUBSTRING(cate_code,1,{$code_parlen}),REPLICATE('0',".$this->dmax."-LEN(CONVERT(VARCHAR,SUBSTRING(cate_code,".($code_parlen+1).",".$this->dmax.")-1)))+CONVERT(VARCHAR,SUBSTRING(cate_code,".($code_parlen+1).",".$this->dmax.")-1),SUBSTRING(cate_code,".($code_len+1).",1000))" ), + "cate_code" => $this->DB->sqleval( "SUBSTRING(cate_code,1,{$code_parlen}) + REPLICATE('0',".$this->dmax."-LEN(CONVERT(VARCHAR,SUBSTRING(cate_code,".($code_parlen+1).",".$this->dmax.")-1)))+CONVERT(VARCHAR,SUBSTRING(cate_code,".($code_parlen+1).",".$this->dmax.")-1) + SUBSTRING(cate_code,".($code_len+1).",1000)" ), + ); + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "{$code_parent}%"); + $where->add("cate_code > ?", $cate_code); + $where->add("cate_code not like ?", "{$cate_code}%"); + $where->add("cate_code not like ?", "xxxxxxxxxx%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->update($this->cate_table, $params, $whereqry, $whererow); //원본 위치의 빠진공간 메움 + + + $params = Array( + //"cate_code" => $this->DB->sqleval( "CONCAT(SUBSTRING(cate_code,1,{$dest_len}), REPLICATE('0', ".$this->dmax."-LEN(CONVERT(VARCHAR,SUBSTRING(cate_code,".($dest_len+1).",".$this->dmax.")+1)))+CONVERT(VARCHAR,SUBSTRING(cate_code,".($dest_len+1).",".$this->dmax.")+1), SUBSTRING(cate_code,".($dest_chilen+1).",1000))" ), + "cate_code" => $this->DB->sqleval( "SUBSTRING(cate_code,1,{$dest_len}) + REPLICATE('0', ".$this->dmax."-LEN(CONVERT(VARCHAR,SUBSTRING(cate_code,".($dest_len+1).",".$this->dmax.")+1)))+CONVERT(VARCHAR,SUBSTRING(cate_code,".($dest_len+1).",".$this->dmax.")+1) + SUBSTRING(cate_code,".($dest_chilen+1).",1000)" ), + ); + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "{$dest_upcode}%"); + $where->add("cate_code >= ?", $new_part); + $where->add("cate_code not like ?", "xxxxxxxxxx%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->update($this->cate_table, $params, $whereqry, $whererow); //대상 위치의 공간확보 + + + + $params = Array( + //"cate_code" => $this->DB->sqleval( "CONCAT('{$dest_upcode}','{$new_part}',SUBSTRING(cate_code,11,1000))" ), + "cate_code" => $this->DB->sqleval( "'{$new_part}' + SUBSTRING(cate_code,11,1000)" ), + ); + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "xxxxxxxxxx%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update($this->cate_table, $params, $whereqry, $whererow); //대상 위치로 이동 + } + + public function drop_cate($cate_code, $cate_save_dir=""){ // 카테고리 삭제 + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "{$cate_code}%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->delete($this->cate_table, $whereqry, $whererow); + } + + public function level_cate($cate_code){ // 카테고리 레벨 - 몇번째 카테고리인지 리턴 + return strlen($cate_code) / $this->dmax; + } + + public function max_level_cate(){ // 최고카테고리 레벨 + $where = $this->getAreaQry(); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select max(len(cate_code)) from {$this->cate_table} where {$whereqry}"; + return $this->DB->queryFirstField($sql, $whererow) / $this->dmax; + } + + public function tree_cate($cate_code){ // 카테고리 트리배열 리턴 + $where = $this->getAreaQry(); + $where = $this->getShowQry($where); + $where->add("cate_code like ?", "{$cate_code}%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where {$whereqry} order by cate_code"; + $rst = $this->DB->qry($sql, $whererow); + return $this->tree_cate_exe($rst); + } + + public function tree_cate_all($cate_code){ // 카테고리 트리배열 리턴. 조회방식과 무관 + $where = $this->getAreaQry(); + $where->add("cate_code like ?", "{$cate_code}%"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $sql = "select * from {$this->cate_table} where {$whereqry} order by cate_code"; + $rst = $this->DB->qry($sql, $whererow); + return $this->tree_cate_exe($rst); + } + + public function tree_cate_exe($rst){ + $i = 0; + $tree_row = Array(); + while( $cate_obj = $this->DB->fetch_array($rst) ){ + $sub_row = $this->sub_cate($cate_obj['cate_code']); + foreach( $cate_obj as $key => $val ){ + $tree_row[$key][$i] = $val; + } + $tree_row['level'][$i] = $this->level_cate($cate_obj['cate_code']); + $tree_row['sub'][$i] = count((Array)$sub_row['cate_code']); + $i++; + } + return $tree_row; + } + + public function draw_cate_all($cate_code, $page_url=""){ // 전체 카테고리 트리 작성 + if( !$page_url ){ + $page_url = $_SERVER['PHP_SELF']; + } + + $tree_row = $this->tree_cate(""); + $history_row = $this->history_cate($cate_code); + + $all_num = count($tree_row['cate_code']); + $pre_level = 0; + $tree_html = "
최상위
"; + + for( $i = 0 ; $i < $all_num ; $i++ ){ + if( $pre_level >= $tree_row['level'][$i] ){ + for( $k = 0 ; $k <= ( $pre_level - $tree_row['level'][$i] ) ; $k++ ){ + $tree_html .= "\r\n"; + } + } + + if( $cate_code == $tree_row['cate_code'][$i] or @in_array($tree_row['cate_code'][$i], $history_row['cate_code']) ){ + $view_conv = ""; + }else{ + $view_conv = "none"; + } + + if( count($this->sub_direct_cate($tree_row['cate_code'][$i])) > 0 ){ + $plus_img = "line_plus.gif"; + }else{ + $plus_img = "line_minus.gif"; + } + + if( $cate_code == $tree_row['cate_code'][$i] ){ + $open_folder = "folder_o.gif"; + $fg_col = 'font-weight:bold;color:#003366'; + }else{ + $open_folder = "folder_c.gif"; + $fg_col = ""; + } + + $tree_html .= "\r\n
"; + for( $ks = 0 ; $ks < $tree_row['level'][$i] ; $ks++ ){ + $tree_html .= ""; + } + $tree_html .= "{$tree_row['cate_name'][$i]}
"; + $tree_html .= "\r\n
"; + $pre_level = $tree_row['level'][$i]; + } + + for( $i = 0 ; $i < $pre_level ; $i++ ){ + $tree_html .= "\r\n
"; + } + + return $tree_html; + } + + public function draw_cate_script($cate_code){ // 전체 카테고리 트리 작성(스크립트) + $tree_row = $this->tree_cate(""); + $history_row = $this->history_cate($cate_code); + + $all_num = count($tree_row['cate_code']); + $pre_level = 0; + $tree_html = ""; + + for( $i = 0 ; $i < $all_num ; $i++ ){ + if( $pre_level >= $tree_row['level'][$i] ){ + for( $k = 0 ; $k <= ( $pre_level - $tree_row['level'][$i] ) ; $k++ ){ + $tree_html .= "\r\n"; + } + } + + if( $cate_code == $tree_row['cate_code'][$i] or @in_array($tree_row['cate_code'][$i], $history_row['cate_code']) ){ + $view_conv = ""; + }else{ + $view_conv = "none"; + } + + if( count($this->sub_direct_cate($tree_row['cate_code'][$i])) > 0 ){ + $plus_img = "line_plus.gif"; + }else{ + $plus_img = "line_minus.gif"; + } + + if( $cate_code == $tree_row['cate_code'][$i] ){ + $open_folder = "folder_o.gif"; + $fg_col = 'font-weight:bold;color:#003366'; + }else{ + $open_folder = "folder_c.gif"; + $fg_col = ""; + } + + $tree_html .= "\r\n
"; + for( $ks = 0 ; $ks < $tree_row['level'][$i] ; $ks++ ){ + $tree_html .= ""; + } + $tree_html .= "{$tree_row['cate_name'][$i]}
"; + $tree_html .= "\r\n
"; + $pre_level = $tree_row['level'][$i]; + } + + for( $i = 0 ; $i < $pre_level ; $i++ ){ + $tree_html .= "\r\n
"; + } + + return $tree_html; + } + + public function list_cate($cate_code, $url, $spr){ + $word = "최상위"; + + $his_row = $this->history_cate($cate_code); + for( $i = 0 ; $i < count($his_row['cate_code']) ; $i++ ){ + $word .= "{$spr}{$his_row['menu_name'][$i]}"; + } + return $word; + } + + public function get_cate($menu_id=""){ + global $cmenu_id, $cmenu_cate, $d1n, $d2n, $d3n, $d4n; + if($menu_id){ + $row = $this->cate_info_id($menu_id); + return $row['cate_code']; + }else if( $cmenu_id ){ + $row = $this->cate_info_id($cmenu_id); + return $row['cate_code']; + }else if( $cmenu_cate ){ + return $cmenu_cate; + }else if( $d1n ){/*이전방식 호환용*/ + return ( ( $d1n )?addzero($d1n, $this->dmax):"" ).( ( $d2n )?addzero($d2n, $this->dmax):"" ).( ( $d3n )?addzero($d3n, $this->dmax):"" ).( ( $d4n )?addzero($d4n, $this->dmax):"" ); + }else{ + $row = $this->cate_info_data(); + return $row['cate_code']; + } + } + + function tree_by_parent( $row, $cd_fld, $pcd_fld, $pcd_val ){ + $nrow = array_filter($row, function($v) use ($pcd_val, $pcd_fld, $cd_fld) { + return $pcd_val == $v[$pcd_fld] && !!$v[$cd_fld]; + }); + + $arr = Array(); + foreach( (Array)$nrow as $ar ){ + $ar['children'] = $this->tree_by_parent($row, $cd_fld, $pcd_fld, $ar[$cd_fld]); + $arr[] = $ar; + } + return $arr; + } + + public function __get($name){ + $method = "get_{$name}"; + if( method_exists($this, $method) ){ + return $this->$method(); + } + + return false; + } + + public function __set($name, $value){ + $method = "set_{$name}"; + if( method_exists($this, $method) ){ + return $this->$method( $value ); + } + return false; + } +} diff --git a/lib/base/lcrypt.class.php b/lib/base/lcrypt.class.php new file mode 100644 index 0000000..eee9401 --- /dev/null +++ b/lib/base/lcrypt.class.php @@ -0,0 +1,125 @@ +pwHash ){ + $site_pw = hash ( "sha256", base64_encode ( strtolower ( $pass ) . $this->pwOpt ) ); + $site_pw = password_hash( $site_pw, PASSWORD_DEFAULT); + }else{ + $site_pw = hash ( "sha256", strtolower ( $pass ) . $this->pwOpt, true ); //Binary + } + return $site_pw; + } + + public function pw_match($pass, $db_pass) { // 패스워드 체킹 + if( $this->pwHash ){ + $site_pw = hash ( "sha256", base64_encode ( strtolower ( $pass ) . $this->pwOpt ) ); + $pwd = password_verify( $site_pw, $db_pass ); + }else{ + $site_pw = hash ( "sha256", strtolower ( $pass ) . $this->pwOpt, true ); //Binary + $pwd = ($site_pw == $db_pass); + } + + if( $pwd ){ + return true; + } + return false; + } + + public function setPwOpt($pw_opt){ + $this->pwOpt = $pw_opt; + } + + public function setPwHash($bool){ + $this->pwHash = !!$bool; + } + + //암복호화 함수 + public function enc_secure($sdata) { + $enc_key = $this -> hex2bin( md5($this->pwOpt, TRUE) ); + $iv = $this -> hex2bin( md5($this->pwOpt, TRUE) ); + $encrypted = $this -> encrypt ($enc_key, $iv, $sdata); + $encrypted = str_replace('+', '+', $encrypted); + return $encrypted?:''; + } + + public function dec_secure($sdata) { + $sdata = str_replace('+', '+', $sdata); + $enc_key = $this -> hex2bin( md5($this->pwOpt, TRUE) ); + $iv = $this -> hex2bin( md5($this->pwOpt, TRUE) ); + $decrypted = $this -> decrypt ($enc_key, $iv, $sdata); + return $decrypted?:''; + } + + public function hex2bin($hexdata){ + return $hexdata; + $bindata = ""; + for( $i = 0 ; $i < strlen($hexdata) ; $i += 2 ){ + $bindata .= chr(hexdec(substr($hexdata, $i, 2))); + } + return $bindata; + } + + public function encrypt($key, $iv, $value){ + if( is_null($value) ){ + $value = ""; + } + if( function_exists("mcrypt_encrypt") ){ + $value = $this->toPkcs7($value); + $output = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $value, MCRYPT_MODE_CBC, $iv); + }else{ + $output = openssl_encrypt($value, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $iv); + } + return base64_encode($output); + } + + public function decrypt($key, $iv, $value){ + if( is_null($value) ){ + $value = ""; + } + $value = base64_decode($value); + if( function_exists("mcrypt_encrypt") ){ + $output = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $value, MCRYPT_MODE_CBC, $iv); + $output = $this->fromPkcs7($output); + }else{ + $output = openssl_decrypt($value, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $iv); + } + return $output; + } + + private function toPkcs7($value){ + if( is_null($value) ){ + $value = ""; + } + $padSize = 16 - intval(strlen($value) % 16); + return $value.str_repeat(chr($padSize), $padSize); + } + + private function fromPkcs7($value){ + $valueLen = strlen($value); + if( $valueLen % 16 > 0 ){ + $value = ""; + } + $padSize = ord($value[$valueLen - 1]); + if( ( $padSize < 1 ) or ( $padSize > 16 ) ){ + $value = ""; + } + // Check padding. + for( $i = 0 ; $i < $padSize ; $i++ ){ + if( ord($value[$valueLen - $i - 1]) != $padSize ){ + $value = ""; + } + } + return substr($value, 0, $valueLen - $padSize); + } +} \ No newline at end of file diff --git a/lib/base/pagenation.class.php b/lib/base/pagenation.class.php new file mode 100644 index 0000000..6b243fc --- /dev/null +++ b/lib/base/pagenation.class.php @@ -0,0 +1,68 @@ +total_rows = $total_rows; + $last_page = ceil($total_rows / $rows_per_page); + $page_num = (int) $page_num; + if ($page_num < 1) { + $page_num = 1; + } + $upto = ($page_num - 1) * $rows_per_page; + if( $upto < 0 ){ + $upto = 0; + } + $pages->limit = array($upto, $rows_per_page); + $pages->current = $page_num; + if ($page_num == 1){ + $pages->prev = $page_num; + } else { + $pages->prev = $page_num - 1; + } + if ($page_num == $last_page) { + $pages->next = $last_page; + } else { + $pages->next = $page_num + 1; + } + $bprev = ceil(($page_num-$show_pages)/$show_pages) * $show_pages; + if( $bprev < 1 ){ + $pages->bprev = 1; + }else{ + $pages->bprev = $bprev; + } + $bnext = ceil($page_num/$show_pages) * $show_pages + 1; + if( $bnext > $last_page ){ + $pages->bnext = $last_page; + }else{ + $pages->bnext = $bnext; + } + $pages->last = $last_page; + $pages->info = "Page ({$page_num} of {$last_page})"; + $pages->pages = $this->get_pages($page_num, $last_page, $pages->next, $show_pages); + return $pages; + } + public function get_pages($page_num, $last_page, $next, $show_pages) { + $arr = array(); + + $start = floor(($page_num-1) / $show_pages)*$show_pages;//주석대신 추가부분 + $end = $start + $show_pages; //주석대신 추가부분 + + if ($start < 0) { + $start = 0; $end = $show_pages; + } + for ($i = $start; $i < $end; $i++) { + if ($i == $last_page){ + break; + } + array_push($arr, $i + 1); + } + return $arr; + } +} \ No newline at end of file diff --git a/lib/base/token.class.php b/lib/base/token.class.php new file mode 100644 index 0000000..1afcac3 --- /dev/null +++ b/lib/base/token.class.php @@ -0,0 +1,231 @@ + 3600, //토큰 유효시간 - 1시간 + "expire_time" => 3600 * 24 * 3, //토큰 재발행 유효시간 3일. 이후 재로그인 + "logging_time" => 3600 * 24 * 31 * 3, //로그보관 시간 3달 (현재미사용 - 나중에 로그쌓이는것 보고 사용여부 결정) + ); + private const SpareTime = 120; + + public function __construct( $cate_table="" ){ + parent::__construct(); + + $this->DB->tableExists(TB_token_log); + } + + + /** + * putToken => 토큰 저장 + * @param string $member_id : 로그인된 사용자 아이디 + * @param string $auth : 인증코드. 각각의 로그인의 Unique세션으로 사용되며 Default는 요청마다 랜덤으로 새로 생성되지만, 인증키를 사용자 아이디로 고정으로 지정하면 중복접속 방지용으로 사용가능(Single Sign On) + * @param array $config : 기본설정 대체환경 + */ + public function putToken( $member_id, $auth="", $config=Array() ){ //$auth 를 ID로 잡으면 Single Sign On, 그냥두면 Multi login + $member_id = trim($member_id); + if( !$member_id ) return false; + + if( defined('_SINGLE_LOGIN_') && _SINGLE_LOGIN_ ){ //Single Sign On 적용 + $auth = $member_id; + }else{ + $auth = $auth ?: bin2hex(openssl_random_pseudo_bytes(self::RdByte)); //인증키 랜덤생성 + } + $token = md5(self::Ezconst . $auth . uniqid()); //토큰생성 + $config = $config + self::$Config; + + $valid_time = time() + $config['valid_time']; + $exprie_time = time() + $config['expire_time']; + + $this->retireToken($auth); + + //$sql = "INSERT INTO ". TB_token_log ." (member_id, auth, token, valid_time, expire_time, active, ip) VALUES (?, ?, ?, ?, ?, ?, ?)"; + $sqlrow = Array( + "member_id" => $member_id, + "auth" => $auth, + "token" => $token, + "valid_time" => $valid_time, + "expire_time" => $exprie_time, + "Active" => "Y", + "ip" => get_ip() + ); + $rst = $this->DB->insert(TB_token_log, $sqlrow); + if( $rst ){ + return $token; + } + return false; + } + + + + + /** + * retireToken => 토큰 무효화. 비정상 접근시 사용 + * @param string $auth : 인증코드. 해당 인증코드로 생성된 모든 토큰 무효화. + */ + public function retireToken( $auth ){//모든 $auth 비활성화 처리 + //$sql = "UPDATE TB_token_log SET Active = 'N' WHERE Auth = ?"; + $sqlrow = Array( + "active" => "N", + ); + $where = new DB_where("and"); + $where->add("auth = ?", $auth); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + return $this->DB->update(TB_token_log, $sqlrow, $whereqry, $whererow); + } + + + + /** + * getFromToken => DB에서 토큰 관련정보 획득 + * @param string $token : 사용자가 제출한 토큰. + */ + public function getFromToken( $token ){//Token 정보 Load + //$sql = "SELECT USER_ID, Auth, Valid_Time, Expire_Time, Active FROM TB_token_log WHERE Token = ?"; + $where = new DB_where("and"); + $where->add("token = ?", $token); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->query_record = false; //query log 기록 금지 + $sql = "select member_id, auth, valid_time, expire_time, active from ". TB_token_log ." where {$whereqry}"; + $row = $this->DB->queryFirstRow($sql, $whererow ); + $this->DB->query_record = true; //query log 기록 + + return $row; + } + + + + /** + * getLastToken => DB에서 Auth 관련 최종정보 획득 + * @param string $auth : 요청 인증. + */ + public function getLastAuth( $auth ){//Token 정보 Load + //$sql = "SELECT USER_ID, Auth, Valid_Time, Expire_Time, Active FROM TB_token_log WHERE Token = ?"; + $where = new DB_where("and"); + $where->add("auth = ?", $auth); + $where->add("active = ?", "Y"); + + $wqry = $where->get_where(); + $whereqry = $wqry['qry']; + $whererow = $wqry['val']; + + $this->DB->query_record = false; //query log 기록 금지 + $sql = "select top 1 member_id, auth, valid_time, expire_time, active from ". TB_token_log ." where {$whereqry} order by valid_time desc"; + $row = $this->DB->queryFirstRow($sql, $whererow ); + $this->DB->query_record = true; //query log 기록 + + return $row; + } + + + + + /** + * statusToken => Token의 현재상태 판단 + * @param array|string $token_info : 토큰 또는 토큰 정보 + * @return string + * Y: 인증성공 + * N: 인증실패 + * E: 연장필요 새로운 Token 발행 + * F: 의심되는 접근. 전체 인증 Token 비활성화 + */ + public function statusToken( $token_info ){//Token 상태 (Y:인증성공) + if( !is_array($token_info) ) $token_info = $this->getFromToken($token_info); + + if( !$token_info['auth'] ) return 'N'; + + $now = time(); + + switch( true ){ + case ( $token_info['expire_time'] < $now ) : //세션만료 + return 'N'; //인증실패 + case ( $token_info['valid_time'] >= $now ) : //유효시간 이내 + if( trim($token_info['active']) != "Y" ) return "F"; //인증 비활성 필요 + return 'Y'; //인증성공 + case ( $token_info['expire_time'] >= $now ) : + if( trim($token_info['active']) != "Y" ){ + if( ($token_info['expire_time'] + self::SpareTime) >= $now ){ + return 'Y'; //동시 신호용 인증성공 $spare_time 초간 인정 + }else{ + return "F"; //인증 비활성 필요 + } + } + return 'E'; //연장요청 + } + + return 'N'; + } + + + public function chkToken( $token ){ + + //$fp = fopen(_UP_PATH_."/token_2t.txt", "a+"); + + //$fptxt = "=======================".PHP_EOL; + //$fptxt .= "NOW=> ".time().PHP_EOL; + //$fptxt .= "REQ=> ".print_r($_REQUEST,true).PHP_EOL; + + $token_info = $this->getFromToken( $token ); + $token_stauts = $this->statusToken($token_info); + //$fptxt .= "STATUS=> ".$token_stauts.PHP_EOL; + switch( $token_stauts ){ + case "E" : //토큰 연장 + $chk_token = $this->getLastAuth($token_info['auth']); + if( $token_info['token'] == $chk_token['token'] ){ + $new_token = $this->putToken($token_info['member_id'], $token_info['auth']); + } + case "Y" : //토큰 유효 + $_SESSION['auth_mem_id'] = $token_info['member_id']; + break; + + // 토큰 연장처리 되어 새로운 토큰($new_token) 이 발행되었는데도 갱신하지 않고, + // 예전 토큰 그대로 사용하면 중복 인증요청으로 무효토큰 처리되니 + // 새로운 토큰이 발행되면 다음 요청시엔 꼭 새로운 토큰으로 교체하는 과정이 필요. + // APP 에서 요청할때 응답이 필요한 요청이외의 단순 요청부분까지 응답을 필수 확인하여 $new_token 값이 있는지 점검후 교체하는 로직 필수!! + + case "F" : //토큰 비활성 + $this->retireToken( $token_info['auth'] ); + case "N" : //토큰 무효 + unset($_SESSION['auth_mem_id']); + break; + } + //fputs($fp, $fptxt); + //fclose($fp); + return $new_token; + } + + + /* + public static function getTokenLogin( $token, $config=Array() ){//Token 처리 + $token_info = self::getToken($token); + $status = self::stateToken($token_info); + + switch( $status ){ + case "Y" : + $retval = $member; + break; + case "N" : + $retval = false; + break; + case "E" : + $token = self::putToken($token_info['member_id'], $token_info['auth'], $config); + $retval = $token; + break; + case "F" : + self::retireToken( $token_info['auth'] ); + $retval = false; + break; + } + } + */ +} \ No newline at end of file diff --git a/lib/base/upload.class.php b/lib/base/upload.class.php new file mode 100644 index 0000000..34479ba --- /dev/null +++ b/lib/base/upload.class.php @@ -0,0 +1,381 @@ + $fileid ) { + if (file_exists($target_dir . $fileid . ".info")) { + $fp = fopen($target_dir . $fileid . ".info", "r"); + while (($line = fgets($fp, 4096)) !== false) { + $tmp = explode(":", $line); + $upfiles[$k][$tmp[0]] = chop($tmp[1]); + } + if( $upfiles[$k]['error'] ){ //등록시 오류가 발생한 경우 제외 + unset($upfiles[$k]); + continue; + } + $upfiles[$k]['tmp_text'] = $fileid; + $upfiles[$k]['tmp_name'] = $target_dir . $fileid; + fclose($fp); + $k++; + if ($info_unlink == "D") { // 같은 자리에서 계속 등록을 할 경우 중복등록 방지용으로 삭제를 한다. + unlink($target_dir . $fileid . ".info"); + } + } + } + return $upfiles; + } + + static function swfInfoSaveFile($ufile){ + $fileinfo["tmp_name"] = $ufile["tmp_name"]; + $fileinfo["name"] = $ufile["name"]; + $fileinfo["size"] = $ufile["size"]; + $fileinfo["type"] = $ufile["type"]; + $fileinfo['width'] = 0; + $fileinfo['height'] = 0; + $fileinfo["error"] = $ufile["error"]; + if( strpos($ufile['type'], "image") !== false ){ + $iinfo = getimagesize($ufile["tmp_name"]); + $fileinfo['width'] = $iinfo[0]; + $fileinfo['height'] = $iinfo[1]; + } + return $fileinfo; + } + + static function swfFormSaveFile($ufile, $target_dir, $temp_id=""){ + if( !preg_match("/\/$/",$target_dir) ) { + $target_dir = $target_dir . "/"; + } + if( $temp_id ){ + $fileid = $temp_id; + }else{ + $fileid = uniqid("tmpfile_"); + } + @move_uploaded_file($ufile["tmp_name"], $target_dir . $fileid); + $ufile['width'] = 0; + $ufile['height'] = 0; + if( strpos($ufile['type'], "image") !== false ){ + $iinfo = getimagesize($target_dir . $fileid); + $ufile['width'] = $iinfo[0]; + $ufile['height'] = $iinfo[1]; + } + $fp = fopen($target_dir . $fileid . ".info","w+"); + fputs($fp, "name:". $ufile["name"]."\r\n"); + fputs($fp, "size:". $ufile["size"]."\r\n"); + fputs($fp, "type:". $ufile["type"]."\r\n"); + fputs($fp, "width:". $ufile["width"]."\r\n"); + fputs($fp, "height:". $ufile["height"]."\r\n"); + fputs($fp, "error:". $ufile["error"]."\r\n"); + fclose($fp); + return $fileid; + } + + static function swfMoveUploadedFile($src, $tgt){ + rename($src, $tgt); + } + + static function swfSaveFile($ufile, $sfile){ + @move_uploaded_file($ufile["tmp_name"], $sfile); + $upfiles['name'] = $ufile['name']; + $upfiles['size'] = $ufile['size']; + return json_encode($upfiles); + } + + static function swfCleanDir($target_dir){ + if( !is_dir($target_dir) ) return; + $dp = opendir($target_dir); + if( !preg_match("/\/$/",$target_dir) ) { + $target_dir = $target_dir . "/"; + } + while(false !== ($file = readdir($dp))) { + if ($file != "." && $file != "..") { + $ftime = filectime($target_dir.$file); + if( $ftime < time()-3600*24 ){ + @unlink($target_dir.$file); + } + } + } + } + + static public function mime_type( $file_ext ){ + switch ( $file_ext ) + { + case "doc" : $mime_type = "application/msword"; + break; + case "xls" : + case "xlw" : + case "xla" : + case "xlc" : + case "xlm" : + case "xlt" : $mime_type= "application/vnd.ms-excel"; + break; + case "ppt" : + case "pps" : + case "pot" : $mime_type= "application/vnd.ms-powerpoint"; + break; + case "mpp" : $mime_type= "application/vnd.ms-project"; + break; + case "mdb" : $mime_type= "application/x-msaccess"; + break; + case "pub" : $mime_type= "application/x-mspublisher"; + break; + case "scd" : $mime_type= "application/x-msschedule"; + break; + case "hlp" : $mime_type= "application/winhlp"; + break; + case "crd" : $mime_type= "application/x-mscardfile"; + break; + case "clp" : $mime_type= "application/x-msclip"; + break; + case "m13" : + case "m14" : $mime_type= "application/x-msmediaview "; + break; + case "wmf" : $mime_type= "application/x-msmetafile"; + break; + case "mny" : $mime_type= "application/x-msmoney"; + break; + case "trm" : $mime_type= "application/x-msterminal"; + break; + case "wri" : $mime_type= "application/x-mswrite"; + break; + case "bin" : + case "exe" : + case "com" : $mime_type= "application/octet-stream"; + break; + case "asd" : + case "asn" : $mime_type= "application/astound"; + break; + case "lcc" : $mime_type= "application/fastman"; + break; + case "hqx" : $mime_type= "application/mac-binhex40"; + break; + case "mbd" : $mime_type= "application/mbedlet"; + break; + case "oda" : $mime_type= "application/oda"; + break; + case "pdf" : $mime_type= "application/pdf"; + break; + case "ai" : + case "eps" : + case "ps" : $mime_type= "application/postscript"; + break; + case "rtf" : $mime_type= "application/rtf"; + break; + case "smp" : $mime_type= "application/studiom"; + break; + case "tbt" : $mime_type= "application/timbuktu"; + break; + case "js" : $mime_type= "application/x-javascript"; + break; + case "asp" : $mime_type= "application/x-asap"; + break; + case "csh" : $mime_type= "application/x-csh"; + break; + case "dot" : $mime_type= "application/x-dot"; + break; + case "dvi" : $mime_type= "application/x-dvi"; + break; + case "etc" : $mime_type= "application/x-earthtime"; + break; + case "evy" : $mime_type= "application/x-envoy"; + break; + case "xll" : $mime_type= "application/x-excel"; + break; + case "gtar" : $mime_type= "application/x-gtar"; + break; + case "hdf" : $mime_type= "application/x-hdf"; + break; + case "latex" : $mime_type= "application/x-latex"; + break; + case "fm" : $mime_type= "application/x-maker"; + break; + case "mi" : + case "mif" : $mime_type= "application/x-mif"; + break; + case "mocha" : + case "moc" : $mime_type= "application/x-mocha"; + break; + case "ins" : $mime_type= "application/x-NET-Install"; + break; + case "nc" : + case "cdf" : $mime_type= "application/x-netcdf"; + break; + case "proxy" : $mime_type= "application/x-ns-proxy-autoconfig"; + break; + case "css" : $mime_type= "application/x-pointplus"; + break; + case "slc" : $mime_type= "application/x-salsa"; + break; + case "sh" : $mime_type= "application/x-sh"; + break; + case "shar" : $mime_type= "application/x-shar"; + break; + case "spr" : + case "sprite" : $mime_type= "application/x-sprite"; + break; + case "tar" : $mime_type= "application/x-tar"; + break; + case "tcl" : $mime_type= "application/x-tcl"; + break; + case "tex" : $mime_type= "application/x-tex"; + break; + case "texi" : + case "texinfo" : $mime_type= "application/x-texinfo"; + break; + case "tbp" : $mime_type= "application/x-timbuktu"; + break; + case "tki" : + case "tkined" : $mime_type= "application/x-tkined"; + break; + case "man" : $mime_type= "application/x-troff-man"; + break; + case "me" : $mime_type= "application/x-troff-me"; + break; + case "ms" : $mime_type= "application/x-troff-ms"; + break; + case "t" : + case "tr" : + case "roff" : $mime_type= "application/x-troff"; + break; + case "src" : $mime_type= "application/x-wais-source"; + break; + case "zip" : $mime_type= "application/zip"; + break; + case "hwp" : $mime_type= "application/hwp"; + break; + case "au" : + case "snd" : $mime_type= "audio/basic"; + break; + case "es" : + case "esl" : $mime_type= "audio/echospeech"; + break; + case "midi" : + case "mid" : $mime_type= "audio/midi"; + break; + case "aif" : + case "aiff" : + case "aifc" : $mime_type= "audio/x-aiff"; + break; + case "wav" : $mime_type= "audio/x-wav"; + break; + case "ra" : + case "ram" : $mime_type= "audio/x-pn-realaudio"; + break; + case "pac" : $mime_type= "audio/x-pac"; + break; + case "pae" : $mime_type= "audio/x-epac"; + break; + case "fif" : $mime_type= "image/fif"; + break; + case "gif" : $mime_type= "image/gif"; + break; + case "ief" : $mime_type= "image/ief"; + break; + case "ifs" : $mime_type= "image/ifs"; + break; + case "jpg" : + case "jpe" : + case "jpeg" : $mime_type= "image/jpeg"; + break; + case "png" : $mime_type= "image/png"; + break; + case "tif" : + case "tiff" : $mime_type= "image/tiff"; + break; + case "dwg" : + case "svf" : $mime_type= "image/vnd"; + break; + case "wi" : $mime_type= "image/wavelet"; + break; + case "bmp" : $mime_type= "image/bmp"; + break; + case "ras" : $mime_type= "image/x-cmu-raster"; + break; + case "pnm" : $mime_type= "image/x-portable-anymap"; + break; + case "pbm" : $mime_type= "image/x-portable-bitmap"; + break; + case "pgm" : $mime_type= "image/x-portable-graymap"; + break; + case "ppm" : $mime_type= "image/x-portable-pixmap"; + break; + case "rgb" : $mime_type= "image/x-rgb"; + break; + case "xbm" : $mime_type= "image/x-xbitmap"; + break; + case "xpm" : $mime_type= "image/x-xpixmap"; + break; + case "xwd" : $mime_type= "image/x-xwindowdump"; + break; + + case "htm" : + case "html" : $mime_type= "text/html"; + break; + case "txt" : $mime_type= "text/plain"; + break; + case "rtx" : $mime_type= "text/richtext"; + break; + case "tsv" : $mime_type= "text/tab-separated-values"; + break; + case "etx" : $mime_type= "text/x-setext"; + break; + case "talk" : $mime_type= "text/x-speech"; + break; + case "fvi" : $mime_type= "video/isivideo"; + break; + case "mpg" : + case "mpe" : + case "mpeg" : $mime_type= "video/mpeg"; + break; + case "avi" : $mime_type= "video/msvideo"; + break; + case "qt" : + case "mov" : $mime_type= "video/quicktime"; + break; + case "viv" : + case "vivo" : $mime_type= "video/vivo"; + break; + case "wv" : $mime_type= "video/wavelet"; + break; + case "movie" : $mime_type= "video/x-sgi-movie"; + break; + case "svr" : $mime_type= "x-world/x-svr"; + break; + case "wrl" : $mime_type= "x-world/x-vrml"; + break; + case "vrt" : $mime_type= "x-world/x-vrt"; + break; + + case "ice" : $mime_type= "x-conference/x-cooltalk"; + break; + case "gz" : $mime_type= "x-gzip"; + break; + case "z" : $mime_type= "x-compress"; + break; + case "uue" : + case "uu" : $mime_type= "x-uuencode"; + break; + case "map" : $mime_type= "magnus-internal/imagemap"; + break; + case "shtml" : $mime_type= "magnus-internal/parsed-html"; + break; + case "bat" : + case "cgi" : $mime_type= "magnus-internal/cgi"; + break; + default : + $mime_type= "application/octet-stream"; + } + return $mime_type; + } +} +?> \ No newline at end of file diff --git a/lib/base/usr_func.php b/lib/base/usr_func.php new file mode 100644 index 0000000..3b29bfe --- /dev/null +++ b/lib/base/usr_func.php @@ -0,0 +1,735 @@ +".PHP_EOL; + } + if( is_array($val) || is_object($val) ){ + print_r($val); + }else{ + echo $val; + } + if( $title ){ + echo PHP_EOL."
== {$title} --==
".PHP_EOL; + } +} + +function pp( $val, $title="" ){ + echo "
";
+  if( $title ){
+    echo "==-- {$title} ==".PHP_EOL;
+  }
+  if( is_array($val) || is_object($val) ){
+    print_r($val);
+  }else{
+    echo $val;
+  }
+  if( $title ){
+    echo PHP_EOL."== {$title} --==".PHP_EOL;
+  }
+  echo "
"; +} + +function alert($mesg, $url=""){ + echo ""; + if( $url ){ + move_page($url); + exit; + } +} + +function move_page($url, $mesg=""){ + if( $mesg ){ + alert($mesg); + } + echo ""; + exit; +} + +function hback($mesg=""){ + if( $mesg ){ + alert($mesg); + } + echo ""; + exit; +} + +function is_mobile(){ + if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($_SERVER['HTTP_USER_AGENT'],0,4))){ + return true; + } + return false; +} + +function strpos_arr($haystack, $needle) { + if(!is_array($needle)) $needle = array($needle); + foreach($needle as $what) { + if(($pos = strpos($haystack, $what))!==false) return $pos; + } + return false; +} + +function referer_check(){//이전페이지 체크. 보안용 + $refer = preg_replace("/https?:\/\//","",$_SERVER['HTTP_REFERER']); + $refer = substr($refer,0,strpos($refer,"/")); + return preg_match( "/".preg_quote($_SERVER['HTTP_HOST'],"/")."/i", $refer ) === 0; +} + +function getDT_datetime( $dt, $format="Y-m-d H:i:s" ){ + if( is_object($dt) && get_class($dt) == "DateTime" ){ + return $dt->format($format); + }else if( $dt ){ + return date($format,strtotime($dt)); + } + return ""; +} +function getDT_date( $dt, $format="Y-m-d" ){ + if( is_object($dt) && get_class($dt) == "DateTime" ){ + return $dt->format($format); + }else if( $dt ){ + return date($format,strtotime($dt)); + } + return ""; +} +function strtodate( $str, $format="Y-m-d" ){ + if( $str ){ + return date($format, strtotime($str)); + } + return ""; +} +function ndate( $seconds, $format="Y-m-d" ){ + if( (int)$seconds ){ + return date($format, $seconds); + } + return ""; +} + +function hidden_input($key, $val){ + return ''.PHP_EOL; +} + +function csrf_input($mode){ + $name = '_CSRF_check_'.$mode; + $sess = uniqid($mode); + if( !isset($_SESSION[$name]) || count($_SESSION[$name]) > 1000 ){ + $_SESSION[$name] = Array(); + } + $_SESSION[$name][] = $sess; + return ''.PHP_EOL; +} + +function csrf_check($mode, $del=false){ //찾을수 없으면 true 리턴 + $name = '_CSRF_check_'.$mode; + if( is_array($_SESSION[$name] ) ){ + $key = array_search($_REQUEST[$name],$_SESSION[$name]); + if( hasval($key) ){ + if( $del ){ + csrf_remove($mode); + } + return false; + } + } + return true; +} + +function csrf_remove($mode){ + $name = '_CSRF_check_'.$mode; + $key = array_search($_REQUEST[$name],$_SESSION[$name]); + if( hasval($key) ){ + unset($_SESSION[$name][$key]); + } +} + +function image_thumb($src_img, $dest_img, $dest_w, $dest_h, $stretch="N", $force="N", $dest_ext=""){//이미지 변환 - 아이구 지겨워 재미없음.. + $src_image = @getimagesize($src_img); + $src_w = $src_image[0]; + $src_h = $src_image[1]; + $src_ext = $src_image[2]; + + $img_size = image_size($src_w, $src_h, $dest_w, $dest_h, $stretch, $force); + $dest_w = $img_size['width']; + $dest_h = $img_size['height']; + + switch($src_ext){ + case 1 : + $src_image_stream = @imagecreatefromgif($src_img); + break; + case 2 : + $src_image_stream = @imagecreatefromjpeg($src_img); + break; + case 3 : + $src_image_stream = @imagecreatefrompng($src_img); + break; + case 15 : + $src_image_stream = @imagecreatefromwbmp($src_img); + break; + default : + echo ""; + return false; + } + +// $dest_image_stream = imagecreate($dest_w, $dest_h); // GD 2.0 이상 지원시 이것을 사용 + $dest_image_stream = @imagecreatetruecolor($dest_w, $dest_h); +// imagecolorallocate($dest_image_stream, 255, 255, 255); +// @imagecopyresized($dest_image_stream, $src_image_stream, 0, 0, 0, 0, $dest_w, $dest_h, $src_w, $src_h); + imagecopyresampled($dest_image_stream, $src_image_stream, 0, 0, 0, 0, $dest_w, $dest_h, $src_w, $src_h); //<-php4.0이후 + + if( $dest_ext ){ + switch($dest_ext) { + case 1 : + @imagegif($dest_image_stream,$dest_img); + break; + case 2 : + @imagejpeg($dest_image_stream,$dest_img,100); + break; + case 3 : + @imagepng($dest_image_stream,$dest_img); + break; + case 15 : + @imagewbmp($dest_image_stream,$dest_img); + break; + default : + echo ""; + return false; + } + }else{ + switch($src_ext){ + case 1 : + @imagegif($dest_image_stream,$dest_img); + break; + case 2 : + @imagejpeg($dest_image_stream,$dest_img,100); + break; + case 3 : + @imagepng($dest_image_stream,$dest_img); + break; + case 15 : + @imagewbmp($dest_image_stream,$dest_img); + break; + default : + echo ""; + return false; + } + } +} + +function image_cthumb($src_img, $dest_img, $dest_w, $dest_h){//이미지 크기 맞춤 이외삭제 + $src_image = @getimagesize($src_img); + $src_w = $src_image[0]; + $src_h = $src_image[1]; + $src_ext = $src_image[2]; + + if( $src_w < $dest_w || $src_h < $dest_h ){ + return image_thumb($src_img, $dest_img, $dest_w, $dest_h); + } + + if( ($src_w - $dest_w) > ($src_h - $dest_h) ){ + $last_w = $dest_w * $src_h/$dest_h; + $last_h = $src_h; + }else{ + $last_w = $src_w; + $last_h = $dest_h * $src_w/$dest_w; + } + + switch($src_ext){ + case 1 : + $src_image_stream = @imagecreatefromgif($src_img); + break; + case 2 : + $src_image_stream = @imagecreatefromjpeg($src_img); + break; + case 3 : + $src_image_stream = @imagecreatefrompng($src_img); + break; + case 15 : + $src_image_stream = @imagecreatefromwbmp($src_img); + break; + default : + echo ""; + return false; + } + + $dest_image_stream = @imagecreatetruecolor($dest_w, $dest_h); + imagecopyresampled($dest_image_stream, $src_image_stream, 0, 0, ($src_w-$last_w)/2, ($src_h-$last_h)/2, $dest_w, $dest_h, $last_w, $last_h); + @imagejpeg($dest_image_stream,$dest_img,100); +} + +function image_size($s_wd, $s_ht, $d_wd, $d_ht, $stretch = "N", $force = "N"){//stretch 늘이기, force 대상크기로 강제맞춤(이미지변형) + if( !$s_wd or !$s_ht or !$d_wd and !$d_ht ){ + echo "Error : image_size function parameter error"; + } + + if( $d_wd and !$d_ht ){ + $d_ht = $s_ht * $d_wd / $s_wd; + }else if( !$d_wd and $d_ht ){ + $d_wd = $s_wd * $d_ht / $s_ht; + } + + if( $force == "Y" ){ + if( $stretch == "Y" ){ + $size['width'] = $d_wd; + $size['height'] = $d_ht; + }else{ + if( $s_wd < $d_wd ){ + $size['width'] = $s_wd; + }else{ + $size['width'] = $d_wd; + } + + if( $s_ht < $d_ht ){ + $size['height'] = $s_ht; + }else{ + $size['height'] = $d_ht; + } + } + }else{ + if( ($s_wd/$d_wd) > ($s_ht/$d_ht) ){ + if( $stretch == "N" and $s_wd < $d_wd ){ + $d_wd = $s_wd; + } + + $size['width'] = $d_wd; + $size['height'] = $s_ht * $d_wd / $s_wd; + }else{ + if( $stretch == "N" and $s_ht < $d_ht ){ + $d_ht = $s_ht; + } + + $size['width'] = $s_wd * $d_ht / $s_ht; + $size['height'] = $d_ht; + } + } + + return $size; +} + +function file_remove($filepath, $unremove=""){ + $glob = glob($filepath); + $rst = true; + foreach( $glob as $filename ) { + if( !$unremove || $filename != $unremove ){ + $rst = $rst && @unlink($filename); + } + } + return $rst; +} + +function oldfile_remove($filepath, $day=1, $unremove=""){ + $glob = glob($filepath); + $rmday = $day * 86400; + $rst = true; + foreach( $glob as $filename ) { + if( fileatime($filename) < time()-$rmday && ( !$unremove || $filename != $unremove && substr(strrchr($filename,'/'),1) != $unremove ) ){ + $rst = $rst && @unlink($filename); + } + } + return $rst; +} + +function get_ip(){ + switch(true){ + case (!empty($_SERVER['HTTP_X_REAL_IP'])) : + $real_ip = $_SERVER['HTTP_X_REAL_IP']; break; + case (!empty($_SERVER['HTTP_CLIENT_IP'])) : + $real_ip = $_SERVER['HTTP_CLIENT_IP']; break; + case (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) : + $real_ip = $_SERVER['HTTP_X_FORWARDED_FOR']; break; + default : + $real_ip = $_SERVER['REMOTE_ADDR']; + } + $real_ip = explode(":",$real_ip); + return $real_ip[0]; +} + +function getRefRow($fields=array()){ //HTTP_REFERER 를 배열로 변경, $fields가 존재하면 그부분 제외 + $query= explode("?",$_SERVER['HTTP_REFERER']); + $query= explode("&",$query[1]); + $qrow = Array(); + if( count($query) > 0 ){ + foreach( $query as $val ){ + $temp = explode("=",$val); + if( !in_array($temp[0], $fields) ){ + $qrow[$temp[0]] = $temp[1]; + } + } + } + return $qrow; +} + +function getQuery($qrow, $addrow=array()){ + if( count($addrow) > 0 ){ + $qrow = array_merge($qrow, $addrow); + } + $query = array(); + if( count($qrow) > 0 ){ + foreach( $qrow as $key => $val ){ + if( hasval($val) ){ + $query[] = "{$key}={$val}"; + } + } + } + return implode("&", $query); +} + +function base64url_encode($data){ + $base64 = base64_encode($data); + + if ($base64 === false) { + return false; + } + $url = strtr($base64, '+/', '-_'); + return rtrim($url, '='); +} + +function base64url_decode($data, $strict = false){ + $b64 = strtr($data, '-_', '+/'); + return base64_decode($b64, $strict); +} + +function cval($key){ + if( isset($$key) ){ + return $$key; + } + return ""; +} + +function crowval($row, $key, $dval=""){ + if( isset($row[$key]) ){ + return $row[$key]; + } + return $dval; +} + +function hasval( $val ){ + if( isset($val) && ($val || $val === 0 || $val === "0") ){ + return true; + } + return false; +} + +function array_merge_static( $row1, $row2 ){ + foreach( (array)$row2 as $k => $v ){ + $row1[$k] = $v; + } + return $row1; +} + +/** getSelectOptions + * @param $row : 선택값 + * @param string $emptv : 빈값추가 + * @param array $exck : 선택값중 제외(기준키) + * @param array $excv : 선택값중 제외(기준값) + * @return string + */ +function getSelectOptions( $row, $emptv="", $defval="", $exck=array(), $excv=array() ){ + $reopt = array(); + if( $emptv ){ + $reopt[] = ""; + } + foreach( (array)$row as $key => $val ){ + if( in_array($key, (array)$exck) ) continue; + if( in_array($val, (array)$excv) ) continue; + $selected = false; + if( $defval ){ + if( is_array($defval) && in_array( $key, $defval ) ){ + $selected = true; + }else if( $key == $defval ){ + $selected = true; + } + } + $reopt[] = ""; + } + return implode(PHP_EOL,$reopt); +} +function getSelectOptionsExp( $row, $emptv="", $defval="", $exck=array(), $excv=array() ){ + $reopt = array(); + if( $emptv ){ + $reopt[] = ""; + } + foreach( (array)$row as $key => $val ){ + if( in_array($key, (array)$exck) ) continue; + if( in_array($val[0], (array)$excv) ) continue; + $selected = false; + if( $defval ){ + if( is_array($defval) && in_array( $key, $defval ) ){ + $selected = true; + }else if( $key == $defval ){ + $selected = true; + } + } + $reopt[] = ""; + } + return implode(PHP_EOL,$reopt); +} + +/** getCheckboxes + * @param $name : name Attr + * @param $vrow : 선택값 + * @param string $defval : default 값 + * @param string $cls1 : 클래스1 label 용 + * @param string $cls2 : 클래스2 input 용 + * @return string + */ +function getCheckboxes( $name, $vrow, $defval="", $cls1="", $cls2="" ){ + $reopt = array(); + $checked = false; + foreach( (array)$vrow as $key => $val ){ + if( $defval ){ + if( is_array($defval) && in_array( $key, $defval ) ){ + $checked = true; + }else if( $key == $defval ){ + $checked = true; + } + } + //$reopt[] = " {$val}"; + $reopt[] = " {$val}"; + } + return implode(PHP_EOL,$reopt); +} + + +/** getRadios + * @param $name : name Attr + * @param $vrow : 선택값 + * @param string $defval : default 값 + * @param string $cls1 : 클래스1 label 용 + * @param string $cls2 : 클래스2 input 용 + * @return string + */ +function getRadios( $name, $vrow, $defval='', $cls1='', $cls2='' ){ + $reopt = array(); + foreach( (array)$vrow as $key => $val ){ + if( is_object($defval) || is_array($defval) ){ + $defval = json_encode($defval); + } + //$reopt[] = " {$val}"; + $reopt[] = " {$val}"; + } + return implode(PHP_EOL,$reopt); +} + +function chkValiMail( $email ){ + if( !$email || preg_match("/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/", $email) ){ + return true; + } + return false; +} + +function chkValiDomain( $domain ){ + if( !$domain || preg_match("/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/", $domain) ){ + return true; + } + return false; +} + +function chkValiUrl( $url ){ + if( !$url || preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i", $url) ){ + return true; + } + return false; +} + +function chkValiPhone( $phone ){ + if( !$phone || preg_match("/^\d{2,3}-\d{3,4}-\d{4}$/", $phone) ){ + return true; + } + return false; +} + +function chkValiDate( $date ){ + if( !$date || preg_match("/^(19|20)\d\d([-])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$/", $date) ){ + return true; + } + return false; +} + +function chkValiAaSpNum( $str ){ + if( !$str || preg_match("/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]$/im", $str) ){ + return true; + } + return false; +} + +function chkValiAaSp( $str ){ + if( !$str || preg_match("/^(?=.*[a-z])(?=.*[A-Z])(?=.*[@$!%*?&])[A-Za-z@$!%*?&]$/im", $str) ){ + return true; + } + return false; +} + +function chkValiAaNum( $str ){ + if( !$str || preg_match("/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[A-Za-z\d]$/im", $str) ){ + return true; + } + return false; +} + +function chkValiSpNum( $str ){ + if( !$str || preg_match("/^(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[a-z\d@$!%*?&]$/im", $str) ){ + return true; + } + return false; +} + +function addzero($num, $dan){ + return str_pad($num,$dan,'0',STR_PAD_LEFT); +} + +function _notAuth( $auth, &$rval="", $cate_id="", $msg="" ){ //단축형... 귀찮아서 + global $retval; + if( !$rval ) $rval = &$retval['mesg']; + if( !$GLOBALS['_Auth_']['menuObj']->hasMenuAuth( $auth, $cate_id ) ){ + $rval = $msg?:$GLOBALS['_Auth_']['deny_mesg']; + return true; + } + return false; +} + +function file_size($bytes, $precision=2){ + $unit = ["B", "KB", "MB", "GB"]; + $exp = floor(log($bytes, 1024)) ?: 0; + return round($bytes / (pow(1024, $exp)), $precision).$unit[$exp]; +} + +function get_encode_base64_str($en_word, $charset="UTF-8"){ + return "=?" . strtolower($charset) . "?B?" . base64_encode($en_word) . "?="; +} + + +/* + * javascript : btoa(encodeURIComponent(JSON.stringify(data))) 의 역, 배열처리 + * */ +function decode_Post($pval){ + return json_decode(urldecode(base64_decode($pval)),true); +} + +function curl_request( $access_url, $query="", $method="GET", $headers="", $options="", $cookie="", $retm="body" ){ + if( is_array($query) ){ + $strquery = http_build_query($query); + }else{ + $strquery = $query; + } + $ch = curl_init(); + switch( strtoupper($method) ){ + case "POST" : + curl_setopt( $ch, CURLOPT_POST, 1); + curl_setopt( $ch, CURLOPT_POSTFIELDS, $strquery); + break; + + case "GET" : + if( $strquery ){ + $access_url = $access_url."?".$strquery; + } + break; + + case "PUT" : + curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "PUT"); + curl_setopt( $ch, CURLOPT_POSTFIELDS, $strquery); + break; + + case "DELETE" : + curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "DELETE"); + curl_setopt( $ch, CURLOPT_POSTFIELDS, $strquery); + break; + + case "RAW" : + if( is_array($query) ){ + $strquery = json_encode( $query ); + }; + curl_setopt( $ch, CURLOPT_POST, 1); + curl_setopt( $ch, CURLOPT_POSTFIELDS, $strquery); + + if( $headers ){ + if( !is_array($headers) ){ + $headers = Array($headers); + } + }else{ + $headers = array(); + } + $headers[] = 'Content-Type: application/json'; + break; + } + + if( $headers ) { //(e.g., array("fruit: apple", "colour: red") + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + + if( $options ) { //(e.g., array("fruit"=>"apple", "colour"=>"red") + curl_setopt_array($ch, $options); + } + + curl_setopt( $ch, CURLOPT_URL, $access_url); + curl_setopt( $ch, CURLOPT_USERAGENT, "Kuls Api" ); + curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); + curl_setopt( $ch, CURLOPT_HEADER, 1); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); + + if( $cookie ){ //(e.g., "fruit=apple; colour=red") + curl_setopt( $ch, CURLOPT_COOKIE, $cookie); + } + + $curl_result = curl_exec( $ch ); + curl_close( $ch ); + + list( $header, $response ) = explode("\r\n\r\n", $curl_result, 2); + $header = get_http_header_as_array($header); + + switch( $retm ){ + case "all": + return Array( + "header" => $header, + "response" => $response, + ); + case "header": + return $header; + case "body": + default: + return $response; + } +} + +function get_http_header_as_array($rawheader){ + $header_array = array(); + $header_rows = explode("\n",$rawheader); + for($i=0;$iDB->dbconn; \ No newline at end of file diff --git a/lib/db/db_where.class.php b/lib/db/db_where.class.php new file mode 100644 index 0000000..c190a50 --- /dev/null +++ b/lib/db/db_where.class.php @@ -0,0 +1,75 @@ +where_obj = new stdClass(); + $this->where_obj->com = $com; + $this->where_obj->row = array(); + switch( $com ){ + case "and": + $this->add("1=?",1); break; + case "or": + $this->add("1<>?",1); break; + } + } + + public function add($qry, $val="EMPTY"){ + if( is_array($val) ){ + foreach( $val as $v ){ + $this->where_obj->row[] = array("qry"=>$qry,"val"=>$v); + } + }else{ + $this->where_obj->row[] = array("qry"=>$qry,"val"=>$val); + } + } + + public function sub_where($com){ + $sub_where = new DB_where($com); + $this->where_obj->row[] = $sub_where; + return $sub_where; + } + + public function get_where(){ + $qryrow = array(); + $valrow = array(); + foreach( (array)$this->where_obj->row as $wval ){ + if( is_object($wval) ){ + $subs = $wval->get_where(); + $qryrow[] = "( {$subs['qry']} )"; + $valrow = array_merge($valrow, $subs['val']); + }else{ + if( $wval['val'] == "EMPTY" ) { + $qryrow[] = "{$wval['qry']}"; + }else{ + if ($this->chkeval($wval['val'])) { + $qryrow[] = str_replace("?", $this->valeval($wval['val']), $wval['qry']); + } else { + $qryrow[] = "{$wval['qry']}"; + array_push($valrow, $wval['val']); + } + } + } + } + return array( + 'qry' => implode( " {$this->where_obj->com} ", $qryrow ), + 'val' => $valrow, + ); + } + + public function sqleval($str){ + return chr(27).$str; + } + + public function chkeval($str){ + if( preg_match("/^".chr(27)."/ims",$str) ){ + return true; + } + return false; + } + + public function valeval($str,$val=""){ + return preg_replace("/^".chr(27)."/ims",$val,$str); + } +} \ No newline at end of file diff --git a/lib/db/mssql.class.php b/lib/db/mssql.class.php new file mode 100644 index 0000000..e298cc3 --- /dev/null +++ b/lib/db/mssql.class.php @@ -0,0 +1,508 @@ +dboption = $db_option ?: $_config_db_option; + + if( !$db_option && $__dbconn__ ) { //기본 Connection을 이용 + $this->dbconn = $__dbconn__; + }else{ //전용 Connection을 이용 + $this->dbConn($db_option); + } + } + + public function dbConn($db_option=""){ + $_config_db_option = @parse_ini_file("db_config.php"); + if( !$_config_db_option ){ + $_config_db_option = @parse_ini_file(_ROOT_PATH_."/config/db_config.php"); + } + if( !$db_option ) $db_option = array(); + + /*위에 있어서 필요없는 코드*/ + $db_option["database_type"] = $db_option["database_type"] ?: $_config_db_option["database_type"]; + $db_option["database_host"] = $db_option["database_host"] ?: $_config_db_option["database_host"]; + $db_option["database_port"] = $db_option["database_port"] ?: $_config_db_option["database_port"]; + $db_option["database_name"] = $db_option["database_name"] ?: $_config_db_option["database_name"]; + $db_option["database_user"] = $db_option["database_user"] ?: $_config_db_option["database_user"]; + $db_option["database_pass"] = $db_option["database_pass"] ?: $_config_db_option["database_pass"]; + $db_option["database_encode"] = $db_option["database_encode"] ?: $_config_db_option["database_encode"]; + $db_option["database_charset"] = $db_option["database_charset"] ?: $_config_db_option["database_charset"]; + $db_option["database_old"] = $db_option["database_old"] ?: $_config_db_option["database_old"]; + + if( !$this->dboption ){ + $this->dboption = $db_option; + } + $addr = "{$db_option['database_host']},{$db_option['database_port']}"; + $option = Array( + "Database" => $db_option['database_name'], + "Uid" => $db_option['database_user'], + "PWD" => $db_option['database_pass'], + "CharacterSet" => $db_option['database_encode'], + "TrustServerCertificate" => "yes", + "ConnectionPooling" => 0, + ); + $conn = sqlsrv_connect( $addr, $option); + if( $conn ){ + $this->dbconn = $conn; + if( defined("TB_query_log") ){ + $this->tableExists(TB_query_log); + } + return $conn; + + }else{ + die('Could not connect: ' . print_r(sqlsrv_errors(), true)); + } + } + + public function qry($sql, $sqlrow="", $options="", $print=""){ + return $this->cqry($sql, $sqlrow, $options, $print); + } + + public function cqry($sql, $sqlrow="", $options="", $print="", $rev=1){ + if( $rev === 1 ){ + $anrow = $this->anqry($sqlrow); + $params = $anrow['params']; + }else{ + $params = $sqlrow; + } + if( $print || $this->query_print ){ + echo $this->mkstr($sql,$params?:Array()); + } + if( $print ){exit;} + $stmt = @sqlsrv_query($this->dbconn, $sql, $params?:Array(), $options?:Array()); + if( $stmt ){ + $result = "SUCCESS"; + $rst = $stmt; + }else{ + $bpage = debug_backtrace(); + $fname = $bpage[count($bpage)-1]['file']; + + if( !$GLOBALS['NO_SQL_ERR'] ){ + $result = print_r(sqlsrv_errors(), true); + echo "
{$fname}".PHP_EOL.$sql.PHP_EOL.print_r($params?:Array(),1).PHP_EOL.PHP_EOL.print_r(sqlsrv_errors(), true)."
"; + }else{ + $result = "NO_SQL_ERROR"; + } + $rst = false; + } + if( $this->query_record ){ + $this->putQueryLog( $sql, $params, $result ); + } + return $rst; + } + + public function query($sql, $params="", $options="", $print=""){ + $stmt = $this->qry($sql, $params?:Array(), $options?:Array(), $print); + if( !$stmt ) return false; + + $rows = Array(); + while( $row = $this->fetch_array($stmt) ){ + $rows[] = $row; + } + return $rows; + } + + public function call( $procedure, $params=array() ){ + $anrow = $this->anqry($params); + $sql = "{CALL {$procedure} (".implode(",",$anrow['val']).")}"; + return $this->qry($sql, $params); + } + + public function call_output( $procedure, $params=array() ){ + $anrow = $this->anqry($params); + $sql = "{CALL {$procedure} ".implode(",",$anrow['val']).")}"; + return $this->cqry($sql, $params,"","",2); + } + + public function call_next( $stmt ){ + return @sqlsrv_next_result($stmt); + } + + public function call_all( $procedure, $params=array() ){ + $rst = $this->call( $procedure, $params ); + if( $rst ){ + $rows = Array(); + while( $row = $this->fetch_array($rst) ){ + $rows[] = $row; + } + return $rows; + } + return $rst; + } + + public function exec( $procedure, $params=array() ){ + $anrow = $this->anqry($params); + $sql = "EXEC {$procedure} ".implode(",",$anrow['val']).""; + return $this->qry($sql, $params); + } + + public function exec_output( $procedure, $params=array() ){ //$params => 숫자키 배열 + $anrow = $this->anqry($params); + $sql = "EXEC {$procedure} ".implode(",",$anrow['val']).""; + return $this->cqry($sql, $params,"","",2); + } + + public function exec_output_merge( $procedure, $params=array() ){ //$params => 문자 키 배열. output요소가 array(array("값",SQLSRV_PARAM_OUT)) 가 되어야 한다. + $oparams = Array(); + foreach( $params as $val ){ + $oparams[] = $val; + } + + $anrow = $this->anqry($oparams); + $sql = "EXEC {$procedure} ".implode(",",$anrow['val']).""; + return $this->cqry($sql, $oparams,"","",2); + } + + public function exec_next( $stmt ){ + return @sqlsrv_next_result($stmt); + } + + public function exec_all( $procedure, $params=array() ){ + $rst = $this->exec( $procedure, $params ); + if( $rst ){ + $rows = Array(); + while( $row = $this->fetch_array($rst) ){ + $rows[] = $row; + } + return $rows; + } + return $rst; + } + + public function queryFirstField($sql, $params="", $options="", $print=""){ + $stmt = $this->qry($sql, $params?:Array(), $options?:Array(), $print); + + if( !$stmt ) return false; + + return $this->result($stmt,0,0); + } + + public function queryFirstRow($sql, $params="", $options="", $print=""){ + $stmt = $this->qry($sql, $params?:Array(), $options?:Array(), $print); + + if( !$stmt ) return false; + + return $this->fetch_array($stmt); + } + + public function pqry($sql, $params="", $options=""){ + return $this->qry($sql, $params?:Array(), $options?:Array(), 1); + } + + public function pquery($sql, $params="", $options=""){ + return $this->query($sql, $params?:Array(), $options?:Array(), 1); + } + + public function fetch_row($stmt){ + if( $stmt ){ + return @sqlsrv_fetch_array($stmt, 1); + } + return "sqlsrv_fetch_array Error #1"; + } + + public function fetch_array($stmt){ + if( $stmt ){ + return @sqlsrv_fetch_array($stmt, 2); + } + echo "sqlsrv_fetch_array Error #2"; + } + + public function fetch_object($stmt){ + if( $stmt ){ + return @sqlsrv_fetch_object($stmt, 2); + } + echo "sqlsrv_fetch_object Error #2"; + } + + public function num_rows($stmt){ + if( $stmt ){ + return @sqlsrv_num_rows($stmt); + } + echo "sqlsrv_num_rows Error"; + } + + public function select_count($tb, $where="", $whererow="", $print=""){ + $where = $where?:"1=1"; + $sql = "select count(*) from {$tb} where {$where}"; + return $this->queryFirstField($sql, $whererow?:array(), $print); + } + + public function insert($tb, $row, $print=""){ + $anrow = $this->anqry($row); + $sql = "insert into {$tb} (".implode(",",$anrow['fld']).") values (".implode(",",$anrow['val']).")"; + $rst = $this->qry($sql, $anrow['params'], "", $print); + return (bool)$rst; + } + + public function update($tb, $row, $where="", $whererow="", $print=""){ + $where = $where?:"1=1"; + $anrow = $this->anqry($row); + $sql = "update {$tb} set "; + + $setrow = array(); + foreach( (array)$anrow['fld'] as $k => $v ){ + $setrow[] = " {$v} = {$anrow['val'][$k]} "; + } + $sql.= implode(",",$setrow)." where {$where}"; + foreach( (array)$whererow as $k => $v ){ + $anrow['params'][] = $v; + } + $rst = $this->qry($sql, $anrow['params'], "", $print); + return (bool)$rst; + } + + public function insertupdate($tb, $ins_row, $upt_row, $where="", $whererow="", $print=""){ + $where = $where?:"1=1"; + $ins_anrow = $this->anqry($ins_row); + $upt_anrow = $this->anqry($upt_row); + $setrow = array(); + foreach( (array)$upt_anrow['fld'] as $k => $v ){ + $setrow[] = " {$v} = {$upt_anrow['val'][$k]} "; + } + + $sql = "merge into {$tb} as A using (select 1 as dual) as B on ({$where}) "; + $sql.= "when matched then "; + $sql.= "update set ".implode(",",$setrow)." "; + $sql.= "when not matched then "; + $sql.= "insert (".implode(",",$ins_anrow['fld']).") values (".implode(",",$ins_anrow['val']).");"; + + $params = array_merge($whererow, $upt_anrow['params'], $ins_anrow['params']); + + $rst = $this->qry($sql, $params?:Array(), "", $print); + return (bool)$rst; + } + + public function delete($tb, $where, $whererow="", $print=""){ + $where = $where?:"1=1"; + $sql = "delete from {$tb} where {$where}"; + $rst = $this->qry($sql, $whererow?:Array(), "", $print); + return (bool)$rst; + } + + public function insertId($tb){ + if( $tb ){ + $sql = "select ident_current(?)"; + return $this->queryFirstField($sql,array($tb)); + }else{ + $sql = "select @@identity"; + return $this->queryFirstField($sql); + } + //@@IDENTITY 현재 세션의 테이블에서 생성된 마지막 ID 값을 반환합니다. --// 현재 세션내 모든 테이블에서 발생하는 ID값중 마지막 + //SCOPE_IDENTITY() 현재 세션의 테이블에서 생성된 마지막 ID 값을 반환합니다. --// 현재 세션내 특 + //IDENT_CURRENT() 임의 세션 및 범위에 있는 특정 테이블에 생성된 값을 반환합니다. + } + + public function anqry($row){ // 필드와 값 분리 + assign value + $fld = array(); + $val = array(); + $params = array(); + foreach( (array)$row as $k => $v ){ + $fld[] = $k; + if( $this->chkeval($v) ){ + $val[] = $this->valeval($v); + }else{ + $val[] = "?"; + $params[] = $v; + } + } + return Array( "fld"=>$fld, "val"=>$val, "params"=>$params ); + } + + public function result($stmt, $rows=0, $cols=0){ + $rows = intval($rows); + for( $a=0 ; $a<=$rows ; $a++ ){ + if( is_int($cols) ){ + $arr = $this->fetch_row($stmt); + }else{ + $arr = $this->fetch_array($stmt); + } + } + return is_array($arr)?$arr[$cols]:$arr; + } + + public function mkstr( $sql, $params="" ){ //쿼리 출력 + $params = $params?:Array(); + $str = $sql; + for( $a=0 ; $a < substr_count($sql, "?") ; $a++ ){ + $str = $this->str_freplace("?","'{$params[$a]}'",$str); + } + return $str; + } + + public function str_freplace( $needle, $replace, $str ){ + $pos = strpos($str, $needle); + if( $pos !== false ){ + $nstr = substr_replace($str, $replace, $pos, strlen($needle)); + } + return $nstr; + } + + public function limit($start, $length){ + if( $length > 0 ){ + return " offset {$start} rows fetch next {$length} rows only "; + } + return ''; + } + + public function addLimit($sql, $ordby, $start, $length){ + $ordby = $ordby?:1; + $start = $start?:0; + $length = $length?:999999999998; + + if( $this->dboption["database_version"] && $this->dboption["database_version"] <= "2008" ){ + $start = $start+1; + $length = $start+$length-1; + $sql = "select * from ( select *, row_number() over(order by {$ordby}) as ROWNUM from ({$sql}) as tblsub ) as tblmain where ROWNUM between {$start} and {$length}"; + }else { + $sql = "{$sql} order by {$ordby} offset {$start} rows fetch next {$length} rows only "; + } + + return $sql; + } + + public function sqleval($str){ + return chr(27).$str; + } + + public function chkeval($str){ + if( !is_array($str) && preg_match("/^".chr(27)."/ims",$str) ){ + return true; + } + return false; + } + + public function valeval($str,$val=""){ + return preg_replace("/^".chr(27)."/ims",$val,$str); + } + + public function tableExists( $table ){ + if( !$table ) return false; + + $tbl = explode(".",$table); + if( !$tbl[1] ){ + $database = "dbo"; + $table = $tbl[0]; + }else{ + $database = $tbl[0]; + $table = $tbl[1]; + } + $cnt = $this->queryFirstField("select 1 from Information_schema.tables where TABLE_TYPE = ? and TABLE_NAME = ?", array( + "BASE TABLE", + $table + )); + if( $cnt ){ + return true; + }else{ + if( !( $fs = fopen( TB_schema_file, "r") ) ) return false; + + while( $rw = fgets($fs, 255) ){ + $tbname = defined("TB_HEAD")?preg_replace("/^".TB_HEAD."/","",$table):$table; + + if( chop($rw) == "[{$tbname}]" ) break; + } + + $query = "create table {$database}.{$table} "; + while( $rw = fgets($fs, 255) ){ + if( chop($rw) != "-end-" ){ + $rw = preg_replace("/ comment[ \=].*\'.*\'/ims","",$rw); + $rw = preg_replace("/CONSTRAINT pk\_/ims","CONSTRAINT pk_".TB_HEAD,$rw); + $rw = preg_replace("/CONSTRAINT fk\_/ims","CONSTRAINT fk_".TB_HEAD,$rw); + $rw = preg_replace("/CONSTRAINT uk\_/ims","CONSTRAINT uk_".TB_HEAD,$rw); + $rw = preg_replace("/CONSTRAINT ik\_/ims","CONSTRAINT ik_".TB_HEAD,$rw); + $query .= $rw; + }else{ + break; + } + } + fclose($fs); + $rst = $this->qry($query); + if( $rst ){ + include TB_data_file; + if( isset($table_base_data[$tbname]) ){ + foreach( $table_base_data[$tbname] as $val ){ + $this->insert($table, $val); + } + } + } + return $rst; + } + } + + public function putQueryLog( $save_sql, $save_params, $result ){ + global $__dbconn__; + if( !defined("TB_query_log") ) return false; + if( preg_match("/Information_schema.tables/ims", $save_sql) ) return false; + + $this->delQueryLog(1); + + $qryrow = Array( + "query_date" => $this->sqleval("CURRENT_TIMESTAMP"), + "query_result" => $result, + "host_name" => $this->dboption["database_host"], + "db_name" => $this->dboption["database_name"], + "query_string" => $save_sql, + "query_params" => @print_r($save_params, true), + "visit_sess" => $_SESSION['visit_sess'], + "member_id" => $GLOBALS['_Umem']['member_id'], + ); + + $anrow = $this->anqry($qryrow); + $sql = "insert into ".TB_query_log." (".implode(",",$anrow['fld']).") values (".implode(",",$anrow['val']).")"; + return @sqlsrv_query($__dbconn__, $sql, $anrow['params']); + } + + public function delQueryLog( $month = 6 ){ + global $__dbconn__; + + if( rand(1,100) === 50 ){ // 1% 확률로 삭제 + $month= -1*abs($month); + $sql = "delete from ".TB_query_log." where query_date < dateadd(month, {$month}, getdate()) "; + return @sqlsrv_query($__dbconn__, $sql); + } + return false; + } + + public function callTransaction(){ + return sqlsrv_begin_transaction( $this->dbconn ); + } + + public function callCommit(){ + return sqlsrv_commit( $this->dbconn ); + } + + public function callRollBack(){ + return sqlsrv_rollback( $this->dbconn ); + } + + public function setPrint(){ + $this->query_print = true; + } + + public function resetPrint(){ + $this->query_print = false; + } + + public function setRecord(){ + $this->query_record = true; + } + + public function resetRecord(){ + $this->query_record = false; + } +} + +class BaseDB { + public $DB; + public $lcrypt; + public function __construct($db_option=""){ + $this->DB = new DB_Mssql($db_option); + $this->lcrypt = new lcrypt(); + } +} \ No newline at end of file diff --git a/lib/db/mssql_lib.php b/lib/db/mssql_lib.php new file mode 100644 index 0000000..ebcdeba --- /dev/null +++ b/lib/db/mssql_lib.php @@ -0,0 +1,31 @@ + $db_option['database_name'], + "Uid" => $db_option['database_user'], + "PWD" => $db_option['database_pass'], + "CharacterSet" => $db_option['database_encode'], + ); + if( $db_option['database_old'] ){ + $option['Encrypt'] = "yes"; + $option['TrustServerCertificate'] = "yes"; + } + $conn = sqlsrv_connect( $addr, $option); + if( $conn ){ + return $conn; + }else{ + die('Could not connect: ' . print_r(sqlsrv_errors(), true)); + } +} + +function sqlsrv_qry($conn, $tsql, $params=Array(), $options=Array()){ + $stmt = @sqlsrv_query($conn, $tsql, $params, $options); + if( $stmt ) return $stmt; + else { + echo "
".print_r(sqlsrv_errors(), true)."
"; + return false; + } +} + +//에러 처리용으로 하나만 만들고 기본 예약함수만 쓴다. \ No newline at end of file diff --git a/lib/db/mysql.class.php b/lib/db/mysql.class.php new file mode 100644 index 0000000..a814366 --- /dev/null +++ b/lib/db/mysql.class.php @@ -0,0 +1 @@ + ".print_r($_REQUEST,true)); fputs($fp, PHP_EOL); + + } +} + +if( $_REQUEST['member_token'] ){ + $tkObj = new Token(); + $token_info = $tkObj->getFromToken($_REQUEST['member_token']); + $token_stauts = $tkObj->statusToken($token_info); + //fputs($fp, "STATUS=> ".$token_stauts); fputs($fp, PHP_EOL); + switch( $token_stauts ){ + case "E" : //토큰 연장 + $new_token = $tkObj->putToken($token_info['member_id'], $token_info['auth']); + //fputs($fp, "NEW TOKEN=> ".$new_token); fputs($fp, PHP_EOL); + case "Y" : //토큰 유효 + $_SESSION['auth_mem_id'] = $token_info['member_id']; + //fputs($fp, "SESSION=> ".$_SESSION['auth_mem_id']); fputs($fp, PHP_EOL); + break; + + // 토큰 연장처리 되어 새로운 토큰($new_token) 이 발행되었는데도 갱신하지 않고, + // 예전 토큰 그대로 사용하면 중복 인증요청으로 무효토큰 처리되니 + // 새로운 토큰이 발행되면 다음 요청시엔 꼭 새로운 토큰으로 교체하는 과정이 필요. + // APP 에서 요청할때 응답이 필요한 요청이외의 단순 요청부분까지 응답을 필수 확인하여 $new_token 값이 있는지 점검후 교체하는 로직 필수!! + + case "F" : //토큰 비활성 + $tkObj->retireToken( $token_info['auth'] ); + case "N" : //토큰 무효 + unset($_SESSION['auth_mem_id']); + break; + } +} + +//fclose($fp); + +$GLOBALS['week_word'] = Array( + "eng" => Array( + "sun", + "mon", + "the", + "wed", + "thu", + "fri", + "sat", + ), + "kor" => Array( + "일", + "월", + "화", + "수", + "목", + "금", + "토", + ) +); +$GLOBALS['mon_word'] = Array( + "eng" => Array( + "jan", + "feb", + "mar", + "apr", + "may", + "jun", + "jul", + "aug", + "sep", + "oct", + "nov", + "dec", + ), + "kor" => Array( + "01월", + "02월", + "03월", + "04월", + "05월", + "06월", + "07월", + "08월", + "09월", + "10월", + "11월", + "12월", + ) +); + +$baseObj = new Member(); +$GLOBALS['_Umem'] = $baseObj->loginCheck($_SESSION['auth_mem_id']); + +$GLOBALS['_varsBaseCode'] = Array( //기본변수 + "line_num" => 20, //기본 라인수 + "page_num" => 5, //기본 페이지 출력수 + "id_len" => 6, //아이디 길이 + "pw_len" => 6, //비밀번호 길이 + "cate_depth" => 4, //카테고리 분류 최대 자리수. 4자리는 0001 ~ 9999 까지 레벨당 총 9999개 Child를 가지게 된다. +); + +$GLOBALS['_varsMemStatus'] = Array( //회원상태 + 1 => "활동중", + 2 => "승인대기", + 3 => "정지", +); + +$GLOBALS['_varsLoginResult'] = Array( //로그인결과 + 0 => "실패", + 1 => "성공", +); + +$GLOBALS['_varsMenuArea'] = Array( //사용 페이지구분 + "service" => "사용자/실무자 화면", + "partner" => "고객사 관리화면", + "admin" => "관리자 화면" +); + +$GLOBALS['_varsAuthArea'] = Array( //권한대상 + "G" => "그룹권한", + "M" => "개별권한", +); + +$GLOBALS['_varsAuthAdmin'] = Array( //관리자구분 + "SA" => "슈퍼관리자", + "A" => "일반관리자", +); + +$GLOBALS['_varsAuthMember'] = Array( //회원구분 + "SM" => "특별회원", + "M" => "일반회원", + "Y" => "게스트", +); + +$GLOBALS['_varsCommonStatus'] = Array( //공통 상태허용 + "0" => "정지", + "1" => "활동중", +); + +$GLOBALS['_varsBoardEditor'] = Array( //웹에디터 선택 + "tinymce" => "웹에디터", + "text" => "텍스트", +); + +/* 디폴트 값을 기준정보 관리와 매칭 시켜야 한다. */ +$GLOBALS['_varsBaseCode'] = array_merge_static($GLOBALS['_varsBaseCode'], $baseObj->getBaseCodeVars("cm_var","cm_var")); +$GLOBALS['_varsMemStatus'] = $baseObj->getBaseCodeVars("mem_status","mem_status") ?: $GLOBALS['_varsMemStatus']; +$GLOBALS['_varsLoginResult'] = $baseObj->getBaseCodeVars("login_result","login_result") ?: $GLOBALS['_varsLoginResult']; +$GLOBALS['_varsMenuArea'] = $baseObj->getBaseCodeVars("menu_area","menu_area") ?: $GLOBALS['_varsMenuArea']; +$GLOBALS['_varsAuthArea'] = $baseObj->getBaseCodeVars("auth_area","auth_area") ?: $GLOBALS['_varsAuthArea']; +$GLOBALS['_varsAuthAdmin'] = $baseObj->getBaseCodeVars("auth_admin","auth_admin") ?: $GLOBALS['_varsAuthAdmin']; +$GLOBALS['_varsAuthMember'] = $baseObj->getBaseCodeVars("auth_member","auth_member") ?: $GLOBALS['_varsAuthMember']; +$GLOBALS['_varsCommonStatus'] = $baseObj->getBaseCodeVars("common_status","common_status") ?: $GLOBALS['_varsCommonStatus']; +$GLOBALS['_varsBoardEditor'] = $baseObj->getBaseCodeVars("board_editor","board_editor") ?: $GLOBALS['_varsBoardEditor']; \ No newline at end of file diff --git a/lib/vendor/Altorouter.php b/lib/vendor/Altorouter.php new file mode 100644 index 0000000..c751464 --- /dev/null +++ b/lib/vendor/Altorouter.php @@ -0,0 +1,294 @@ + '[0-9]++', + 'a' => '[0-9A-Za-z]++', + 'h' => '[0-9A-Fa-f]++', + '*' => '.+?', + '**' => '.++', + '' => '[^/\.]++' + ); + + /** + * Create router in one call from config. + * + * @param array $routes + * @param string $basePath + * @param array $matchTypes + */ + public function __construct( $routes = array(), $basePath = '', $matchTypes = array() ) { + $this->addRoutes($routes); + $this->setBasePath($basePath); + $this->addMatchTypes($matchTypes); + } + + /** + * Retrieves all routes. + * Useful if you want to process or display routes. + * @return array All routes. + */ + public function getRoutes() { + return $this->routes; + } + + /** + * Add multiple routes at once from array in the following format: + * + * $routes = array( + * array($method, $route, $target, $name) + * ); + * + * @param array $routes + * @return void + * @author Koen Punt + * @throws Exception + */ + public function addRoutes($routes){ + if(!is_array($routes) && !$routes instanceof Traversable) { + throw new \Exception('Routes should be an array or an instance of Traversable'); + } + foreach($routes as $route) { + call_user_func_array(array($this, 'map'), $route); + } + } + + /** + * Set the base path. + * Useful if you are running your application from a subdirectory. + */ + public function setBasePath($basePath) { + $this->basePath = $basePath; + } + + /** + * Add named match types. It uses array_merge so keys can be overwritten. + * + * @param array $matchTypes The key is the name and the value is the regex. + */ + public function addMatchTypes($matchTypes) { + $this->matchTypes = array_merge($this->matchTypes, $matchTypes); + } + + /** + * Map a route to a target + * + * @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE) + * @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id] + * @param mixed $target The target where this route should point to. Can be anything. + * @param string $name Optional name of this route. Supply if you want to reverse route this url in your application. + * @throws Exception + */ + public function map($method, $route, $target, $name = null) { + + $this->routes[] = array($method, $route, $target, $name); + + if($name) { + if(isset($this->namedRoutes[$name])) { + throw new \Exception("Can not redeclare route '{$name}'"); + } else { + $this->namedRoutes[$name] = $route; + } + + } + + return; + } + + /** + * Reversed routing + * + * Generate the URL for a named route. Replace regexes with supplied parameters + * + * @param string $routeName The name of the route. + * @param array @params Associative array of parameters to replace placeholders with. + * @return string The URL of the route with named parameters in place. + * @throws Exception + */ + public function generate($routeName, array $params = array()) { + + // Check if named route exists + if(!isset($this->namedRoutes[$routeName])) { + throw new \Exception("Route '{$routeName}' does not exist."); + } + + // Replace named parameters + $route = $this->namedRoutes[$routeName]; + + // prepend base path to route url again + $url = $this->basePath . $route; + + if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) { + + foreach($matches as $match) { + list($block, $pre, $type, $param, $optional) = $match; + + if ($pre) { + $block = substr($block, 1); + } + + if(isset($params[$param])) { + $url = str_replace($block, $params[$param], $url); + } elseif ($optional) { + $url = str_replace($pre . $block, '', $url); + } + } + + + } + + return $url; + } + + /** + * Match a given Request Url against stored routes + * @param string $requestUrl + * @param string $requestMethod + * @return array|boolean Array with route information on success, false on failure (no match). + */ + public function match($requestUrl = null, $requestMethod = null) { + + $params = array(); + $match = false; + + // set Request Url if it isn't passed as parameter + if($requestUrl === null) { + $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'; + } + + // strip base path from request url + $requestUrl = substr($requestUrl, strlen($this->basePath)); + + // Strip query string (?a=b) from Request Url + if (($strpos = strpos($requestUrl, '?')) !== false) { + $requestUrl = substr($requestUrl, 0, $strpos); + } + + // set Request Method if it isn't passed as a parameter + if($requestMethod === null) { + $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + } + + foreach($this->routes as $handler) { + list($method, $_route, $target, $name) = $handler; + + $methods = explode('|', $method); + $method_match = false; + + // Check if request method matches. If not, abandon early. (CHEAP) + foreach($methods as $method) { + if (strcasecmp($requestMethod, $method) === 0) { + $method_match = true; + break; + } + } + + // Method did not match, continue to next route. + if(!$method_match) continue; + + // Check for a wildcard (matches all) + if ($_route === '*') { + $match = true; + } elseif (isset($_route[0]) && $_route[0] === '@') { + $pattern = '`' . substr($_route, 1) . '`u'; + $match = preg_match($pattern, $requestUrl, $params); + } else { + $route = null; + $regex = false; + $j = 0; + $n = isset($_route[0]) ? $_route[0] : null; + $i = 0; + + // Find the longest non-regex substring and match it against the URI + while (true) { + if (!isset($_route[$i])) { + break; + } elseif (false === $regex) { + $c = $n; + $regex = $c === '[' || $c === '(' || $c === '.'; + if (false === $regex && false !== isset($_route[$i+1])) { + $n = $_route[$i + 1]; + $regex = $n === '?' || $n === '+' || $n === '*' || $n === '{'; + } + if (false === $regex && $c !== '/' && (!isset($requestUrl[$j]) || $c !== $requestUrl[$j])) { + continue 2; + } + $j++; + } + $route .= $_route[$i++]; + } + + $regex = $this->compileRoute($route); + $match = preg_match($regex, $requestUrl, $params); + } + + if(($match == true || $match > 0)) { + + if($params) { + foreach($params as $key => $value) { + if(is_numeric($key)) unset($params[$key]); + } + } + + return array( + 'target' => $target, + 'params' => $params, + 'name' => $name + ); + } + } + return false; + } + + /** + * Compile the regex for a given route (EXPENSIVE) + */ + private function compileRoute($route) { + if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) { + + $matchTypes = $this->matchTypes; + foreach($matches as $match) { + list($block, $pre, $type, $param, $optional) = $match; + + if (isset($matchTypes[$type])) { + $type = $matchTypes[$type]; + } + if ($pre === '.') { + $pre = '\.'; + } + + //Older versions of PCRE require the 'P' in (?P) + $pattern = '(?:' + . ($pre !== '' ? $pre : null) + . '(' + . ($param !== '' ? "?P<$param>" : null) + . $type + . '))' + . ($optional !== '' ? '?' : null); + + $route = str_replace($block, $pattern, $route); + } + + } + return "`^$route$`u"; + } +} diff --git a/lib/vendor/PHPMailer/LICENSE b/lib/vendor/PHPMailer/LICENSE new file mode 100644 index 0000000..f166cc5 --- /dev/null +++ b/lib/vendor/PHPMailer/LICENSE @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! \ No newline at end of file diff --git a/lib/vendor/PHPMailer/PHPMailerAutoload.php b/lib/vendor/PHPMailer/PHPMailerAutoload.php new file mode 100644 index 0000000..eaa2e30 --- /dev/null +++ b/lib/vendor/PHPMailer/PHPMailerAutoload.php @@ -0,0 +1,49 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * PHPMailer SPL autoloader. + * @param string $classname The name of the class to load + */ +function PHPMailerAutoload($classname) +{ + //Can't use __DIR__ as it's only in PHP 5.3+ + $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; + if (is_readable($filename)) { + require $filename; + } +} + +if (version_compare(PHP_VERSION, '5.1.2', '>=')) { + //SPL autoloading was introduced in PHP 5.1.2 + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + spl_autoload_register('PHPMailerAutoload', true, true); + } else { + spl_autoload_register('PHPMailerAutoload'); + } +} else { + /** + * Fall back to traditional autoload for old PHP versions + * @param string $classname The name of the class to load + */ + function __autoload($classname) + { + PHPMailerAutoload($classname); + } +} diff --git a/lib/vendor/PHPMailer/VERSION b/lib/vendor/PHPMailer/VERSION new file mode 100644 index 0000000..32779c1 --- /dev/null +++ b/lib/vendor/PHPMailer/VERSION @@ -0,0 +1 @@ +5.2.27 \ No newline at end of file diff --git a/lib/vendor/PHPMailer/class.webmail.php b/lib/vendor/PHPMailer/class.webmail.php new file mode 100644 index 0000000..997b891 --- /dev/null +++ b/lib/vendor/PHPMailer/class.webmail.php @@ -0,0 +1,4062 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace Frody\Util; + +/** + * PHPMailer - PHP email creation and transport class. + * @package PHPMailer + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + */ +class PHPMailer +{ + /** + * The PHPMailer Version number. + * @var string + */ + public $Version = '5.2.27'; + + /** + * Email priority. + * Options: null (default), 1 = High, 3 = Normal, 5 = low. + * When null, the header is not set at all. + * @var integer + */ + public $Priority = null; + + /** + * The character set of the message. + * @var string + */ + public $CharSet = 'iso-8859-1'; + + /** + * The MIME Content-type of the message. + * @var string + */ + public $ContentType = 'text/plain'; + + /** + * The message encoding. + * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". + * @var string + */ + public $Encoding = '8bit'; + + /** + * Holds the most recent mailer error message. + * @var string + */ + public $ErrorInfo = ''; + + /** + * The From email address for the message. + * @var string + */ + public $From = 'root@localhost'; + + /** + * The From name of the message. + * @var string + */ + public $FromName = 'Root User'; + + /** + * The Sender email (Return-Path) of the message. + * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. + * @var string + */ + public $Sender = ''; + + /** + * The Return-Path of the message. + * If empty, it will be set to either From or Sender. + * @var string + * @deprecated Email senders should never set a return-path header; + * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything. + * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference + */ + public $ReturnPath = ''; + + /** + * The Subject of the message. + * @var string + */ + public $Subject = ''; + + /** + * An HTML or plain text message body. + * If HTML then call isHTML(true). + * @var string + */ + public $Body = ''; + + /** + * The plain-text message body. + * This body can be read by mail clients that do not have HTML email + * capability such as mutt & Eudora. + * Clients that can read HTML will view the normal Body. + * @var string + */ + public $AltBody = ''; + + /** + * An iCal message part body. + * Only supported in simple alt or alt_inline message types + * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator + * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ + * @link http://kigkonsult.se/iCalcreator/ + * @var string + */ + public $Ical = ''; + + /** + * The complete compiled MIME message body. + * @access protected + * @var string + */ + protected $MIMEBody = ''; + + /** + * The complete compiled MIME message headers. + * @var string + * @access protected + */ + protected $MIMEHeader = ''; + + /** + * Extra headers that createHeader() doesn't fold in. + * @var string + * @access protected + */ + protected $mailHeader = ''; + + /** + * Word-wrap the message body to this number of chars. + * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance. + * @var integer + */ + public $WordWrap = 0; + + /** + * Which method to use to send mail. + * Options: "mail", "sendmail", or "smtp". + * @var string + */ + public $Mailer = 'mail'; + + /** + * The path to the sendmail program. + * @var string + */ + public $Sendmail = '/usr/sbin/sendmail'; + + /** + * Whether mail() uses a fully sendmail-compatible MTA. + * One which supports sendmail's "-oi -f" options. + * @var boolean + */ + public $UseSendmailOptions = true; + + /** + * Path to PHPMailer plugins. + * Useful if the SMTP class is not in the PHP include path. + * @var string + * @deprecated Should not be needed now there is an autoloader. + */ + public $PluginDir = ''; + + /** + * The email address that a reading confirmation should be sent to, also known as read receipt. + * @var string + */ + public $ConfirmReadingTo = ''; + + /** + * The hostname to use in the Message-ID header and as default HELO string. + * If empty, PHPMailer attempts to find one with, in order, + * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value + * 'localhost.localdomain'. + * @var string + */ + public $Hostname = ''; + + /** + * An ID to be used in the Message-ID header. + * If empty, a unique id will be generated. + * You can set your own, but it must be in the format "", + * as defined in RFC5322 section 3.6.4 or it will be ignored. + * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * @var string + */ + public $MessageID = ''; + + /** + * The message Date to be used in the Date header. + * If empty, the current date will be added. + * @var string + */ + public $MessageDate = ''; + + /** + * SMTP hosts. + * Either a single hostname or multiple semicolon-delimited hostnames. + * You can also specify a different port + * for each host by using this format: [hostname:port] + * (e.g. "smtp1.example.com:25;smtp2.example.com"). + * You can also specify encryption type, for example: + * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465"). + * Hosts will be tried in order. + * @var string + */ + public $Host = 'localhost'; + + /** + * The default SMTP server port. + * @var integer + * @TODO Why is this needed when the SMTP class takes care of it? + */ + public $Port = 25; + + /** + * The SMTP HELO of the message. + * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find + * one with the same method described above for $Hostname. + * @var string + * @see PHPMailer::$Hostname + */ + public $Helo = ''; + + /** + * What kind of encryption to use on the SMTP connection. + * Options: '', 'ssl' or 'tls' + * @var string + */ + public $SMTPSecure = ''; + + /** + * Whether to enable TLS encryption automatically if a server supports it, + * even if `SMTPSecure` is not set to 'tls'. + * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid. + * @var boolean + */ + public $SMTPAutoTLS = true; + + /** + * Whether to use SMTP authentication. + * Uses the Username and Password properties. + * @var boolean + * @see PHPMailer::$Username + * @see PHPMailer::$Password + */ + public $SMTPAuth = false; + + /** + * Options array passed to stream_context_create when connecting via SMTP. + * @var array + */ + public $SMTPOptions = array(); + + /** + * SMTP username. + * @var string + */ + public $Username = ''; + + /** + * SMTP password. + * @var string + */ + public $Password = ''; + + /** + * SMTP auth type. + * Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified + * @var string + */ + public $AuthType = ''; + + /** + * SMTP realm. + * Used for NTLM auth + * @var string + */ + public $Realm = ''; + + /** + * SMTP workstation. + * Used for NTLM auth + * @var string + */ + public $Workstation = ''; + + /** + * The SMTP server timeout in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 + * @var integer + */ + public $Timeout = 300; + + /** + * SMTP class debug output mode. + * Debug output level. + * Options: + * * `0` No output + * * `1` Commands + * * `2` Data and commands + * * `3` As 2 plus connection status + * * `4` Low-level data output + * @var integer + * @see SMTP::$do_debug + */ + public $SMTPDebug = 0; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * + * @var string|callable + * @see SMTP::$Debugoutput + */ + public $Debugoutput = 'echo'; + + /** + * Whether to keep SMTP connection open after each message. + * If this is set to true then to close the connection + * requires an explicit call to smtpClose(). + * @var boolean + */ + public $SMTPKeepAlive = false; + + /** + * Whether to split multiple to addresses into multiple messages + * or send them all in one message. + * Only supported in `mail` and `sendmail` transports, not in SMTP. + * @var boolean + */ + public $SingleTo = false; + + /** + * Storage for addresses when SingleTo is enabled. + * @var array + * @TODO This should really not be public + */ + public $SingleToArray = array(); + + /** + * Whether to generate VERP addresses on send. + * Only applicable when sending via SMTP. + * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @link http://www.postfix.org/VERP_README.html Postfix VERP info + * @var boolean + */ + public $do_verp = false; + + /** + * Whether to allow sending messages with an empty body. + * @var boolean + */ + public $AllowEmpty = false; + + /** + * The default line ending. + * @note The default remains "\n". We force CRLF where we know + * it must be used via self::CRLF. + * @var string + */ + public $LE = "\n"; + + /** + * DKIM selector. + * @var string + */ + public $DKIM_selector = ''; + + /** + * DKIM Identity. + * Usually the email address used as the source of the email. + * @var string + */ + public $DKIM_identity = ''; + + /** + * DKIM passphrase. + * Used if your key is encrypted. + * @var string + */ + public $DKIM_passphrase = ''; + + /** + * DKIM signing domain name. + * @example 'example.com' + * @var string + */ + public $DKIM_domain = ''; + + /** + * DKIM private key file path. + * @var string + */ + public $DKIM_private = ''; + + /** + * DKIM private key string. + * If set, takes precedence over `$DKIM_private`. + * @var string + */ + public $DKIM_private_string = ''; + + /** + * Callback Action function name. + * + * The function that handles the result of the send email action. + * It is called out by send() for each email sent. + * + * Value can be any php callable: http://www.php.net/is_callable + * + * Parameters: + * boolean $result result of the send action + * array $to email addresses of the recipients + * array $cc cc email addresses + * array $bcc bcc email addresses + * string $subject the subject + * string $body the email body + * string $from email address of sender + * @var string + */ + public $action_function = ''; + + /** + * What to put in the X-Mailer header. + * Options: An empty string for PHPMailer default, whitespace for none, or a string to use + * @var string + */ + public $XMailer = 'Frody Mailer v0.1'; + + /** + * Which validator to use by default when validating email addresses. + * May be a callable to inject your own validator, but there are several built-in validators. + * @see PHPMailer::validateAddress() + * @var string|callable + * @static + */ + public static $validator = 'auto'; + + /** + * An instance of the SMTP sender class. + * @var SMTP + * @access protected + */ + protected $smtp = null; + + /** + * The array of 'to' names and addresses. + * @var array + * @access protected + */ + protected $to = array(); + + /** + * The array of 'cc' names and addresses. + * @var array + * @access protected + */ + protected $cc = array(); + + /** + * The array of 'bcc' names and addresses. + * @var array + * @access protected + */ + protected $bcc = array(); + + /** + * The array of reply-to names and addresses. + * @var array + * @access protected + */ + protected $ReplyTo = array(); + + /** + * An array of all kinds of addresses. + * Includes all of $to, $cc, $bcc + * @var array + * @access protected + * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc + */ + protected $all_recipients = array(); + + /** + * An array of names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $all_recipients + * and one of $to, $cc, or $bcc. + * This array is used only for addresses with IDN. + * @var array + * @access protected + * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc + * @see PHPMailer::$all_recipients + */ + protected $RecipientsQueue = array(); + + /** + * An array of reply-to names and addresses queued for validation. + * In send(), valid and non duplicate entries are moved to $ReplyTo. + * This array is used only for addresses with IDN. + * @var array + * @access protected + * @see PHPMailer::$ReplyTo + */ + protected $ReplyToQueue = array(); + + /** + * The array of attachments. + * @var array + * @access protected + */ + protected $attachment = array(); + + /** + * The array of custom headers. + * @var array + * @access protected + */ + protected $CustomHeader = array(); + + /** + * The most recent Message-ID (including angular brackets). + * @var string + * @access protected + */ + protected $lastMessageID = ''; + + /** + * The message's MIME type. + * @var string + * @access protected + */ + protected $message_type = ''; + + /** + * The array of MIME boundary strings. + * @var array + * @access protected + */ + protected $boundary = array(); + + /** + * The array of available languages. + * @var array + * @access protected + */ + protected $language = array(); + + /** + * The number of errors encountered. + * @var integer + * @access protected + */ + protected $error_count = 0; + + /** + * The S/MIME certificate file path. + * @var string + * @access protected + */ + protected $sign_cert_file = ''; + + /** + * The S/MIME key file path. + * @var string + * @access protected + */ + protected $sign_key_file = ''; + + /** + * The optional S/MIME extra certificates ("CA Chain") file path. + * @var string + * @access protected + */ + protected $sign_extracerts_file = ''; + + /** + * The S/MIME password for the key. + * Used only if the key is encrypted. + * @var string + * @access protected + */ + protected $sign_key_pass = ''; + + /** + * Whether to throw exceptions for errors. + * @var boolean + * @access protected + */ + protected $exceptions = false; + + /** + * Unique ID used for message ID and boundaries. + * @var string + * @access protected + */ + protected $uniqueid = ''; + + /** + * Error severity: message only, continue processing. + */ + const STOP_MESSAGE = 0; + + /** + * Error severity: message, likely ok to continue processing. + */ + const STOP_CONTINUE = 1; + + /** + * Error severity: message, plus full stop, critical error reached. + */ + const STOP_CRITICAL = 2; + + /** + * SMTP RFC standard line ending. + */ + const CRLF = "\r\n"; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1 + * @var integer + */ + const MAX_LINE_LENGTH = 998; + + /** + * Constructor. + * @param boolean $exceptions Should we throw external exceptions? + */ + public function __construct($exceptions = null) + { + if ($exceptions !== null) { + $this->exceptions = (boolean)$exceptions; + } + //Pick an appropriate debug output format automatically + $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html'); + } + + /** + * Destructor. + */ + public function __destruct() + { + //Close any open SMTP connection nicely + $this->smtpClose(); + } + + /** + * Call mail() in a safe_mode-aware fashion. + * Also, unless sendmail_path points to sendmail (or something that + * claims to be sendmail), don't pass params (not a perfect fix, + * but it will do) + * @param string $to To + * @param string $subject Subject + * @param string $body Message Body + * @param string $header Additional Header(s) + * @param string $params Params + * @access private + * @return boolean + */ + private function mailPassthru($to, $subject, $body, $header, $params) + { + //Check overloading of mail function to avoid double-encoding + if (ini_get('mbstring.func_overload') & 1) { + $subject = $this->secureHeader($subject); + } else { + $subject = $this->encodeHeader($this->secureHeader($subject)); + } + + //Can't use additional_parameters in safe_mode, calling mail() with null params breaks + //@link http://php.net/manual/en/function.mail.php + if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) { + $result = @mail($to, $subject, $body, $header); + } else { + $result = @mail($to, $subject, $body, $header, $params); + } + return $result; + } + /** + * Output debugging info via user-defined method. + * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). + * @see PHPMailer::$Debugoutput + * @see PHPMailer::$SMTPDebug + * @param string $str + */ + protected function edebug($str) + { + if ($this->SMTPDebug <= 0) { + return; + } + //Avoid clash with built-in function names + if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) { + call_user_func($this->Debugoutput, $str, $this->SMTPDebug); + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ) + . "
\n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/\r\n?/ms', "\n", $str); + echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( + "\n", + "\n \t ", + trim($str) + ) . "\n"; + } + } + + /** + * Sets message type to HTML or plain. + * @param boolean $isHtml True for HTML mode. + * @return void + */ + public function isHTML($isHtml = true) + { + if ($isHtml) { + $this->ContentType = 'text/html'; + } else { + $this->ContentType = 'text/plain'; + } + } + + /** + * Send messages using SMTP. + * @return void + */ + public function isSMTP() + { + $this->Mailer = 'smtp'; + } + + /** + * Send messages using PHP's mail() function. + * @return void + */ + public function isMail() + { + $this->Mailer = 'mail'; + } + + /** + * Send messages using $Sendmail. + * @return void + */ + public function isSendmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (!stristr($ini_sendmail_path, 'sendmail')) { + $this->Sendmail = '/usr/sbin/sendmail'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'sendmail'; + } + + /** + * Send messages using qmail. + * @return void + */ + public function isQmail() + { + $ini_sendmail_path = ini_get('sendmail_path'); + + if (!stristr($ini_sendmail_path, 'qmail')) { + $this->Sendmail = '/var/qmail/bin/qmail-inject'; + } else { + $this->Sendmail = $ini_sendmail_path; + } + $this->Mailer = 'qmail'; + } + + /** + * Add a "To" address. + * @param string $address The email address to send to + * @param string $name + * @return boolean true on success, false if address already used or invalid in some way + */ + public function addAddress($address, $name = '') + { + return $this->addOrEnqueueAnAddress('to', $address, $name); + } + + /** + * Add a "CC" address. + * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. + * @param string $address The email address to send to + * @param string $name + * @return boolean true on success, false if address already used or invalid in some way + */ + public function addCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('cc', $address, $name); + } + + /** + * Add a "BCC" address. + * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. + * @param string $address The email address to send to + * @param string $name + * @return boolean true on success, false if address already used or invalid in some way + */ + public function addBCC($address, $name = '') + { + return $this->addOrEnqueueAnAddress('bcc', $address, $name); + } + + /** + * Add a "Reply-To" address. + * @param string $address The email address to reply to + * @param string $name + * @return boolean true on success, false if address already used or invalid in some way + */ + public function addReplyTo($address, $name = '') + { + return $this->addOrEnqueueAnAddress('Reply-To', $address, $name); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer + * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still + * be modified after calling this function), addition of such addresses is delayed until send(). + * Addresses that have been added already return false, but do not throw exceptions. + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * @throws phpmailerException + * @return boolean true on success, false if address already used or invalid in some way + * @access protected + */ + protected function addOrEnqueueAnAddress($kind, $address, $name) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + if (($pos = strrpos($address, '@')) === false) { + // At-sign is misssing. + $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new phpmailerException($error_message); + } + return false; + } + $params = array($kind, $address, $name); + // Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) { + if ($kind != 'Reply-To') { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; + return true; + } + } else { + if (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; + return true; + } + } + return false; + } + // Immediately add standard addresses without IDN. + return call_user_func_array(array($this, 'addAnAddress'), $params); + } + + /** + * Add an address to one of the recipient arrays or to the ReplyTo array. + * Addresses that have been added already return false, but do not throw exceptions. + * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' + * @param string $address The email address to send, resp. to reply to + * @param string $name + * @throws phpmailerException + * @return boolean true on success, false if address already used or invalid in some way + * @access protected + */ + protected function addAnAddress($kind, $address, $name = '') + { + if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) { + $error_message = $this->lang('Invalid recipient kind: ') . $kind; + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new phpmailerException($error_message); + } + return false; + } + if (!$this->validateAddress($address)) { + $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new phpmailerException($error_message); + } + return false; + } + if ($kind != 'Reply-To') { + if (!array_key_exists(strtolower($address), $this->all_recipients)) { + array_push($this->$kind, array($address, $name)); + $this->all_recipients[strtolower($address)] = true; + return true; + } + } else { + if (!array_key_exists(strtolower($address), $this->ReplyTo)) { + $this->ReplyTo[strtolower($address)] = array($address, $name); + return true; + } + } + return false; + } + + /** + * Parse and validate a string containing one or more RFC822-style comma-separated email addresses + * of the form "display name
" into an array of name/address pairs. + * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. + * Note that quotes in the name part are removed. + * @param string $addrstr The address list string + * @param bool $useimap Whether to use the IMAP extension to parse the list + * @return array + * @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + */ + public function parseAddresses($addrstr, $useimap = true) + { + $addresses = array(); + if ($useimap and function_exists('imap_rfc822_parse_adrlist')) { + //Use this built-in parser if it's available + $list = imap_rfc822_parse_adrlist($addrstr, ''); + foreach ($list as $address) { + if ($address->host != '.SYNTAX-ERROR.') { + if ($this->validateAddress($address->mailbox . '@' . $address->host)) { + $addresses[] = array( + 'name' => (property_exists($address, 'personal') ? $address->personal : ''), + 'address' => $address->mailbox . '@' . $address->host + ); + } + } + } + } else { + //Use this simpler parser + $list = explode(',', $addrstr); + foreach ($list as $address) { + $address = trim($address); + //Is there a separate name part? + if (strpos($address, '<') === false) { + //No separate name, just use the whole thing + if ($this->validateAddress($address)) { + $addresses[] = array( + 'name' => '', + 'address' => $address + ); + } + } else { + list($name, $email) = explode('<', $address); + $email = trim(str_replace('>', '', $email)); + if ($this->validateAddress($email)) { + $addresses[] = array( + 'name' => trim(str_replace(array('"', "'"), '', $name)), + 'address' => $email + ); + } + } + } + } + return $addresses; + } + + /** + * Set the From and FromName properties. + * @param string $address + * @param string $name + * @param boolean $auto Whether to also set the Sender address, defaults to true + * @throws phpmailerException + * @return boolean + */ + public function setFrom($address, $name = '', $auto = true) + { + $address = trim($address); + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + // Don't validate now addresses with IDN. Will be done in send(). + if (($pos = strrpos($address, '@')) === false or + (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and + !$this->validateAddress($address)) { + $error_message = $this->lang('invalid_address') . " (setFrom) $address"; + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new phpmailerException($error_message); + } + return false; + } + $this->From = $address; + $this->FromName = $name; + if ($auto) { + if (empty($this->Sender)) { + $this->Sender = $address; + } + } + return true; + } + + /** + * Return the Message-ID header of the last email. + * Technically this is the value from the last time the headers were created, + * but it's also the message ID of the last sent message except in + * pathological cases. + * @return string + */ + public function getLastMessageID() + { + return $this->lastMessageID; + } + + /** + * Check that a string looks like an email address. + * @param string $address The email address to check + * @param string|callable $patternselect A selector for the validation pattern to use : + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * @return boolean + * @static + * @access public + */ + public static function validateAddress($address, $patternselect = null) + { + if (is_null($patternselect)) { + $patternselect = self::$validator; + } + if (is_callable($patternselect)) { + return call_user_func($patternselect, $address); + } + //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 + if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) { + return false; + } + if (!$patternselect or $patternselect == 'auto') { + //Check this constant first so it works when extension_loaded() is disabled by safe mode + //Constant was added in PHP 5.2.4 + if (defined('PCRE_VERSION')) { + //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2 + if (version_compare(PCRE_VERSION, '8.0.3') >= 0) { + $patternselect = 'pcre8'; + } else { + $patternselect = 'pcre'; + } + } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) { + //Fall back to older PCRE + $patternselect = 'pcre'; + } else { + //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension + if (version_compare(PHP_VERSION, '5.2.0') >= 0) { + $patternselect = 'php'; + } else { + $patternselect = 'noregex'; + } + } + } + switch ($patternselect) { + case 'pcre8': + /** + * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. + * @link http://squiloople.com/2009/12/20/email-address-validation/ + * @copyright 2009-2010 Michael Rushton + * Feel free to use and redistribute this code. But please keep this copyright notice. + */ + return (boolean)preg_match( + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', + $address + ); + case 'pcre': + //An older regex that doesn't need a recent PCRE + return (boolean)preg_match( + '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . + '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . + '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . + '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . + '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . + '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . + '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . + '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . + '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . + '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', + $address + ); + case 'html5': + /** + * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. + * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) + */ + return (boolean)preg_match( + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . + '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', + $address + ); + case 'noregex': + //No PCRE! Do something _very_ approximate! + //Check the address is 3 chars or longer and contains an @ that's not the first or last char + return (strlen($address) >= 3 + and strpos($address, '@') >= 1 + and strpos($address, '@') != strlen($address) - 1); + case 'php': + default: + return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL); + } + } + + /** + * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the + * "intl" and "mbstring" PHP extensions. + * @return bool "true" if required functions for IDN support are present + */ + public function idnSupported() + { + // @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2. + return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding'); + } + + /** + * Converts IDN in given email address to its ASCII form, also known as punycode, if possible. + * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. + * This function silently returns unmodified address if: + * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form) + * - Conversion to punycode is impossible (e.g. required PHP functions are not available) + * or fails for any reason (e.g. domain has characters not allowed in an IDN) + * @see PHPMailer::$CharSet + * @param string $address The email address to convert + * @return string The encoded address in ASCII form + */ + public function punyencodeAddress($address) + { + // Verify we have required functions, CharSet, and at-sign. + if ($this->idnSupported() and + !empty($this->CharSet) and + ($pos = strrpos($address, '@')) !== false) { + $domain = substr($address, ++$pos); + // Verify CharSet string is a valid one, and domain properly encoded in this CharSet. + if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) { + $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); + if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ? + idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : + idn_to_ascii($domain)) !== false) { + return substr($address, 0, $pos) . $punycode; + } + } + } + return $address; + } + + /** + * Create a message and send it. + * Uses the sending method specified by $Mailer. + * @throws phpmailerException + * @return boolean false on error - See the ErrorInfo property for details of the error. + */ + public function send() + { + try { + if (!$this->preSend()) { + return false; + } + return $this->postSend(); + } catch (phpmailerException $exc) { + $this->mailHeader = ''; + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + return false; + } + } + + /** + * Prepare a message for sending. + * @throws phpmailerException + * @return boolean + */ + public function preSend() + { + try { + $this->error_count = 0; // Reset errors + $this->mailHeader = ''; + + // Dequeue recipient and Reply-To addresses with IDN + foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { + $params[1] = $this->punyencodeAddress($params[1]); + call_user_func_array(array($this, 'addAnAddress'), $params); + } + if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { + throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); + } + + // Validate From, Sender, and ConfirmReadingTo addresses + foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) { + $this->$address_kind = trim($this->$address_kind); + if (empty($this->$address_kind)) { + continue; + } + $this->$address_kind = $this->punyencodeAddress($this->$address_kind); + if (!$this->validateAddress($this->$address_kind)) { + $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind; + $this->setError($error_message); + $this->edebug($error_message); + if ($this->exceptions) { + throw new phpmailerException($error_message); + } + return false; + } + } + + // Set whether the message is multipart/alternative + if ($this->alternativeExists()) { + $this->ContentType = 'multipart/alternative'; + } + + $this->setMessageType(); + // Refuse to send an empty message unless we are specifically allowing it + if (!$this->AllowEmpty and empty($this->Body)) { + throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL); + } + + // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + $this->MIMEHeader = ''; + $this->MIMEBody = $this->createBody(); + // createBody may have added some headers, so retain them + $tempheaders = $this->MIMEHeader; + $this->MIMEHeader = $this->createHeader(); + $this->MIMEHeader .= $tempheaders; + + // To capture the complete message when using mail(), create + // an extra header list which createHeader() doesn't fold in + if ($this->Mailer == 'mail') { + if (count($this->to) > 0) { + $this->mailHeader .= $this->addrAppend('To', $this->to); + } else { + $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + $this->mailHeader .= $this->headerLine( + 'Subject', + $this->encodeHeader($this->secureHeader(trim($this->Subject))) + ); + } + + // Sign with DKIM if enabled + if (!empty($this->DKIM_domain) + and !empty($this->DKIM_selector) + and (!empty($this->DKIM_private_string) + or (!empty($this->DKIM_private) + and self::isPermittedPath($this->DKIM_private) + and file_exists($this->DKIM_private) + ) + ) + ) { + $header_dkim = $this->DKIM_Add( + $this->MIMEHeader . $this->mailHeader, + $this->encodeHeader($this->secureHeader($this->Subject)), + $this->MIMEBody + ); + $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . + str_replace("\r\n", "\n", $header_dkim) . self::CRLF; + } + return true; + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + return false; + } + } + + /** + * Actually send a message. + * Send the email via the selected mechanism + * @throws phpmailerException + * @return boolean + */ + public function postSend() + { + try { + // Choose the mailer and send through it + switch ($this->Mailer) { + case 'sendmail': + case 'qmail': + return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody); + case 'smtp': + return $this->smtpSend($this->MIMEHeader, $this->MIMEBody); + case 'mail': + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + default: + $sendMethod = $this->Mailer.'Send'; + if (method_exists($this, $sendMethod)) { + return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); + } + + return $this->mailSend($this->MIMEHeader, $this->MIMEBody); + } + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + } + return false; + } + + /** + * Send mail using the $Sendmail program. + * @param string $header The message headers + * @param string $body The message body + * @see PHPMailer::$Sendmail + * @throws phpmailerException + * @access protected + * @return boolean + */ + protected function sendmailSend($header, $body) + { + // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) and self::isShellSafe($this->Sender)) { + if ($this->Mailer == 'qmail') { + $sendmailFmt = '%s -f%s'; + } else { + $sendmailFmt = '%s -oi -f%s -t'; + } + } else { + if ($this->Mailer == 'qmail') { + $sendmailFmt = '%s'; + } else { + $sendmailFmt = '%s -oi -t'; + } + } + + // TODO: If possible, this should be changed to escapeshellarg. Needs thorough testing. + $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); + + if ($this->SingleTo) { + foreach ($this->SingleToArray as $toAddr) { + if (!@$mail = popen($sendmail, 'w')) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fputs($mail, 'To: ' . $toAddr . "\n"); + fputs($mail, $header); + fputs($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result == 0), + array($toAddr), + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From + ); + if ($result != 0) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + } else { + if (!@$mail = popen($sendmail, 'w')) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + fputs($mail, $header); + fputs($mail, $body); + $result = pclose($mail); + $this->doCallback( + ($result == 0), + $this->to, + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From + ); + if ($result != 0) { + throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); + } + } + return true; + } + + /** + * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. + * + * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows. + * @param string $string The string to be validated + * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report + * @access protected + * @return boolean + */ + protected static function isShellSafe($string) + { + // Future-proof + if (escapeshellcmd($string) !== $string + or !in_array(escapeshellarg($string), array("'$string'", "\"$string\"")) + ) { + return false; + } + + $length = strlen($string); + + for ($i = 0; $i < $length; $i++) { + $c = $string[$i]; + + // All other characters have a special meaning in at least one common shell, including = and +. + // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + // Note that this does permit non-Latin alphanumeric characters based on the current locale. + if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { + return false; + } + } + + return true; + } + + /** + * Check whether a file path is of a permitted type. + * Used to reject URLs and phar files from functions that access local file paths, + * such as addAttachment. + * @param string $path A relative or absolute path to a file. + * @return bool + */ + protected static function isPermittedPath($path) + { + return !preg_match('#^[a-z]+://#i', $path); + } + + /** + * Send mail using the PHP mail() function. + * @param string $header The message headers + * @param string $body The message body + * @link http://www.php.net/manual/en/book.mail.php + * @throws phpmailerException + * @access protected + * @return boolean + */ + protected function mailSend($header, $body) + { + $toArr = array(); + foreach ($this->to as $toaddr) { + $toArr[] = $this->addrFormat($toaddr); + } + $to = implode(', ', $toArr); + + $params = null; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + if (!empty($this->Sender) and $this->validateAddress($this->Sender)) { + // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (self::isShellSafe($this->Sender)) { + $params = sprintf('-f%s', $this->Sender); + } + } + if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) { + $old_from = ini_get('sendmail_from'); + ini_set('sendmail_from', $this->Sender); + } + $result = false; + if ($this->SingleTo and count($toArr) > 1) { + foreach ($toArr as $toAddr) { + $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); + $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From); + } + } else { + $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); + $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From); + } + if (isset($old_from)) { + ini_set('sendmail_from', $old_from); + } + if (!$result) { + throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL); + } + return true; + } + + /** + * Get an instance to use for SMTP operations. + * Override this function to load your own SMTP implementation + * @return SMTP + */ + public function getSMTPInstance() + { + if (!is_object($this->smtp)) { + $this->smtp = new SMTP; + } + return $this->smtp; + } + + /** + * Send mail via SMTP. + * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. + * Uses the PHPMailerSMTP class by default. + * @see PHPMailer::getSMTPInstance() to use a different class. + * @param string $header The message headers + * @param string $body The message body + * @throws phpmailerException + * @uses SMTP + * @access protected + * @return boolean + */ + protected function smtpSend($header, $body) + { + $bad_rcpt = array(); + if (!$this->smtpConnect($this->SMTPOptions)) { + throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + } + if (!empty($this->Sender) and $this->validateAddress($this->Sender)) { + $smtp_from = $this->Sender; + } else { + $smtp_from = $this->From; + } + if (!$this->smtp->mail($smtp_from)) { + $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); + throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); + } + + // Attempt to send to all recipients + foreach (array($this->to, $this->cc, $this->bcc) as $togroup) { + foreach ($togroup as $to) { + if (!$this->smtp->recipient($to[0])) { + $error = $this->smtp->getError(); + $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']); + $isSent = false; + } else { + $isSent = true; + } + $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From); + } + } + + // Only send the DATA command if we have viable recipients + if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { + throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); + } + if ($this->SMTPKeepAlive) { + $this->smtp->reset(); + } else { + $this->smtp->quit(); + $this->smtp->close(); + } + //Create error message for any bad addresses + if (count($bad_rcpt) > 0) { + $errstr = ''; + foreach ($bad_rcpt as $bad) { + $errstr .= $bad['to'] . ': ' . $bad['error']; + } + throw new phpmailerException( + $this->lang('recipients_failed') . $errstr, + self::STOP_CONTINUE + ); + } + return true; + } + + /** + * Initiate a connection to an SMTP server. + * Returns false if the operation failed. + * @param array $options An array of options compatible with stream_context_create() + * @uses SMTP + * @access public + * @throws phpmailerException + * @return boolean + */ + public function smtpConnect($options = null) + { + if (is_null($this->smtp)) { + $this->smtp = $this->getSMTPInstance(); + } + + //If no options are provided, use whatever is set in the instance + if (is_null($options)) { + $options = $this->SMTPOptions; + } + + // Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = array(); + if (!preg_match( + '/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*|\[[a-fA-F0-9:]+\]):?([0-9]*)$/', + trim($hostentry), + $hostinfo + )) { + // Not a valid host entry + $this->edebug('Ignoring invalid host: ' . $hostentry); + continue; + } + // $hostinfo[2]: optional ssl or tls prefix + // $hostinfo[3]: the hostname + // $hostinfo[4]: optional port number + // The host string prefix can temporarily override the current setting for SMTPSecure + // If it's not specified, the default value is used + $prefix = ''; + $secure = $this->SMTPSecure; + $tls = ($this->SMTPSecure == 'tls'); + if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) { + $prefix = 'ssl://'; + $tls = false; // Can't have SSL and TLS at the same time + $secure = 'ssl'; + } elseif ($hostinfo[2] == 'tls') { + $tls = true; + // tls doesn't use a prefix + $secure = 'tls'; + } + //Do we need the OpenSSL extension? + $sslext = defined('OPENSSL_ALGO_SHA1'); + if ('tls' === $secure or 'ssl' === $secure) { + //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled + if (!$sslext) { + throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL); + } + } + $host = $hostinfo[3]; + $port = $this->Port; + $tport = (integer)$hostinfo[4]; + if ($tport > 0 and $tport < 65536) { + $port = $tport; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + //Automatically enable TLS encryption if: + // * it's not disabled + // * we have openssl extension + // * we are not already using SSL + // * the server offers STARTTLS + if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) { + $tls = true; + } + if ($tls) { + if (!$this->smtp->startTLS()) { + throw new phpmailerException($this->lang('connect_host')); + } + // We must resend EHLO after TLS negotiation + $this->smtp->hello($hello); + } + if ($this->SMTPAuth) { + if (!$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->Realm, + $this->Workstation + ) + ) { + throw new phpmailerException($this->lang('authenticate')); + } + } + return true; + } catch (phpmailerException $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + // We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + // If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + // As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions and !is_null($lastexception)) { + throw $lastexception; + } + return false; + } + + /** + * Close the active SMTP session if one exists. + * @return void + */ + public function smtpClose() + { + if (is_a($this->smtp, 'SMTP')) { + if ($this->smtp->connected()) { + $this->smtp->quit(); + $this->smtp->close(); + } + } + } + + /** + * Set the language for error messages. + * Returns false if it cannot load the language file. + * The default language is English. + * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * @return boolean + * @access public + */ + public function setLanguage($langcode = 'en', $lang_path = '') + { + // Backwards compatibility for renamed language codes + $renamed_langcodes = array( + 'br' => 'pt_br', + 'cz' => 'cs', + 'dk' => 'da', + 'no' => 'nb', + 'se' => 'sv', + 'sr' => 'rs' + ); + + if (isset($renamed_langcodes[$langcode])) { + $langcode = $renamed_langcodes[$langcode]; + } + + // Define full set of translatable strings in English + $PHPMAILER_LANG = array( + 'authenticate' => 'SMTP Error: Could not authenticate.', + 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', + 'data_not_accepted' => 'SMTP Error: data not accepted.', + 'empty_message' => 'Message body empty', + 'encoding' => 'Unknown encoding: ', + 'execute' => 'Could not execute: ', + 'file_access' => 'Could not access file: ', + 'file_open' => 'File Error: Could not open file: ', + 'from_failed' => 'The following From address failed: ', + 'instantiate' => 'Could not instantiate mail function.', + 'invalid_address' => 'Invalid address: ', + 'mailer_not_supported' => ' mailer is not supported.', + 'provide_address' => 'You must provide at least one recipient email address.', + 'recipients_failed' => 'SMTP Error: The following recipients failed: ', + 'signing' => 'Signing Error: ', + 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_error' => 'SMTP server error: ', + 'variable_set' => 'Cannot set or reset variable: ', + 'extension_missing' => 'Extension missing: ' + ); + if (empty($lang_path)) { + // Calculate an absolute path so it can work if CWD is not here + $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; + } + //Validate $langcode + if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { + $langcode = 'en'; + } + $foundlang = true; + $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; + // There is no English translation file + if ($langcode != 'en') { + // Make sure language file path is readable + if (!self::isPermittedPath($lang_file) or !is_readable($lang_file)) { + $foundlang = false; + } else { + // Overwrite language-specific strings. + // This way we'll never have missing translation keys. + $foundlang = include $lang_file; + } + } + $this->language = $PHPMAILER_LANG; + return (boolean)$foundlang; // Returns false if language not found + } + + /** + * Get the array of strings for the current language. + * @return array + */ + public function getTranslations() + { + return $this->language; + } + + /** + * Create recipient headers. + * @access public + * @param string $type + * @param array $addr An array of recipient, + * where each recipient is a 2-element indexed array with element 0 containing an address + * and element 1 containing a name, like: + * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User')) + * @return string + */ + public function addrAppend($type, $addr) + { + $addresses = array(); + foreach ($addr as $address) { + $addresses[] = $this->addrFormat($address); + } + return $type . ': ' . implode(', ', $addresses) . $this->LE; + } + + /** + * Format an address for use in a message header. + * @access public + * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name + * like array('joe@example.com', 'Joe User') + * @return string + */ + public function addrFormat($addr) + { + if (empty($addr[1])) { // No name provided + return $this->secureHeader($addr[0]); + } else { + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( + $addr[0] + ) . '>'; + } + } + + /** + * Word-wrap message. + * For use with mailers that do not automatically perform wrapping + * and for quoted-printable encoded messages. + * Original written by philippe. + * @param string $message The message to wrap + * @param integer $length The line length to wrap to + * @param boolean $qp_mode Whether to run in Quoted-Printable mode + * @access public + * @return string + */ + public function wrapText($message, $length, $qp_mode = false) + { + if ($qp_mode) { + $soft_break = sprintf(' =%s', $this->LE); + } else { + $soft_break = $this->LE; + } + // If utf-8 encoding is used, we will need to make sure we don't + // split multibyte characters when we wrap + $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); + $lelen = strlen($this->LE); + $crlflen = strlen(self::CRLF); + + $message = $this->fixEOL($message); + //Remove a trailing line break + if (substr($message, -$lelen) == $this->LE) { + $message = substr($message, 0, -$lelen); + } + + //Split message into lines + $lines = explode($this->LE, $message); + //Message will be rebuilt in here + $message = ''; + foreach ($lines as $line) { + $words = explode(' ', $line); + $buf = ''; + $firstword = true; + foreach ($words as $word) { + if ($qp_mode and (strlen($word) > $length)) { + $space_left = $length - strlen($buf) - $crlflen; + if (!$firstword) { + if ($space_left > 20) { + $len = $space_left; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == '=') { + $len--; + } elseif (substr($word, $len - 2, 1) == '=') { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + $buf .= ' ' . $part; + $message .= $buf . sprintf('=%s', self::CRLF); + } else { + $message .= $buf . $soft_break; + } + $buf = ''; + } + while (strlen($word) > 0) { + if ($length <= 0) { + break; + } + $len = $length; + if ($is_utf8) { + $len = $this->utf8CharBoundary($word, $len); + } elseif (substr($word, $len - 1, 1) == '=') { + $len--; + } elseif (substr($word, $len - 2, 1) == '=') { + $len -= 2; + } + $part = substr($word, 0, $len); + $word = substr($word, $len); + + if (strlen($word) > 0) { + $message .= $part . sprintf('=%s', self::CRLF); + } else { + $buf = $part; + } + } + } else { + $buf_o = $buf; + if (!$firstword) { + $buf .= ' '; + } + $buf .= $word; + + if (strlen($buf) > $length and $buf_o != '') { + $message .= $buf_o . $soft_break; + $buf = $word; + } + } + $firstword = false; + } + $message .= $buf . self::CRLF; + } + + return $message; + } + + /** + * Find the last character boundary prior to $maxLength in a utf-8 + * quoted-printable encoded string. + * Original written by Colin Brown. + * @access public + * @param string $encodedText utf-8 QP text + * @param integer $maxLength Find the last character boundary prior to this length + * @return integer + */ + public function utf8CharBoundary($encodedText, $maxLength) + { + $foundSplitPos = false; + $lookBack = 3; + while (!$foundSplitPos) { + $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); + $encodedCharPos = strpos($lastChunk, '='); + if (false !== $encodedCharPos) { + // Found start of encoded character byte within $lookBack block. + // Check the encoded byte value (the 2 chars after the '=') + $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); + $dec = hexdec($hex); + if ($dec < 128) { + // Single byte character. + // If the encoded char was found at pos 0, it will fit + // otherwise reduce maxLength to start of the encoded char + if ($encodedCharPos > 0) { + $maxLength = $maxLength - ($lookBack - $encodedCharPos); + } + $foundSplitPos = true; + } elseif ($dec >= 192) { + // First byte of a multi byte character + // Reduce maxLength to split at start of character + $maxLength = $maxLength - ($lookBack - $encodedCharPos); + $foundSplitPos = true; + } elseif ($dec < 192) { + // Middle byte of a multi byte character, look further back + $lookBack += 3; + } + } else { + // No encoded character found + $foundSplitPos = true; + } + } + return $maxLength; + } + + /** + * Apply word wrapping to the message body. + * Wraps the message body to the number of chars set in the WordWrap property. + * You should only do this to plain-text bodies as wrapping HTML tags may break them. + * This is called automatically by createBody(), so you don't need to call it yourself. + * @access public + * @return void + */ + public function setWordWrap() + { + if ($this->WordWrap < 1) { + return; + } + + switch ($this->message_type) { + case 'alt': + case 'alt_inline': + case 'alt_attach': + case 'alt_inline_attach': + $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); + break; + default: + $this->Body = $this->wrapText($this->Body, $this->WordWrap); + break; + } + } + + /** + * Assemble message headers. + * @access public + * @return string The assembled headers + */ + public function createHeader() + { + $result = ''; + + $result .= $this->headerLine('Date', $this->MessageDate == '' ? self::rfcDate() : $this->MessageDate); + + // To be created automatically by mail() + if ($this->SingleTo) { + if ($this->Mailer != 'mail') { + foreach ($this->to as $toaddr) { + $this->SingleToArray[] = $this->addrFormat($toaddr); + } + } + } else { + if (count($this->to) > 0) { + if ($this->Mailer != 'mail') { + $result .= $this->addrAppend('To', $this->to); + } + } elseif (count($this->cc) == 0) { + $result .= $this->headerLine('To', 'undisclosed-recipients:;'); + } + } + + $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName))); + + // sendmail and mail() extract Cc from the header before sending + if (count($this->cc) > 0) { + $result .= $this->addrAppend('Cc', $this->cc); + } + + // sendmail and mail() extract Bcc from the header before sending + if (( + $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' + ) + and count($this->bcc) > 0 + ) { + $result .= $this->addrAppend('Bcc', $this->bcc); + } + + if (count($this->ReplyTo) > 0) { + $result .= $this->addrAppend('Reply-To', $this->ReplyTo); + } + + // mail() sets the subject itself + if ($this->Mailer != 'mail') { + $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); + } + + // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 + // https://tools.ietf.org/html/rfc5322#section-3.6.4 + if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) { + $this->lastMessageID = $this->MessageID; + } else { + $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); + } + $result .= $this->headerLine('Message-ID', $this->lastMessageID); + if (!is_null($this->Priority)) { + $result .= $this->headerLine('X-Priority', $this->Priority); + } + if ($this->XMailer == '') { + $result .= $this->headerLine( + 'X-Mailer', + 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)' + ); + } else { + $myXmailer = trim($this->XMailer); + if ($myXmailer) { + $result .= $this->headerLine('X-Mailer', $myXmailer); + } + } + + if ($this->ConfirmReadingTo != '') { + $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); + } + + // Add custom headers + foreach ($this->CustomHeader as $header) { + $result .= $this->headerLine( + trim($header[0]), + $this->encodeHeader(trim($header[1])) + ); + } + if (!$this->sign_key_file) { + $result .= $this->headerLine('MIME-Version', '1.0'); + $result .= $this->getMailMIME(); + } + + return $result; + } + + /** + * Get the message MIME type headers. + * @access public + * @return string + */ + public function getMailMIME() + { + $result = ''; + $ismultipart = true; + switch ($this->message_type) { + case 'inline': + $result .= $this->headerLine('Content-Type', 'multipart/related;'); + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + case 'attach': + case 'inline_attach': + case 'alt_attach': + case 'alt_inline_attach': + $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + case 'alt': + case 'alt_inline': + $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); + $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); + break; + default: + // Catches case 'plain': and case '': + $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); + $ismultipart = false; + break; + } + // RFC1341 part 5 says 7bit is assumed if not specified + if ($this->Encoding != '7bit') { + // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + if ($ismultipart) { + if ($this->Encoding == '8bit') { + $result .= $this->headerLine('Content-Transfer-Encoding', '8bit'); + } + // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + } else { + $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); + } + } + + if ($this->Mailer != 'mail') { + $result .= $this->LE; + } + + return $result; + } + + /** + * Returns the whole MIME message. + * Includes complete headers and body. + * Only valid post preSend(). + * @see PHPMailer::preSend() + * @access public + * @return string + */ + public function getSentMIMEMessage() + { + return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody; + } + + /** + * Create unique ID + * @return string + */ + protected function generateId() { + return md5(uniqid(time())); + } + + /** + * Assemble the message body. + * Returns an empty string on failure. + * @access public + * @throws phpmailerException + * @return string The assembled message body + */ + public function createBody() + { + $body = ''; + //Create unique IDs and preset boundaries + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1_' . $this->uniqueid; + $this->boundary[2] = 'b2_' . $this->uniqueid; + $this->boundary[3] = 'b3_' . $this->uniqueid; + + if ($this->sign_key_file) { + $body .= $this->getMailMIME() . $this->LE; + } + + $this->setWordWrap(); + + $bodyEncoding = $this->Encoding; + $bodyCharSet = $this->CharSet; + //Can we do a 7-bit downgrade? + if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) { + $bodyEncoding = '7bit'; + //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit + $bodyCharSet = 'us-ascii'; + } + //If lines are too long, and we're not already using an encoding that will shorten them, + //change to quoted-printable transfer encoding for the body part only + if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) { + $bodyEncoding = 'quoted-printable'; + } + + $altBodyEncoding = $this->Encoding; + $altBodyCharSet = $this->CharSet; + //Can we do a 7-bit downgrade? + if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) { + $altBodyEncoding = '7bit'; + //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit + $altBodyCharSet = 'us-ascii'; + } + //If lines are too long, and we're not already using an encoding that will shorten them, + //change to quoted-printable transfer encoding for the alt body part only + if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) { + $altBodyEncoding = 'quoted-printable'; + } + //Use this as a preamble in all multipart message types + $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE; + switch ($this->message_type) { + case 'inline': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[1]); + break; + case 'attach': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'inline_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/related;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + if (!empty($this->Ical)) { + $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); + $body .= $this->encodeString($this->Ical, $this->Encoding); + $body .= $this->LE . $this->LE; + } + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_inline': + $body .= $mimepre; + $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/related;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[2]); + $body .= $this->LE; + $body .= $this->endBoundary($this->boundary[1]); + break; + case 'alt_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->endBoundary($this->boundary[2]); + $body .= $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + case 'alt_inline_attach': + $body .= $mimepre; + $body .= $this->textLine('--' . $this->boundary[1]); + $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); + $body .= $this->encodeString($this->AltBody, $altBodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->textLine('--' . $this->boundary[2]); + $body .= $this->headerLine('Content-Type', 'multipart/related;'); + $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); + $body .= $this->LE; + $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); + $body .= $this->encodeString($this->Body, $bodyEncoding); + $body .= $this->LE . $this->LE; + $body .= $this->attachAll('inline', $this->boundary[3]); + $body .= $this->LE; + $body .= $this->endBoundary($this->boundary[2]); + $body .= $this->LE; + $body .= $this->attachAll('attachment', $this->boundary[1]); + break; + default: + // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types + //Reset the `Encoding` property in case we changed it for line length reasons + $this->Encoding = $bodyEncoding; + $body .= $this->encodeString($this->Body, $this->Encoding); + break; + } + + if ($this->isError()) { + $body = ''; + } elseif ($this->sign_key_file) { + try { + if (!defined('PKCS7_TEXT')) { + throw new phpmailerException($this->lang('extension_missing') . 'openssl'); + } + // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 + $file = tempnam(sys_get_temp_dir(), 'mail'); + if (false === file_put_contents($file, $body)) { + throw new phpmailerException($this->lang('signing') . ' Could not write temp file'); + } + $signed = tempnam(sys_get_temp_dir(), 'signed'); + //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 + if (empty($this->sign_extracerts_file)) { + $sign = @openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), + null + ); + } else { + $sign = @openssl_pkcs7_sign( + $file, + $signed, + 'file://' . realpath($this->sign_cert_file), + array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), + null, + PKCS7_DETACHED, + $this->sign_extracerts_file + ); + } + if ($sign) { + @unlink($file); + $body = file_get_contents($signed); + @unlink($signed); + //The message returned by openssl contains both headers and body, so need to split them up + $parts = explode("\n\n", $body, 2); + $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE; + $body = $parts[1]; + } else { + @unlink($file); + @unlink($signed); + throw new phpmailerException($this->lang('signing') . openssl_error_string()); + } + } catch (phpmailerException $exc) { + $body = ''; + if ($this->exceptions) { + throw $exc; + } + } + } + return $body; + } + + /** + * Return the start of a message boundary. + * @access protected + * @param string $boundary + * @param string $charSet + * @param string $contentType + * @param string $encoding + * @return string + */ + protected function getBoundary($boundary, $charSet, $contentType, $encoding) + { + $result = ''; + if ($charSet == '') { + $charSet = $this->CharSet; + } + if ($contentType == '') { + $contentType = $this->ContentType; + } + if ($encoding == '') { + $encoding = $this->Encoding; + } + $result .= $this->textLine('--' . $boundary); + $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); + $result .= $this->LE; + // RFC1341 part 5 says 7bit is assumed if not specified + if ($encoding != '7bit') { + $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); + } + $result .= $this->LE; + + return $result; + } + + /** + * Return the end of a message boundary. + * @access protected + * @param string $boundary + * @return string + */ + protected function endBoundary($boundary) + { + return $this->LE . '--' . $boundary . '--' . $this->LE; + } + + /** + * Set the message type. + * PHPMailer only supports some preset message types, not arbitrary MIME structures. + * @access protected + * @return void + */ + protected function setMessageType() + { + $type = array(); + if ($this->alternativeExists()) { + $type[] = 'alt'; + } + if ($this->inlineImageExists()) { + $type[] = 'inline'; + } + if ($this->attachmentExists()) { + $type[] = 'attach'; + } + $this->message_type = implode('_', $type); + if ($this->message_type == '') { + //The 'plain' message_type refers to the message having a single body element, not that it is plain-text + $this->message_type = 'plain'; + } + } + + /** + * Format a header line. + * @access public + * @param string $name + * @param string $value + * @return string + */ + public function headerLine($name, $value) + { + return $name . ': ' . $value . $this->LE; + } + + /** + * Return a formatted mail line. + * @access public + * @param string $value + * @return string + */ + public function textLine($value) + { + return $value . $this->LE; + } + + /** + * Add an attachment from a path on the filesystem. + * Never use a user-supplied path to a file! + * Returns false if the file could not be found or read. + * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. + * If you need to do that, fetch the resource yourself and pass it in via a local file or string. + * @param string $path Path to the attachment. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @param string $disposition Disposition to use + * @throws phpmailerException + * @return boolean + */ + public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') + { + try { + if (!self::isPermittedPath($path) or !@is_file($path)) { + throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); + } + + // If a MIME type is not specified, try to work it out from the file name + if ($type == '') { + $type = self::filenameToType($path); + } + + $filename = basename($path); + if ($name == '') { + $name = $filename; + } + + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => $disposition, + 7 => 0 + ); + + } catch (phpmailerException $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); + if ($this->exceptions) { + throw $exc; + } + return false; + } + return true; + } + + /** + * Return the array of attachments. + * @return array + */ + public function getAttachments() + { + return $this->attachment; + } + + /** + * Attach all file, string, and binary attachments to the message. + * Returns an empty string on failure. + * @access protected + * @param string $disposition_type + * @param string $boundary + * @return string + */ + protected function attachAll($disposition_type, $boundary) + { + // Return text of body + $mime = array(); + $cidUniq = array(); + $incl = array(); + + // Add all attachments + foreach ($this->attachment as $attachment) { + // Check if it is a valid disposition_filter + if ($attachment[6] == $disposition_type) { + // Check for string attachment + $string = ''; + $path = ''; + $bString = $attachment[5]; + if ($bString) { + $string = $attachment[0]; + } else { + $path = $attachment[0]; + } + + $inclhash = md5(serialize($attachment)); + if (in_array($inclhash, $incl)) { + continue; + } + $incl[] = $inclhash; + $name = $attachment[2]; + $encoding = $attachment[3]; + $type = $attachment[4]; + $disposition = $attachment[6]; + $cid = $attachment[7]; + if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) { + continue; + } + $cidUniq[$cid] = true; + + $mime[] = sprintf('--%s%s', $boundary, $this->LE); + //Only include a filename property if we have one + if (!empty($name)) { + $mime[] = sprintf( + 'Content-Type: %s; name="%s"%s', + $type, + $this->encodeHeader($this->secureHeader($name)), + $this->LE + ); + } else { + $mime[] = sprintf( + 'Content-Type: %s%s', + $type, + $this->LE + ); + } + // RFC1341 part 5 says 7bit is assumed if not specified + if ($encoding != '7bit') { + $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE); + } + + if ($disposition == 'inline') { + $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE); + } + + // If a filename contains any of these chars, it should be quoted, + // but not otherwise: RFC2183 & RFC2045 5.1 + // Fixes a warning in IETF's msglint MIME checker + // Allow for bypassing the Content-Disposition header totally + if (!(empty($disposition))) { + $encoded_name = $this->encodeHeader($this->secureHeader($name)); + if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) { + $mime[] = sprintf( + 'Content-Disposition: %s; filename="%s"%s', + $disposition, + $encoded_name, + $this->LE . $this->LE + ); + } else { + if (!empty($encoded_name)) { + $mime[] = sprintf( + 'Content-Disposition: %s; filename=%s%s', + $disposition, + $encoded_name, + $this->LE . $this->LE + ); + } else { + $mime[] = sprintf( + 'Content-Disposition: %s%s', + $disposition, + $this->LE . $this->LE + ); + } + } + } else { + $mime[] = $this->LE; + } + + // Encode as string attachment + if ($bString) { + $mime[] = $this->encodeString($string, $encoding); + if ($this->isError()) { + return ''; + } + $mime[] = $this->LE . $this->LE; + } else { + $mime[] = $this->encodeFile($path, $encoding); + if ($this->isError()) { + return ''; + } + $mime[] = $this->LE . $this->LE; + } + } + } + + $mime[] = sprintf('--%s--%s', $boundary, $this->LE); + + return implode('', $mime); + } + + /** + * Encode a file attachment in requested format. + * Returns an empty string on failure. + * @param string $path The full path to the file + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @throws phpmailerException + * @access protected + * @return string + */ + protected function encodeFile($path, $encoding = 'base64') + { + try { + if (!self::isPermittedPath($path) or !file_exists($path)) { + throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); + } + $magic_quotes = get_magic_quotes_runtime(); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime(false); + } else { + //Doesn't exist in PHP 5.4, but we don't need to check because + //get_magic_quotes_runtime always returns false in 5.4+ + //so it will never get here + ini_set('magic_quotes_runtime', false); + } + } + $file_buffer = file_get_contents($path); + $file_buffer = $this->encodeString($file_buffer, $encoding); + if ($magic_quotes) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) { + set_magic_quotes_runtime($magic_quotes); + } else { + ini_set('magic_quotes_runtime', $magic_quotes); + } + } + return $file_buffer; + } catch (Exception $exc) { + $this->setError($exc->getMessage()); + return ''; + } + } + + /** + * Encode a string in requested format. + * Returns an empty string on failure. + * @param string $str The text to encode + * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' + * @access public + * @return string + */ + public function encodeString($str, $encoding = 'base64') + { + $encoded = ''; + switch (strtolower($encoding)) { + case 'base64': + $encoded = chunk_split(base64_encode($str), 76, $this->LE); + break; + case '7bit': + case '8bit': + $encoded = $this->fixEOL($str); + // Make sure it ends with a line break + if (substr($encoded, -(strlen($this->LE))) != $this->LE) { + $encoded .= $this->LE; + } + break; + case 'binary': + $encoded = $str; + break; + case 'quoted-printable': + $encoded = $this->encodeQP($str); + break; + default: + $this->setError($this->lang('encoding') . $encoding); + break; + } + return $encoded; + } + + /** + * Encode a header string optimally. + * Picks shortest of Q, B, quoted-printable or none. + * @access public + * @param string $str + * @param string $position + * @return string + */ + public function encodeHeader($str, $position = 'text') + { + $matchcount = 0; + switch (strtolower($position)) { + case 'phrase': + if (!preg_match('/[\200-\377]/', $str)) { + // Can't use addslashes as we don't know the value of magic_quotes_sybase + $encoded = addcslashes($str, "\0..\37\177\\\""); + if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { + return ($encoded); + } else { + return ("\"$encoded\""); + } + } + $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); + break; + /** @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + $matchcount = preg_match_all('/[()"]/', $str, $matches); + // Intentional fall-through + case 'text': + default: + $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); + break; + } + + //There are no chars that need encoding + if ($matchcount == 0) { + return ($str); + } + + $maxlen = 75 - 7 - strlen($this->CharSet); + // Try to select the encoding which should produce the shortest output + if ($matchcount > strlen($str) / 3) { + // More than a third of the content will need encoding, so B encoding will be most efficient + $encoding = 'B'; + if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { + // Use a custom function which correctly encodes and wraps long + // multibyte strings without breaking lines within a character + $encoded = $this->base64EncodeWrapMB($str, "\n"); + } else { + $encoded = base64_encode($str); + $maxlen -= $maxlen % 4; + $encoded = trim(chunk_split($encoded, $maxlen, "\n")); + } + } else { + $encoding = 'Q'; + $encoded = $this->encodeQ($str, $position); + $encoded = $this->wrapText($encoded, $maxlen, true); + $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); + } + + $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); + $encoded = trim(str_replace("\n", $this->LE, $encoded)); + + return $encoded; + } + + /** + * Check if a string contains multi-byte characters. + * @access public + * @param string $str multi-byte text to wrap encode + * @return boolean + */ + public function hasMultiBytes($str) + { + if (function_exists('mb_strlen')) { + return (strlen($str) > mb_strlen($str, $this->CharSet)); + } else { // Assume no multibytes (we can't handle without mbstring functions anyway) + return false; + } + } + + /** + * Does a string contain any 8-bit chars (in any charset)? + * @param string $text + * @return boolean + */ + public function has8bitChars($text) + { + return (boolean)preg_match('/[\x80-\xFF]/', $text); + } + + /** + * Encode and wrap long multibyte strings for mail headers + * without breaking lines within a character. + * Adapted from a function by paravoid + * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * @access public + * @param string $str multi-byte text to wrap encode + * @param string $linebreak string to use as linefeed/end-of-line + * @return string + */ + public function base64EncodeWrapMB($str, $linebreak = null) + { + $start = '=?' . $this->CharSet . '?B?'; + $end = '?='; + $encoded = ''; + if ($linebreak === null) { + $linebreak = $this->LE; + } + + $mb_length = mb_strlen($str, $this->CharSet); + // Each line must have length <= 75, including $start and $end + $length = 75 - strlen($start) - strlen($end); + // Average multi-byte ratio + $ratio = $mb_length / strlen($str); + // Base64 has a 4:3 ratio + $avgLength = floor($length * $ratio * .75); + + for ($i = 0; $i < $mb_length; $i += $offset) { + $lookBack = 0; + do { + $offset = $avgLength - $lookBack; + $chunk = mb_substr($str, $i, $offset, $this->CharSet); + $chunk = base64_encode($chunk); + $lookBack++; + } while (strlen($chunk) > $length); + $encoded .= $chunk . $linebreak; + } + + // Chomp the last linefeed + $encoded = substr($encoded, 0, -strlen($linebreak)); + return $encoded; + } + + /** + * Encode a string in quoted-printable format. + * According to RFC2045 section 6.7. + * @access public + * @param string $string The text to encode + * @param integer $line_max Number of chars allowed on a line before wrapping + * @return string + * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment + */ + public function encodeQP($string, $line_max = 76) + { + // Use native function if it's available (>= PHP5.3) + if (function_exists('quoted_printable_encode')) { + return quoted_printable_encode($string); + } + // Fall back to a pure PHP implementation + $string = str_replace( + array('%20', '%0D%0A.', '%0D%0A', '%'), + array(' ', "\r\n=2E", "\r\n", '='), + rawurlencode($string) + ); + return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); + } + + /** + * Backward compatibility wrapper for an old QP encoding function that was removed. + * @see PHPMailer::encodeQP() + * @access public + * @param string $string + * @param integer $line_max + * @param boolean $space_conv + * @return string + * @deprecated Use encodeQP instead. + */ + public function encodeQPphp( + $string, + $line_max = 76, + /** @noinspection PhpUnusedParameterInspection */ $space_conv = false + ) { + return $this->encodeQP($string, $line_max); + } + + /** + * Encode a string using Q encoding. + * @link http://tools.ietf.org/html/rfc2047 + * @param string $str the text to encode + * @param string $position Where the text is going to be used, see the RFC for what that means + * @access public + * @return string + */ + public function encodeQ($str, $position = 'text') + { + // There should not be any EOL in the string + $pattern = ''; + $encoded = str_replace(array("\r", "\n"), '', $str); + switch (strtolower($position)) { + case 'phrase': + // RFC 2047 section 5.3 + $pattern = '^A-Za-z0-9!*+\/ -'; + break; + /** @noinspection PhpMissingBreakStatementInspection */ + case 'comment': + // RFC 2047 section 5.2 + $pattern = '\(\)"'; + // intentional fall-through + // for this reason we build the $pattern without including delimiters and [] + case 'text': + default: + // RFC 2047 section 5.1 + // Replace every high ascii, control, =, ? and _ characters + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; + break; + } + $matches = array(); + if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { + // If the string contains an '=', make sure it's the first thing we replace + // so as to avoid double-encoding + $eqkey = array_search('=', $matches[0]); + if (false !== $eqkey) { + unset($matches[0][$eqkey]); + array_unshift($matches[0], '='); + } + foreach (array_unique($matches[0]) as $char) { + $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); + } + } + // Replace every spaces to _ (more readable than =20) + return str_replace(' ', '_', $encoded); + } + + /** + * Add a string or binary attachment (non-filesystem). + * This method can be used to attach ascii or binary data, + * such as a BLOB record from a database. + * @param string $string String attachment data. + * @param string $filename Name of the attachment. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File extension (MIME) type. + * @param string $disposition Disposition to use + * @return void + */ + public function addStringAttachment( + $string, + $filename, + $encoding = 'base64', + $type = '', + $disposition = 'attachment' + ) { + // If a MIME type is not specified, try to work it out from the file name + if ($type == '') { + $type = self::filenameToType($filename); + } + // Append to $attachment array + $this->attachment[] = array( + 0 => $string, + 1 => $filename, + 2 => basename($filename), + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => $disposition, + 7 => 0 + ); + } + + /** + * Add an embedded (inline) attachment from a file. + * This can include images, sounds, and just about any other document type. + * These differ from 'regular' attachments in that they are intended to be + * displayed inline with the message, not just attached for download. + * This is used in HTML messages that embed the images + * the HTML refers to using the $cid value. + * Never use a user-supplied path to a file! + * @param string $path Path to the attachment. + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML. + * @param string $name Overrides the attachment name. + * @param string $encoding File encoding (see $Encoding). + * @param string $type File MIME type. + * @param string $disposition Disposition to use + * @return boolean True on successfully adding an attachment + */ + public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') + { + if (!self::isPermittedPath($path) or !@is_file($path)) { + $this->setError($this->lang('file_access') . $path); + return false; + } + + // If a MIME type is not specified, try to work it out from the file name + if ($type == '') { + $type = self::filenameToType($path); + } + + $filename = basename($path); + if ($name == '') { + $name = $filename; + } + + // Append to $attachment array + $this->attachment[] = array( + 0 => $path, + 1 => $filename, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => false, // isStringAttachment + 6 => $disposition, + 7 => $cid + ); + return true; + } + + /** + * Add an embedded stringified attachment. + * This can include images, sounds, and just about any other document type. + * Be sure to set the $type to an image type for images: + * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. + * @param string $string The attachment binary data. + * @param string $cid Content ID of the attachment; Use this to reference + * the content when using an embedded image in HTML. + * @param string $name + * @param string $encoding File encoding (see $Encoding). + * @param string $type MIME type. + * @param string $disposition Disposition to use + * @return boolean True on successfully adding an attachment + */ + public function addStringEmbeddedImage( + $string, + $cid, + $name = '', + $encoding = 'base64', + $type = '', + $disposition = 'inline' + ) { + // If a MIME type is not specified, try to work it out from the name + if ($type == '' and !empty($name)) { + $type = self::filenameToType($name); + } + + // Append to $attachment array + $this->attachment[] = array( + 0 => $string, + 1 => $name, + 2 => $name, + 3 => $encoding, + 4 => $type, + 5 => true, // isStringAttachment + 6 => $disposition, + 7 => $cid + ); + return true; + } + + /** + * Check if an inline attachment is present. + * @access public + * @return boolean + */ + public function inlineImageExists() + { + foreach ($this->attachment as $attachment) { + if ($attachment[6] == 'inline') { + return true; + } + } + return false; + } + + /** + * Check if an attachment (non-inline) is present. + * @return boolean + */ + public function attachmentExists() + { + foreach ($this->attachment as $attachment) { + if ($attachment[6] == 'attachment') { + return true; + } + } + return false; + } + + /** + * Check if this message has an alternative body set. + * @return boolean + */ + public function alternativeExists() + { + return !empty($this->AltBody); + } + + /** + * Clear queued addresses of given kind. + * @access protected + * @param string $kind 'to', 'cc', or 'bcc' + * @return void + */ + public function clearQueuedAddresses($kind) + { + $RecipientsQueue = $this->RecipientsQueue; + foreach ($RecipientsQueue as $address => $params) { + if ($params[0] == $kind) { + unset($this->RecipientsQueue[$address]); + } + } + } + + /** + * Clear all To recipients. + * @return void + */ + public function clearAddresses() + { + foreach ($this->to as $to) { + unset($this->all_recipients[strtolower($to[0])]); + } + $this->to = array(); + $this->clearQueuedAddresses('to'); + } + + /** + * Clear all CC recipients. + * @return void + */ + public function clearCCs() + { + foreach ($this->cc as $cc) { + unset($this->all_recipients[strtolower($cc[0])]); + } + $this->cc = array(); + $this->clearQueuedAddresses('cc'); + } + + /** + * Clear all BCC recipients. + * @return void + */ + public function clearBCCs() + { + foreach ($this->bcc as $bcc) { + unset($this->all_recipients[strtolower($bcc[0])]); + } + $this->bcc = array(); + $this->clearQueuedAddresses('bcc'); + } + + /** + * Clear all ReplyTo recipients. + * @return void + */ + public function clearReplyTos() + { + $this->ReplyTo = array(); + $this->ReplyToQueue = array(); + } + + /** + * Clear all recipient types. + * @return void + */ + public function clearAllRecipients() + { + $this->to = array(); + $this->cc = array(); + $this->bcc = array(); + $this->all_recipients = array(); + $this->RecipientsQueue = array(); + } + + /** + * Clear all filesystem, string, and binary attachments. + * @return void + */ + public function clearAttachments() + { + $this->attachment = array(); + } + + /** + * Clear all custom headers. + * @return void + */ + public function clearCustomHeaders() + { + $this->CustomHeader = array(); + } + + /** + * Add an error message to the error container. + * @access protected + * @param string $msg + * @return void + */ + protected function setError($msg) + { + $this->error_count++; + if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { + $lasterror = $this->smtp->getError(); + if (!empty($lasterror['error'])) { + $msg .= $this->lang('smtp_error') . $lasterror['error']; + if (!empty($lasterror['detail'])) { + $msg .= ' Detail: '. $lasterror['detail']; + } + if (!empty($lasterror['smtp_code'])) { + $msg .= ' SMTP code: ' . $lasterror['smtp_code']; + } + if (!empty($lasterror['smtp_code_ex'])) { + $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; + } + } + } + $this->ErrorInfo = $msg; + } + + /** + * Return an RFC 822 formatted date. + * @access public + * @return string + * @static + */ + public static function rfcDate() + { + // Set the time zone to whatever the default is to avoid 500 errors + // Will default to UTC if it's not set properly in php.ini + date_default_timezone_set(@date_default_timezone_get()); + return date('D, j M Y H:i:s O'); + } + + /** + * Get the server hostname. + * Returns 'localhost.localdomain' if unknown. + * @access protected + * @return string + */ + protected function serverHostname() + { + $result = 'localhost.localdomain'; + if (!empty($this->Hostname)) { + $result = $this->Hostname; + } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { + $result = $_SERVER['SERVER_NAME']; + } elseif (function_exists('gethostname') && gethostname() !== false) { + $result = gethostname(); + } elseif (php_uname('n') !== false) { + $result = php_uname('n'); + } + return $result; + } + + /** + * Get an error message in the current language. + * @access protected + * @param string $key + * @return string + */ + protected function lang($key) + { + if (count($this->language) < 1) { + $this->setLanguage('en'); // set the default language + } + + if (array_key_exists($key, $this->language)) { + if ($key == 'smtp_connect_failed') { + //Include a link to troubleshooting docs on SMTP connection failure + //this is by far the biggest cause of support questions + //but it's usually not PHPMailer's fault. + return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; + } + return $this->language[$key]; + } else { + //Return the key as a fallback + return $key; + } + } + + /** + * Check if an error occurred. + * @access public + * @return boolean True if an error did occur. + */ + public function isError() + { + return ($this->error_count > 0); + } + + /** + * Ensure consistent line endings in a string. + * Changes every end of line from CRLF, CR or LF to $this->LE. + * @access public + * @param string $str String to fixEOL + * @return string + */ + public function fixEOL($str) + { + // Normalise to \n + $nstr = str_replace(array("\r\n", "\r"), "\n", $str); + // Now convert LE as needed + if ($this->LE !== "\n") { + $nstr = str_replace("\n", $this->LE, $nstr); + } + return $nstr; + } + + /** + * Add a custom header. + * $name value can be overloaded to contain + * both header name and value (name:value) + * @access public + * @param string $name Custom header name + * @param string $value Header value + * @return void + */ + public function addCustomHeader($name, $value = null) + { + if ($value === null) { + // Value passed in as name:value + $this->CustomHeader[] = explode(':', $name, 2); + } else { + $this->CustomHeader[] = array($name, $value); + } + } + + /** + * Returns all custom headers. + * @return array + */ + public function getCustomHeaders() + { + return $this->CustomHeader; + } + + /** + * Create a message body from an HTML string. + * Automatically inlines images and creates a plain-text version by converting the HTML, + * overwriting any existing values in Body and AltBody. + * Do not source $message content from user input! + * $basedir is prepended when handling relative URLs, e.g. and must not be empty + * will look for an image file in $basedir/images/a.png and convert it to inline. + * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) + * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. + * @access public + * @param string $message HTML message string + * @param string $basedir Absolute path to a base directory to prepend to relative paths to images + * @param boolean|callable $advanced Whether to use the internal HTML to text converter + * or your own custom converter @see PHPMailer::html2text() + * @return string $message The transformed message Body + */ + public function msgHTML($message, $basedir = '', $advanced = false) + { + preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images); + if (array_key_exists(2, $images)) { + if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { + // Ensure $basedir has a trailing / + $basedir .= '/'; + } + foreach ($images[2] as $imgindex => $url) { + // Convert data URIs into embedded images + if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) { + $data = substr($url, strpos($url, ',')); + if ($match[2]) { + $data = base64_decode($data); + } else { + $data = rawurldecode($data); + } + $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 + if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) { + $message = str_replace( + $images[0][$imgindex], + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + } + continue; + } + if ( + // Only process relative URLs if a basedir is provided (i.e. no absolute local paths) + !empty($basedir) + // Ignore URLs containing parent dir traversal (..) + && (strpos($url, '..') === false) + // Do not change urls that are already inline images + && substr($url, 0, 4) !== 'cid:' + // Do not change absolute URLs, including anonymous protocol + && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) + ) { + $filename = basename($url); + $directory = dirname($url); + if ($directory == '.') { + $directory = ''; + } + $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 + if (strlen($directory) > 1 && substr($directory, -1) != '/') { + $directory .= '/'; + } + if ($this->addEmbeddedImage( + $basedir . $directory . $filename, + $cid, + $filename, + 'base64', + self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION)) + ) + ) { + $message = preg_replace( + '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', + $images[1][$imgindex] . '="cid:' . $cid . '"', + $message + ); + } + } + } + } + $this->isHTML(true); + // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better + $this->Body = $this->normalizeBreaks($message); + $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); + if (!$this->alternativeExists()) { + $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . + self::CRLF . self::CRLF; + } + return $this->Body; + } + + /** + * Convert an HTML string into plain text. + * This is used by msgHTML(). + * Note - older versions of this function used a bundled advanced converter + * which was been removed for license reasons in #232. + * Example usage: + * + * // Use default conversion + * $plain = $mail->html2text($html); + * // Use your own custom converter + * $plain = $mail->html2text($html, function($html) { + * $converter = new MyHtml2text($html); + * return $converter->get_text(); + * }); + * + * @param string $html The HTML text to convert + * @param boolean|callable $advanced Any boolean value to use the internal converter, + * or provide your own callable for custom conversion. + * @return string + */ + public function html2text($html, $advanced = false) + { + if (is_callable($advanced)) { + return call_user_func($advanced, $html); + } + return html_entity_decode( + trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), + ENT_QUOTES, + $this->CharSet + ); + } + + /** + * Get the MIME type for a file extension. + * @param string $ext File extension + * @access public + * @return string MIME type of file. + * @static + */ + public static function _mime_types($ext = '') + { + $mimes = array( + 'xl' => 'application/excel', + 'js' => 'application/javascript', + 'hqx' => 'application/mac-binhex40', + 'cpt' => 'application/mac-compactpro', + 'bin' => 'application/macbinary', + 'doc' => 'application/msword', + 'word' => 'application/msword', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'class' => 'application/octet-stream', + 'dll' => 'application/octet-stream', + 'dms' => 'application/octet-stream', + 'exe' => 'application/octet-stream', + 'lha' => 'application/octet-stream', + 'lzh' => 'application/octet-stream', + 'psd' => 'application/octet-stream', + 'sea' => 'application/octet-stream', + 'so' => 'application/octet-stream', + 'oda' => 'application/oda', + 'pdf' => 'application/pdf', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'mif' => 'application/vnd.mif', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + 'wbxml' => 'application/vnd.wap.wbxml', + 'wmlc' => 'application/vnd.wap.wmlc', + 'dcr' => 'application/x-director', + 'dir' => 'application/x-director', + 'dxr' => 'application/x-director', + 'dvi' => 'application/x-dvi', + 'gtar' => 'application/x-gtar', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'php' => 'application/x-httpd-php', + 'phtml' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'swf' => 'application/x-shockwave-flash', + 'sit' => 'application/x-stuffit', + 'tar' => 'application/x-tar', + 'tgz' => 'application/x-tar', + 'xht' => 'application/xhtml+xml', + 'xhtml' => 'application/xhtml+xml', + 'zip' => 'application/zip', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mp2' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mpga' => 'audio/mpeg', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + 'ram' => 'audio/x-pn-realaudio', + 'rm' => 'audio/x-pn-realaudio', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'ra' => 'audio/x-realaudio', + 'wav' => 'audio/x-wav', + 'bmp' => 'image/bmp', + 'gif' => 'image/gif', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'png' => 'image/png', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'eml' => 'message/rfc822', + 'css' => 'text/css', + 'html' => 'text/html', + 'htm' => 'text/html', + 'shtml' => 'text/html', + 'log' => 'text/plain', + 'text' => 'text/plain', + 'txt' => 'text/plain', + 'rtx' => 'text/richtext', + 'rtf' => 'text/rtf', + 'vcf' => 'text/vcard', + 'vcard' => 'text/vcard', + 'xml' => 'text/xml', + 'xsl' => 'text/xml', + 'mpeg' => 'video/mpeg', + 'mpe' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mov' => 'video/quicktime', + 'qt' => 'video/quicktime', + 'rv' => 'video/vnd.rn-realvideo', + 'avi' => 'video/x-msvideo', + 'movie' => 'video/x-sgi-movie' + ); + if (array_key_exists(strtolower($ext), $mimes)) { + return $mimes[strtolower($ext)]; + } + return 'application/octet-stream'; + } + + /** + * Map a file name to a MIME type. + * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. + * @param string $filename A file name or full path, does not need to exist as a file + * @return string + * @static + */ + public static function filenameToType($filename) + { + // In case the path is a URL, strip any query string before getting extension + $qpos = strpos($filename, '?'); + if (false !== $qpos) { + $filename = substr($filename, 0, $qpos); + } + $pathinfo = self::mb_pathinfo($filename); + return self::_mime_types($pathinfo['extension']); + } + + /** + * Multi-byte-safe pathinfo replacement. + * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. + * Works similarly to the one in PHP >= 5.2.0 + * @link http://www.php.net/manual/en/function.pathinfo.php#107461 + * @param string $path A filename or path, does not need to exist as a file + * @param integer|string $options Either a PATHINFO_* constant, + * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2 + * @return string|array + * @static + */ + public static function mb_pathinfo($path, $options = null) + { + $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); + $pathinfo = array(); + if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) { + if (array_key_exists(1, $pathinfo)) { + $ret['dirname'] = $pathinfo[1]; + } + if (array_key_exists(2, $pathinfo)) { + $ret['basename'] = $pathinfo[2]; + } + if (array_key_exists(5, $pathinfo)) { + $ret['extension'] = $pathinfo[5]; + } + if (array_key_exists(3, $pathinfo)) { + $ret['filename'] = $pathinfo[3]; + } + } + switch ($options) { + case PATHINFO_DIRNAME: + case 'dirname': + return $ret['dirname']; + case PATHINFO_BASENAME: + case 'basename': + return $ret['basename']; + case PATHINFO_EXTENSION: + case 'extension': + return $ret['extension']; + case PATHINFO_FILENAME: + case 'filename': + return $ret['filename']; + default: + return $ret; + } + } + + /** + * Set or reset instance properties. + * You should avoid this function - it's more verbose, less efficient, more error-prone and + * harder to debug than setting properties directly. + * Usage Example: + * `$mail->set('SMTPSecure', 'tls');` + * is the same as: + * `$mail->SMTPSecure = 'tls';` + * @access public + * @param string $name The property name to set + * @param mixed $value The value to set the property to + * @return boolean + * @TODO Should this not be using the __set() magic function? + */ + public function set($name, $value = '') + { + if (property_exists($this, $name)) { + $this->$name = $value; + return true; + } else { + $this->setError($this->lang('variable_set') . $name); + return false; + } + } + + /** + * Strip newlines to prevent header injection. + * @access public + * @param string $str + * @return string + */ + public function secureHeader($str) + { + return trim(str_replace(array("\r", "\n"), '', $str)); + } + + /** + * Normalize line breaks in a string. + * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. + * Defaults to CRLF (for message bodies) and preserves consecutive breaks. + * @param string $text + * @param string $breaktype What kind of line break to use, defaults to CRLF + * @return string + * @access public + * @static + */ + public static function normalizeBreaks($text, $breaktype = "\r\n") + { + return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text); + } + + /** + * Set the public and private key files and password for S/MIME signing. + * @access public + * @param string $cert_filename + * @param string $key_filename + * @param string $key_pass Password for private key + * @param string $extracerts_filename Optional path to chain certificate + */ + public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') + { + $this->sign_cert_file = $cert_filename; + $this->sign_key_file = $key_filename; + $this->sign_key_pass = $key_pass; + $this->sign_extracerts_file = $extracerts_filename; + } + + /** + * Quoted-Printable-encode a DKIM header. + * @access public + * @param string $txt + * @return string + */ + public function DKIM_QP($txt) + { + $line = ''; + for ($i = 0; $i < strlen($txt); $i++) { + $ord = ord($txt[$i]); + if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { + $line .= $txt[$i]; + } else { + $line .= '=' . sprintf('%02X', $ord); + } + } + return $line; + } + + /** + * Generate a DKIM signature. + * @access public + * @param string $signHeader + * @throws phpmailerException + * @return string The DKIM signature value + */ + public function DKIM_Sign($signHeader) + { + if (!defined('PKCS7_TEXT')) { + if ($this->exceptions) { + throw new phpmailerException($this->lang('extension_missing') . 'openssl'); + } + return ''; + } + $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private); + if ('' != $this->DKIM_passphrase) { + $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); + } else { + $privKey = openssl_pkey_get_private($privKeyStr); + } + //Workaround for missing digest algorithms in old PHP & OpenSSL versions + //@link http://stackoverflow.com/a/11117338/333340 + if (version_compare(PHP_VERSION, '5.3.0') >= 0 and + in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) { + if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { + openssl_pkey_free($privKey); + return base64_encode($signature); + } + } else { + $pinfo = openssl_pkey_get_details($privKey); + $hash = hash('sha256', $signHeader); + //'Magic' constant for SHA256 from RFC3447 + //@link https://tools.ietf.org/html/rfc3447#page-43 + $t = '3031300d060960864801650304020105000420' . $hash; + $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3); + $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t); + + if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) { + openssl_pkey_free($privKey); + return base64_encode($signature); + } + } + openssl_pkey_free($privKey); + return ''; + } + + /** + * Generate a DKIM canonicalization header. + * @access public + * @param string $signHeader Header + * @return string + */ + public function DKIM_HeaderC($signHeader) + { + $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader); + $lines = explode("\r\n", $signHeader); + foreach ($lines as $key => $line) { + list($heading, $value) = explode(':', $line, 2); + $heading = strtolower($heading); + $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces + $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value + } + $signHeader = implode("\r\n", $lines); + return $signHeader; + } + + /** + * Generate a DKIM canonicalization body. + * @access public + * @param string $body Message Body + * @return string + */ + public function DKIM_BodyC($body) + { + if ($body == '') { + return "\r\n"; + } + // stabilize line endings + $body = str_replace("\r\n", "\n", $body); + $body = str_replace("\n", "\r\n", $body); + // END stabilize line endings + while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { + $body = substr($body, 0, strlen($body) - 2); + } + return $body; + } + + /** + * Create the DKIM header and body in a new message header. + * @access public + * @param string $headers_line Header lines + * @param string $subject Subject + * @param string $body Body + * @return string + */ + public function DKIM_Add($headers_line, $subject, $body) + { + $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms + $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body + $DKIMquery = 'dns/txt'; // Query method + $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) + $subject_header = "Subject: $subject"; + $headers = explode($this->LE, $headers_line); + $from_header = ''; + $to_header = ''; + $date_header = ''; + $current = ''; + foreach ($headers as $header) { + if (strpos($header, 'From:') === 0) { + $from_header = $header; + $current = 'from_header'; + } elseif (strpos($header, 'To:') === 0) { + $to_header = $header; + $current = 'to_header'; + } elseif (strpos($header, 'Date:') === 0) { + $date_header = $header; + $current = 'date_header'; + } else { + if (!empty($$current) && strpos($header, ' =?') === 0) { + $$current .= $header; + } else { + $current = ''; + } + } + } + $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); + $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); + $date = str_replace('|', '=7C', $this->DKIM_QP($date_header)); + $subject = str_replace( + '|', + '=7C', + $this->DKIM_QP($subject_header) + ); // Copied header fields (dkim-quoted-printable) + $body = $this->DKIM_BodyC($body); + $DKIMlen = strlen($body); // Length of body + $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body + if ('' == $this->DKIM_identity) { + $ident = ''; + } else { + $ident = ' i=' . $this->DKIM_identity . ';'; + } + $dkimhdrs = 'DKIM-Signature: v=1; a=' . + $DKIMsignatureType . '; q=' . + $DKIMquery . '; l=' . + $DKIMlen . '; s=' . + $this->DKIM_selector . + ";\r\n" . + "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . + "\th=From:To:Date:Subject;\r\n" . + "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . + "\tz=$from\r\n" . + "\t|$to\r\n" . + "\t|$date\r\n" . + "\t|$subject;\r\n" . + "\tbh=" . $DKIMb64 . ";\r\n" . + "\tb="; + $toSign = $this->DKIM_HeaderC( + $from_header . "\r\n" . + $to_header . "\r\n" . + $date_header . "\r\n" . + $subject_header . "\r\n" . + $dkimhdrs + ); + $signed = $this->DKIM_Sign($toSign); + return $dkimhdrs . $signed . "\r\n"; + } + + /** + * Detect if a string contains a line longer than the maximum line length allowed. + * @param string $str + * @return boolean + * @static + */ + public static function hasLineLongerThanMax($str) + { + //+2 to include CRLF line break for a 1000 total + return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str); + } + + /** + * Allows for public read access to 'to' property. + * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * @access public + * @return array + */ + public function getToAddresses() + { + return $this->to; + } + + /** + * Allows for public read access to 'cc' property. + * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * @access public + * @return array + */ + public function getCcAddresses() + { + return $this->cc; + } + + /** + * Allows for public read access to 'bcc' property. + * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * @access public + * @return array + */ + public function getBccAddresses() + { + return $this->bcc; + } + + /** + * Allows for public read access to 'ReplyTo' property. + * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * @access public + * @return array + */ + public function getReplyToAddresses() + { + return $this->ReplyTo; + } + + /** + * Allows for public read access to 'all_recipients' property. + * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. + * @access public + * @return array + */ + public function getAllRecipientAddresses() + { + return $this->all_recipients; + } + + /** + * Perform a callback. + * @param boolean $isSent + * @param array $to + * @param array $cc + * @param array $bcc + * @param string $subject + * @param string $body + * @param string $from + */ + protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from) + { + if (!empty($this->action_function) && is_callable($this->action_function)) { + $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); + call_user_func_array($this->action_function, $params); + } + } +} + +/** + * PHPMailer exception handler + * @package PHPMailer + */ +class phpmailerException extends \Exception +{ + /** + * Prettify error message output + * @return string + */ + public function errorMessage() + { + $errorMsg = '' . htmlspecialchars($this->getMessage()) . "
\n"; + return $errorMsg; + } +} diff --git a/lib/vendor/PHPMailer/class.webmailoauth.php b/lib/vendor/PHPMailer/class.webmailoauth.php new file mode 100644 index 0000000..80bf6c6 --- /dev/null +++ b/lib/vendor/PHPMailer/class.webmailoauth.php @@ -0,0 +1,198 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace Frody\Util; + +/** + * PHPMailerOAuth - PHPMailer subclass adding OAuth support. + * @package PHPMailer + * @author @sherryl4george + * @author Marcus Bointon (@Synchro) + */ +class PHPMailerOAuth extends PHPMailer +{ + /** + * The OAuth user's email address + * @var string + */ + public $oauthUserEmail = ''; + + /** + * The OAuth refresh token + * @var string + */ + public $oauthRefreshToken = ''; + + /** + * The OAuth client ID + * @var string + */ + public $oauthClientId = ''; + + /** + * The OAuth client secret + * @var string + */ + public $oauthClientSecret = ''; + + /** + * An instance of the PHPMailerOAuthGoogle class. + * @var PHPMailerOAuthGoogle + * @access protected + */ + protected $oauth = null; + + /** + * Get a PHPMailerOAuthGoogle instance to use. + * @return PHPMailerOAuthGoogle + */ + public function getOAUTHInstance() + { + if (!is_object($this->oauth)) { + $this->oauth = new PHPMailerOAuthGoogle( + $this->oauthUserEmail, + $this->oauthClientSecret, + $this->oauthClientId, + $this->oauthRefreshToken + ); + } + return $this->oauth; + } + + /** + * Initiate a connection to an SMTP server. + * Overrides the original smtpConnect method to add support for OAuth. + * @param array $options An array of options compatible with stream_context_create() + * @uses SMTP + * @access public + * @return bool + * @throws phpmailerException + */ + public function smtpConnect($options = array()) + { + if (is_null($this->smtp)) { + $this->smtp = $this->getSMTPInstance(); + } + + if (is_null($this->oauth)) { + $this->oauth = $this->getOAUTHInstance(); + } + + // Already connected? + if ($this->smtp->connected()) { + return true; + } + + $this->smtp->setTimeout($this->Timeout); + $this->smtp->setDebugLevel($this->SMTPDebug); + $this->smtp->setDebugOutput($this->Debugoutput); + $this->smtp->setVerp($this->do_verp); + $hosts = explode(';', $this->Host); + $lastexception = null; + + foreach ($hosts as $hostentry) { + $hostinfo = array(); + if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { + // Not a valid host entry + continue; + } + // $hostinfo[2]: optional ssl or tls prefix + // $hostinfo[3]: the hostname + // $hostinfo[4]: optional port number + // The host string prefix can temporarily override the current setting for SMTPSecure + // If it's not specified, the default value is used + $prefix = ''; + $secure = $this->SMTPSecure; + $tls = ($this->SMTPSecure == 'tls'); + if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) { + $prefix = 'ssl://'; + $tls = false; // Can't have SSL and TLS at the same time + $secure = 'ssl'; + } elseif ($hostinfo[2] == 'tls') { + $tls = true; + // tls doesn't use a prefix + $secure = 'tls'; + } + //Do we need the OpenSSL extension? + $sslext = defined('OPENSSL_ALGO_SHA1'); + if ('tls' === $secure or 'ssl' === $secure) { + //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled + if (!$sslext) { + throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL); + } + } + $host = $hostinfo[3]; + $port = $this->Port; + $tport = (integer)$hostinfo[4]; + if ($tport > 0 and $tport < 65536) { + $port = $tport; + } + if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { + try { + if ($this->Helo) { + $hello = $this->Helo; + } else { + $hello = $this->serverHostname(); + } + $this->smtp->hello($hello); + //Automatically enable TLS encryption if: + // * it's not disabled + // * we have openssl extension + // * we are not already using SSL + // * the server offers STARTTLS + if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) { + $tls = true; + } + if ($tls) { + if (!$this->smtp->startTLS()) { + throw new phpmailerException($this->lang('connect_host')); + } + // We must resend HELO after tls negotiation + $this->smtp->hello($hello); + } + if ($this->SMTPAuth) { + if (!$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->Realm, + $this->Workstation, + $this->oauth + ) + ) { + throw new phpmailerException($this->lang('authenticate')); + } + } + return true; + } catch (phpmailerException $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + // We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } + } + } + // If we get here, all connection attempts have failed, so close connection hard + $this->smtp->close(); + // As we've caught all exceptions, just report whatever the last one was + if ($this->exceptions and !is_null($lastexception)) { + throw $lastexception; + } + return false; + } +} diff --git a/lib/vendor/PHPMailer/class.webmailoauthgoogle.php b/lib/vendor/PHPMailer/class.webmailoauthgoogle.php new file mode 100644 index 0000000..315d871 --- /dev/null +++ b/lib/vendor/PHPMailer/class.webmailoauthgoogle.php @@ -0,0 +1,78 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace Frody\Util; + +/** + * PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider. + * @package PHPMailer + * @author @sherryl4george + * @author Marcus Bointon (@Synchro) + * @link https://github.com/thephpleague/oauth2-client + */ +class PHPMailerOAuthGoogle +{ + private $oauthUserEmail = ''; + private $oauthRefreshToken = ''; + private $oauthClientId = ''; + private $oauthClientSecret = ''; + + /** + * @param string $UserEmail + * @param string $ClientSecret + * @param string $ClientId + * @param string $RefreshToken + */ + public function __construct( + $UserEmail, + $ClientSecret, + $ClientId, + $RefreshToken + ) { + $this->oauthClientId = $ClientId; + $this->oauthClientSecret = $ClientSecret; + $this->oauthRefreshToken = $RefreshToken; + $this->oauthUserEmail = $UserEmail; + } + + private function getProvider() + { + return new League\OAuth2\Client\Provider\Google(Array( + 'clientId' => $this->oauthClientId, + 'clientSecret' => $this->oauthClientSecret + )); + } + + private function getGrant() + { + return new \League\OAuth2\Client\Grant\RefreshToken(); + } + + private function getToken() + { + $provider = $this->getProvider(); + $grant = $this->getGrant(); + return $provider->getAccessToken($grant, Array('refresh_token' => $this->oauthRefreshToken)); + } + + public function getOauth64() + { + $token = $this->getToken(); + return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001"); + } +} diff --git a/lib/vendor/PHPMailer/class.webmailpop3.php b/lib/vendor/PHPMailer/class.webmailpop3.php new file mode 100644 index 0000000..e931138 --- /dev/null +++ b/lib/vendor/PHPMailer/class.webmailpop3.php @@ -0,0 +1,408 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace Frody\Util; + +/** + * PHPMailer POP-Before-SMTP Authentication Class. + * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. + * Does not support APOP. + * @package PHPMailer + * @author Richard Davey (original author) + * @author Marcus Bointon (Synchro/coolbru) + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + */ +class POP3 +{ + /** + * The POP3 PHPMailer Version number. + * @var string + * @access public + */ + public $Version = '5.2.27'; + + /** + * Default POP3 port number. + * @var integer + * @access public + */ + public $POP3_PORT = 110; + + /** + * Default timeout in seconds. + * @var integer + * @access public + */ + public $POP3_TIMEOUT = 30; + + /** + * POP3 Carriage Return + Line Feed. + * @var string + * @access public + * @deprecated Use the constant instead + */ + public $CRLF = "\r\n"; + + /** + * Debug display level. + * Options: 0 = no, 1+ = yes + * @var integer + * @access public + */ + public $do_debug = 0; + + /** + * POP3 mail server hostname. + * @var string + * @access public + */ + public $host; + + /** + * POP3 port number. + * @var integer + * @access public + */ + public $port; + + /** + * POP3 Timeout Value in seconds. + * @var integer + * @access public + */ + public $tval; + + /** + * POP3 username + * @var string + * @access public + */ + public $username; + + /** + * POP3 password. + * @var string + * @access public + */ + public $password; + + /** + * Resource handle for the POP3 connection socket. + * @var resource + * @access protected + */ + protected $pop_conn; + + /** + * Are we connected? + * @var boolean + * @access protected + */ + protected $connected = false; + + /** + * Error container. + * @var array + * @access protected + */ + protected $errors = array(); + + /** + * Line break constant + */ + const CRLF = "\r\n"; + + /** + * Simple static wrapper for all-in-one POP before SMTP + * @param $host + * @param integer|boolean $port The port number to connect to + * @param integer|boolean $timeout The timeout value + * @param string $username + * @param string $password + * @param integer $debug_level + * @return boolean + */ + public static function popBeforeSmtp( + $host, + $port = false, + $timeout = false, + $username = '', + $password = '', + $debug_level = 0 + ) { + $pop = new POP3; + return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level); + } + + /** + * Authenticate with a POP3 server. + * A connect, login, disconnect sequence + * appropriate for POP-before SMTP authorisation. + * @access public + * @param string $host The hostname to connect to + * @param integer|boolean $port The port number to connect to + * @param integer|boolean $timeout The timeout value + * @param string $username + * @param string $password + * @param integer $debug_level + * @return boolean + */ + public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) + { + $this->host = $host; + // If no port value provided, use default + if (false === $port) { + $this->port = $this->POP3_PORT; + } else { + $this->port = (integer)$port; + } + // If no timeout value provided, use default + if (false === $timeout) { + $this->tval = $this->POP3_TIMEOUT; + } else { + $this->tval = (integer)$timeout; + } + $this->do_debug = $debug_level; + $this->username = $username; + $this->password = $password; + // Reset the error log + $this->errors = array(); + // connect + $result = $this->connect($this->host, $this->port, $this->tval); + if ($result) { + $login_result = $this->login($this->username, $this->password); + if ($login_result) { + $this->disconnect(); + return true; + } + } + // We need to disconnect regardless of whether the login succeeded + $this->disconnect(); + return false; + } + + /** + * Connect to a POP3 server. + * @access public + * @param string $host + * @param integer|boolean $port + * @param integer $tval + * @return boolean + */ + public function connect($host, $port = false, $tval = 30) + { + // Are we already connected? + if ($this->connected) { + return true; + } + + //On Windows this will raise a PHP Warning error if the hostname doesn't exist. + //Rather than suppress it with @fsockopen, capture it cleanly instead + set_error_handler(array($this, 'catchWarning')); + + if (false === $port) { + $port = $this->POP3_PORT; + } + + // connect to the POP3 server + $this->pop_conn = fsockopen( + $host, // POP3 Host + $port, // Port # + $errno, // Error Number + $errstr, // Error Message + $tval + ); // Timeout (seconds) + // Restore the error handler + restore_error_handler(); + + // Did we connect? + if (false === $this->pop_conn) { + // It would appear not... + $this->setError(array( + 'error' => "Failed to connect to server $host on port $port", + 'errno' => $errno, + 'errstr' => $errstr + )); + return false; + } + + // Increase the stream time-out + stream_set_timeout($this->pop_conn, $tval, 0); + + // Get the POP3 server response + $pop3_response = $this->getResponse(); + // Check for the +OK + if ($this->checkResponse($pop3_response)) { + // The connection is established and the POP3 server is talking + $this->connected = true; + return true; + } + return false; + } + + /** + * Log in to the POP3 server. + * Does not support APOP (RFC 2828, 4949). + * @access public + * @param string $username + * @param string $password + * @return boolean + */ + public function login($username = '', $password = '') + { + if (!$this->connected) { + $this->setError('Not connected to POP3 server'); + } + if (empty($username)) { + $username = $this->username; + } + if (empty($password)) { + $password = $this->password; + } + + // Send the Username + $this->sendString("USER $username" . self::CRLF); + $pop3_response = $this->getResponse(); + if ($this->checkResponse($pop3_response)) { + // Send the Password + $this->sendString("PASS $password" . self::CRLF); + $pop3_response = $this->getResponse(); + if ($this->checkResponse($pop3_response)) { + return true; + } + } + return false; + } + + /** + * Disconnect from the POP3 server. + * @access public + */ + public function disconnect() + { + $this->sendString('QUIT'); + //The QUIT command may cause the daemon to exit, which will kill our connection + //So ignore errors here + try { + @fclose($this->pop_conn); + } catch (Exception $e) { + //Do nothing + }; + } + + /** + * Get a response from the POP3 server. + * $size is the maximum number of bytes to retrieve + * @param integer $size + * @return string + * @access protected + */ + protected function getResponse($size = 128) + { + $response = fgets($this->pop_conn, $size); + if ($this->do_debug >= 1) { + echo "Server -> Client: $response"; + } + return $response; + } + + /** + * Send raw data to the POP3 server. + * @param string $string + * @return integer + * @access protected + */ + protected function sendString($string) + { + if ($this->pop_conn) { + if ($this->do_debug >= 2) { //Show client messages when debug >= 2 + echo "Client -> Server: $string"; + } + return fwrite($this->pop_conn, $string, strlen($string)); + } + return 0; + } + + /** + * Checks the POP3 server response. + * Looks for for +OK or -ERR. + * @param string $string + * @return boolean + * @access protected + */ + protected function checkResponse($string) + { + if (substr($string, 0, 3) !== '+OK') { + $this->setError(array( + 'error' => "Server reported an error: $string", + 'errno' => 0, + 'errstr' => '' + )); + return false; + } else { + return true; + } + } + + /** + * Add an error to the internal error store. + * Also display debug output if it's enabled. + * @param $error + * @access protected + */ + protected function setError($error) + { + $this->errors[] = $error; + if ($this->do_debug >= 1) { + echo '
';
+            foreach ($this->errors as $error) {
+                print_r($error);
+            }
+            echo '
'; + } + } + + /** + * Get an array of error messages, if any. + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * POP3 connection error handler. + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline + * @access protected + */ + protected function catchWarning($errno, $errstr, $errfile, $errline) + { + $this->setError(array( + 'error' => "Connecting to the POP3 server raised a PHP warning: ", + 'errno' => $errno, + 'errstr' => $errstr, + 'errfile' => $errfile, + 'errline' => $errline + )); + } +} diff --git a/lib/vendor/PHPMailer/class.webmailsmtp.php b/lib/vendor/PHPMailer/class.webmailsmtp.php new file mode 100644 index 0000000..091fd41 --- /dev/null +++ b/lib/vendor/PHPMailer/class.webmailsmtp.php @@ -0,0 +1,1277 @@ + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2014 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ +namespace Frody\Util; + +/** + * PHPMailer RFC821 SMTP email transport class. + * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. + * @package PHPMailer + * @author Chris Ryan + * @author Marcus Bointon + */ +class SMTP +{ + /** + * The PHPMailer SMTP version number. + * @var string + */ + const VERSION = '5.2.27'; + + /** + * SMTP line break constant. + * @var string + */ + const CRLF = "\r\n"; + + /** + * The SMTP port to use if one is not specified. + * @var integer + */ + const DEFAULT_SMTP_PORT = 25; + + /** + * The maximum line length allowed by RFC 2822 section 2.1.1 + * @var integer + */ + const MAX_LINE_LENGTH = 998; + + /** + * Debug level for no output + */ + const DEBUG_OFF = 0; + + /** + * Debug level to show client -> server messages + */ + const DEBUG_CLIENT = 1; + + /** + * Debug level to show client -> server and server -> client messages + */ + const DEBUG_SERVER = 2; + + /** + * Debug level to show connection status, client -> server and server -> client messages + */ + const DEBUG_CONNECTION = 3; + + /** + * Debug level to show all messages + */ + const DEBUG_LOWLEVEL = 4; + + /** + * The PHPMailer SMTP Version number. + * @var string + * @deprecated Use the `VERSION` constant instead + * @see SMTP::VERSION + */ + public $Version = '5.2.27'; + + /** + * SMTP server port number. + * @var integer + * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead + * @see SMTP::DEFAULT_SMTP_PORT + */ + public $SMTP_PORT = 25; + + /** + * SMTP reply line ending. + * @var string + * @deprecated Use the `CRLF` constant instead + * @see SMTP::CRLF + */ + public $CRLF = "\r\n"; + + /** + * Debug output level. + * Options: + * * self::DEBUG_OFF (`0`) No debug output, default + * * self::DEBUG_CLIENT (`1`) Client commands + * * self::DEBUG_SERVER (`2`) Client commands and server responses + * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status + * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages + * @var integer + */ + public $do_debug = self::DEBUG_OFF; + + /** + * How to handle debug output. + * Options: + * * `echo` Output plain-text as-is, appropriate for CLI + * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * * `error_log` Output to error log as configured in php.ini + * + * Alternatively, you can provide a callable expecting two params: a message string and the debug level: + * + * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + * + * @var string|callable + */ + public $Debugoutput = 'echo'; + + /** + * Whether to use VERP. + * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path + * @link http://www.postfix.org/VERP_README.html Info on VERP + * @var boolean + */ + public $do_verp = false; + + /** + * The timeout value for connection, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 + * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. + * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * @var integer + */ + public $Timeout = 300; + + /** + * How long to wait for commands to complete, in seconds. + * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 + * @var integer + */ + public $Timelimit = 300; + + /** + * @var array Patterns to extract an SMTP transaction id from reply to a DATA command. + * The first capture group in each regex will be used as the ID. + */ + protected $smtp_transaction_id_patterns = array( + 'exim' => '/[0-9]{3} OK id=(.*)/', + 'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/', + 'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/' + ); + + /** + * @var string The last transaction ID issued in response to a DATA command, + * if one was detected + */ + protected $last_smtp_transaction_id; + + /** + * The socket for the server connection. + * @var resource + */ + protected $smtp_conn; + + /** + * Error information, if any, for the last SMTP command. + * @var array + */ + protected $error = array( + 'error' => '', + 'detail' => '', + 'smtp_code' => '', + 'smtp_code_ex' => '' + ); + + /** + * The reply the server sent to us for HELO. + * If null, no HELO string has yet been received. + * @var string|null + */ + protected $helo_rply = null; + + /** + * The set of SMTP extensions sent in reply to EHLO command. + * Indexes of the array are extension names. + * Value at index 'HELO' or 'EHLO' (according to command that was sent) + * represents the server name. In case of HELO it is the only element of the array. + * Other values can be boolean TRUE or an array containing extension options. + * If null, no HELO/EHLO string has yet been received. + * @var array|null + */ + protected $server_caps = null; + + /** + * The most recent reply received from the server. + * @var string + */ + protected $last_reply = ''; + + /** + * Output debugging info via a user-selected method. + * @see SMTP::$Debugoutput + * @see SMTP::$do_debug + * @param string $str Debug string to output + * @param integer $level The debug level of this message; see DEBUG_* constants + * @return void + */ + protected function edebug($str, $level = 0) + { + if ($level > $this->do_debug) { + return; + } + //Avoid clash with built-in function names + if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) { + call_user_func($this->Debugoutput, $str, $level); + return; + } + switch ($this->Debugoutput) { + case 'error_log': + //Don't output, just log + error_log($str); + break; + case 'html': + //Cleans up output a bit for a better looking, HTML-safe output + echo gmdate('Y-m-d H:i:s') . ' ' . htmlentities( + preg_replace('/[\r\n]+/', '', $str), + ENT_QUOTES, + 'UTF-8' + ) . "
\n"; + break; + case 'echo': + default: + //Normalize line breaks + $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); + echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( + "\n", + "\n \t ", + trim($str) + ) . "\n"; + } + } + + /** + * Connect to an SMTP server. + * @param string $host SMTP server IP or host name + * @param integer $port The port number to connect to + * @param integer $timeout How long to wait for the connection to open + * @param array $options An array of options for stream_context_create() + * @access public + * @return boolean + */ + public function connect($host, $port = null, $timeout = 30, $options = array()) + { + static $streamok; + //This is enabled by default since 5.0.0 but some providers disable it + //Check this once and cache the result + if (is_null($streamok)) { + $streamok = function_exists('stream_socket_client'); + } + // Clear errors to avoid confusion + $this->setError(''); + // Make sure we are __not__ connected + if ($this->connected()) { + // Already connected, generate error + $this->setError('Already connected to a server'); + return false; + } + if (empty($port)) { + $port = self::DEFAULT_SMTP_PORT; + } + // Connect to the SMTP server + $this->edebug( + "Connection: opening to $host:$port, timeout=$timeout, options=" . + var_export($options, true), + self::DEBUG_CONNECTION + ); + $errno = 0; + $errstr = ''; + if ($streamok) { + $socket_context = stream_context_create($options); + set_error_handler(array($this, 'errorHandler')); + $this->smtp_conn = stream_socket_client( + $host . ":" . $port, + $errno, + $errstr, + $timeout, + STREAM_CLIENT_CONNECT, + $socket_context + ); + restore_error_handler(); + } else { + //Fall back to fsockopen which should work in more places, but is missing some features + $this->edebug( + "Connection: stream_socket_client not available, falling back to fsockopen", + self::DEBUG_CONNECTION + ); + set_error_handler(array($this, 'errorHandler')); + $this->smtp_conn = fsockopen( + $host, + $port, + $errno, + $errstr, + $timeout + ); + restore_error_handler(); + } + // Verify we connected properly + if (!is_resource($this->smtp_conn)) { + $this->setError( + 'Failed to connect to server', + $errno, + $errstr + ); + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] + . ": $errstr ($errno)", + self::DEBUG_CLIENT + ); + return false; + } + $this->edebug('Connection: opened', self::DEBUG_CONNECTION); + // SMTP server can take longer to respond, give longer timeout for first read + // Windows does not have support for this timeout function + if (substr(PHP_OS, 0, 3) != 'WIN') { + $max = ini_get('max_execution_time'); + // Don't bother if unlimited + if ($max != 0 && $timeout > $max) { + @set_time_limit($timeout); + } + stream_set_timeout($this->smtp_conn, $timeout, 0); + } + // Get any announcement + $announce = $this->get_lines(); + $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); + return true; + } + + /** + * Initiate a TLS (encrypted) session. + * @access public + * @return boolean + */ + public function startTLS() + { + if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { + return false; + } + + //Allow the best TLS version(s) we can + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; + + //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT + //so add them back in manually if we can + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + // Begin encrypted connection + set_error_handler(array($this, 'errorHandler')); + $crypto_ok = stream_socket_enable_crypto( + $this->smtp_conn, + true, + $crypto_method + ); + restore_error_handler(); + return $crypto_ok; + } + + /** + * Perform SMTP authentication. + * Must be run after hello(). + * @see hello() + * @param string $username The user name + * @param string $password The password + * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2) + * @param string $realm The auth realm for NTLM + * @param string $workstation The auth workstation for NTLM + * @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth) + * @return bool True if successfully authenticated.* @access public + */ + public function authenticate( + $username, + $password, + $authtype = null, + $realm = '', + $workstation = '', + $OAuth = null + ) { + if (!$this->server_caps) { + $this->setError('Authentication is not allowed before HELO/EHLO'); + return false; + } + + if (array_key_exists('EHLO', $this->server_caps)) { + // SMTP extensions are available; try to find a proper authentication method + if (!array_key_exists('AUTH', $this->server_caps)) { + $this->setError('Authentication is not allowed at this stage'); + // 'at this stage' means that auth may be allowed after the stage changes + // e.g. after STARTTLS + return false; + } + + self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); + self::edebug( + 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), + self::DEBUG_LOWLEVEL + ); + + if (empty($authtype)) { + foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) { + if (in_array($method, $this->server_caps['AUTH'])) { + $authtype = $method; + break; + } + } + if (empty($authtype)) { + $this->setError('No supported authentication methods found'); + return false; + } + self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); + } + + if (!in_array($authtype, $this->server_caps['AUTH'])) { + $this->setError("The requested authentication method \"$authtype\" is not supported by the server"); + return false; + } + } elseif (empty($authtype)) { + $authtype = 'LOGIN'; + } + switch ($authtype) { + case 'PLAIN': + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { + return false; + } + // Send encoded username and password + if (!$this->sendCommand( + 'User & Password', + base64_encode("\0" . $username . "\0" . $password), + 235 + ) + ) { + return false; + } + break; + case 'LOGIN': + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { + return false; + } + if (!$this->sendCommand("Username", base64_encode($username), 334)) { + return false; + } + if (!$this->sendCommand("Password", base64_encode($password), 235)) { + return false; + } + break; + case 'XOAUTH2': + //If the OAuth Instance is not set. Can be a case when PHPMailer is used + //instead of PHPMailerOAuth + if (is_null($OAuth)) { + return false; + } + $oauth = $OAuth->getOauth64(); + + // Start authentication + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { + return false; + } + break; + case 'NTLM': + /* + * ntlm_sasl_client.php + * Bundled with Permission + * + * How to telnet in windows: + * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx + * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication + */ + require_once 'extras/ntlm_sasl_client.php'; + $temp = new stdClass; + $ntlm_client = new ntlm_sasl_client_class; + //Check that functions are available + if (!$ntlm_client->initialize($temp)) { + $this->setError($temp->error); + $this->edebug( + 'You need to enable some modules in your php.ini file: ' + . $this->error['error'], + self::DEBUG_CLIENT + ); + return false; + } + //msg1 + $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 + + if (!$this->sendCommand( + 'AUTH NTLM', + 'AUTH NTLM ' . base64_encode($msg1), + 334 + ) + ) { + return false; + } + //Though 0 based, there is a white space after the 3 digit number + //msg2 + $challenge = substr($this->last_reply, 3); + $challenge = base64_decode($challenge); + $ntlm_res = $ntlm_client->NTLMResponse( + substr($challenge, 24, 8), + $password + ); + //msg3 + $msg3 = $ntlm_client->typeMsg3( + $ntlm_res, + $username, + $realm, + $workstation + ); + // send encoded username + return $this->sendCommand('Username', base64_encode($msg3), 235); + case 'CRAM-MD5': + // Start authentication + if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { + return false; + } + // Get the challenge + $challenge = base64_decode(substr($this->last_reply, 4)); + + // Build the response + $response = $username . ' ' . $this->hmac($challenge, $password); + + // send encoded credentials + return $this->sendCommand('Username', base64_encode($response), 235); + default: + $this->setError("Authentication method \"$authtype\" is not supported"); + return false; + } + return true; + } + + /** + * Calculate an MD5 HMAC hash. + * Works like hash_hmac('md5', $data, $key) + * in case that function is not available + * @param string $data The data to hash + * @param string $key The key to hash with + * @access protected + * @return string + */ + protected function hmac($data, $key) + { + if (function_exists('hash_hmac')) { + return hash_hmac('md5', $data, $key); + } + + // The following borrowed from + // http://php.net/manual/en/function.mhash.php#27225 + + // RFC 2104 HMAC implementation for php. + // Creates an md5 HMAC. + // Eliminates the need to install mhash to compute a HMAC + // by Lance Rushing + + $bytelen = 64; // byte length for md5 + if (strlen($key) > $bytelen) { + $key = pack('H*', md5($key)); + } + $key = str_pad($key, $bytelen, chr(0x00)); + $ipad = str_pad('', $bytelen, chr(0x36)); + $opad = str_pad('', $bytelen, chr(0x5c)); + $k_ipad = $key ^ $ipad; + $k_opad = $key ^ $opad; + + return md5($k_opad . pack('H*', md5($k_ipad . $data))); + } + + /** + * Check connection state. + * @access public + * @return boolean True if connected. + */ + public function connected() + { + if (is_resource($this->smtp_conn)) { + $sock_status = stream_get_meta_data($this->smtp_conn); + if ($sock_status['eof']) { + // The socket is valid but we are not connected + $this->edebug( + 'SMTP NOTICE: EOF caught while checking if connected', + self::DEBUG_CLIENT + ); + $this->close(); + return false; + } + return true; // everything looks good + } + return false; + } + + /** + * Close the socket and clean up the state of the class. + * Don't use this function without first trying to use QUIT. + * @see quit() + * @access public + * @return void + */ + public function close() + { + $this->setError(''); + $this->server_caps = null; + $this->helo_rply = null; + if (is_resource($this->smtp_conn)) { + // close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = null; //Makes for cleaner serialization + $this->edebug('Connection: closed', self::DEBUG_CONNECTION); + } + } + + /** + * Send an SMTP DATA command. + * Issues a data command and sends the msg_data to the server, + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being separated by and additional . + * Implements rfc 821: DATA + * @param string $msg_data Message data to send + * @access public + * @return boolean + */ + public function data($msg_data) + { + //This will use the standard timelimit + if (!$this->sendCommand('DATA', 'DATA', 354)) { + return false; + } + + /* The server is ready to accept data! + * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF) + * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into + * smaller lines to fit within the limit. + * We will also look for lines that start with a '.' and prepend an additional '.'. + * NOTE: this does not count towards line-length limit. + */ + + // Normalize line breaks before exploding + $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data)); + + /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field + * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * process all lines before a blank line as headers. + */ + + $field = substr($lines[0], 0, strpos($lines[0], ':')); + $in_headers = false; + if (!empty($field) && strpos($field, ' ') === false) { + $in_headers = true; + } + + foreach ($lines as $line) { + $lines_out = array(); + if ($in_headers and $line == '') { + $in_headers = false; + } + //Break this line up into several smaller lines if it's too long + //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len), + while (isset($line[self::MAX_LINE_LENGTH])) { + //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on + //so as to avoid breaking in the middle of a word + $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); + //Deliberately matches both false and 0 + if (!$pos) { + //No nice break found, add a hard break + $pos = self::MAX_LINE_LENGTH - 1; + $lines_out[] = substr($line, 0, $pos); + $line = substr($line, $pos); + } else { + //Break at the found point + $lines_out[] = substr($line, 0, $pos); + //Move along by the amount we dealt with + $line = substr($line, $pos + 1); + } + //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 + if ($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + //Send the lines to the server + foreach ($lines_out as $line_out) { + //RFC2821 section 4.5.2 + if (!empty($line_out) and $line_out[0] == '.') { + $line_out = '.' . $line_out; + } + $this->client_send($line_out . self::CRLF); + } + } + + //Message data has been sent, complete the command + //Increase timelimit for end of DATA command + $savetimelimit = $this->Timelimit; + $this->Timelimit = $this->Timelimit * 2; + $result = $this->sendCommand('DATA END', '.', 250); + $this->recordLastTransactionID(); + //Restore timelimit + $this->Timelimit = $savetimelimit; + return $result; + } + + /** + * Send an SMTP HELO or EHLO command. + * Used to identify the sending server to the receiving server. + * This makes sure that client and server are in a known state. + * Implements RFC 821: HELO + * and RFC 2821 EHLO. + * @param string $host The host name or IP to connect to + * @access public + * @return boolean + */ + public function hello($host = '') + { + //Try extended hello first (RFC 2821) + return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); + } + + /** + * Send an SMTP HELO or EHLO command. + * Low-level implementation used by hello() + * @see hello() + * @param string $hello The HELO string + * @param string $host The hostname to say we are + * @access protected + * @return boolean + */ + protected function sendHello($hello, $host) + { + $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); + $this->helo_rply = $this->last_reply; + if ($noerror) { + $this->parseHelloFields($hello); + } else { + $this->server_caps = null; + } + return $noerror; + } + + /** + * Parse a reply to HELO/EHLO command to discover server extensions. + * In case of HELO, the only parameter that can be discovered is a server name. + * @access protected + * @param string $type - 'HELO' or 'EHLO' + */ + protected function parseHelloFields($type) + { + $this->server_caps = array(); + $lines = explode("\n", $this->helo_rply); + + foreach ($lines as $n => $s) { + //First 4 chars contain response code followed by - or space + $s = trim(substr($s, 4)); + if (empty($s)) { + continue; + } + $fields = explode(' ', $s); + if (!empty($fields)) { + if (!$n) { + $name = $type; + $fields = $fields[0]; + } else { + $name = array_shift($fields); + switch ($name) { + case 'SIZE': + $fields = ($fields ? $fields[0] : 0); + break; + case 'AUTH': + if (!is_array($fields)) { + $fields = array(); + } + break; + default: + $fields = true; + } + } + $this->server_caps[$name] = $fields; + } + } + } + + /** + * Send an SMTP MAIL command. + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. + * Implements rfc 821: MAIL FROM: + * @param string $from Source address of this message + * @access public + * @return boolean + */ + public function mail($from) + { + $useVerp = ($this->do_verp ? ' XVERP' : ''); + return $this->sendCommand( + 'MAIL FROM', + 'MAIL FROM:<' . $from . '>' . $useVerp, + 250 + ); + } + + /** + * Send an SMTP QUIT command. + * Closes the socket if there is no error or the $close_on_error argument is true. + * Implements from rfc 821: QUIT + * @param boolean $close_on_error Should the connection close if an error occurs? + * @access public + * @return boolean + */ + public function quit($close_on_error = true) + { + $noerror = $this->sendCommand('QUIT', 'QUIT', 221); + $err = $this->error; //Save any error + if ($noerror or $close_on_error) { + $this->close(); + $this->error = $err; //Restore any error from the quit command + } + return $noerror; + } + + /** + * Send an SMTP RCPT command. + * Sets the TO argument to $toaddr. + * Returns true if the recipient was accepted false if it was rejected. + * Implements from rfc 821: RCPT TO: + * @param string $address The address the message is being sent to + * @access public + * @return boolean + */ + public function recipient($address) + { + return $this->sendCommand( + 'RCPT TO', + 'RCPT TO:<' . $address . '>', + array(250, 251) + ); + } + + /** + * Send an SMTP RSET command. + * Abort any transaction that is currently in progress. + * Implements rfc 821: RSET + * @access public + * @return boolean True on success. + */ + public function reset() + { + return $this->sendCommand('RSET', 'RSET', 250); + } + + /** + * Send a command to an SMTP server and check its return code. + * @param string $command The command name - not sent to the server + * @param string $commandstring The actual command to send + * @param integer|array $expect One or more expected integer success codes + * @access protected + * @return boolean True on success. + */ + protected function sendCommand($command, $commandstring, $expect) + { + if (!$this->connected()) { + $this->setError("Called $command without being connected"); + return false; + } + //Reject line breaks in all commands + if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) { + $this->setError("Command '$command' contained line breaks"); + return false; + } + $this->client_send($commandstring . self::CRLF); + + $this->last_reply = $this->get_lines(); + // Fetch SMTP code and possible error code explanation + $matches = array(); + if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) { + $code = $matches[1]; + $code_ex = (count($matches) > 2 ? $matches[2] : null); + // Cut off error code from each response line + $detail = preg_replace( + "/{$code}[ -]" . + ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m", + '', + $this->last_reply + ); + } else { + // Fall back to simple parsing if regex fails + $code = substr($this->last_reply, 0, 3); + $code_ex = null; + $detail = substr($this->last_reply, 4); + } + + $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); + + if (!in_array($code, (array)$expect)) { + $this->setError( + "$command command failed", + $detail, + $code, + $code_ex + ); + $this->edebug( + 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, + self::DEBUG_CLIENT + ); + return false; + } + + $this->setError(''); + return true; + } + + /** + * Send an SMTP SAML command. + * Starts a mail transaction from the email address specified in $from. + * Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more recipient + * commands may be called followed by a data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * Implements rfc 821: SAML FROM: + * @param string $from The address the message is from + * @access public + * @return boolean + */ + public function sendAndMail($from) + { + return $this->sendCommand('SAML', "SAML FROM:$from", 250); + } + + /** + * Send an SMTP VRFY command. + * @param string $name The name to verify + * @access public + * @return boolean + */ + public function verify($name) + { + return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); + } + + /** + * Send an SMTP NOOP command. + * Used to keep keep-alives alive, doesn't actually do anything + * @access public + * @return boolean + */ + public function noop() + { + return $this->sendCommand('NOOP', 'NOOP', 250); + } + + /** + * Send an SMTP TURN command. + * This is an optional command for SMTP that this class does not support. + * This method is here to make the RFC821 Definition complete for this class + * and _may_ be implemented in future + * Implements from rfc 821: TURN + * @access public + * @return boolean + */ + public function turn() + { + $this->setError('The SMTP TURN command is not implemented'); + $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); + return false; + } + + /** + * Send raw data to the server. + * @param string $data The data to send + * @access public + * @return integer|boolean The number of bytes sent to the server or false on error + */ + public function client_send($data) + { + $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT); + set_error_handler(array($this, 'errorHandler')); + $result = fwrite($this->smtp_conn, $data); + restore_error_handler(); + return $result; + } + + /** + * Get the latest error. + * @access public + * @return array + */ + public function getError() + { + return $this->error; + } + + /** + * Get SMTP extensions available on the server + * @access public + * @return array|null + */ + public function getServerExtList() + { + return $this->server_caps; + } + + /** + * A multipurpose method + * The method works in three ways, dependent on argument value and current state + * 1. HELO/EHLO was not sent - returns null and set up $this->error + * 2. HELO was sent + * $name = 'HELO': returns server name + * $name = 'EHLO': returns boolean false + * $name = any string: returns null and set up $this->error + * 3. EHLO was sent + * $name = 'HELO'|'EHLO': returns server name + * $name = any string: if extension $name exists, returns boolean True + * or its options. Otherwise returns boolean False + * In other words, one can use this method to detect 3 conditions: + * - null returned: handshake was not or we don't know about ext (refer to $this->error) + * - false returned: the requested feature exactly not exists + * - positive value returned: the requested feature exists + * @param string $name Name of SMTP extension or 'HELO'|'EHLO' + * @return mixed + */ + public function getServerExt($name) + { + if (!$this->server_caps) { + $this->setError('No HELO/EHLO was sent'); + return null; + } + + // the tight logic knot ;) + if (!array_key_exists($name, $this->server_caps)) { + if ($name == 'HELO') { + return $this->server_caps['EHLO']; + } + if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) { + return false; + } + $this->setError('HELO handshake was used. Client knows nothing about server extensions'); + return null; + } + + return $this->server_caps[$name]; + } + + /** + * Get the last reply from the server. + * @access public + * @return string + */ + public function getLastReply() + { + return $this->last_reply; + } + + /** + * Read the SMTP server's response. + * Either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * @access protected + * @return string + */ + protected function get_lines() + { + // If the connection is bad, give up straight away + if (!is_resource($this->smtp_conn)) { + return ''; + } + $data = ''; + $endtime = 0; + stream_set_timeout($this->smtp_conn, $this->Timeout); + if ($this->Timelimit > 0) { + $endtime = time() + $this->Timelimit; + } + while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { + $str = @fgets($this->smtp_conn, 515); + $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL); + $this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL); + $data .= $str; + // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), + // or 4th character is a space, we are done reading, break the loop, + // string array access is a micro-optimisation over strlen + if (!isset($str[3]) or (isset($str[3]) and $str[3] == ' ')) { + break; + } + // Timed-out? Log and break + $info = stream_get_meta_data($this->smtp_conn); + if ($info['timed_out']) { + $this->edebug( + 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + // Now check if reads took too long + if ($endtime and time() > $endtime) { + $this->edebug( + 'SMTP -> get_lines(): timelimit reached (' . + $this->Timelimit . ' sec)', + self::DEBUG_LOWLEVEL + ); + break; + } + } + return $data; + } + + /** + * Enable or disable VERP address generation. + * @param boolean $enabled + */ + public function setVerp($enabled = false) + { + $this->do_verp = $enabled; + } + + /** + * Get VERP address generation mode. + * @return boolean + */ + public function getVerp() + { + return $this->do_verp; + } + + /** + * Set error messages and codes. + * @param string $message The error message + * @param string $detail Further detail on the error + * @param string $smtp_code An associated SMTP error code + * @param string $smtp_code_ex Extended SMTP code + */ + protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') + { + $this->error = array( + 'error' => $message, + 'detail' => $detail, + 'smtp_code' => $smtp_code, + 'smtp_code_ex' => $smtp_code_ex + ); + } + + /** + * Set debug output method. + * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it. + */ + public function setDebugOutput($method = 'echo') + { + $this->Debugoutput = $method; + } + + /** + * Get debug output method. + * @return string + */ + public function getDebugOutput() + { + return $this->Debugoutput; + } + + /** + * Set debug output level. + * @param integer $level + */ + public function setDebugLevel($level = 0) + { + $this->do_debug = $level; + } + + /** + * Get debug output level. + * @return integer + */ + public function getDebugLevel() + { + return $this->do_debug; + } + + /** + * Set SMTP timeout. + * @param integer $timeout + */ + public function setTimeout($timeout = 0) + { + $this->Timeout = $timeout; + } + + /** + * Get SMTP timeout. + * @return integer + */ + public function getTimeout() + { + return $this->Timeout; + } + + /** + * Reports an error number and string. + * @param integer $errno The error number returned by PHP. + * @param string $errmsg The error message returned by PHP. + * @param string $errfile The file the error occurred in + * @param integer $errline The line number the error occurred on + */ + protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) + { + $notice = 'Connection failed.'; + $this->setError( + $notice, + $errno, + $errmsg + ); + $this->edebug( + $notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]", + self::DEBUG_CONNECTION + ); + } + + /** + * Extract and return the ID of the last SMTP transaction based on + * a list of patterns provided in SMTP::$smtp_transaction_id_patterns. + * Relies on the host providing the ID in response to a DATA command. + * If no reply has been received yet, it will return null. + * If no pattern was matched, it will return false. + * @return bool|null|string + */ + protected function recordLastTransactionID() + { + $reply = $this->getLastReply(); + + if (empty($reply)) { + $this->last_smtp_transaction_id = null; + } else { + $this->last_smtp_transaction_id = false; + foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { + if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { + $this->last_smtp_transaction_id = $matches[1]; + } + } + } + + return $this->last_smtp_transaction_id; + } + + /** + * Get the queue/transaction ID of the last SMTP transaction + * If no reply has been received yet, it will return null. + * If no pattern was matched, it will return false. + * @return bool|null|string + * @see recordLastTransactionID() + */ + public function getLastTransactionID() + { + return $this->last_smtp_transaction_id; + } +} diff --git a/lib/vendor/PHPMailer/composer.json b/lib/vendor/PHPMailer/composer.json new file mode 100644 index 0000000..b857fa8 --- /dev/null +++ b/lib/vendor/PHPMailer/composer.json @@ -0,0 +1,61 @@ +{ + "name": "phpmailer/phpmailer", + "type": "library", + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "require": { + "ext-ctype": "*", + "php": ">=5.0.0" + }, + "require-dev": { + "doctrine/annotations": "1.2.*", + "jms/serializer": "0.16.*", + "phpdocumentor/phpdocumentor": "2.*", + "phpunit/phpunit": "4.8.*", + "symfony/debug": "2.8.*", + "symfony/filesystem": "2.8.*", + "symfony/translation": "2.8.*", + "symfony/yaml": "2.8.*", + "zendframework/zend-cache": "2.5.1", + "zendframework/zend-config": "2.5.1", + "zendframework/zend-eventmanager": "2.5.1", + "zendframework/zend-filter": "2.5.1", + "zendframework/zend-i18n": "2.5.1", + "zendframework/zend-json": "2.5.1", + "zendframework/zend-math": "2.5.1", + "zendframework/zend-serializer": "2.5.*", + "zendframework/zend-servicemanager": "2.5.*", + "zendframework/zend-stdlib": "2.5.1" + }, + "suggest": { + "league/oauth2-google": "Needed for Google XOAUTH2 authentication" + }, + "autoload": { + "classmap": [ + "class.phpmailer.php", + "class.phpmaileroauth.php", + "class.phpmaileroauthgoogle.php", + "class.smtp.php", + "class.pop3.php", + "extras/EasyPeasyICS.php", + "extras/ntlm_sasl_client.php" + ] + }, + "license": "LGPL-2.1" +} diff --git a/lib/vendor/PHPMailer/composer.lock b/lib/vendor/PHPMailer/composer.lock new file mode 100644 index 0000000..12ac7e4 --- /dev/null +++ b/lib/vendor/PHPMailer/composer.lock @@ -0,0 +1,3593 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "7e4b1bef833056eed0df39fad5399d7a", + "packages": [], + "packages-dev": [ + { + "name": "cilex/cilex", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Cilex/Cilex.git", + "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Cilex/Cilex/zipball/7acd965a609a56d0345e8b6071c261fbdb926cb5", + "reference": "7acd965a609a56d0345e8b6071c261fbdb926cb5", + "shasum": "" + }, + "require": { + "cilex/console-service-provider": "1.*", + "php": ">=5.3.3", + "pimple/pimple": "~1.0", + "symfony/finder": "~2.1", + "symfony/process": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*", + "symfony/validator": "~2.1" + }, + "suggest": { + "monolog/monolog": ">=1.0.0", + "symfony/validator": ">=1.0.0", + "symfony/yaml": ">=1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Cilex": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "description": "The PHP micro-framework for Command line tools based on the Symfony2 Components", + "homepage": "http://cilex.github.com", + "keywords": [ + "cli", + "microframework" + ], + "time": "2014-03-29T14:03:13+00:00" + }, + { + "name": "cilex/console-service-provider", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/Cilex/console-service-provider.git", + "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Cilex/console-service-provider/zipball/25ee3d1875243d38e1a3448ff94bdf944f70d24e", + "reference": "25ee3d1875243d38e1a3448ff94bdf944f70d24e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "pimple/pimple": "1.*@dev", + "symfony/console": "~2.1" + }, + "require-dev": { + "cilex/cilex": "1.*@dev", + "silex/silex": "1.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Cilex\\Provider\\Console": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "description": "Console Service Provider", + "keywords": [ + "cilex", + "console", + "pimple", + "service-provider", + "silex" + ], + "time": "2012-12-19T10:50:58+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.2.7", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": ">=5.3.2" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2015-08-31T12:32:49+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "doctrine/lexer", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "lexer", + "parser" + ], + "time": "2014-09-09T13:34:57+00:00" + }, + { + "name": "erusev/parsedown", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/erusev/parsedown.git", + "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb", + "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Parsedown": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" + } + ], + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", + "keywords": [ + "markdown", + "parser" + ], + "time": "2016-11-02T15:56:58+00:00" + }, + { + "name": "herrera-io/json", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/kherge-php/json.git", + "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kherge-php/json/zipball/60c696c9370a1e5136816ca557c17f82a6fa83f1", + "reference": "60c696c9370a1e5136816ca557c17f82a6fa83f1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "justinrainbow/json-schema": ">=1.0,<2.0-dev", + "php": ">=5.3.3", + "seld/jsonlint": ">=1.0,<2.0-dev" + }, + "require-dev": { + "herrera-io/phpunit-test-case": "1.*", + "mikey179/vfsstream": "1.1.0", + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "files": [ + "src/lib/json_version.php" + ], + "psr-0": { + "Herrera\\Json": "src/lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Herrera", + "email": "kevin@herrera.io", + "homepage": "http://kevin.herrera.io/", + "role": "Developer" + } + ], + "description": "A library for simplifying JSON linting and validation.", + "homepage": "http://herrera-io.github.com/php-json", + "keywords": [ + "json", + "lint", + "schema", + "validate" + ], + "abandoned": "kherge/json", + "time": "2013-10-30T16:51:34+00:00" + }, + { + "name": "herrera-io/phar-update", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/kherge-abandoned/php-phar-update.git", + "reference": "00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kherge-abandoned/php-phar-update/zipball/00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b", + "reference": "00a79e1d5b8cf3c080a2e3becf1ddf7a7fea025b", + "shasum": "" + }, + "require": { + "herrera-io/json": "1.*", + "kherge/version": "1.*", + "php": ">=5.3.3" + }, + "require-dev": { + "herrera-io/phpunit-test-case": "1.*", + "mikey179/vfsstream": "1.1.0", + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "files": [ + "src/lib/constants.php" + ], + "psr-0": { + "Herrera\\Phar\\Update": "src/lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Herrera", + "email": "kevin@herrera.io", + "homepage": "http://kevin.herrera.io/", + "role": "Developer" + } + ], + "description": "A library for self-updating Phars.", + "homepage": "http://herrera-io.github.com/php-phar-update", + "keywords": [ + "phar", + "update" + ], + "abandoned": true, + "time": "2013-10-30T17:23:01+00:00" + }, + { + "name": "jms/metadata", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/metadata.git", + "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/6a06970a10e0a532fb52d3959547123b84a3b3ab", + "reference": "6a06970a10e0a532fb52d3959547123b84a3b3ab", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/cache": "~1.0", + "symfony/cache": "~3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Metadata\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Class/method/property metadata management in PHP", + "keywords": [ + "annotations", + "metadata", + "xml", + "yaml" + ], + "time": "2016-12-05T10:18:33+00:00" + }, + { + "name": "jms/parser-lib", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/parser-lib.git", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "shasum": "" + }, + "require": { + "phpoption/phpoption": ">=0.9,<2.0-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "description": "A library for easily creating recursive-descent parsers.", + "time": "2012-11-18T18:08:43+00:00" + }, + { + "name": "jms/serializer", + "version": "0.16.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/serializer.git", + "reference": "c8a171357ca92b6706e395c757f334902d430ea9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9", + "reference": "c8a171357ca92b6706e395c757f334902d430ea9", + "shasum": "" + }, + "require": { + "doctrine/annotations": "1.*", + "jms/metadata": "~1.1", + "jms/parser-lib": "1.*", + "php": ">=5.3.2", + "phpcollection/phpcollection": "~0.1" + }, + "require-dev": { + "doctrine/orm": "~2.1", + "doctrine/phpcr-odm": "~1.0.1", + "jackalope/jackalope-doctrine-dbal": "1.0.*", + "propel/propel1": "~1.7", + "symfony/filesystem": "2.*", + "symfony/form": "~2.1", + "symfony/translation": "~2.0", + "symfony/validator": "~2.0", + "symfony/yaml": "2.*", + "twig/twig": ">=1.8,<2.0-dev" + }, + "suggest": { + "symfony/yaml": "Required if you'd like to serialize data to YAML format." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.15-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\Serializer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh", + "role": "Developer of wrapped JMSSerializerBundle" + } + ], + "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", + "homepage": "http://jmsyst.com/libs/serializer", + "keywords": [ + "deserialization", + "jaxb", + "json", + "serialization", + "xml" + ], + "time": "2014-03-18T08:39:00+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341", + "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341", + "shasum": "" + }, + "require": { + "php": ">=5.3.29" + }, + "require-dev": { + "json-schema/json-schema-test-suite": "1.1.0", + "phpdocumentor/phpdocumentor": "~2", + "phpunit/phpunit": "~3.7" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2016-01-25T15:43:01+00:00" + }, + { + "name": "kherge/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/kherge-abandoned/Version.git", + "reference": "f07cf83f8ce533be8f93d2893d96d674bbeb7e30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kherge-abandoned/Version/zipball/f07cf83f8ce533be8f93d2893d96d674bbeb7e30", + "reference": "f07cf83f8ce533be8f93d2893d96d674bbeb7e30", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "KevinGH\\Version": "src/lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Herrera", + "email": "me@kevingh.com", + "homepage": "http://www.kevingh.com/" + } + ], + "description": "A parsing and comparison library for semantic versioning.", + "homepage": "http://github.com/kherge/Version", + "abandoned": true, + "time": "2012-08-16T17:13:03+00:00" + }, + { + "name": "monolog/monolog", + "version": "1.22.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0", + "reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "~5.3" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "time": "2017-03-13T07:08:03+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", + "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "files": [ + "lib/bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2015-09-19T14:15:08+00:00" + }, + { + "name": "phpcollection/phpcollection", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-collection.git", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "shasum": "" + }, + "require": { + "phpoption/phpoption": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-0": { + "PhpCollection": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "General-Purpose Collection Library for PHP", + "keywords": [ + "collection", + "list", + "map", + "sequence", + "set" + ], + "time": "2015-05-17T12:39:23+00:00" + }, + { + "name": "phpdocumentor/fileset", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Fileset.git", + "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Fileset/zipball/bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", + "reference": "bfa78d8fa9763dfce6d0e5d3730c1d8ab25d34b0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/finder": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "~3.7" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Fileset component for collecting a set of files given directories and file paths", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "files", + "fileset", + "phpdoc" + ], + "time": "2013-08-06T21:07:42+00:00" + }, + { + "name": "phpdocumentor/graphviz", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/GraphViz.git", + "reference": "a906a90a9f230535f25ea31caf81b2323956283f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/a906a90a9f230535f25ea31caf81b2323956283f", + "reference": "a906a90a9f230535f25ea31caf81b2323956283f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-02-02T13:00:08+00:00" + }, + { + "name": "phpdocumentor/phpdocumentor", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/phpDocumentor2.git", + "reference": "be607da0eef9b9249c43c5b4820d25d631c73667" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor2/zipball/be607da0eef9b9249c43c5b4820d25d631c73667", + "reference": "be607da0eef9b9249c43c5b4820d25d631c73667", + "shasum": "" + }, + "require": { + "cilex/cilex": "~1.0", + "erusev/parsedown": "~1.0", + "herrera-io/phar-update": "1.0.3", + "jms/serializer": ">=0.12", + "monolog/monolog": "~1.6", + "php": ">=5.3.3", + "phpdocumentor/fileset": "~1.0", + "phpdocumentor/graphviz": "~1.0", + "phpdocumentor/reflection": "^3.0", + "phpdocumentor/reflection-docblock": "~2.0", + "symfony/config": "~2.3", + "symfony/console": "~2.3", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.0", + "symfony/stopwatch": "~2.3", + "symfony/validator": "~2.2", + "twig/twig": "~1.3", + "zendframework/zend-cache": "~2.1", + "zendframework/zend-config": "~2.1", + "zendframework/zend-filter": "~2.1", + "zendframework/zend-i18n": "~2.1", + "zendframework/zend-serializer": "~2.1", + "zendframework/zend-servicemanager": "~2.1", + "zendframework/zend-stdlib": "~2.1", + "zetacomponents/document": ">=1.3.1" + }, + "require-dev": { + "behat/behat": "~3.0", + "mikey179/vfsstream": "~1.2", + "mockery/mockery": "~0.9@dev", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~1.4", + "symfony/expression-language": "~2.4" + }, + "suggest": { + "ext-twig": "Enabling the twig extension improves the generation of twig based templates.", + "ext-xslcache": "Enabling the XSLCache extension improves the generation of xml based templates." + }, + "bin": [ + "bin/phpdoc.php", + "bin/phpdoc" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.9-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/" + ], + "Cilex\\Provider": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Documentation Generator for PHP", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "api", + "application", + "dga", + "documentation", + "phpdoc" + ], + "time": "2016-05-22T09:50:56+00:00" + }, + { + "name": "phpdocumentor/reflection", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/Reflection.git", + "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d", + "reference": "793bfd92d9a0fc96ae9608fb3e947c3f59fb3a0d", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^1.0", + "php": ">=5.3.3", + "phpdocumentor/reflection-docblock": "~2.0", + "psr/log": "~1.0" + }, + "require-dev": { + "behat/behat": "~2.4", + "mockery/mockery": "~0.8", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/", + "tests/unit/", + "tests/mocks/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Reflection library to do Static Analysis for PHP Projects", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2016-05-21T08:42:32+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03T12:10:50+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "reference": "94e644f7d2051a5f0fcf77d81605f152eecff0ed", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.7.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-0": { + "PhpOption\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "time": "2015-07-25T16:39:46+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02T20:05:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03T07:40:28+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-02-27T10:12:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.35", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", + "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-02-06T05:18:07+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "pimple/pimple", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Pimple": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + } + ], + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", + "keywords": [ + "container", + "dependency injection" + ], + "time": "2013-11-22T08:30:29+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-12-08T07:14:41+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17T09:04:28+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-10-03T07:41:43+00:00" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21T13:59:46+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/791f8c594f300d246cdf01c6b3e1e19611e301d8", + "reference": "791f8c594f300d246cdf01c6b3e1e19611e301d8", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2017-03-06T16:42:24+00:00" + }, + { + "name": "symfony/config", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/06ce6bb46c24963ec09323da45d0f4f85d3cecd2", + "reference": "06ce6bb46c24963ec09323da45d0f4f85d3cecd2", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/filesystem": "~2.3|~3.0.0" + }, + "require-dev": { + "symfony/yaml": "~2.7|~3.0.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2017-03-01T18:13:50+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/81508e6fac4476771275a3f4f53c3fee9b956bfa", + "reference": "81508e6fac4476771275a3f4f53c3fee9b956bfa", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-03-04T11:00:12+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "e90099a2958d4833a02d05b504cc06e1c234abcc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/e90099a2958d4833a02d05b504cc06e1c234abcc", + "reference": "e90099a2958d4833a02d05b504cc06e1c234abcc", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-02-18T19:13:35+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bb4ec47e8e109c1c1172145732d0aa468d967cd0", + "reference": "bb4ec47e8e109c1c1172145732d0aa468d967cd0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-02-21T08:33:48+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e542d4765092d22552b1bf01ddccfb01d98ee325", + "reference": "e542d4765092d22552b1bf01ddccfb01d98ee325", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-02-18T17:06:33+00:00" + }, + { + "name": "symfony/finder", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/5fc4b5cab38b9d28be318fcffd8066988e7d9451", + "reference": "5fc4b5cab38b9d28be318fcffd8066988e7d9451", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2017-02-21T08:33:48+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14T01:06:16+00:00" + }, + { + "name": "symfony/process", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "41336b20b52f5fd5b42a227e394e673c8071118f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/41336b20b52f5fd5b42a227e394e673c8071118f", + "reference": "41336b20b52f5fd5b42a227e394e673c8071118f", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2017-03-04T12:20:59+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "9e4369666d02ee9b8830da878b7f6a769eb96f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/9e4369666d02ee9b8830da878b7f6a769eb96f4b", + "reference": "9e4369666d02ee9b8830da878b7f6a769eb96f4b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2017-02-18T17:06:33+00:00" + }, + { + "name": "symfony/translation", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/b538355bc99db2ec7cc35284ec76d92ae7d1d256", + "reference": "b538355bc99db2ec7cc35284ec76d92ae7d1d256", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/yaml": "~2.2|~3.0.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2017-03-04T12:20:59+00:00" + }, + { + "name": "symfony/validator", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63", + "reference": "8d4bfa7ec24e70ebc28d0cea5f2702d3f1257a63", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~2.4|~3.0.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.1", + "symfony/config": "~2.2|~3.0.0", + "symfony/expression-language": "~2.4|~3.0.0", + "symfony/http-foundation": "~2.3|~3.0.0", + "symfony/intl": "~2.7.25|^2.8.18|~3.2.5", + "symfony/property-access": "~2.3|~3.0.0", + "symfony/yaml": "^2.0.5|~3.0.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "symfony/config": "", + "symfony/expression-language": "For using the 2.4 Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For using the 2.4 Validator API", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2017-02-28T02:24:56+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.18", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d", + "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-03-01T18:13:50+00:00" + }, + { + "name": "twig/twig", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "9935b662e24d6e634da88901ab534cc12e8c728f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9935b662e24d6e634da88901ab534cc12e8c728f", + "reference": "9935b662e24d6e634da88901ab534cc12e8c728f", + "shasum": "" + }, + "require": { + "php": ">=5.2.7" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.32-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2017-02-27T00:07:03+00:00" + }, + { + "name": "zendframework/zend-cache", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-cache.git", + "reference": "5999e5a03f7dcf82abbbe67eea74da641f959684" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-cache/zipball/5999e5a03f7dcf82abbbe67eea74da641f959684", + "reference": "5999e5a03f7dcf82abbbe67eea74da641f959684", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-serializer": "~2.5", + "zendframework/zend-servicemanager": "~2.5", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-session": "~2.5" + }, + "suggest": { + "ext-apc": "APC >= 3.1.6 to use the APC storage adapter", + "ext-dba": "DBA, to use the DBA storage adapter", + "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter", + "ext-mongo": "Mongo, to use MongoDb storage adapter", + "ext-wincache": "WinCache, to use the WinCache storage adapter", + "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-session": "Zend\\Session component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a generic way to cache any data", + "homepage": "https://github.com/zendframework/zend-cache", + "keywords": [ + "cache", + "zf2" + ], + "time": "2015-06-03T15:31:59+00:00" + }, + { + "name": "zendframework/zend-config", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-config.git", + "reference": "ec49b1df1bdd9772df09dc2f612fbfc279bf4c27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-config/zipball/ec49b1df1bdd9772df09dc2f612fbfc279bf4c27", + "reference": "ec49b1df1bdd9772df09dc2f612fbfc279bf4c27", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-filter": "~2.5", + "zendframework/zend-i18n": "~2.5", + "zendframework/zend-json": "~2.5", + "zendframework/zend-mvc": "~2.5", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Config\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "homepage": "https://github.com/zendframework/zend-config", + "keywords": [ + "config", + "zf2" + ], + "time": "2015-06-03T15:32:00+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "d94a16039144936f107f906896349900fd634443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d94a16039144936f107f906896349900fd634443", + "reference": "d94a16039144936f107f906896349900fd634443", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "eventmanager", + "zf2" + ], + "time": "2015-06-03T15:32:01+00:00" + }, + { + "name": "zendframework/zend-filter", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-filter.git", + "reference": "93e6990a198e6cdd811064083acac4693f4b29ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-filter/zipball/93e6990a198e6cdd811064083acac4693f4b29ae", + "reference": "93e6990a198e6cdd811064083acac4693f4b29ae", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-config": "~2.5", + "zendframework/zend-crypt": "~2.5", + "zendframework/zend-i18n": "~2.5", + "zendframework/zend-loader": "~2.5", + "zendframework/zend-servicemanager": "~2.5", + "zendframework/zend-uri": "~2.5" + }, + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Filter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed data filters", + "homepage": "https://github.com/zendframework/zend-filter", + "keywords": [ + "filter", + "zf2" + ], + "time": "2015-06-03T15:32:01+00:00" + }, + { + "name": "zendframework/zend-i18n", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-i18n.git", + "reference": "509271eb7947e4aabebfc376104179cffea42696" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/509271eb7947e4aabebfc376104179cffea42696", + "reference": "509271eb7947e4aabebfc376104179cffea42696", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-cache": "~2.5", + "zendframework/zend-config": "~2.5", + "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-filter": "~2.5", + "zendframework/zend-servicemanager": "~2.5", + "zendframework/zend-validator": "~2.5", + "zendframework/zend-view": "~2.5" + }, + "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", + "zendframework/zend-cache": "Zend\\Cache component", + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", + "zendframework/zend-filter": "You should install this package to use the provided filters", + "zendframework/zend-resources": "Translation resources", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "You should install this package to use the provided validators", + "zendframework/zend-view": "You should install this package to use the provided view helpers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\I18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-i18n", + "keywords": [ + "i18n", + "zf2" + ], + "time": "2015-06-03T15:32:01+00:00" + }, + { + "name": "zendframework/zend-json", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-json.git", + "reference": "c74eaf17d2dd37dc1e964be8dfde05706a821ebc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/c74eaf17d2dd37dc1e964be8dfde05706a821ebc", + "reference": "c74eaf17d2dd37dc1e964be8dfde05706a821ebc", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-http": "~2.5", + "zendframework/zend-server": "~2.5", + "zendframework/zendxml": "~1.0" + }, + "suggest": { + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-server": "Zend\\Server component", + "zendframework/zendxml": "To support Zend\\Json\\Json::fromXml() usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "homepage": "https://github.com/zendframework/zend-json", + "keywords": [ + "json", + "zf2" + ], + "time": "2015-06-03T15:32:01+00:00" + }, + { + "name": "zendframework/zend-math", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-math.git", + "reference": "9f02a1ac4d3374d3332c80f9215deec9c71558fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-math/zipball/9f02a1ac4d3374d3332c80f9215deec9c71558fc", + "reference": "9f02a1ac4d3374d3332c80f9215deec9c71558fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "ircmaxell/random-lib": "~1.1", + "phpunit/phpunit": "~4.0", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "ext-bcmath": "If using the bcmath functionality", + "ext-gmp": "If using the gmp functionality", + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", + "zendframework/zend-servicemanager": ">= current version, if using the BigInteger::factory functionality" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-math", + "keywords": [ + "math", + "zf2" + ], + "time": "2015-06-03T15:32:02+00:00" + }, + { + "name": "zendframework/zend-serializer", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-serializer.git", + "reference": "b7208eb17dc4a4fb3a660b85e6c4af035eeed40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/b7208eb17dc4a4fb3a660b85e6c4af035eeed40c", + "reference": "b7208eb17dc4a4fb3a660b85e6c4af035eeed40c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-json": "~2.5", + "zendframework/zend-math": "~2.5", + "zendframework/zend-stdlib": "~2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "zendframework/zend-servicemanager": "To support plugin manager support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Serializer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", + "homepage": "https://github.com/zendframework/zend-serializer", + "keywords": [ + "serializer", + "zf2" + ], + "time": "2015-06-03T15:32:02+00:00" + }, + { + "name": "zendframework/zend-servicemanager", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-servicemanager.git", + "reference": "3b22c403e351d92526c642cba0bd810bc22e1c56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-servicemanager/zipball/3b22c403e351d92526c642cba0bd810bc22e1c56", + "reference": "3b22c403e351d92526c642cba0bd810bc22e1c56", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-di": "~2.5", + "zendframework/zend-mvc": "~2.5" + }, + "suggest": { + "ocramius/proxy-manager": "ProxyManager 0.5.* to handle lazy initialization of services", + "zendframework/zend-di": "Zend\\Di component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\ServiceManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-servicemanager", + "keywords": [ + "servicemanager", + "zf2" + ], + "time": "2015-06-03T15:32:02+00:00" + }, + { + "name": "zendframework/zend-stdlib", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cc8e90a60dd5d44b9730b77d07b97550091da1ae", + "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-config": "~2.5", + "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-filter": "~2.5", + "zendframework/zend-inputfilter": "~2.5", + "zendframework/zend-serializer": "~2.5", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-filter": "To support naming strategy hydrator usage", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-stdlib", + "keywords": [ + "stdlib", + "zf2" + ], + "time": "2015-06-03T15:32:03+00:00" + }, + { + "name": "zetacomponents/base", + "version": "1.9", + "source": { + "type": "git", + "url": "https://github.com/zetacomponents/Base.git", + "reference": "f20df24e8de3e48b6b69b2503f917e457281e687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Base/zipball/f20df24e8de3e48b6b69b2503f917e457281e687", + "reference": "f20df24e8de3e48b6b69b2503f917e457281e687", + "shasum": "" + }, + "require-dev": { + "zetacomponents/unit-test": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sergey Alexeev" + }, + { + "name": "Sebastian Bergmann" + }, + { + "name": "Jan Borsodi" + }, + { + "name": "Raymond Bosman" + }, + { + "name": "Frederik Holljen" + }, + { + "name": "Kore Nordmann" + }, + { + "name": "Derick Rethans" + }, + { + "name": "Vadym Savchuk" + }, + { + "name": "Tobias Schlitt" + }, + { + "name": "Alexandru Stanoi" + } + ], + "description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.", + "homepage": "https://github.com/zetacomponents", + "time": "2014-09-19T03:28:34+00:00" + }, + { + "name": "zetacomponents/document", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/zetacomponents/Document.git", + "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Document/zipball/688abfde573cf3fe0730f82538fbd7aa9fc95bc8", + "reference": "688abfde573cf3fe0730f82538fbd7aa9fc95bc8", + "shasum": "" + }, + "require": { + "zetacomponents/base": "*" + }, + "require-dev": { + "zetacomponents/unit-test": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Sebastian Bergmann" + }, + { + "name": "Kore Nordmann" + }, + { + "name": "Derick Rethans" + }, + { + "name": "Tobias Schlitt" + }, + { + "name": "Alexandru Stanoi" + } + ], + "description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.", + "homepage": "https://github.com/zetacomponents", + "time": "2013-12-19T11:40:00+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.0.0" + }, + "platform-dev": [] +} diff --git a/lib/vendor/PHPMailer/examples/DKIM.phps b/lib/vendor/PHPMailer/examples/DKIM.phps new file mode 100644 index 0000000..e3d2bae --- /dev/null +++ b/lib/vendor/PHPMailer/examples/DKIM.phps @@ -0,0 +1,38 @@ +setFrom('from@example.com', 'First Last'); +//Set an alternative reply-to address +$mail->addReplyTo('replyto@example.com', 'First Last'); +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); +//Set the subject line +$mail->Subject = 'PHPMailer DKIM test'; +//This should be the same as the domain of your From address +$mail->DKIM_domain = 'example.com'; +//Path to your private key file +$mail->DKIM_private = 'dkim_private.pem'; +//Set this to your own selector +$mail->DKIM_selector = 'phpmailer'; +//If your private key has a passphrase, set it here +$mail->DKIM_passphrase = ''; +//The identity you're signing as - usually your From address +$mail->DKIM_identity = $mail->From; + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} diff --git a/lib/vendor/PHPMailer/examples/code_generator.phps b/lib/vendor/PHPMailer/examples/code_generator.phps new file mode 100644 index 0000000..2182663 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/code_generator.phps @@ -0,0 +1,604 @@ +CharSet = 'utf-8'; +ini_set('default_charset', 'UTF-8'); +$mail->Debugoutput = $CFG['smtp_debugoutput']; +$example_code .= "\n\n\$mail = new PHPMailer(true);"; +$example_code .= "\n\$mail->CharSet = 'utf-8';"; +$example_code .= "\nini_set('default_charset', 'UTF-8');"; + +class phpmailerAppException extends phpmailerException +{ +} + +$example_code .= "\n\nclass phpmailerAppException extends phpmailerException {}"; +$example_code .= "\n\ntry {"; + +// Convert a string to its JavaScript representation. +function JSString($s) { + static $from = array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'); + static $to = array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\\"'); + return is_null($s)? 'null': '"' . str_replace($from, $to, "$s") . '"'; +} + +try { + if (isset($_POST["submit"]) && $_POST['submit'] == "Submit") { + $to = $to_email; + if (!PHPMailer::validateAddress($to)) { + throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!"); + } + + $example_code .= "\n\$to = '" . addslashes($to_email) . "';"; + $example_code .= "\nif(!PHPMailer::validateAddress(\$to)) {"; + $example_code .= "\n throw new phpmailerAppException(\"Email address \" . " . + "\$to . \" is invalid -- aborting!\");"; + $example_code .= "\n}"; + + switch ($test_type) { + case 'smtp': + $mail->isSMTP(); // telling the class to use SMTP + $mail->SMTPDebug = (integer)$smtp_debug; + $mail->Host = $smtp_server; // SMTP server + $mail->Port = (integer)$smtp_port; // set the SMTP port + if ($smtp_secure) { + $mail->SMTPSecure = strtolower($smtp_secure); + } + $mail->SMTPAuth = array_key_exists('smtp_authenticate', $_POST); // enable SMTP authentication? + if (array_key_exists('smtp_authenticate', $_POST)) { + $mail->Username = $authenticate_username; // SMTP account username + $mail->Password = $authenticate_password; // SMTP account password + } + + $example_code .= "\n\$mail->isSMTP();"; + $example_code .= "\n\$mail->SMTPDebug = " . (integer) $smtp_debug . ";"; + $example_code .= "\n\$mail->Host = \"" . addslashes($smtp_server) . "\";"; + $example_code .= "\n\$mail->Port = \"" . addslashes($smtp_port) . "\";"; + $example_code .= "\n\$mail->SMTPSecure = \"" . addslashes(strtolower($smtp_secure)) . "\";"; + $example_code .= "\n\$mail->SMTPAuth = " . (array_key_exists( + 'smtp_authenticate', + $_POST + ) ? 'true' : 'false') . ";"; + if (array_key_exists('smtp_authenticate', $_POST)) { + $example_code .= "\n\$mail->Username = \"" . addslashes($authenticate_username) . "\";"; + $example_code .= "\n\$mail->Password = \"" . addslashes($authenticate_password) . "\";"; + } + break; + case 'mail': + $mail->isMail(); // telling the class to use PHP's mail() + $example_code .= "\n\$mail->isMail();"; + break; + case 'sendmail': + $mail->isSendmail(); // telling the class to use Sendmail + $example_code .= "\n\$mail->isSendmail();"; + break; + case 'qmail': + $mail->isQmail(); // telling the class to use Qmail + $example_code .= "\n\$mail->isQmail();"; + break; + default: + throw new phpmailerAppException('Invalid test_type provided'); + } + + try { + if ($_POST['From_Name'] != '') { + $mail->addReplyTo($from_email, $from_name); + $mail->setFrom($from_email, $from_name); + + $example_code .= "\n\$mail->addReplyTo(\"" . + addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");"; + $example_code .= "\n\$mail->setFrom(\"" . + addslashes($from_email) . "\", \"" . addslashes($from_name) . "\");"; + } else { + $mail->addReplyTo($from_email); + $mail->setFrom($from_email, $from_email); + + $example_code .= "\n\$mail->addReplyTo(\"" . addslashes($from_email) . "\");"; + $example_code .= "\n\$mail->setFrom(\"" . + addslashes($from_email) . "\", \"" . addslashes($from_email) . "\");"; + } + + if ($_POST['To_Name'] != '') { + $mail->addAddress($to, $to_name); + $example_code .= "\n\$mail->addAddress(\"$to\", \"" . addslashes($to_name) . "\");"; + } else { + $mail->addAddress($to); + $example_code .= "\n\$mail->addAddress(\"$to\");"; + } + + if ($_POST['bcc_Email'] != '') { + $indiBCC = explode(" ", $bcc_email); + foreach ($indiBCC as $key => $value) { + $mail->addBCC($value); + $example_code .= "\n\$mail->addBCC(\"" . addslashes($value) . "\");"; + } + } + + if ($_POST['cc_Email'] != '') { + $indiCC = explode(" ", $cc_Email); + foreach ($indiCC as $key => $value) { + $mail->addCC($value); + $example_code .= "\n\$mail->addCC(\"" . addslashes($value) . "\");"; + } + } + } catch (phpmailerException $e) { //Catch all kinds of bad addressing + throw new phpmailerAppException($e->getMessage()); + } + $mail->Subject = $subject . ' (PHPMailer test using ' . strtoupper($test_type) . ')'; + $example_code .= "\n\$mail->Subject = \"" . addslashes($subject) . + ' (PHPMailer test using ' . addslashes(strtoupper($test_type)) . ')";'; + + if ($_POST['Message'] == '') { + $body = file_get_contents('contents.html'); + } else { + $body = $message; + } + + $example_code .= "\n\$body = <<<'EOT'\n$body\nEOT;"; + + $mail->WordWrap = 78; // set word wrap to the RFC2822 limit + $mail->msgHTML($body, dirname(__FILE__), true); //Create message bodies and embed images + + $example_code .= "\n\$mail->WordWrap = 78;"; + $example_code .= "\n\$mail->msgHTML(\$body, dirname(__FILE__), true); //Create message bodies and embed images"; + + $mail->addAttachment('images/phpmailer_mini.png', 'phpmailer_mini.png'); // optional name + $mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name + $example_code .= "\n\$mail->addAttachment('images/phpmailer_mini.png'," . + "'phpmailer_mini.png'); // optional name"; + $example_code .= "\n\$mail->addAttachment('images/phpmailer.png', 'phpmailer.png'); // optional name"; + + $example_code .= "\n\ntry {"; + $example_code .= "\n \$mail->send();"; + $example_code .= "\n \$results_messages[] = \"Message has been sent using " . + addslashes(strtoupper($test_type)) . "\";"; + $example_code .= "\n}"; + $example_code .= "\ncatch (phpmailerException \$e) {"; + $example_code .= "\n throw new phpmailerAppException('Unable to send to: ' . \$to. ': '.\$e->getMessage());"; + $example_code .= "\n}"; + + try { + $mail->send(); + $results_messages[] = "Message has been sent using " . strtoupper($test_type); + } catch (phpmailerException $e) { + throw new phpmailerAppException("Unable to send to: " . $to . ': ' . $e->getMessage()); + } + } +} catch (phpmailerAppException $e) { + $results_messages[] = $e->errorMessage(); +} +$example_code .= "\n}"; +$example_code .= "\ncatch (phpmailerAppException \$e) {"; +$example_code .= "\n \$results_messages[] = \$e->errorMessage();"; +$example_code .= "\n}"; +$example_code .= "\n\nif (count(\$results_messages) > 0) {"; +$example_code .= "\n echo \"

Run results

\\n\";"; +$example_code .= "\n echo \"
    \\n\";"; +$example_code .= "\nforeach (\$results_messages as \$result) {"; +$example_code .= "\n echo \"
  • \$result
  • \\n\";"; +$example_code .= "\n}"; +$example_code .= "\necho \"
\\n\";"; +$example_code .= "\n}"; +?> + + + + PHPMailer Test Page + + + + + + + + +"; + echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above."); +} + +if (count($results_messages) > 0) { + echo '

Run results

'; + echo '
    '; + foreach ($results_messages as $result) { + echo "
  • $result
  • "; + } + echo '
'; +} + +if (isset($_POST["submit"]) && $_POST["submit"] == "Submit") { + echo "
\n"; + echo "
Script:\n"; + echo "
\n";
+    echo htmlentities($example_code);
+    echo "\n
\n"; + echo "\n
\n"; +} +?> +
+
+
+
+ Mail Details + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
Test will include two attachments.
+
+
+
+
+ Mail Test Specs + + + + + +
Test Type +
+ + + required> +
+
+ + + required> +
+
+ + + required> +
+
+ + + required> +
+
+
"> + SMTP Specific Options: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ + value="true"> +
+ +
+ +
+
+
+
+
+ +
+
+ +
+ +
+
+
+ + diff --git a/lib/vendor/PHPMailer/examples/contactform.phps b/lib/vendor/PHPMailer/examples/contactform.phps new file mode 100644 index 0000000..d85e204 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/contactform.phps @@ -0,0 +1,71 @@ +isSMTP(); + $mail->Host = 'localhost'; + $mail->Port = 25; + + //Use a fixed address in your own domain as the from address + //**DO NOT** use the submitter's address here as it will be forgery + //and will cause your messages to fail SPF checks + $mail->setFrom('from@example.com', 'First Last'); + //Send the message to yourself, or whoever should receive contact for submissions + $mail->addAddress('whoto@example.com', 'John Doe'); + //Put the submitter's address in a reply-to header + //This will fail if the address provided is invalid, + //in which case we should ignore the whole request + if ($mail->addReplyTo($_POST['email'], $_POST['name'])) { + $mail->Subject = 'PHPMailer contact form'; + //Keep it simple - don't use HTML + $mail->isHTML(false); + //Build a simple message body + $mail->Body = <<send()) { + //The reason for failing to send will be in $mail->ErrorInfo + //but you shouldn't display errors to users - process the error, log it on your server. + $msg = 'Sorry, something went wrong. Please try again later.'; + } else { + $msg = 'Message sent! Thanks for contacting us.'; + } + } else { + $msg = 'Invalid email address, message ignored.'; + } +} +?> + + + + + Contact form + + +

Contact us

+$msg"; +} ?> +
+
+
+
+ +
+ + diff --git a/lib/vendor/PHPMailer/examples/contents.html b/lib/vendor/PHPMailer/examples/contents.html new file mode 100644 index 0000000..dc3fc66 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/contents.html @@ -0,0 +1,17 @@ + + + + + PHPMailer Test + + +
+

This is a test of PHPMailer.

+
+ PHPMailer rocks +
+

This example uses HTML.

+

ISO-8859-1 text:

+
+ + diff --git a/lib/vendor/PHPMailer/examples/contentsutf8.html b/lib/vendor/PHPMailer/examples/contentsutf8.html new file mode 100644 index 0000000..035d10c --- /dev/null +++ b/lib/vendor/PHPMailer/examples/contentsutf8.html @@ -0,0 +1,21 @@ + + + + + PHPMailer Test + + +
+

This is a test of PHPMailer.

+
+ PHPMailer rocks +
+

This example uses HTML.

+

Chinese text: 郵件內容為空

+

Russian text: Пустое тело сообщения

+

Armenian text: Հաղորդագրությունը դատարկ է

+

Czech text: Prázdné tělo zprávy

+

Emoji: 😂 🦄 💥 📤 📧

+
+ + diff --git a/lib/vendor/PHPMailer/examples/exceptions.phps b/lib/vendor/PHPMailer/examples/exceptions.phps new file mode 100644 index 0000000..0e941e7 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/exceptions.phps @@ -0,0 +1,35 @@ +setFrom('from@example.com', 'First Last'); + //Set an alternative reply-to address + $mail->addReplyTo('replyto@example.com', 'First Last'); + //Set who the message is to be sent to + $mail->addAddress('whoto@example.com', 'John Doe'); + //Set the subject line + $mail->Subject = 'PHPMailer Exceptions test'; + //Read an HTML message body from an external file, convert referenced images to embedded, + //and convert the HTML into a basic plain-text alternative body + $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + //Replace the plain text body with one created manually + $mail->AltBody = 'This is a plain-text message body'; + //Attach an image file + $mail->addAttachment('images/phpmailer_mini.png'); + //send the message + //Note that we don't need check the response from this because it will throw an exception if it has trouble + $mail->send(); + echo "Message sent!"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} diff --git a/lib/vendor/PHPMailer/examples/gmail.phps b/lib/vendor/PHPMailer/examples/gmail.phps new file mode 100644 index 0000000..121ca70 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/gmail.phps @@ -0,0 +1,99 @@ +isSMTP(); + +//Enable SMTP debugging +// 0 = off (for production use) +// 1 = client messages +// 2 = client and server messages +$mail->SMTPDebug = 2; + +//Ask for HTML-friendly debug output +$mail->Debugoutput = 'html'; + +//Set the hostname of the mail server +$mail->Host = 'smtp.gmail.com'; +// use +// $mail->Host = gethostbyname('smtp.gmail.com'); +// if your network does not support SMTP over IPv6 + +//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission +$mail->Port = 587; + +//Set the encryption system to use - ssl (deprecated) or tls +$mail->SMTPSecure = 'tls'; + +//Whether to use SMTP authentication +$mail->SMTPAuth = true; + +//Username to use for SMTP authentication - use full email address for gmail +$mail->Username = "username@gmail.com"; + +//Password to use for SMTP authentication +$mail->Password = "yourpassword"; + +//Set who the message is to be sent from +$mail->setFrom('from@example.com', 'First Last'); + +//Set an alternative reply-to address +$mail->addReplyTo('replyto@example.com', 'First Last'); + +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); + +//Set the subject line +$mail->Subject = 'PHPMailer GMail SMTP test'; + +//Read an HTML message body from an external file, convert referenced images to embedded, +//convert HTML into a basic plain-text alternative body +$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + +//Replace the plain text body with one created manually +$mail->AltBody = 'This is a plain-text message body'; + +//Attach an image file +$mail->addAttachment('images/phpmailer_mini.png'); + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; + //Section 2: IMAP + //Uncomment these to save your message in the 'Sent Mail' folder. + #if (save_mail($mail)) { + # echo "Message saved!"; + #} +} + +//Section 2: IMAP +//IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php +//Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php +//You can use imap_getmailboxes($imapStream, '/imap/ssl') to get a list of available folders or labels, this can +//be useful if you are trying to get this working on a non-Gmail IMAP server. +function save_mail($mail) { + //You can change 'Sent Mail' to any other folder or tag + $path = "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail"; + + //Tell your server to open an IMAP connection using the same username and password as you used for SMTP + $imapStream = imap_open($path, $mail->Username, $mail->Password); + + $result = imap_append($imapStream, $path, $mail->getSentMIMEMessage()); + imap_close($imapStream); + + return $result; +} diff --git a/lib/vendor/PHPMailer/examples/gmail_xoauth.phps b/lib/vendor/PHPMailer/examples/gmail_xoauth.phps new file mode 100644 index 0000000..2aec181 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/gmail_xoauth.phps @@ -0,0 +1,85 @@ +isSMTP(); + +//Enable SMTP debugging +// 0 = off (for production use) +// 1 = client messages +// 2 = client and server messages +$mail->SMTPDebug = 0; + +//Ask for HTML-friendly debug output +$mail->Debugoutput = 'html'; + +//Set the hostname of the mail server +$mail->Host = 'smtp.gmail.com'; + +//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission +$mail->Port = 587; + +//Set the encryption system to use - ssl (deprecated) or tls +$mail->SMTPSecure = 'tls'; + +//Whether to use SMTP authentication +$mail->SMTPAuth = true; + +//Set AuthType +$mail->AuthType = 'XOAUTH2'; + +//User Email to use for SMTP authentication - user who gave consent to our app +$mail->oauthUserEmail = "from@gmail.com"; + +//Obtained From Google Developer Console +$mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com"; + +//Obtained From Google Developer Console +$mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP"; + +//Obtained By running get_oauth_token.php after setting up APP in Google Developer Console. +//Set Redirect URI in Developer Console as [https/http]:////get_oauth_token.php +// eg: http://localhost/phpmail/get_oauth_token.php +$mail->oauthRefreshToken = "RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0"; + +//Set who the message is to be sent from +//For gmail, this generally needs to be the same as the user you logged in as +$mail->setFrom('from@example.com', 'First Last'); + +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); + +//Set the subject line +$mail->Subject = 'PHPMailer GMail SMTP test'; + +//Read an HTML message body from an external file, convert referenced images to embedded, +//convert HTML into a basic plain-text alternative body +$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + +//Replace the plain text body with one created manually +$mail->AltBody = 'This is a plain-text message body'; + +//Attach an image file +$mail->addAttachment('images/phpmailer_mini.png'); + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} diff --git a/lib/vendor/PHPMailer/examples/images/phpmailer.png b/lib/vendor/PHPMailer/examples/images/phpmailer.png new file mode 100644 index 0000000..9bdd83c Binary files /dev/null and b/lib/vendor/PHPMailer/examples/images/phpmailer.png differ diff --git a/lib/vendor/PHPMailer/examples/images/phpmailer_mini.png b/lib/vendor/PHPMailer/examples/images/phpmailer_mini.png new file mode 100644 index 0000000..e6915f4 Binary files /dev/null and b/lib/vendor/PHPMailer/examples/images/phpmailer_mini.png differ diff --git a/lib/vendor/PHPMailer/examples/index.html b/lib/vendor/PHPMailer/examples/index.html new file mode 100644 index 0000000..bbb830d --- /dev/null +++ b/lib/vendor/PHPMailer/examples/index.html @@ -0,0 +1,48 @@ + + + + + PHPMailer Examples + + +

PHPMailer code examplesPHPMailer logo

+

This folder contains a collection of examples of using PHPMailer.

+

About testing email sending

+

When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try:

+
    +
  • FakeSMTP, a Java desktop app with the ability to show an SMTP log and save messages to a folder.
  • +
  • FakeEmail, a Python-based fake mail server with a web interface.
  • +
  • smtp-sink, part of the Postfix mail server, so you probably already have this installed. This is used in the Travis-CI configuration to run PHPMailer's unit tests.
  • +
  • smtp4dev, a dummy SMTP server for Windows.
  • +
  • fakesendmail.sh, part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer.
  • +
  • msglint, not a mail server, the IETF's MIME structure analyser checks the formatting of your messages.
  • +
+
+

Security note

+

Before running these examples you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - please don't do that! Similarly, don't leave your passwords in these files as they will be visible to the world!

+
+

code_generator.phps

+

This script is a simple code generator - fill in the form and hit submit, and it will use when you entered to email you a message, and will also generate PHP code using your settings that you can copy and paste to use in your own apps. If you need to get going quickly, this is probably the best place to start.

+

mail.phps

+

This script is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead.

+

exceptions.phps

+

The same as the mail example, but shows how to use PHPMailer's optional exceptions for error handling.

+

smtp.phps

+

A simple example sending using SMTP with authentication.

+

smtp_no_auth.phps

+

A simple example sending using SMTP without authentication.

+

sendmail.phps

+

A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc.

+

gmail.phps

+

Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that.

+

pop_before_smtp.phps

+

Before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a POP3 protocol client, so it can carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP first.

+

mailing_list.phps

+

This is a somewhat naïve example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message.

+
+

smtp_check.phps

+

This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection.

+
+

Most of these examples use the 'example.com' domain. This domain is reserved by IANA for illustrative purposes, as documented in RFC 2606. Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them!

+ + diff --git a/lib/vendor/PHPMailer/examples/mail.phps b/lib/vendor/PHPMailer/examples/mail.phps new file mode 100644 index 0000000..8e129f4 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/mail.phps @@ -0,0 +1,31 @@ +setFrom('from@example.com', 'First Last'); +//Set an alternative reply-to address +$mail->addReplyTo('replyto@example.com', 'First Last'); +//Set who the message is to be sent to +$mail->addAddress('whoto@example.com', 'John Doe'); +//Set the subject line +$mail->Subject = 'PHPMailer mail() test'; +//Read an HTML message body from an external file, convert referenced images to embedded, +//convert HTML into a basic plain-text alternative body +$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); +//Replace the plain text body with one created manually +$mail->AltBody = 'This is a plain-text message body'; +//Attach an image file +$mail->addAttachment('images/phpmailer_mini.png'); + +//send the message, check for errors +if (!$mail->send()) { + echo "Mailer Error: " . $mail->ErrorInfo; +} else { + echo "Message sent!"; +} diff --git a/lib/vendor/PHPMailer/examples/mailing_list.phps b/lib/vendor/PHPMailer/examples/mailing_list.phps new file mode 100644 index 0000000..8644bb5 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/mailing_list.phps @@ -0,0 +1,59 @@ +isSMTP(); +$mail->Host = 'smtp.example.com'; +$mail->SMTPAuth = true; +$mail->SMTPKeepAlive = true; // SMTP connection will not close after each email sent, reduces SMTP overhead +$mail->Port = 25; +$mail->Username = 'yourname@example.com'; +$mail->Password = 'yourpassword'; +$mail->setFrom('list@example.com', 'List manager'); +$mail->addReplyTo('list@example.com', 'List manager'); + +$mail->Subject = "PHPMailer Simple database mailing list test"; + +//Same body for all messages, so set this before the sending loop +//If you generate a different body for each recipient (e.g. you're using a templating system), +//set it inside the loop +$mail->msgHTML($body); +//msgHTML also sets AltBody, but if you want a custom one, set it afterwards +$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; + +//Connect to the database and select the recipients from your mailing list that have not yet been sent to +//You'll need to alter this to match your database +$mysql = mysqli_connect('localhost', 'username', 'password'); +mysqli_select_db($mysql, 'mydb'); +$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = false'); + +foreach ($result as $row) { //This iterator syntax only works in PHP 5.4+ + $mail->addAddress($row['email'], $row['full_name']); + if (!empty($row['photo'])) { + $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); //Assumes the image data is stored in the DB + } + + if (!$mail->send()) { + echo "Mailer Error (" . str_replace("@", "@", $row["email"]) . ') ' . $mail->ErrorInfo . '
'; + break; //Abandon sending + } else { + echo "Message sent to :" . $row['full_name'] . ' (' . str_replace("@", "@", $row['email']) . ')
'; + //Mark it as sent in the DB + mysqli_query( + $mysql, + "UPDATE mailinglist SET sent = true WHERE email = '" . + mysqli_real_escape_string($mysql, $row['email']) . "'" + ); + } + // Clear all addresses and attachments for next loop + $mail->clearAddresses(); + $mail->clearAttachments(); +} diff --git a/lib/vendor/PHPMailer/examples/pop_before_smtp.phps b/lib/vendor/PHPMailer/examples/pop_before_smtp.phps new file mode 100644 index 0000000..164dfe8 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/pop_before_smtp.phps @@ -0,0 +1,54 @@ +isSMTP(); + //Enable SMTP debugging + // 0 = off (for production use) + // 1 = client messages + // 2 = client and server messages + $mail->SMTPDebug = 2; + //Ask for HTML-friendly debug output + $mail->Debugoutput = 'html'; + //Set the hostname of the mail server + $mail->Host = "mail.example.com"; + //Set the SMTP port number - likely to be 25, 465 or 587 + $mail->Port = 25; + //Whether to use SMTP authentication + $mail->SMTPAuth = false; + //Set who the message is to be sent from + $mail->setFrom('from@example.com', 'First Last'); + //Set an alternative reply-to address + $mail->addReplyTo('replyto@example.com', 'First Last'); + //Set who the message is to be sent to + $mail->addAddress('whoto@example.com', 'John Doe'); + //Set the subject line + $mail->Subject = 'PHPMailer POP-before-SMTP test'; + //Read an HTML message body from an external file, convert referenced images to embedded, + //and convert the HTML into a basic plain-text alternative body + $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); + //Replace the plain text body with one created manually + $mail->AltBody = 'This is a plain-text message body'; + //Attach an image file + $mail->addAttachment('images/phpmailer_mini.png'); + //send the message + //Note that we don't need check the response from this because it will throw an exception if it has trouble + $mail->send(); + echo "Message sent!"; +} catch (phpmailerException $e) { + echo $e->errorMessage(); //Pretty error messages from PHPMailer +} catch (Exception $e) { + echo $e->getMessage(); //Boring error messages from anything else! +} diff --git a/lib/vendor/PHPMailer/examples/scripts/XRegExp.js b/lib/vendor/PHPMailer/examples/scripts/XRegExp.js new file mode 100644 index 0000000..feb6679 --- /dev/null +++ b/lib/vendor/PHPMailer/examples/scripts/XRegExp.js @@ -0,0 +1,664 @@ +// XRegExp 1.5.1 +// (c) 2007-2012 Steven Levithan +// MIT License +// +// Provides an augmented, extensible, cross-browser implementation of regular expressions, +// including support for additional syntax, flags, and methods + +var XRegExp; + +if (XRegExp) { + // Avoid running twice, since that would break references to native globals + throw Error("can't load XRegExp twice in the same frame"); +} + +// Run within an anonymous function to protect variables and avoid new globals +(function (undefined) { + + //--------------------------------- + // Constructor + //--------------------------------- + + // Accepts a pattern and flags; returns a new, extended `RegExp` object. Differs from a native + // regular expression in that additional syntax and flags are supported and cross-browser + // syntax inconsistencies are ameliorated. `XRegExp(/regex/)` clones an existing regex and + // converts to type XRegExp + XRegExp = function (pattern, flags) { + var output = [], + currScope = XRegExp.OUTSIDE_CLASS, + pos = 0, + context, tokenResult, match, chr, regex; + + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) + throw TypeError("can't supply flags when constructing one RegExp from another"); + return clone(pattern); + } + // Tokens become part of the regex construction process, so protect against infinite + // recursion when an XRegExp is constructed within a token handler or trigger + if (isInsideConstructor) + throw Error("can't call the XRegExp constructor within token definition functions"); + + flags = flags || ""; + context = { // `this` object for custom tokens + hasNamedCapture: false, + captureNames: [], + hasFlag: function (flag) {return flags.indexOf(flag) > -1;}, + setFlag: function (flag) {flags += flag;} + }; + + while (pos < pattern.length) { + // Check for custom tokens at the current position + tokenResult = runTokens(pattern, pos, currScope, context); + + if (tokenResult) { + output.push(tokenResult.output); + pos += (tokenResult.match[0].length || 1); + } else { + // Check for native multicharacter metasequences (excluding character classes) at + // the current position + if (match = nativ.exec.call(nativeTokens[currScope], pattern.slice(pos))) { + output.push(match[0]); + pos += match[0].length; + } else { + chr = pattern.charAt(pos); + if (chr === "[") + currScope = XRegExp.INSIDE_CLASS; + else if (chr === "]") + currScope = XRegExp.OUTSIDE_CLASS; + // Advance position one character + output.push(chr); + pos++; + } + } + } + + regex = RegExp(output.join(""), nativ.replace.call(flags, flagClip, "")); + regex._xregexp = { + source: pattern, + captureNames: context.hasNamedCapture ? context.captureNames : null + }; + return regex; + }; + + + //--------------------------------- + // Public properties + //--------------------------------- + + XRegExp.version = "1.5.1"; + + // Token scope bitflags + XRegExp.INSIDE_CLASS = 1; + XRegExp.OUTSIDE_CLASS = 2; + + + //--------------------------------- + // Private variables + //--------------------------------- + + var replacementToken = /\$(?:(\d\d?|[$&`'])|{([$\w]+)})/g, + flagClip = /[^gimy]+|([\s\S])(?=[\s\S]*\1)/g, // Nonnative and duplicate flags + quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, + isInsideConstructor = false, + tokens = [], + // Copy native globals for reference ("native" is an ES3 reserved keyword) + nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups + compliantLastIndexIncrement = function () { + var x = /^/g; + nativ.test.call(x, ""); + return !x.lastIndex; + }(), + hasNativeY = RegExp.prototype.sticky !== undefined, + nativeTokens = {}; + + // `nativeTokens` match native multicharacter metasequences only (including deprecated octals, + // excluding character classes) + nativeTokens[XRegExp.INSIDE_CLASS] = /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/; + nativeTokens[XRegExp.OUTSIDE_CLASS] = /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/; + + + //--------------------------------- + // Public methods + //--------------------------------- + + // Lets you extend or change XRegExp syntax and create custom flags. This is used internally by + // the XRegExp library and can be used to create XRegExp plugins. This function is intended for + // users with advanced knowledge of JavaScript's regular expression syntax and behavior. It can + // be disabled by `XRegExp.freezeTokens` + XRegExp.addToken = function (regex, handler, scope, trigger) { + tokens.push({ + pattern: clone(regex, "g" + (hasNativeY ? "y" : "")), + handler: handler, + scope: scope || XRegExp.OUTSIDE_CLASS, + trigger: trigger || null + }); + }; + + // Accepts a pattern and flags; returns an extended `RegExp` object. If the pattern and flag + // combination has previously been cached, the cached copy is returned; otherwise the newly + // created regex is cached + XRegExp.cache = function (pattern, flags) { + var key = pattern + "/" + (flags || ""); + return XRegExp.cache[key] || (XRegExp.cache[key] = XRegExp(pattern, flags)); + }; + + // Accepts a `RegExp` instance; returns a copy with the `/g` flag set. The copy has a fresh + // `lastIndex` (set to zero). If you want to copy a regex without forcing the `global` + // property, use `XRegExp(regex)`. Do not use `RegExp(regex)` because it will not preserve + // special properties required for named capture + XRegExp.copyAsGlobal = function (regex) { + return clone(regex, "g"); + }; + + // Accepts a string; returns the string with regex metacharacters escaped. The returned string + // can safely be used at any point within a regex to match the provided literal string. Escaped + // characters are [ ] { } ( ) * + ? - . , \ ^ $ | # and whitespace + XRegExp.escape = function (str) { + return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }; + + // Accepts a string to search, regex to search with, position to start the search within the + // string (default: 0), and an optional Boolean indicating whether matches must start at-or- + // after the position or at the specified position only. This function ignores the `lastIndex` + // of the provided regex in its own handling, but updates the property for compatibility + XRegExp.execAt = function (str, regex, pos, anchored) { + var r2 = clone(regex, "g" + ((anchored && hasNativeY) ? "y" : "")), + match; + r2.lastIndex = pos = pos || 0; + match = r2.exec(str); // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (anchored && match && match.index !== pos) + match = null; + if (regex.global) + regex.lastIndex = match ? r2.lastIndex : 0; + return match; + }; + + // Breaks the unrestorable link to XRegExp's private list of tokens, thereby preventing + // syntax and flag changes. Should be run after XRegExp and any plugins are loaded + XRegExp.freezeTokens = function () { + XRegExp.addToken = function () { + throw Error("can't run addToken after freezeTokens"); + }; + }; + + // Accepts any value; returns a Boolean indicating whether the argument is a `RegExp` object. + // Note that this is also `true` for regex literals and regexes created by the `XRegExp` + // constructor. This works correctly for variables created in another frame, when `instanceof` + // and `constructor` checks would fail to work as intended + XRegExp.isRegExp = function (o) { + return Object.prototype.toString.call(o) === "[object RegExp]"; + }; + + // Executes `callback` once per match within `str`. Provides a simpler and cleaner way to + // iterate over regex matches compared to the traditional approaches of subverting + // `String.prototype.replace` or repeatedly calling `exec` within a `while` loop + XRegExp.iterate = function (str, regex, callback, context) { + var r2 = clone(regex, "g"), + i = -1, match; + while (match = r2.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (regex.global) + regex.lastIndex = r2.lastIndex; // Doing this to follow expectations if `lastIndex` is checked within `callback` + callback.call(context, match, ++i, str, regex); + if (r2.lastIndex === match.index) + r2.lastIndex++; + } + if (regex.global) + regex.lastIndex = 0; + }; + + // Accepts a string and an array of regexes; returns the result of using each successive regex + // to search within the matches of the previous regex. The array of regexes can also contain + // objects with `regex` and `backref` properties, in which case the named or numbered back- + // references specified are passed forward to the next regex or returned. E.g.: + // var xregexpImgFileNames = XRegExp.matchChain(html, [ + // {regex: /]+)>/i, backref: 1}, // tag attributes + // {regex: XRegExp('(?ix) \\s src=" (? [^"]+ )'), backref: "src"}, // src attribute values + // {regex: XRegExp("^http://xregexp\\.com(/[^#?]+)", "i"), backref: 1}, // xregexp.com paths + // /[^\/]+$/ // filenames (strip directory paths) + // ]); + XRegExp.matchChain = function (str, chain) { + return function recurseChain (values, level) { + var item = chain[level].regex ? chain[level] : {regex: chain[level]}, + regex = clone(item.regex, "g"), + matches = [], i; + for (i = 0; i < values.length; i++) { + XRegExp.iterate(values[i], regex, function (match) { + matches.push(item.backref ? (match[item.backref] || "") : match[0]); + }); + } + return ((level === chain.length - 1) || !matches.length) ? + matches : recurseChain(matches, level + 1); + }([str], 0); + }; + + + //--------------------------------- + // New RegExp prototype methods + //--------------------------------- + + // Accepts a context object and arguments array; returns the result of calling `exec` with the + // first value in the arguments array. the context is ignored but is accepted for congruity + // with `Function.prototype.apply` + RegExp.prototype.apply = function (context, args) { + return this.exec(args[0]); + }; + + // Accepts a context object and string; returns the result of calling `exec` with the provided + // string. the context is ignored but is accepted for congruity with `Function.prototype.call` + RegExp.prototype.call = function (context, str) { + return this.exec(str); + }; + + + //--------------------------------- + // Overridden native methods + //--------------------------------- + + // Adds named capture support (with backreferences returned as `result.name`), and fixes two + // cross-browser issues per ES3: + // - Captured values for nonparticipating capturing groups should be returned as `undefined`, + // rather than the empty string. + // - `lastIndex` should not be incremented after zero-length matches. + RegExp.prototype.exec = function (str) { + var match, name, r2, origLastIndex; + if (!this.global) + origLastIndex = this.lastIndex; + match = nativ.exec.apply(this, arguments); + if (match) { + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { + r2 = RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call((str + "").slice(match.index), r2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) + match[i] = undefined; + } + }); + } + // Attach named capture properties + if (this._xregexp && this._xregexp.captureNames) { + for (var i = 1; i < match.length; i++) { + name = this._xregexp.captureNames[i - 1]; + if (name) + match[name] = match[i]; + } + } + // Fix browsers that increment `lastIndex` after zero-length matches + if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + } + if (!this.global) + this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + return match; + }; + + // Fix browser bugs in native method + RegExp.prototype.test = function (str) { + // Use the native `exec` to skip some processing overhead, even though the altered + // `exec` would take care of the `lastIndex` fixes + var match, origLastIndex; + if (!this.global) + origLastIndex = this.lastIndex; + match = nativ.exec.call(this, str); + // Fix browsers that increment `lastIndex` after zero-length matches + if (match && !compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) + this.lastIndex--; + if (!this.global) + this.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + return !!match; + }; + + // Adds named capture support and fixes browser bugs in native method + String.prototype.match = function (regex) { + if (!XRegExp.isRegExp(regex)) + regex = RegExp(regex); // Native `RegExp` + if (regex.global) { + var result = nativ.match.apply(this, arguments); + regex.lastIndex = 0; // Fix IE bug + return result; + } + return regex.exec(this); // Run the altered `exec` + }; + + // Adds support for `${n}` tokens for named and numbered backreferences in replacement text, + // and provides named backreferences to replacement functions as `arguments[0].name`. Also + // fixes cross-browser differences in replacement text syntax when performing a replacement + // using a nonregex search value, and the value of replacement regexes' `lastIndex` property + // during replacement iterations. Note that this doesn't support SpiderMonkey's proprietary + // third (`flags`) parameter + String.prototype.replace = function (search, replacement) { + var isRegex = XRegExp.isRegExp(search), + captureNames, result, str, origLastIndex; + + // There are too many combinations of search/replacement types/values and browser bugs that + // preclude passing to native `replace`, so don't try + //if (...) + // return nativ.replace.apply(this, arguments); + + if (isRegex) { + if (search._xregexp) + captureNames = search._xregexp.captureNames; // Array or `null` + if (!search.global) + origLastIndex = search.lastIndex; + } else { + search = search + ""; // Type conversion + } + + if (Object.prototype.toString.call(replacement) === "[object Function]") { + result = nativ.replace.call(this + "", search, function () { + if (captureNames) { + // Change the `arguments[0]` string primitive to a String object which can store properties + arguments[0] = new String(arguments[0]); + // Store named backreferences on `arguments[0]` + for (var i = 0; i < captureNames.length; i++) { + if (captureNames[i]) + arguments[0][captureNames[i]] = arguments[i + 1]; + } + } + // Update `lastIndex` before calling `replacement` (fix browsers) + if (isRegex && search.global) + search.lastIndex = arguments[arguments.length - 2] + arguments[0].length; + return replacement.apply(null, arguments); + }); + } else { + str = this + ""; // Type conversion, so `args[args.length - 1]` will be a string (given nonstring `this`) + result = nativ.replace.call(str, search, function () { + var args = arguments; // Keep this function's `arguments` available through closure + return nativ.replace.call(replacement + "", replacementToken, function ($0, $1, $2) { + // Numbered backreference (without delimiters) or special variable + if ($1) { + switch ($1) { + case "$": return "$"; + case "&": return args[0]; + case "`": return args[args.length - 1].slice(0, args[args.length - 2]); + case "'": return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + // Numbered backreference + default: + // What does "$10" mean? + // - Backreference 10, if 10 or more capturing groups exist + // - Backreference 1 followed by "0", if 1-9 capturing groups exist + // - Otherwise, it's the string "$10" + // Also note: + // - Backreferences cannot be more than two digits (enforced by `replacementToken`) + // - "$01" is equivalent to "$1" if a capturing group exists, otherwise it's the string "$01" + // - There is no "$0" token ("$&" is the entire match) + var literalNumbers = ""; + $1 = +$1; // Type conversion; drop leading zero + if (!$1) // `$1` was "0" or "00" + return $0; + while ($1 > args.length - 3) { + literalNumbers = String.prototype.slice.call($1, -1) + literalNumbers; + $1 = Math.floor($1 / 10); // Drop the last digit + } + return ($1 ? args[$1] || "" : "$") + literalNumbers; + } + // Named backreference or delimited numbered backreference + } else { + // What does "${n}" mean? + // - Backreference to numbered capture n. Two differences from "$n": + // - n can be more than two digits + // - Backreference 0 is allowed, and is the entire match + // - Backreference to named capture n, if it exists and is not a number overridden by numbered capture + // - Otherwise, it's the string "${n}" + var n = +$2; // Type conversion; drop leading zeros + if (n <= args.length - 3) + return args[n]; + n = captureNames ? indexOf(captureNames, $2) : -1; + return n > -1 ? args[n + 1] : $0; + } + }); + }); + } + + if (isRegex) { + if (search.global) + search.lastIndex = 0; // Fix IE, Safari bug (last tested IE 9.0.5, Safari 5.1.2 on Windows) + else + search.lastIndex = origLastIndex; // Fix IE, Opera bug (last tested IE 9.0.5, Opera 11.61 on Windows) + } + + return result; + }; + + // A consistent cross-browser, ES3 compliant `split` + String.prototype.split = function (s /* separator */, limit) { + // If separator `s` is not a regex, use the native `split` + if (!XRegExp.isRegExp(s)) + return nativ.split.apply(this, arguments); + + var str = this + "", // Type conversion + output = [], + lastLastIndex = 0, + match, lastLength; + + // Behavior for `limit`: if it's... + // - `undefined`: No limit + // - `NaN` or zero: Return an empty array + // - A positive number: Use `Math.floor(limit)` + // - A negative number: No limit + // - Other: Type-convert, then use the above rules + if (limit === undefined || +limit < 0) { + limit = Infinity; + } else { + limit = Math.floor(+limit); + if (!limit) + return []; + } + + // This is required if not `s.global`, and it avoids needing to set `s.lastIndex` to zero + // and restore it to its original value when we're done using the regex + s = XRegExp.copyAsGlobal(s); + + while (match = s.exec(str)) { // Run the altered `exec` (required for `lastIndex` fix, etc.) + if (s.lastIndex > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + + if (match.length > 1 && match.index < str.length) + Array.prototype.push.apply(output, match.slice(1)); + + lastLength = match[0].length; + lastLastIndex = s.lastIndex; + + if (output.length >= limit) + break; + } + + if (s.lastIndex === match.index) + s.lastIndex++; + } + + if (lastLastIndex === str.length) { + if (!nativ.test.call(s, "") || lastLength) + output.push(""); + } else { + output.push(str.slice(lastLastIndex)); + } + + return output.length > limit ? output.slice(0, limit) : output; + }; + + + //--------------------------------- + // Private helper functions + //--------------------------------- + + // Supporting function for `XRegExp`, `XRegExp.copyAsGlobal`, etc. Returns a copy of a `RegExp` + // instance with a fresh `lastIndex` (set to zero), preserving properties required for named + // capture. Also allows adding new flags in the process of copying the regex + function clone (regex, additionalFlags) { + if (!XRegExp.isRegExp(regex)) + throw TypeError("type RegExp expected"); + var x = regex._xregexp; + regex = XRegExp(regex.source, getNativeFlags(regex) + (additionalFlags || "")); + if (x) { + regex._xregexp = { + source: x.source, + captureNames: x.captureNames ? x.captureNames.slice(0) : null + }; + } + return regex; + } + + function getNativeFlags (regex) { + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 + (regex.sticky ? "y" : ""); + } + + function runTokens (pattern, index, scope, context) { + var i = tokens.length, + result, match, t; + // Protect against constructing XRegExps within token handler and trigger functions + isInsideConstructor = true; + // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws + try { + while (i--) { // Run in reverse order + t = tokens[i]; + if ((scope & t.scope) && (!t.trigger || t.trigger.call(context))) { + t.pattern.lastIndex = index; + match = t.pattern.exec(pattern); // Running the altered `exec` here allows use of named backreferences, etc. + if (match && match.index === index) { + result = { + output: t.handler.call(context, match, scope), + match: match + }; + break; + } + } + } + } catch (err) { + throw err; + } finally { + isInsideConstructor = false; + } + return result; + } + + function indexOf (array, item, from) { + if (Array.prototype.indexOf) // Use the native array method if available + return array.indexOf(item, from); + for (var i = from || 0; i < array.length; i++) { + if (array[i] === item) + return i; + } + return -1; + } + + + //--------------------------------- + // Built-in tokens + //--------------------------------- + + // Augment XRegExp's regular expression syntax and flags. Note that when adding tokens, the + // third (`scope`) argument defaults to `XRegExp.OUTSIDE_CLASS` + + // Comment pattern: (?# ) + XRegExp.addToken( + /\(\?#[^)]*\)/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + } + ); + + // Capturing group (match the opening parenthesis only). + // Required for support of named capturing groups + XRegExp.addToken( + /\((?!\?)/, + function () { + this.captureNames.push(null); + return "("; + } + ); + + // Named capturing group (match the opening delimiter only): (? + XRegExp.addToken( + /\(\?<([$\w]+)>/, + function (match) { + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return "("; + } + ); + + // Named backreference: \k + XRegExp.addToken( + /\\k<([\w$]+)>/, + function (match) { + var index = indexOf(this.captureNames, match[1]); + // Keep backreferences separate from subsequent literal numbers. Preserve back- + // references to named groups that are undefined at this point as literal strings + return index > -1 ? + "\\" + (index + 1) + (isNaN(match.input.charAt(match.index + match[0].length)) ? "" : "(?:)") : + match[0]; + } + ); + + // Empty character class: [] or [^] + XRegExp.addToken( + /\[\^?]/, + function (match) { + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in Firefox + return match[0] === "[]" ? "\\b\\B" : "[\\s\\S]"; + } + ); + + // Mode modifier at the start of the pattern only, with any combination of flags imsx: (?imsx) + // Does not support x(?i), (?-i), (?i-m), (?i: ), (?i)(?m), etc. + XRegExp.addToken( + /^\(\?([imsx]+)\)/, + function (match) { + this.setFlag(match[1]); + return ""; + } + ); + + // Whitespace and comments, in free-spacing (aka extended) mode only + XRegExp.addToken( + /(?:\s+|#.*)+/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + }, + XRegExp.OUTSIDE_CLASS, + function () {return this.hasFlag("x");} + ); + + // Dot, in dotall (aka singleline) mode only + XRegExp.addToken( + /\./, + function () {return "[\\s\\S]";}, + XRegExp.OUTSIDE_CLASS, + function () {return this.hasFlag("s");} + ); + + + //--------------------------------- + // Backward compatibility + //--------------------------------- + + // Uncomment the following block for compatibility with XRegExp 1.0-1.2: + /* + XRegExp.matchWithinChain = XRegExp.matchChain; + RegExp.prototype.addFlags = function (s) {return clone(this, s);}; + RegExp.prototype.execAll = function (s) {var r = []; XRegExp.iterate(s, this, function (m) {r.push(m);}); return r;}; + RegExp.prototype.forEachExec = function (s, f, c) {return XRegExp.iterate(s, this, f, c);}; + RegExp.prototype.validate = function (s) {var r = RegExp("^(?:" + this.source + ")$(?!\\s)", getNativeFlags(this)); if (this.global) this.lastIndex = 0; return s.search(r) === 0;}; + */ + +})(); + diff --git a/lib/vendor/PHPMailer/examples/scripts/shAutoloader.js b/lib/vendor/PHPMailer/examples/scripts/shAutoloader.js new file mode 100644 index 0000000..9f5942e --- /dev/null +++ b/lib/vendor/PHPMailer/examples/scripts/shAutoloader.js @@ -0,0 +1,122 @@ +(function() { + +var sh = SyntaxHighlighter; + +/** + * Provides functionality to dynamically load only the brushes that a needed to render the current page. + * + * There are two syntaxes that autoload understands. For example: + * + * SyntaxHighlighter.autoloader( + * [ 'applescript', 'Scripts/shBrushAppleScript.js' ], + * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ] + * ); + * + * or a more easily comprehendable one: + * + * SyntaxHighlighter.autoloader( + * 'applescript Scripts/shBrushAppleScript.js', + * 'actionscript3 as3 Scripts/shBrushAS3.js' + * ); + */ +sh.autoloader = function() +{ + var list = arguments, + elements = sh.findElements(), + brushes = {}, + scripts = {}, + all = SyntaxHighlighter.all, + allCalled = false, + allParams = null, + i + ; + + SyntaxHighlighter.all = function(params) + { + allParams = params; + allCalled = true; + }; + + function addBrush(aliases, url) + { + for (var i = 0; i < aliases.length; i++) + brushes[aliases[i]] = url; + }; + + function getAliases(item) + { + return item.pop + ? item + : item.split(/\s+/) + ; + } + + // create table of aliases and script urls + for (i = 0; i < list.length; i++) + { + var aliases = getAliases(list[i]), + url = aliases.pop() + ; + + addBrush(aliases, url); + } + + // dynamically add + + + +
 
+
Child 2
+ + diff --git a/www/kadm/_backup/demo/basic/root.json b/www/kadm/_backup/demo/basic/root.json new file mode 100644 index 0000000..8560404 --- /dev/null +++ b/www/kadm/_backup/demo/basic/root.json @@ -0,0 +1 @@ +[{"id":1,"text":"Root node","children":[{"id":2,"text":"Child node 1"},{"id":3,"text":"Child node 2"}]}] \ No newline at end of file diff --git a/www/kadm/_backup/main.php b/www/kadm/_backup/main.php new file mode 100644 index 0000000..aca93e7 --- /dev/null +++ b/www/kadm/_backup/main.php @@ -0,0 +1,234 @@ + + + + + + + (주)Kuls Admin + + + + + +
+ +
+
+
Dash Board 우성 서비스 : 상단 대쉬보드 / 현위치 / 로그인 / mnb / Info 등등
+
Admin Home > Home
+
+
본문 +





















+





















+





















+





















+





















+





















+





















+
+
+
+ + + + + \ No newline at end of file diff --git a/www/kadm/_backup/test/unit/index.html b/www/kadm/_backup/test/unit/index.html new file mode 100644 index 0000000..3f8ca95 --- /dev/null +++ b/www/kadm/_backup/test/unit/index.html @@ -0,0 +1,16 @@ + + + + + Basic Test Suite + + + + + +
+
this had better work.
+ + + + \ No newline at end of file diff --git a/www/kadm/_backup/test/unit/libs/qunit.css b/www/kadm/_backup/test/unit/libs/qunit.css new file mode 100644 index 0000000..2a6a02b --- /dev/null +++ b/www/kadm/_backup/test/unit/libs/qunit.css @@ -0,0 +1,244 @@ +/** + * QUnit v1.12.0 - A JavaScript Unit Testing Framework + * + * http://qunitjs.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + +/** Font Family and Sizes */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { + font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; +} + +#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } +#qunit-tests { font-size: smaller; } + + +/** Resets */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { + margin: 0; + padding: 0; +} + + +/** Header */ + +#qunit-header { + padding: 0.5em 0 0.5em 1em; + + color: #8699a4; + background-color: #0d3349; + + font-size: 1.5em; + line-height: 1em; + font-weight: normal; + + border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + -webkit-border-top-right-radius: 5px; + -webkit-border-top-left-radius: 5px; +} + +#qunit-header a { + text-decoration: none; + color: #c2ccd1; +} + +#qunit-header a:hover, +#qunit-header a:focus { + color: #fff; +} + +#qunit-testrunner-toolbar label { + display: inline-block; + padding: 0 .5em 0 .1em; +} + +#qunit-banner { + height: 5px; +} + +#qunit-testrunner-toolbar { + padding: 0.5em 0 0.5em 2em; + color: #5E740B; + background-color: #eee; + overflow: hidden; +} + +#qunit-userAgent { + padding: 0.5em 0 0.5em 2.5em; + background-color: #2b81af; + color: #fff; + text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; +} + +#qunit-modulefilter-container { + float: right; +} + +/** Tests: Pass/Fail */ + +#qunit-tests { + list-style-position: inside; +} + +#qunit-tests li { + padding: 0.4em 0.5em 0.4em 2.5em; + border-bottom: 1px solid #fff; + list-style-position: inside; +} + +#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { + display: none; +} + +#qunit-tests li strong { + cursor: pointer; +} + +#qunit-tests li a { + padding: 0.5em; + color: #c2ccd1; + text-decoration: none; +} +#qunit-tests li a:hover, +#qunit-tests li a:focus { + color: #000; +} + +#qunit-tests li .runtime { + float: right; + font-size: smaller; +} + +.qunit-assert-list { + margin-top: 0.5em; + padding: 0.5em; + + background-color: #fff; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.qunit-collapsed { + display: none; +} + +#qunit-tests table { + border-collapse: collapse; + margin-top: .2em; +} + +#qunit-tests th { + text-align: right; + vertical-align: top; + padding: 0 .5em 0 0; +} + +#qunit-tests td { + vertical-align: top; +} + +#qunit-tests pre { + margin: 0; + white-space: pre-wrap; + word-wrap: break-word; +} + +#qunit-tests del { + background-color: #e0f2be; + color: #374e0c; + text-decoration: none; +} + +#qunit-tests ins { + background-color: #ffcaca; + color: #500; + text-decoration: none; +} + +/*** Test Counts */ + +#qunit-tests b.counts { color: black; } +#qunit-tests b.passed { color: #5E740B; } +#qunit-tests b.failed { color: #710909; } + +#qunit-tests li li { + padding: 5px; + background-color: #fff; + border-bottom: none; + list-style-position: inside; +} + +/*** Passing Styles */ + +#qunit-tests li li.pass { + color: #3c510c; + background-color: #fff; + border-left: 10px solid #C6E746; +} + +#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } +#qunit-tests .pass .test-name { color: #366097; } + +#qunit-tests .pass .test-actual, +#qunit-tests .pass .test-expected { color: #999999; } + +#qunit-banner.qunit-pass { background-color: #C6E746; } + +/*** Failing Styles */ + +#qunit-tests li li.fail { + color: #710909; + background-color: #fff; + border-left: 10px solid #EE5757; + white-space: pre; +} + +#qunit-tests > li:last-child { + border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; +} + +#qunit-tests .fail { color: #000000; background-color: #EE5757; } +#qunit-tests .fail .test-name, +#qunit-tests .fail .module-name { color: #000000; } + +#qunit-tests .fail .test-actual { color: #EE5757; } +#qunit-tests .fail .test-expected { color: green; } + +#qunit-banner.qunit-fail { background-color: #EE5757; } + + +/** Result */ + +#qunit-testresult { + padding: 0.5em 0.5em 0.5em 2.5em; + + color: #2b81af; + background-color: #D2E0E6; + + border-bottom: 1px solid white; +} +#qunit-testresult .module-name { + font-weight: bold; +} + +/** Fixture */ + +#qunit-fixture { + position: absolute; + top: -10000px; + left: -10000px; + width: 1000px; + height: 1000px; +} \ No newline at end of file diff --git a/www/kadm/_backup/test/unit/libs/qunit.js b/www/kadm/_backup/test/unit/libs/qunit.js new file mode 100644 index 0000000..ba99f1a --- /dev/null +++ b/www/kadm/_backup/test/unit/libs/qunit.js @@ -0,0 +1,2212 @@ +/** + * QUnit v1.12.0 - A JavaScript Unit Testing Framework + * + * http://qunitjs.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license/ + */ + +(function( window ) { + +var QUnit, + assert, + config, + onErrorFnPrev, + testId = 0, + fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + // Keep a local reference to Date (GH-283) + Date = window.Date, + setTimeout = window.setTimeout, + defined = { + setTimeout: typeof window.setTimeout !== "undefined", + sessionStorage: (function() { + var x = "qunit-test-string"; + try { + sessionStorage.setItem( x, x ); + sessionStorage.removeItem( x ); + return true; + } catch( e ) { + return false; + } + }()) + }, + /** + * Provides a normalized error string, correcting an issue + * with IE 7 (and prior) where Error.prototype.toString is + * not properly implemented + * + * Based on http://es5.github.com/#x15.11.4.4 + * + * @param {String|Error} error + * @return {String} error message + */ + errorString = function( error ) { + var name, message, + errorString = error.toString(); + if ( errorString.substring( 0, 7 ) === "[object" ) { + name = error.name ? error.name.toString() : "Error"; + message = error.message ? error.message.toString() : ""; + if ( name && message ) { + return name + ": " + message; + } else if ( name ) { + return name; + } else if ( message ) { + return message; + } else { + return "Error"; + } + } else { + return errorString; + } + }, + /** + * Makes a clone of an object using only Array or Object as base, + * and copies over the own enumerable properties. + * + * @param {Object} obj + * @return {Object} New object with only the own properties (recursively). + */ + objectValues = function( obj ) { + // Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392. + /*jshint newcap: false */ + var key, val, + vals = QUnit.is( "array", obj ) ? [] : {}; + for ( key in obj ) { + if ( hasOwn.call( obj, key ) ) { + val = obj[key]; + vals[key] = val === Object(val) ? objectValues(val) : val; + } + } + return vals; + }; + +function Test( settings ) { + extend( this, settings ); + this.assertions = []; + this.testNumber = ++Test.count; +} + +Test.count = 0; + +Test.prototype = { + init: function() { + var a, b, li, + tests = id( "qunit-tests" ); + + if ( tests ) { + b = document.createElement( "strong" ); + b.innerHTML = this.nameHtml; + + // `a` initialized at top of scope + a = document.createElement( "a" ); + a.innerHTML = "Rerun"; + a.href = QUnit.url({ testNumber: this.testNumber }); + + li = document.createElement( "li" ); + li.appendChild( b ); + li.appendChild( a ); + li.className = "running"; + li.id = this.id = "qunit-test-output" + testId++; + + tests.appendChild( li ); + } + }, + setup: function() { + if ( + // Emit moduleStart when we're switching from one module to another + this.module !== config.previousModule || + // They could be equal (both undefined) but if the previousModule property doesn't + // yet exist it means this is the first test in a suite that isn't wrapped in a + // module, in which case we'll just emit a moduleStart event for 'undefined'. + // Without this, reporters can get testStart before moduleStart which is a problem. + !hasOwn.call( config, "previousModule" ) + ) { + if ( hasOwn.call( config, "previousModule" ) ) { + runLoggingCallbacks( "moduleDone", QUnit, { + name: config.previousModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + }); + } + config.previousModule = this.module; + config.moduleStats = { all: 0, bad: 0 }; + runLoggingCallbacks( "moduleStart", QUnit, { + name: this.module + }); + } + + config.current = this; + + this.testEnvironment = extend({ + setup: function() {}, + teardown: function() {} + }, this.moduleTestEnvironment ); + + this.started = +new Date(); + runLoggingCallbacks( "testStart", QUnit, { + name: this.testName, + module: this.module + }); + + /*jshint camelcase:false */ + + + /** + * Expose the current test environment. + * + * @deprecated since 1.12.0: Use QUnit.config.current.testEnvironment instead. + */ + QUnit.current_testEnvironment = this.testEnvironment; + + /*jshint camelcase:true */ + + if ( !config.pollution ) { + saveGlobal(); + } + if ( config.notrycatch ) { + this.testEnvironment.setup.call( this.testEnvironment, QUnit.assert ); + return; + } + try { + this.testEnvironment.setup.call( this.testEnvironment, QUnit.assert ); + } catch( e ) { + QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); + } + }, + run: function() { + config.current = this; + + var running = id( "qunit-testresult" ); + + if ( running ) { + running.innerHTML = "Running:
" + this.nameHtml; + } + + if ( this.async ) { + QUnit.stop(); + } + + this.callbackStarted = +new Date(); + + if ( config.notrycatch ) { + this.callback.call( this.testEnvironment, QUnit.assert ); + this.callbackRuntime = +new Date() - this.callbackStarted; + return; + } + + try { + this.callback.call( this.testEnvironment, QUnit.assert ); + this.callbackRuntime = +new Date() - this.callbackStarted; + } catch( e ) { + this.callbackRuntime = +new Date() - this.callbackStarted; + + QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) ); + // else next test will carry the responsibility + saveGlobal(); + + // Restart the tests if they're blocking + if ( config.blocking ) { + QUnit.start(); + } + } + }, + teardown: function() { + config.current = this; + if ( config.notrycatch ) { + if ( typeof this.callbackRuntime === "undefined" ) { + this.callbackRuntime = +new Date() - this.callbackStarted; + } + this.testEnvironment.teardown.call( this.testEnvironment, QUnit.assert ); + return; + } else { + try { + this.testEnvironment.teardown.call( this.testEnvironment, QUnit.assert ); + } catch( e ) { + QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); + } + } + checkPollution(); + }, + finish: function() { + config.current = this; + if ( config.requireExpects && this.expected === null ) { + QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); + } else if ( this.expected !== null && this.expected !== this.assertions.length ) { + QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); + } else if ( this.expected === null && !this.assertions.length ) { + QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); + } + + var i, assertion, a, b, time, li, ol, + test = this, + good = 0, + bad = 0, + tests = id( "qunit-tests" ); + + this.runtime = +new Date() - this.started; + config.stats.all += this.assertions.length; + config.moduleStats.all += this.assertions.length; + + if ( tests ) { + ol = document.createElement( "ol" ); + ol.className = "qunit-assert-list"; + + for ( i = 0; i < this.assertions.length; i++ ) { + assertion = this.assertions[i]; + + li = document.createElement( "li" ); + li.className = assertion.result ? "pass" : "fail"; + li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); + ol.appendChild( li ); + + if ( assertion.result ) { + good++; + } else { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + + // store result when possible + if ( QUnit.config.reorder && defined.sessionStorage ) { + if ( bad ) { + sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); + } else { + sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); + } + } + + if ( bad === 0 ) { + addClass( ol, "qunit-collapsed" ); + } + + // `b` initialized at top of scope + b = document.createElement( "strong" ); + b.innerHTML = this.nameHtml + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; + + addEvent(b, "click", function() { + var next = b.parentNode.lastChild, + collapsed = hasClass( next, "qunit-collapsed" ); + ( collapsed ? removeClass : addClass )( next, "qunit-collapsed" ); + }); + + addEvent(b, "dblclick", function( e ) { + var target = e && e.target ? e.target : window.event.srcElement; + if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { + target = target.parentNode; + } + if ( window.location && target.nodeName.toLowerCase() === "strong" ) { + window.location = QUnit.url({ testNumber: test.testNumber }); + } + }); + + // `time` initialized at top of scope + time = document.createElement( "span" ); + time.className = "runtime"; + time.innerHTML = this.runtime + " ms"; + + // `li` initialized at top of scope + li = id( this.id ); + li.className = bad ? "fail" : "pass"; + li.removeChild( li.firstChild ); + a = li.firstChild; + li.appendChild( b ); + li.appendChild( a ); + li.appendChild( time ); + li.appendChild( ol ); + + } else { + for ( i = 0; i < this.assertions.length; i++ ) { + if ( !this.assertions[i].result ) { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + } + + runLoggingCallbacks( "testDone", QUnit, { + name: this.testName, + module: this.module, + failed: bad, + passed: this.assertions.length - bad, + total: this.assertions.length, + duration: this.runtime + }); + + QUnit.reset(); + + config.current = undefined; + }, + + queue: function() { + var bad, + test = this; + + synchronize(function() { + test.init(); + }); + function run() { + // each of these can by async + synchronize(function() { + test.setup(); + }); + synchronize(function() { + test.run(); + }); + synchronize(function() { + test.teardown(); + }); + synchronize(function() { + test.finish(); + }); + } + + // `bad` initialized at top of scope + // defer when previous test run passed, if storage is available + bad = QUnit.config.reorder && defined.sessionStorage && + +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); + + if ( bad ) { + run(); + } else { + synchronize( run, true ); + } + } +}; + +// Root QUnit object. +// `QUnit` initialized at top of scope +QUnit = { + + // call on start of module test to prepend name to all tests + module: function( name, testEnvironment ) { + config.currentModule = name; + config.currentModuleTestEnvironment = testEnvironment; + config.modules[name] = true; + }, + + asyncTest: function( testName, expected, callback ) { + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + QUnit.test( testName, expected, callback, true ); + }, + + test: function( testName, expected, callback, async ) { + var test, + nameHtml = "" + escapeText( testName ) + ""; + + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + if ( config.currentModule ) { + nameHtml = "" + escapeText( config.currentModule ) + ": " + nameHtml; + } + + test = new Test({ + nameHtml: nameHtml, + testName: testName, + expected: expected, + async: async, + callback: callback, + module: config.currentModule, + moduleTestEnvironment: config.currentModuleTestEnvironment, + stack: sourceFromStacktrace( 2 ) + }); + + if ( !validTest( test ) ) { + return; + } + + test.queue(); + }, + + // Specify the number of expected assertions to guarantee that failed test (no assertions are run at all) don't slip through. + expect: function( asserts ) { + if (arguments.length === 1) { + config.current.expected = asserts; + } else { + return config.current.expected; + } + }, + + start: function( count ) { + // QUnit hasn't been initialized yet. + // Note: RequireJS (et al) may delay onLoad + if ( config.semaphore === undefined ) { + QUnit.begin(function() { + // This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first + setTimeout(function() { + QUnit.start( count ); + }); + }); + return; + } + + config.semaphore -= count || 1; + // don't start until equal number of stop-calls + if ( config.semaphore > 0 ) { + return; + } + // ignore if start is called more often then stop + if ( config.semaphore < 0 ) { + config.semaphore = 0; + QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) ); + return; + } + // A slight delay, to avoid any current callbacks + if ( defined.setTimeout ) { + setTimeout(function() { + if ( config.semaphore > 0 ) { + return; + } + if ( config.timeout ) { + clearTimeout( config.timeout ); + } + + config.blocking = false; + process( true ); + }, 13); + } else { + config.blocking = false; + process( true ); + } + }, + + stop: function( count ) { + config.semaphore += count || 1; + config.blocking = true; + + if ( config.testTimeout && defined.setTimeout ) { + clearTimeout( config.timeout ); + config.timeout = setTimeout(function() { + QUnit.ok( false, "Test timed out" ); + config.semaphore = 1; + QUnit.start(); + }, config.testTimeout ); + } + } +}; + +// `assert` initialized at top of scope +// Assert helpers +// All of these must either call QUnit.push() or manually do: +// - runLoggingCallbacks( "log", .. ); +// - config.current.assertions.push({ .. }); +// We attach it to the QUnit object *after* we expose the public API, +// otherwise `assert` will become a global variable in browsers (#341). +assert = { + /** + * Asserts rough true-ish result. + * @name ok + * @function + * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); + */ + ok: function( result, msg ) { + if ( !config.current ) { + throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); + } + result = !!result; + msg = msg || (result ? "okay" : "failed" ); + + var source, + details = { + module: config.current.module, + name: config.current.testName, + result: result, + message: msg + }; + + msg = "" + escapeText( msg ) + ""; + + if ( !result ) { + source = sourceFromStacktrace( 2 ); + if ( source ) { + details.source = source; + msg += "
Source:
" + escapeText( source ) + "
"; + } + } + runLoggingCallbacks( "log", QUnit, details ); + config.current.assertions.push({ + result: result, + message: msg + }); + }, + + /** + * Assert that the first two arguments are equal, with an optional message. + * Prints out both actual and expected values. + * @name equal + * @function + * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); + */ + equal: function( actual, expected, message ) { + /*jshint eqeqeq:false */ + QUnit.push( expected == actual, actual, expected, message ); + }, + + /** + * @name notEqual + * @function + */ + notEqual: function( actual, expected, message ) { + /*jshint eqeqeq:false */ + QUnit.push( expected != actual, actual, expected, message ); + }, + + /** + * @name propEqual + * @function + */ + propEqual: function( actual, expected, message ) { + actual = objectValues(actual); + expected = objectValues(expected); + QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name notPropEqual + * @function + */ + notPropEqual: function( actual, expected, message ) { + actual = objectValues(actual); + expected = objectValues(expected); + QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name deepEqual + * @function + */ + deepEqual: function( actual, expected, message ) { + QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name notDeepEqual + * @function + */ + notDeepEqual: function( actual, expected, message ) { + QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name strictEqual + * @function + */ + strictEqual: function( actual, expected, message ) { + QUnit.push( expected === actual, actual, expected, message ); + }, + + /** + * @name notStrictEqual + * @function + */ + notStrictEqual: function( actual, expected, message ) { + QUnit.push( expected !== actual, actual, expected, message ); + }, + + "throws": function( block, expected, message ) { + var actual, + expectedOutput = expected, + ok = false; + + // 'expected' is optional + if ( typeof expected === "string" ) { + message = expected; + expected = null; + } + + config.current.ignoreGlobalErrors = true; + try { + block.call( config.current.testEnvironment ); + } catch (e) { + actual = e; + } + config.current.ignoreGlobalErrors = false; + + if ( actual ) { + // we don't want to validate thrown error + if ( !expected ) { + ok = true; + expectedOutput = null; + // expected is a regexp + } else if ( QUnit.objectType( expected ) === "regexp" ) { + ok = expected.test( errorString( actual ) ); + // expected is a constructor + } else if ( actual instanceof expected ) { + ok = true; + // expected is a validation function which returns true is validation passed + } else if ( expected.call( {}, actual ) === true ) { + expectedOutput = null; + ok = true; + } + + QUnit.push( ok, actual, expectedOutput, message ); + } else { + QUnit.pushFailure( message, null, "No exception was thrown." ); + } + } +}; + +/** + * @deprecated since 1.8.0 + * Kept assertion helpers in root for backwards compatibility. + */ +extend( QUnit, assert ); + +/** + * @deprecated since 1.9.0 + * Kept root "raises()" for backwards compatibility. + * (Note that we don't introduce assert.raises). + */ +QUnit.raises = assert[ "throws" ]; + +/** + * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 + * Kept to avoid TypeErrors for undefined methods. + */ +QUnit.equals = function() { + QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); +}; +QUnit.same = function() { + QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); +}; + +// We want access to the constructor's prototype +(function() { + function F() {} + F.prototype = QUnit; + QUnit = new F(); + // Make F QUnit's constructor so that we can add to the prototype later + QUnit.constructor = F; +}()); + +/** + * Config object: Maintain internal state + * Later exposed as QUnit.config + * `config` initialized at top of scope + */ +config = { + // The queue of tests to run + queue: [], + + // block until document ready + blocking: true, + + // when enabled, show only failing tests + // gets persisted through sessionStorage and can be changed in UI via checkbox + hidepassed: false, + + // by default, run previously failed tests first + // very useful in combination with "Hide passed tests" checked + reorder: true, + + // by default, modify document.title when suite is done + altertitle: true, + + // when enabled, all tests must call expect() + requireExpects: false, + + // add checkboxes that are persisted in the query-string + // when enabled, the id is set to `true` as a `QUnit.config` property + urlConfig: [ + { + id: "noglobals", + label: "Check for Globals", + tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." + }, + { + id: "notrycatch", + label: "No try-catch", + tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." + } + ], + + // Set of all modules. + modules: {}, + + // logging callback queues + begin: [], + done: [], + log: [], + testStart: [], + testDone: [], + moduleStart: [], + moduleDone: [] +}; + +// Export global variables, unless an 'exports' object exists, +// in that case we assume we're in CommonJS (dealt with on the bottom of the script) +if ( typeof exports === "undefined" ) { + extend( window, QUnit.constructor.prototype ); + + // Expose QUnit object + window.QUnit = QUnit; +} + +// Initialize more QUnit.config and QUnit.urlParams +(function() { + var i, + location = window.location || { search: "", protocol: "file:" }, + params = location.search.slice( 1 ).split( "&" ), + length = params.length, + urlParams = {}, + current; + + if ( params[ 0 ] ) { + for ( i = 0; i < length; i++ ) { + current = params[ i ].split( "=" ); + current[ 0 ] = decodeURIComponent( current[ 0 ] ); + // allow just a key to turn on a flag, e.g., test.html?noglobals + current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; + urlParams[ current[ 0 ] ] = current[ 1 ]; + } + } + + QUnit.urlParams = urlParams; + + // String search anywhere in moduleName+testName + config.filter = urlParams.filter; + + // Exact match of the module name + config.module = urlParams.module; + + config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = location.protocol === "file:"; +}()); + +// Extend QUnit object, +// these after set here because they should not be exposed as global functions +extend( QUnit, { + assert: assert, + + config: config, + + // Initialize the configuration options + init: function() { + extend( config, { + stats: { all: 0, bad: 0 }, + moduleStats: { all: 0, bad: 0 }, + started: +new Date(), + updateRate: 1000, + blocking: false, + autostart: true, + autorun: false, + filter: "", + queue: [], + semaphore: 1 + }); + + var tests, banner, result, + qunit = id( "qunit" ); + + if ( qunit ) { + qunit.innerHTML = + "

" + escapeText( document.title ) + "

" + + "

" + + "
" + + "

" + + "
    "; + } + + tests = id( "qunit-tests" ); + banner = id( "qunit-banner" ); + result = id( "qunit-testresult" ); + + if ( tests ) { + tests.innerHTML = ""; + } + + if ( banner ) { + banner.className = ""; + } + + if ( result ) { + result.parentNode.removeChild( result ); + } + + if ( tests ) { + result = document.createElement( "p" ); + result.id = "qunit-testresult"; + result.className = "result"; + tests.parentNode.insertBefore( result, tests ); + result.innerHTML = "Running...
     "; + } + }, + + // Resets the test setup. Useful for tests that modify the DOM. + /* + DEPRECATED: Use multiple tests instead of resetting inside a test. + Use testStart or testDone for custom cleanup. + This method will throw an error in 2.0, and will be removed in 2.1 + */ + reset: function() { + var fixture = id( "qunit-fixture" ); + if ( fixture ) { + fixture.innerHTML = config.fixture; + } + }, + + // Trigger an event on an element. + // @example triggerEvent( document.body, "click" ); + triggerEvent: function( elem, type, event ) { + if ( document.createEvent ) { + event = document.createEvent( "MouseEvents" ); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + + elem.dispatchEvent( event ); + } else if ( elem.fireEvent ) { + elem.fireEvent( "on" + type ); + } + }, + + // Safe object type checking + is: function( type, obj ) { + return QUnit.objectType( obj ) === type; + }, + + objectType: function( obj ) { + if ( typeof obj === "undefined" ) { + return "undefined"; + // consider: typeof null === object + } + if ( obj === null ) { + return "null"; + } + + var match = toString.call( obj ).match(/^\[object\s(.*)\]$/), + type = match && match[1] || ""; + + switch ( type ) { + case "Number": + if ( isNaN(obj) ) { + return "nan"; + } + return "number"; + case "String": + case "Boolean": + case "Array": + case "Date": + case "RegExp": + case "Function": + return type.toLowerCase(); + } + if ( typeof obj === "object" ) { + return "object"; + } + return undefined; + }, + + push: function( result, actual, expected, message ) { + if ( !config.current ) { + throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); + } + + var output, source, + details = { + module: config.current.module, + name: config.current.testName, + result: result, + message: message, + actual: actual, + expected: expected + }; + + message = escapeText( message ) || ( result ? "okay" : "failed" ); + message = "" + message + ""; + output = message; + + if ( !result ) { + expected = escapeText( QUnit.jsDump.parse(expected) ); + actual = escapeText( QUnit.jsDump.parse(actual) ); + output += ""; + + if ( actual !== expected ) { + output += ""; + output += ""; + } + + source = sourceFromStacktrace(); + + if ( source ) { + details.source = source; + output += ""; + } + + output += "
    Expected:
    " + expected + "
    Result:
    " + actual + "
    Diff:
    " + QUnit.diff( expected, actual ) + "
    Source:
    " + escapeText( source ) + "
    "; + } + + runLoggingCallbacks( "log", QUnit, details ); + + config.current.assertions.push({ + result: !!result, + message: output + }); + }, + + pushFailure: function( message, source, actual ) { + if ( !config.current ) { + throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); + } + + var output, + details = { + module: config.current.module, + name: config.current.testName, + result: false, + message: message + }; + + message = escapeText( message ) || "error"; + message = "" + message + ""; + output = message; + + output += ""; + + if ( actual ) { + output += ""; + } + + if ( source ) { + details.source = source; + output += ""; + } + + output += "
    Result:
    " + escapeText( actual ) + "
    Source:
    " + escapeText( source ) + "
    "; + + runLoggingCallbacks( "log", QUnit, details ); + + config.current.assertions.push({ + result: false, + message: output + }); + }, + + url: function( params ) { + params = extend( extend( {}, QUnit.urlParams ), params ); + var key, + querystring = "?"; + + for ( key in params ) { + if ( hasOwn.call( params, key ) ) { + querystring += encodeURIComponent( key ) + "=" + + encodeURIComponent( params[ key ] ) + "&"; + } + } + return window.location.protocol + "//" + window.location.host + + window.location.pathname + querystring.slice( 0, -1 ); + }, + + extend: extend, + id: id, + addEvent: addEvent, + addClass: addClass, + hasClass: hasClass, + removeClass: removeClass + // load, equiv, jsDump, diff: Attached later +}); + +/** + * @deprecated: Created for backwards compatibility with test runner that set the hook function + * into QUnit.{hook}, instead of invoking it and passing the hook function. + * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. + * Doing this allows us to tell if the following methods have been overwritten on the actual + * QUnit object. + */ +extend( QUnit.constructor.prototype, { + + // Logging callbacks; all receive a single argument with the listed properties + // run test/logs.html for any related changes + begin: registerLoggingCallback( "begin" ), + + // done: { failed, passed, total, runtime } + done: registerLoggingCallback( "done" ), + + // log: { result, actual, expected, message } + log: registerLoggingCallback( "log" ), + + // testStart: { name } + testStart: registerLoggingCallback( "testStart" ), + + // testDone: { name, failed, passed, total, duration } + testDone: registerLoggingCallback( "testDone" ), + + // moduleStart: { name } + moduleStart: registerLoggingCallback( "moduleStart" ), + + // moduleDone: { name, failed, passed, total } + moduleDone: registerLoggingCallback( "moduleDone" ) +}); + +if ( typeof document === "undefined" || document.readyState === "complete" ) { + config.autorun = true; +} + +QUnit.load = function() { + runLoggingCallbacks( "begin", QUnit, {} ); + + // Initialize the config, saving the execution queue + var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, + urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter, + numModules = 0, + moduleNames = [], + moduleFilterHtml = "", + urlConfigHtml = "", + oldconfig = extend( {}, config ); + + QUnit.init(); + extend(config, oldconfig); + + config.blocking = false; + + len = config.urlConfig.length; + + for ( i = 0; i < len; i++ ) { + val = config.urlConfig[i]; + if ( typeof val === "string" ) { + val = { + id: val, + label: val, + tooltip: "[no tooltip available]" + }; + } + config[ val.id ] = QUnit.urlParams[ val.id ]; + urlConfigHtml += ""; + } + for ( i in config.modules ) { + if ( config.modules.hasOwnProperty( i ) ) { + moduleNames.push(i); + } + } + numModules = moduleNames.length; + moduleNames.sort( function( a, b ) { + return a.localeCompare( b ); + }); + moduleFilterHtml += ""; + + // `userAgent` initialized at top of scope + userAgent = id( "qunit-userAgent" ); + if ( userAgent ) { + userAgent.innerHTML = navigator.userAgent; + } + + // `banner` initialized at top of scope + banner = id( "qunit-header" ); + if ( banner ) { + banner.innerHTML = "" + banner.innerHTML + " "; + } + + // `toolbar` initialized at top of scope + toolbar = id( "qunit-testrunner-toolbar" ); + if ( toolbar ) { + // `filter` initialized at top of scope + filter = document.createElement( "input" ); + filter.type = "checkbox"; + filter.id = "qunit-filter-pass"; + + addEvent( filter, "click", function() { + var tmp, + ol = document.getElementById( "qunit-tests" ); + + if ( filter.checked ) { + ol.className = ol.className + " hidepass"; + } else { + tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; + ol.className = tmp.replace( / hidepass /, " " ); + } + if ( defined.sessionStorage ) { + if (filter.checked) { + sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); + } else { + sessionStorage.removeItem( "qunit-filter-passed-tests" ); + } + } + }); + + if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { + filter.checked = true; + // `ol` initialized at top of scope + ol = document.getElementById( "qunit-tests" ); + ol.className = ol.className + " hidepass"; + } + toolbar.appendChild( filter ); + + // `label` initialized at top of scope + label = document.createElement( "label" ); + label.setAttribute( "for", "qunit-filter-pass" ); + label.setAttribute( "title", "Only show tests and assertions that fail. Stored in sessionStorage." ); + label.innerHTML = "Hide passed tests"; + toolbar.appendChild( label ); + + urlConfigCheckboxesContainer = document.createElement("span"); + urlConfigCheckboxesContainer.innerHTML = urlConfigHtml; + urlConfigCheckboxes = urlConfigCheckboxesContainer.getElementsByTagName("input"); + // For oldIE support: + // * Add handlers to the individual elements instead of the container + // * Use "click" instead of "change" + // * Fallback from event.target to event.srcElement + addEvents( urlConfigCheckboxes, "click", function( event ) { + var params = {}, + target = event.target || event.srcElement; + params[ target.name ] = target.checked ? true : undefined; + window.location = QUnit.url( params ); + }); + toolbar.appendChild( urlConfigCheckboxesContainer ); + + if (numModules > 1) { + moduleFilter = document.createElement( "span" ); + moduleFilter.setAttribute( "id", "qunit-modulefilter-container" ); + moduleFilter.innerHTML = moduleFilterHtml; + addEvent( moduleFilter.lastChild, "change", function() { + var selectBox = moduleFilter.getElementsByTagName("select")[0], + selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); + + window.location = QUnit.url({ + module: ( selectedModule === "" ) ? undefined : selectedModule, + // Remove any existing filters + filter: undefined, + testNumber: undefined + }); + }); + toolbar.appendChild(moduleFilter); + } + } + + // `main` initialized at top of scope + main = id( "qunit-fixture" ); + if ( main ) { + config.fixture = main.innerHTML; + } + + if ( config.autostart ) { + QUnit.start(); + } +}; + +addEvent( window, "load", QUnit.load ); + +// `onErrorFnPrev` initialized at top of scope +// Preserve other handlers +onErrorFnPrev = window.onerror; + +// Cover uncaught exceptions +// Returning true will suppress the default browser handler, +// returning false will let it run. +window.onerror = function ( error, filePath, linerNr ) { + var ret = false; + if ( onErrorFnPrev ) { + ret = onErrorFnPrev( error, filePath, linerNr ); + } + + // Treat return value as window.onerror itself does, + // Only do our handling if not suppressed. + if ( ret !== true ) { + if ( QUnit.config.current ) { + if ( QUnit.config.current.ignoreGlobalErrors ) { + return true; + } + QUnit.pushFailure( error, filePath + ":" + linerNr ); + } else { + QUnit.test( "global failure", extend( function() { + QUnit.pushFailure( error, filePath + ":" + linerNr ); + }, { validTest: validTest } ) ); + } + return false; + } + + return ret; +}; + +function done() { + config.autorun = true; + + // Log the last module results + if ( config.currentModule ) { + runLoggingCallbacks( "moduleDone", QUnit, { + name: config.currentModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + }); + } + delete config.previousModule; + + var i, key, + banner = id( "qunit-banner" ), + tests = id( "qunit-tests" ), + runtime = +new Date() - config.started, + passed = config.stats.all - config.stats.bad, + html = [ + "Tests completed in ", + runtime, + " milliseconds.
    ", + "", + passed, + " assertions of ", + config.stats.all, + " passed, ", + config.stats.bad, + " failed." + ].join( "" ); + + if ( banner ) { + banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); + } + + if ( tests ) { + id( "qunit-testresult" ).innerHTML = html; + } + + if ( config.altertitle && typeof document !== "undefined" && document.title ) { + // show ✖ for good, ✔ for bad suite result in title + // use escape sequences in case file gets loaded with non-utf-8-charset + document.title = [ + ( config.stats.bad ? "\u2716" : "\u2714" ), + document.title.replace( /^[\u2714\u2716] /i, "" ) + ].join( " " ); + } + + // clear own sessionStorage items if all tests passed + if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { + // `key` & `i` initialized at top of scope + for ( i = 0; i < sessionStorage.length; i++ ) { + key = sessionStorage.key( i++ ); + if ( key.indexOf( "qunit-test-" ) === 0 ) { + sessionStorage.removeItem( key ); + } + } + } + + // scroll back to top to show results + if ( window.scrollTo ) { + window.scrollTo(0, 0); + } + + runLoggingCallbacks( "done", QUnit, { + failed: config.stats.bad, + passed: passed, + total: config.stats.all, + runtime: runtime + }); +} + +/** @return Boolean: true if this test should be ran */ +function validTest( test ) { + var include, + filter = config.filter && config.filter.toLowerCase(), + module = config.module && config.module.toLowerCase(), + fullName = (test.module + ": " + test.testName).toLowerCase(); + + // Internally-generated tests are always valid + if ( test.callback && test.callback.validTest === validTest ) { + delete test.callback.validTest; + return true; + } + + if ( config.testNumber ) { + return test.testNumber === config.testNumber; + } + + if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { + return false; + } + + if ( !filter ) { + return true; + } + + include = filter.charAt( 0 ) !== "!"; + if ( !include ) { + filter = filter.slice( 1 ); + } + + // If the filter matches, we need to honour include + if ( fullName.indexOf( filter ) !== -1 ) { + return include; + } + + // Otherwise, do the opposite + return !include; +} + +// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) +// Later Safari and IE10 are supposed to support error.stack as well +// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack +function extractStacktrace( e, offset ) { + offset = offset === undefined ? 3 : offset; + + var stack, include, i; + + if ( e.stacktrace ) { + // Opera + return e.stacktrace.split( "\n" )[ offset + 3 ]; + } else if ( e.stack ) { + // Firefox, Chrome + stack = e.stack.split( "\n" ); + if (/^error$/i.test( stack[0] ) ) { + stack.shift(); + } + if ( fileName ) { + include = []; + for ( i = offset; i < stack.length; i++ ) { + if ( stack[ i ].indexOf( fileName ) !== -1 ) { + break; + } + include.push( stack[ i ] ); + } + if ( include.length ) { + return include.join( "\n" ); + } + } + return stack[ offset ]; + } else if ( e.sourceURL ) { + // Safari, PhantomJS + // hopefully one day Safari provides actual stacktraces + // exclude useless self-reference for generated Error objects + if ( /qunit.js$/.test( e.sourceURL ) ) { + return; + } + // for actual exceptions, this is useful + return e.sourceURL + ":" + e.line; + } +} +function sourceFromStacktrace( offset ) { + try { + throw new Error(); + } catch ( e ) { + return extractStacktrace( e, offset ); + } +} + +/** + * Escape text for attribute or text content. + */ +function escapeText( s ) { + if ( !s ) { + return ""; + } + s = s + ""; + // Both single quotes and double quotes (for attributes) + return s.replace( /['"<>&]/g, function( s ) { + switch( s ) { + case "'": + return "'"; + case "\"": + return """; + case "<": + return "<"; + case ">": + return ">"; + case "&": + return "&"; + } + }); +} + +function synchronize( callback, last ) { + config.queue.push( callback ); + + if ( config.autorun && !config.blocking ) { + process( last ); + } +} + +function process( last ) { + function next() { + process( last ); + } + var start = new Date().getTime(); + config.depth = config.depth ? config.depth + 1 : 1; + + while ( config.queue.length && !config.blocking ) { + if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { + config.queue.shift()(); + } else { + setTimeout( next, 13 ); + break; + } + } + config.depth--; + if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { + done(); + } +} + +function saveGlobal() { + config.pollution = []; + + if ( config.noglobals ) { + for ( var key in window ) { + if ( hasOwn.call( window, key ) ) { + // in Opera sometimes DOM element ids show up here, ignore them + if ( /^qunit-test-output/.test( key ) ) { + continue; + } + config.pollution.push( key ); + } + } + } +} + +function checkPollution() { + var newGlobals, + deletedGlobals, + old = config.pollution; + + saveGlobal(); + + newGlobals = diff( config.pollution, old ); + if ( newGlobals.length > 0 ) { + QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); + } + + deletedGlobals = diff( old, config.pollution ); + if ( deletedGlobals.length > 0 ) { + QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); + } +} + +// returns a new Array with the elements that are in a but not in b +function diff( a, b ) { + var i, j, + result = a.slice(); + + for ( i = 0; i < result.length; i++ ) { + for ( j = 0; j < b.length; j++ ) { + if ( result[i] === b[j] ) { + result.splice( i, 1 ); + i--; + break; + } + } + } + return result; +} + +function extend( a, b ) { + for ( var prop in b ) { + if ( hasOwn.call( b, prop ) ) { + // Avoid "Member not found" error in IE8 caused by messing with window.constructor + if ( !( prop === "constructor" && a === window ) ) { + if ( b[ prop ] === undefined ) { + delete a[ prop ]; + } else { + a[ prop ] = b[ prop ]; + } + } + } + } + + return a; +} + +/** + * @param {HTMLElement} elem + * @param {string} type + * @param {Function} fn + */ +function addEvent( elem, type, fn ) { + // Standards-based browsers + if ( elem.addEventListener ) { + elem.addEventListener( type, fn, false ); + // IE + } else { + elem.attachEvent( "on" + type, fn ); + } +} + +/** + * @param {Array|NodeList} elems + * @param {string} type + * @param {Function} fn + */ +function addEvents( elems, type, fn ) { + var i = elems.length; + while ( i-- ) { + addEvent( elems[i], type, fn ); + } +} + +function hasClass( elem, name ) { + return (" " + elem.className + " ").indexOf(" " + name + " ") > -1; +} + +function addClass( elem, name ) { + if ( !hasClass( elem, name ) ) { + elem.className += (elem.className ? " " : "") + name; + } +} + +function removeClass( elem, name ) { + var set = " " + elem.className + " "; + // Class name may appear multiple times + while ( set.indexOf(" " + name + " ") > -1 ) { + set = set.replace(" " + name + " " , " "); + } + // If possible, trim it for prettiness, but not necessarily + elem.className = typeof set.trim === "function" ? set.trim() : set.replace(/^\s+|\s+$/g, ""); +} + +function id( name ) { + return !!( typeof document !== "undefined" && document && document.getElementById ) && + document.getElementById( name ); +} + +function registerLoggingCallback( key ) { + return function( callback ) { + config[key].push( callback ); + }; +} + +// Supports deprecated method of completely overwriting logging callbacks +function runLoggingCallbacks( key, scope, args ) { + var i, callbacks; + if ( QUnit.hasOwnProperty( key ) ) { + QUnit[ key ].call(scope, args ); + } else { + callbacks = config[ key ]; + for ( i = 0; i < callbacks.length; i++ ) { + callbacks[ i ].call( scope, args ); + } + } +} + +// Test for equality any JavaScript type. +// Author: Philippe Rathé +QUnit.equiv = (function() { + + // Call the o related callback with the given arguments. + function bindCallbacks( o, callbacks, args ) { + var prop = QUnit.objectType( o ); + if ( prop ) { + if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { + return callbacks[ prop ].apply( callbacks, args ); + } else { + return callbacks[ prop ]; // or undefined + } + } + } + + // the real equiv function + var innerEquiv, + // stack to decide between skip/abort functions + callers = [], + // stack to avoiding loops from circular referencing + parents = [], + parentsB = [], + + getProto = Object.getPrototypeOf || function ( obj ) { + /*jshint camelcase:false */ + return obj.__proto__; + }, + callbacks = (function () { + + // for string, boolean, number and null + function useStrictEquality( b, a ) { + /*jshint eqeqeq:false */ + if ( b instanceof a.constructor || a instanceof b.constructor ) { + // to catch short annotation VS 'new' annotation of a + // declaration + // e.g. var i = 1; + // var j = new Number(1); + return a == b; + } else { + return a === b; + } + } + + return { + "string": useStrictEquality, + "boolean": useStrictEquality, + "number": useStrictEquality, + "null": useStrictEquality, + "undefined": useStrictEquality, + + "nan": function( b ) { + return isNaN( b ); + }, + + "date": function( b, a ) { + return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); + }, + + "regexp": function( b, a ) { + return QUnit.objectType( b ) === "regexp" && + // the regex itself + a.source === b.source && + // and its modifiers + a.global === b.global && + // (gmi) ... + a.ignoreCase === b.ignoreCase && + a.multiline === b.multiline && + a.sticky === b.sticky; + }, + + // - skip when the property is a method of an instance (OOP) + // - abort otherwise, + // initial === would have catch identical references anyway + "function": function() { + var caller = callers[callers.length - 1]; + return caller !== Object && typeof caller !== "undefined"; + }, + + "array": function( b, a ) { + var i, j, len, loop, aCircular, bCircular; + + // b could be an object literal here + if ( QUnit.objectType( b ) !== "array" ) { + return false; + } + + len = a.length; + if ( len !== b.length ) { + // safe and faster + return false; + } + + // track reference to avoid circular references + parents.push( a ); + parentsB.push( b ); + for ( i = 0; i < len; i++ ) { + loop = false; + for ( j = 0; j < parents.length; j++ ) { + aCircular = parents[j] === a[i]; + bCircular = parentsB[j] === b[i]; + if ( aCircular || bCircular ) { + if ( a[i] === b[i] || aCircular && bCircular ) { + loop = true; + } else { + parents.pop(); + parentsB.pop(); + return false; + } + } + } + if ( !loop && !innerEquiv(a[i], b[i]) ) { + parents.pop(); + parentsB.pop(); + return false; + } + } + parents.pop(); + parentsB.pop(); + return true; + }, + + "object": function( b, a ) { + /*jshint forin:false */ + var i, j, loop, aCircular, bCircular, + // Default to true + eq = true, + aProperties = [], + bProperties = []; + + // comparing constructors is more strict than using + // instanceof + if ( a.constructor !== b.constructor ) { + // Allow objects with no prototype to be equivalent to + // objects with Object as their constructor. + if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || + ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { + return false; + } + } + + // stack constructor before traversing properties + callers.push( a.constructor ); + + // track reference to avoid circular references + parents.push( a ); + parentsB.push( b ); + + // be strict: don't ensure hasOwnProperty and go deep + for ( i in a ) { + loop = false; + for ( j = 0; j < parents.length; j++ ) { + aCircular = parents[j] === a[i]; + bCircular = parentsB[j] === b[i]; + if ( aCircular || bCircular ) { + if ( a[i] === b[i] || aCircular && bCircular ) { + loop = true; + } else { + eq = false; + break; + } + } + } + aProperties.push(i); + if ( !loop && !innerEquiv(a[i], b[i]) ) { + eq = false; + break; + } + } + + parents.pop(); + parentsB.pop(); + callers.pop(); // unstack, we are done + + for ( i in b ) { + bProperties.push( i ); // collect b's properties + } + + // Ensures identical properties name + return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); + } + }; + }()); + + innerEquiv = function() { // can take multiple arguments + var args = [].slice.apply( arguments ); + if ( args.length < 2 ) { + return true; // end transition + } + + return (function( a, b ) { + if ( a === b ) { + return true; // catch the most you can + } else if ( a === null || b === null || typeof a === "undefined" || + typeof b === "undefined" || + QUnit.objectType(a) !== QUnit.objectType(b) ) { + return false; // don't lose time with error prone cases + } else { + return bindCallbacks(a, callbacks, [ b, a ]); + } + + // apply transition with (1..n) arguments + }( args[0], args[1] ) && innerEquiv.apply( this, args.splice(1, args.length - 1 )) ); + }; + + return innerEquiv; +}()); + +/** + * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | + * http://flesler.blogspot.com Licensed under BSD + * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 + * + * @projectDescription Advanced and extensible data dumping for Javascript. + * @version 1.0.0 + * @author Ariel Flesler + * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} + */ +QUnit.jsDump = (function() { + function quote( str ) { + return "\"" + str.toString().replace( /"/g, "\\\"" ) + "\""; + } + function literal( o ) { + return o + ""; + } + function join( pre, arr, post ) { + var s = jsDump.separator(), + base = jsDump.indent(), + inner = jsDump.indent(1); + if ( arr.join ) { + arr = arr.join( "," + s + inner ); + } + if ( !arr ) { + return pre + post; + } + return [ pre, inner + arr, base + post ].join(s); + } + function array( arr, stack ) { + var i = arr.length, ret = new Array(i); + this.up(); + while ( i-- ) { + ret[i] = this.parse( arr[i] , undefined , stack); + } + this.down(); + return join( "[", ret, "]" ); + } + + var reName = /^function (\w+)/, + jsDump = { + // type is used mostly internally, you can fix a (custom)type in advance + parse: function( obj, type, stack ) { + stack = stack || [ ]; + var inStack, res, + parser = this.parsers[ type || this.typeOf(obj) ]; + + type = typeof parser; + inStack = inArray( obj, stack ); + + if ( inStack !== -1 ) { + return "recursion(" + (inStack - stack.length) + ")"; + } + if ( type === "function" ) { + stack.push( obj ); + res = parser.call( this, obj, stack ); + stack.pop(); + return res; + } + return ( type === "string" ) ? parser : this.parsers.error; + }, + typeOf: function( obj ) { + var type; + if ( obj === null ) { + type = "null"; + } else if ( typeof obj === "undefined" ) { + type = "undefined"; + } else if ( QUnit.is( "regexp", obj) ) { + type = "regexp"; + } else if ( QUnit.is( "date", obj) ) { + type = "date"; + } else if ( QUnit.is( "function", obj) ) { + type = "function"; + } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { + type = "window"; + } else if ( obj.nodeType === 9 ) { + type = "document"; + } else if ( obj.nodeType ) { + type = "node"; + } else if ( + // native arrays + toString.call( obj ) === "[object Array]" || + // NodeList objects + ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) + ) { + type = "array"; + } else if ( obj.constructor === Error.prototype.constructor ) { + type = "error"; + } else { + type = typeof obj; + } + return type; + }, + separator: function() { + return this.multiline ? this.HTML ? "
    " : "\n" : this.HTML ? " " : " "; + }, + // extra can be a number, shortcut for increasing-calling-decreasing + indent: function( extra ) { + if ( !this.multiline ) { + return ""; + } + var chr = this.indentChar; + if ( this.HTML ) { + chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); + } + return new Array( this.depth + ( extra || 0 ) ).join(chr); + }, + up: function( a ) { + this.depth += a || 1; + }, + down: function( a ) { + this.depth -= a || 1; + }, + setParser: function( name, parser ) { + this.parsers[name] = parser; + }, + // The next 3 are exposed so you can use them + quote: quote, + literal: literal, + join: join, + // + depth: 1, + // This is the list of parsers, to modify them, use jsDump.setParser + parsers: { + window: "[Window]", + document: "[Document]", + error: function(error) { + return "Error(\"" + error.message + "\")"; + }, + unknown: "[Unknown]", + "null": "null", + "undefined": "undefined", + "function": function( fn ) { + var ret = "function", + // functions never have name in IE + name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; + + if ( name ) { + ret += " " + name; + } + ret += "( "; + + ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); + return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); + }, + array: array, + nodelist: array, + "arguments": array, + object: function( map, stack ) { + /*jshint forin:false */ + var ret = [ ], keys, key, val, i; + QUnit.jsDump.up(); + keys = []; + for ( key in map ) { + keys.push( key ); + } + keys.sort(); + for ( i = 0; i < keys.length; i++ ) { + key = keys[ i ]; + val = map[ key ]; + ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); + } + QUnit.jsDump.down(); + return join( "{", ret, "}" ); + }, + node: function( node ) { + var len, i, val, + open = QUnit.jsDump.HTML ? "<" : "<", + close = QUnit.jsDump.HTML ? ">" : ">", + tag = node.nodeName.toLowerCase(), + ret = open + tag, + attrs = node.attributes; + + if ( attrs ) { + for ( i = 0, len = attrs.length; i < len; i++ ) { + val = attrs[i].nodeValue; + // IE6 includes all attributes in .attributes, even ones not explicitly set. + // Those have values like undefined, null, 0, false, "" or "inherit". + if ( val && val !== "inherit" ) { + ret += " " + attrs[i].nodeName + "=" + QUnit.jsDump.parse( val, "attribute" ); + } + } + } + ret += close; + + // Show content of TextNode or CDATASection + if ( node.nodeType === 3 || node.nodeType === 4 ) { + ret += node.nodeValue; + } + + return ret + open + "/" + tag + close; + }, + // function calls it internally, it's the arguments part of the function + functionArgs: function( fn ) { + var args, + l = fn.length; + + if ( !l ) { + return ""; + } + + args = new Array(l); + while ( l-- ) { + // 97 is 'a' + args[l] = String.fromCharCode(97+l); + } + return " " + args.join( ", " ) + " "; + }, + // object calls it internally, the key part of an item in a map + key: quote, + // function calls it internally, it's the content of the function + functionCode: "[code]", + // node calls it internally, it's an html attribute value + attribute: quote, + string: quote, + date: quote, + regexp: literal, + number: literal, + "boolean": literal + }, + // if true, entities are escaped ( <, >, \t, space and \n ) + HTML: false, + // indentation unit + indentChar: " ", + // if true, items in a collection, are separated by a \n, else just a space. + multiline: true + }; + + return jsDump; +}()); + +// from jquery.js +function inArray( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; +} + +/* + * Javascript Diff Algorithm + * By John Resig (http://ejohn.org/) + * Modified by Chu Alan "sprite" + * + * Released under the MIT license. + * + * More Info: + * http://ejohn.org/projects/javascript-diff-algorithm/ + * + * Usage: QUnit.diff(expected, actual) + * + * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick brown fox jumped jumps over" + */ +QUnit.diff = (function() { + /*jshint eqeqeq:false, eqnull:true */ + function diff( o, n ) { + var i, + ns = {}, + os = {}; + + for ( i = 0; i < n.length; i++ ) { + if ( !hasOwn.call( ns, n[i] ) ) { + ns[ n[i] ] = { + rows: [], + o: null + }; + } + ns[ n[i] ].rows.push( i ); + } + + for ( i = 0; i < o.length; i++ ) { + if ( !hasOwn.call( os, o[i] ) ) { + os[ o[i] ] = { + rows: [], + n: null + }; + } + os[ o[i] ].rows.push( i ); + } + + for ( i in ns ) { + if ( hasOwn.call( ns, i ) ) { + if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) { + n[ ns[i].rows[0] ] = { + text: n[ ns[i].rows[0] ], + row: os[i].rows[0] + }; + o[ os[i].rows[0] ] = { + text: o[ os[i].rows[0] ], + row: ns[i].rows[0] + }; + } + } + } + + for ( i = 0; i < n.length - 1; i++ ) { + if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && + n[ i + 1 ] == o[ n[i].row + 1 ] ) { + + n[ i + 1 ] = { + text: n[ i + 1 ], + row: n[i].row + 1 + }; + o[ n[i].row + 1 ] = { + text: o[ n[i].row + 1 ], + row: i + 1 + }; + } + } + + for ( i = n.length - 1; i > 0; i-- ) { + if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && + n[ i - 1 ] == o[ n[i].row - 1 ]) { + + n[ i - 1 ] = { + text: n[ i - 1 ], + row: n[i].row - 1 + }; + o[ n[i].row - 1 ] = { + text: o[ n[i].row - 1 ], + row: i - 1 + }; + } + } + + return { + o: o, + n: n + }; + } + + return function( o, n ) { + o = o.replace( /\s+$/, "" ); + n = n.replace( /\s+$/, "" ); + + var i, pre, + str = "", + out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), + oSpace = o.match(/\s+/g), + nSpace = n.match(/\s+/g); + + if ( oSpace == null ) { + oSpace = [ " " ]; + } + else { + oSpace.push( " " ); + } + + if ( nSpace == null ) { + nSpace = [ " " ]; + } + else { + nSpace.push( " " ); + } + + if ( out.n.length === 0 ) { + for ( i = 0; i < out.o.length; i++ ) { + str += "" + out.o[i] + oSpace[i] + ""; + } + } + else { + if ( out.n[0].text == null ) { + for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { + str += "" + out.o[n] + oSpace[n] + ""; + } + } + + for ( i = 0; i < out.n.length; i++ ) { + if (out.n[i].text == null) { + str += "" + out.n[i] + nSpace[i] + ""; + } + else { + // `pre` initialized at top of scope + pre = ""; + + for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { + pre += "" + out.o[n] + oSpace[n] + ""; + } + str += " " + out.n[i].text + nSpace[i] + pre; + } + } + } + + return str; + }; +}()); + +// for CommonJS environments, export everything +if ( typeof exports !== "undefined" ) { + extend( exports, QUnit.constructor.prototype ); +} + +// get at whatever the global object is, like window in browsers +}( (function() {return this;}.call()) )); \ No newline at end of file diff --git a/www/kadm/_backup/test/unit/test.js b/www/kadm/_backup/test/unit/test.js new file mode 100644 index 0000000..96aa22c --- /dev/null +++ b/www/kadm/_backup/test/unit/test.js @@ -0,0 +1,11 @@ +test('basic test', function() { + expect(1); + ok(true, 'this had better work.'); +}); + + +test('can access the DOM', function() { + expect(1); + var fixture = document.getElementById('qunit-fixture'); + equal(fixture.innerText || fixture.textContent, 'this had better work.', 'should be able to access the DOM.'); +}); \ No newline at end of file diff --git a/www/kadm/_backup/test/visual/desktop/index.html b/www/kadm/_backup/test/visual/desktop/index.html new file mode 100644 index 0000000..baeb64e --- /dev/null +++ b/www/kadm/_backup/test/visual/desktop/index.html @@ -0,0 +1,44 @@ + + + + + Light theme visual tests + + + + + +
    +
    • asdf
    +
    +
      +
    • Node 01 +
        +
      • Node
      • +
      • Node
      • +
      +
    • +
    • Node 02
    • +
    • Node 03 +
        +
      • Node
      • +
      • Node
      • +
      +
    • +
    • Node 04
    • +
    • Node 05
    • +
    +
    +
    • full
    • asdf
    +
    • full
    • asdf
    + + + + + + \ No newline at end of file diff --git a/www/kadm/_backup/test/visual/mobile/index.html b/www/kadm/_backup/test/visual/mobile/index.html new file mode 100644 index 0000000..b84baff --- /dev/null +++ b/www/kadm/_backup/test/visual/mobile/index.html @@ -0,0 +1,42 @@ + + + + + Mobile theme visual tests + + + + + +
    +
      +
    • Node 01 +
        +
      • Node
      • +
      • Node
      • +
      +
    • +
    • Node 02
    • +
    • Node 03 +
        +
      • Node
      • +
      • Node
      • +
      +
    • +
    • Node 04
    • +
    • Node 05
    • +
    +
    +
    • full
    • asdf
    +
    • full
    • asdf
    + + + + + + \ No newline at end of file diff --git a/www/kadm/_backup/test/visual/screenshots/desktop/.png b/www/kadm/_backup/test/visual/screenshots/desktop/.png new file mode 100644 index 0000000..55ccf18 Binary files /dev/null and b/www/kadm/_backup/test/visual/screenshots/desktop/.png differ diff --git a/www/kadm/_backup/test/visual/screenshots/desktop/desktop.png b/www/kadm/_backup/test/visual/screenshots/desktop/desktop.png new file mode 100644 index 0000000..d6ececd Binary files /dev/null and b/www/kadm/_backup/test/visual/screenshots/desktop/desktop.png differ diff --git a/www/kadm/_backup/test/visual/screenshots/desktop/home.png b/www/kadm/_backup/test/visual/screenshots/desktop/home.png new file mode 100644 index 0000000..55ccf18 Binary files /dev/null and b/www/kadm/_backup/test/visual/screenshots/desktop/home.png differ diff --git a/www/kadm/_backup/test/visual/screenshots/mobile/.png b/www/kadm/_backup/test/visual/screenshots/mobile/.png new file mode 100644 index 0000000..c8cd05a Binary files /dev/null and b/www/kadm/_backup/test/visual/screenshots/mobile/.png differ diff --git a/www/kadm/_backup/test/visual/screenshots/mobile/home.png b/www/kadm/_backup/test/visual/screenshots/mobile/home.png new file mode 100644 index 0000000..c8cd05a Binary files /dev/null and b/www/kadm/_backup/test/visual/screenshots/mobile/home.png differ diff --git a/www/kadm/_backup/test/visual/screenshots/mobile/mobile.png b/www/kadm/_backup/test/visual/screenshots/mobile/mobile.png new file mode 100644 index 0000000..dcc76a0 Binary files /dev/null and b/www/kadm/_backup/test/visual/screenshots/mobile/mobile.png differ diff --git a/www/kadm/admin/index.php b/www/kadm/admin/index.php new file mode 100644 index 0000000..11b8c9f --- /dev/null +++ b/www/kadm/admin/index.php @@ -0,0 +1,2 @@ + + + +
    + +
    + + + + + + + + + \ No newline at end of file diff --git a/www/kadm/auth/_backup/i.php b/www/kadm/auth/_backup/i.php new file mode 100644 index 0000000..ba72ff6 --- /dev/null +++ b/www/kadm/auth/_backup/i.php @@ -0,0 +1,136 @@ +cate_area = "admin"; +$mmn->auth = ""; +pp($mmn->getMenuList("")); +exit; +?> + +
    +
    권한 관리
    +
    +
    +
    + +
    +
    +
    +
    + 권한 정보 + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    NOGroupCode IdCode ValCode ExpCode IdxCode Use
    +
    +
    +
    +
    기준정보 내용
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ ID는 분류내에서 유일한(Unique)한 값이어야 합니다. +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ 출력순서를 지정합니다. 입력한 index의 후순위 코드들은 자동으로 순위가 변경 적용됩니다. +
    +
    +
    + +
    + + ※ 사용하지 않을경우 체크해제 합니다. +
    +
    +
    + +
    +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/www/kadm/auth/_backup/t/App.vue.js b/www/kadm/auth/_backup/t/App.vue.js new file mode 100644 index 0000000..590f5e5 --- /dev/null +++ b/www/kadm/auth/_backup/t/App.vue.js @@ -0,0 +1,32 @@ +import TreeItem from './TreeItem.vue.js' + + +export default { + name: "Tree", + components: { + TreeItem + }, + props: { + treedata: Object + }, + data() { + return { + } + }, + template: ` +
      + +
    + `, + css: ` + .item { + cursor: pointer; + line-height: 1.5; + color:red; + } + .bold { + font-weight: bold; + color:green; + } + ` +} \ No newline at end of file diff --git a/www/kadm/auth/_backup/t/TreeItem.vue.js b/www/kadm/auth/_backup/t/TreeItem.vue.js new file mode 100644 index 0000000..ff74f3f --- /dev/null +++ b/www/kadm/auth/_backup/t/TreeItem.vue.js @@ -0,0 +1,57 @@ +export default { + name: 'TreeItem', // necessary for self-reference + props: { + model: Object + }, + data() { + return { + isOpen: false + } + }, + computed: { + isFolder() { + return this.model.children && this.model.children.length + } + }, + methods: { + toggle() { + if (this.isFolder) { + this.isOpen = !this.isOpen + } + }, + changeType() { + if (!this.isFolder) { + this.model.children = [] + this.addChild() + this.isOpen = true + } + }, + addChild() { + this.model.children.push({ + name: 'new stuff' + }) + } + }, + template: ` +
  1. +
    + {{ model.name }} + [{{ isOpen ? '-' : '+' }}] +
    +
      + + + +
    +
  2. + ` +} \ No newline at end of file diff --git a/www/kadm/auth/_backup/t/index.html b/www/kadm/auth/_backup/t/index.html new file mode 100644 index 0000000..802043f --- /dev/null +++ b/www/kadm/auth/_backup/t/index.html @@ -0,0 +1,69 @@ + + + + + + + Document + + +
    + +
    + + + + + + \ No newline at end of file diff --git a/www/kadm/auth/_backup/u/Switch.vue.js b/www/kadm/auth/_backup/u/Switch.vue.js new file mode 100644 index 0000000..7e74698 --- /dev/null +++ b/www/kadm/auth/_backup/u/Switch.vue.js @@ -0,0 +1,47 @@ + export default { + name: 'zk-switch', + props: { + value: { + type: Boolean, + default: false, + }, + disabled: { + type: Boolean, + default: false, + }, + }, + data() { + return { + prefixCls: 'zk-switch', + }; + }, + computed: { + switchClass() { + return [ + `${this.prefixCls}`, + { + [`${this.prefixCls}--checked`]: this.value, + [`${this.prefixCls}--disabled`]: this.disabled, + }, + ]; + }, + }, + methods: { + toggle() { + if (this.disabled) { + return false; + } + const value = !this.value; + this.$emit('input', value); + return this.$emit('on-change', value); + }, + }, + template : ` +
    + + True + False + +
    + ` + }; \ No newline at end of file diff --git a/www/kadm/auth/_backup/u/exam.vue.js b/www/kadm/auth/_backup/u/exam.vue.js new file mode 100644 index 0000000..d312bc4 --- /dev/null +++ b/www/kadm/auth/_backup/u/exam.vue.js @@ -0,0 +1,226 @@ + import ZkSwitch from './Switch.vue.js'; + + export default { + name: 'VG', + components: { + ZkSwitch, + }, + data() { + return { + props: { + stripe: false, + border: false, + showHeader: true, + showSummary: false, + showRowHover: true, + showIndex: false, + treeType: true, + isFold: true, + expandType: false, + selectionType: false, + }, + data: [ + { + name: 'Jack', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + }, + ], + }, + ], + }, + ], + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + }, + ], + }, + { + name: 'Tom', + sex: 'male', + likes: ['football', 'basketball'], + score: 20, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + }, + ], + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + }, + ], + }, + ], + }, + { + name: 'Tom', + sex: 'male', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Tom', + sex: 'male', + likes: ['football', 'basketball'], + score: 20, + children: [ + { + name: 'Ashley', + sex: 'female', + likes: ['football', 'basketball'], + score: 20, + }, + { + name: 'Taki', + sex: 'male', + likes: ['football', 'basketball'], + score: 10, + }, + ], + }, + ], + columns: [ + { + label: 'name', + prop: 'name', + width: '400px', + }, + { + label: 'sex', + prop: 'sex', + minWidth: '50px', + }, + { + label: 'score', + prop: 'score', + }, + { + label: 'likes', + prop: 'likes', + minWidth: '200px', + type: 'template', + template: 'likes', + }, + ], + }; + }, + computed: { + propList() { + return Object.keys(this.props).map(item => ({ + name: item, + })); + }, + }, + methods: { + + }, + template: ` +
    +
      +
    • + {{ item.name }}: + +
    • +
    + + + + +
    + ` + }; \ No newline at end of file diff --git a/www/kadm/auth/_backup/u/index.html b/www/kadm/auth/_backup/u/index.html new file mode 100644 index 0000000..e471685 --- /dev/null +++ b/www/kadm/auth/_backup/u/index.html @@ -0,0 +1,31 @@ + + + + + + + Document + + +
    + +
    + + + + + + \ No newline at end of file diff --git a/www/kadm/auth/auth.ajax.php b/www/kadm/auth/auth.ajax.php new file mode 100644 index 0000000..1ce4270 --- /dev/null +++ b/www/kadm/auth/auth.ajax.php @@ -0,0 +1,94 @@ +cate_area = $_REQUEST['cate_area']; + +$cmem_auth = $mnuObj->gsetAuthTarget(); + +if( !_notAuth("R") ){/************ 권한체크*/ + switch( $_REQUEST['mode'] ) { + case "getManages": + $where = new DB_where("and"); + $where->add("member_status = ?",1); + if( count($cmem_auth) ){ + $subwhere = $where->sub_where("or"); + foreach( $cmem_auth as $key => $val ){ + $subwhere->add("member_auth = ?", $key); + } + } + + $menu_list = $mnuObj->getMenuList(""); + $member_list = $baseObj->getMemberList("member_id, member_name, member_auth",$where,"member_name asc"); + $auth_list = $mnuObj->AUTH->getAuthList($_REQUEST['cate_area']); + + //없어진 메뉴 정보가 DB에 존재할때 걸러냄 + foreach( $menu_list as $menu ){ + $menu_id_row[] = $menu['id']; + } + foreach( $auth_list as $menu_id => $auth_menu ){ + if( !in_array($menu_id, $menu_id_row) ){ + unset($auth_list[$menu_id]); + } + } + //없어진 메뉴 정보가 DB에 존재할때 걸러냄// + + foreach( $menu_list as $menu_data ){ + $menu_id = $menu_data['id']; + foreach ( $mnuObj->authDest as $key => $val ){ + foreach( Array('R','W','D') as $v ){ + $auth_list[$menu_id]['G'][$key][$v] = (isset($auth_list[$menu_id]['G'][$key][$v]) && $auth_list[$menu_id]['G'][$key][$v]) ? true : false; + } + } + foreach ( $member_list as $val ){ + foreach( Array('R','W','D') as $v ){ + $auth_list[$menu_id]['M'][$val['member_id']][$v] = (isset($auth_list[$menu_id]['M'][$val['member_id']][$v]) && $auth_list[$menu_id]['M'][$val['member_id']][$v]) ? true : false; + } + } + } + + $retval['code'] = 1; + $retval['data'] = Array( + "menu_max_level" => $mnuObj->max_level_cate(), + "menu_list" => $menu_list, + "group_list" => $mnuObj->authDest, + "member_list" => $member_list, + "auth_list" => $auth_list, + ); + break; + + + case "setAuth": + + if( _notAuth("D") ) break; /************ 권한체크*/ + + $_REQUEST['auth_data'] = json_decode($_REQUEST['auth_data']); + + foreach( (array)$_REQUEST['auth_data'] as $cate_id => $group_data ){ + foreach( (array)$group_data as $auth_area => $target_data ){ + foreach( (array)$target_data as $auth_target => $val ){ + + $mnuObj->AUTH->setAuth( + $mnuObj->cate_area, + (string)$cate_id, + (string)$auth_area, + (string)$auth_target, + $mnuObj->AUTH->getAuthToNum( (bool)$val->R, (bool)$val->W, (bool)$val->D ) + ); + + } + } + } + + $retval['code'] = 1; + break; + } +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/auth/auth_admin.php b/www/kadm/auth/auth_admin.php new file mode 100644 index 0000000..654506b --- /dev/null +++ b/www/kadm/auth/auth_admin.php @@ -0,0 +1,8 @@ + + +
    + +
    + 조회 : + , + + +
    + +
    +
    권한 관리
    +
    + +
    +
    + +
    +
    +
    +
    + 권한 정보 ※ 붉은 표시는 사용하지 않는 메뉴 +
    +
    + + + + + + + + + + + + + + + + + +
    기능 / 메뉴GroupMember
    + + + + + + + + + + +
    구분Menu_Id
    +
    + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    + + + \ No newline at end of file diff --git a/www/kadm/auth/auth_service.php b/www/kadm/auth/auth_service.php new file mode 100644 index 0000000..a5dafdb --- /dev/null +++ b/www/kadm/auth/auth_service.php @@ -0,0 +1,8 @@ +getAllBaseCodeList(); + break; + + case "putCode": + + if( $_REQUEST['Code_Uid'] === "" ) { + $retval['mesg'] = cUtil\Mlang::getText("코드 ID를 입력하지 않았습니다."); break; + } + if( !$_REQUEST['Code_Val'] && !$_REQUEST['Code_Exp'] ) { + $retval['mesg'] = cUtil\Mlang::getText("코드값과 코드명중 하나는 입력해야 합니다.");break; + } + + if( !$_REQUEST['Code_Val'] ) { + $_REQUEST['Code_Val'] = $_REQUEST['Code_Uid']; + } + if( !$_REQUEST['Code_Exp'] ) { + $_REQUEST['Code_Exp'] = $_REQUEST['Code_Val']; + } + + if( !$_REQUEST['Code_Idx'] ){ //REQUEST 값 변경전 순서 찾기 + $midx = $baseObj->getMaxBaseCodeIdx($_REQUEST['Bran_Uid'], $_REQUEST['Group_Uid']); + $_REQUEST['Code_Idx'] = $midx+1; + } + $_REQUEST['Bran_Uid'] = $_REQUEST['Bran_Uid'] ?: $_REQUEST['Group_Uid'] ?: $_REQUEST['Code_Uid']; + $_REQUEST['Group_Uid'] = $_REQUEST['Group_Uid'] ?: $_REQUEST['Code_Uid']; + + $where = new DB_where("and"); + $subwhere = $where->sub_where("or"); + $subwhere->add("Bran_Uid != ?",$_REQUEST['Ori_Bran_Uid']); + $subwhere->add("Group_Uid != ?",$_REQUEST['Ori_Group_Uid']); + $subwhere->add("Code_Uid != ?",$_REQUEST['Ori_Code_Uid']); + $row = $baseObj->getBaseCode($_REQUEST['Bran_Uid'], $_REQUEST['Group_Uid'], $_REQUEST['Code_Uid'], $where); + + if( isset($row['Code_Uid']) ){ + $retval['mesg'] = cUtil\Mlang::getText("코드가 중복됩니다."); break; + } + + if( $_REQUEST['Code_Active'] != "Y" ){ $_REQUEST['Code_Active'] = "N"; } + $sqldata = Array( + 'Code_Val' => isset($_REQUEST['Code_Val']) ? $_REQUEST['Code_Val'] : "", + 'Code_Exp' => isset($_REQUEST['Code_Exp']) ? $_REQUEST['Code_Exp'] : "", + 'Code_Idx' => isset($_REQUEST['Code_Idx']) ? $_REQUEST['Code_Idx'] : "", + 'Active' => $_REQUEST['Code_Active'], + ); + if( $_REQUEST['Ori_Code_Uid'] !== "" ){ + + if( _notAuth("D") ) break; /************ 권한체크*/ + + $sqldata = array_merge(Array( + 'Code_Uid' => isset($_REQUEST['Code_Uid']) ? $_REQUEST['Code_Uid'] : "", + ), $sqldata); + $rst = $baseObj->setBaseCode($sqldata, $_REQUEST['Ori_Bran_Uid'], $_REQUEST['Ori_Group_Uid'], $_REQUEST['Ori_Code_Uid']); + + if( $_REQUEST['Ori_Code_Uid'] != $_REQUEST['Code_Uid'] && $_REQUEST['Ori_Group_Uid'] == $_REQUEST['Ori_Code_Uid'] ){ //Group Uid 로 사용되는 Code_Uid 가 변경될때 + $sqldata = Array( + 'Group_Uid' => isset($_REQUEST['Code_Uid']) ? $_REQUEST['Code_Uid'] : "", + ); + $baseObj->setBaseCode($sqldata, $_REQUEST['Ori_Bran_Uid'], $_REQUEST['Ori_Group_Uid']); + } + //if( $_REQUEST['Ori_Group_Uid'] != $_REQUEST['Group_Uid'] && $_REQUEST['Ori_Bran_Uid'] == $_REQUEST['Ori_Group_Uid'] ){ //Bran Uid 로 사용되는 Code_Uid 가 변경될때 + if( $_REQUEST['Ori_Code_Uid'] != $_REQUEST['Code_Uid'] && $_REQUEST['Ori_Bran_Uid'] == $_REQUEST['Ori_Code_Uid'] ){ //Bran Uid 로 사용되는 Code_Uid 가 변경될때 + $sqldata = Array( + 'Bran_Uid' => isset($_REQUEST['Code_Uid']) ? $_REQUEST['Code_Uid'] : "", + ); + $baseObj->setBaseCode($sqldata, $_REQUEST['Ori_Bran_Uid']); + } + }else{ + + if( _notAuth("W") ) break; /************ 권한체크*/ + + $sqldata = array_merge(Array( + 'Bran_Uid' => isset($_REQUEST['Bran_Uid']) ? $_REQUEST['Bran_Uid'] : "", + 'Group_Uid' => isset($_REQUEST['Group_Uid']) ? $_REQUEST['Group_Uid'] : "", + 'Code_Uid' => isset($_REQUEST['Code_Uid']) ? $_REQUEST['Code_Uid'] : "", + ), $sqldata); + $rst = $baseObj->putBaseCode($sqldata); + } + + if( $rst ){ + //$_REQUEST['mode'] = "sortCode"; + //include __FILE__; + $retval['code'] = 1; + $baseObj->sortBaseCode($_REQUEST['Bran_Uid'], $_REQUEST['Group_Uid'], $_REQUEST['Code_Uid'], $_REQUEST['Code_Idx']); + }else{ + $retval['mesg'] = cUtil\Mlang::getText("등록시 오류가 발생하였습니다. 확인하여 주십시오."); + } + break; + + case "delCode": + + if( _notAuth("D") ) break; /************ 권한체크*/ + + if( !isset($_REQUEST['Bran_Uid']) || !isset($_REQUEST['Group_Uid']) || !isset($_REQUEST['Code_Uid']) ) { + $retval['mesg'] = cUtil\Mlang::getText("삭제할 코드를 선택하지 않았거나, 올바른 접근이 아닙니다."); break; + } + + $row = $baseObj->getBaseCode($_REQUEST['Bran_Uid'], $_REQUEST['Group_Uid'], $_REQUEST['Code_Uid'],$where); + + if( $row['Bran_Uid'] == $row['Code_Uid'] ){ + $rst = $baseObj->delBaseCode($row['Bran_Uid']); + }else if( $row['Group_Uid'] == $row['Code_Uid'] ){ + $rst = $baseObj->delBaseCode($row['Bran_Uid'], $row['Group_Uid']); + }else{ + $rst = $baseObj->delBaseCode($row['Bran_Uid'], $row['Group_Uid'], $row['Code_Uid']); + } + + if( !$rst ){ + $retval['mesg'] = cUtil\Mlang::getText("삭제시 오류가 발생하였습니다. 확인하여 주십시오."); + }else{ + //$_REQUEST['mode'] = "sortCode"; + //$_REQUEST['Code_Idx'] = $_REQUEST['Code_Idx'] - 1; + //$_REQUEST['adv'] = 0; + //include __FILE__; + $retval['code'] = $baseObj->sortBaseCode($_REQUEST['Bran_Uid'], $_REQUEST['Group_Uid'], $_REQUEST['Code_Uid'], $_REQUEST['Code_Idx'], 0); + } + break; + + /* + case "sortCode": + return $baseObj->sortBaseCode($_REQUEST['Bran_Uid'], $_REQUEST['Group_Uid'], $_REQUEST['Code_Uid'], $_REQUEST['Code_Idx'], $_REQUEST['adv']); + break; + */ + } +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/basecode/basecode_manage.php b/www/kadm/basecode/basecode_manage.php new file mode 100644 index 0000000..4afc9be --- /dev/null +++ b/www/kadm/basecode/basecode_manage.php @@ -0,0 +1,331 @@ + + +
    +
    기준정보 관리
    +
    +
    +
    + +
    +
    +
    +
    + 기준정보 리스트 + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    NOGroupCode IdCode ValCode ExpCode IdxCode Use
    +
    +
    +
    +
    기준정보 내용
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ ID는 분류내에서 유일한(Unique)한 값이어야 합니다. +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ 출력순서를 지정합니다. 입력한 index의 후순위 코드들은 자동으로 순위가 변경 적용됩니다. +
    +
    +
    + +
    + + ※ 사용하지 않을경우 체크해제 합니다. +
    +
    +
    + +
    +
    +
    +
    +
    + + + \ No newline at end of file diff --git a/www/kadm/basecode/index.php b/www/kadm/basecode/index.php new file mode 100644 index 0000000..734fb1d --- /dev/null +++ b/www/kadm/basecode/index.php @@ -0,0 +1,2 @@ +getBoardPage($_REQUEST); + $retval['code'] = 1; + $retval['data'] = $lists; + $retval['mesg'] = cUtil\Mlang::getText("리스트를 불러오는 도중 오류가 발생하였습니다."); + break; + + //게시판 로드 + case "getBoard" : + if( $_REQUEST['board_id'] ){ + $binfo = $brdObj->getBoard($_REQUEST['board_id']); + if( !$binfo['board_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("권한이 없거나, 데이터를 불러오지 못하였습니다."); + }else{ + $retval['code'] = 1; + $retval['data'] = $binfo; + } + } + break; + + //게시판 등록/수정 + case "putBoard" : + if( !$_REQUEST['board_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("게시판 코드를 입력하지 않았습니다."); + }else if( !$_REQUEST['board_name'] ){ + $retval['mesg'] = cUtil\Mlang::getText("게시판명을 입력하지 않았습니다."); + }else if( !$_REQUEST['use_webeditor'] ){ + $retval['mesg'] = cUtil\Mlang::getText("내용 작성방식을 선택하지 않았습니다."); + }else if( !$_REQUEST['line_num'] ){ + $retval['mesg'] = cUtil\Mlang::getText("페이지당 라인수를 입력하지 않았습니다."); + }else if( !$_REQUEST['page_num'] ){ + $retval['mesg'] = cUtil\Mlang::getText("페이지 표시수를 입력하지 않았습니다."); + }else if( !$_REQUEST['new_num'] ){ + $retval['mesg'] = cUtil\Mlang::getText("최신글 기준 일수를 입력하지 않았습니다."); + }else if( !$_REQUEST['hot_num'] ){ + $retval['mesg'] = cUtil\Mlang::getText("인기글 기준 조회수를 입력하지 않았습니다."); + }else{ + $retval['mesg'] = cUtil\Mlang::getText("게시판이 등록되지 않았습니다."); + if( $_REQUEST['board_oid'] ){ + + if( _notAuth("D") ) break; /************ 권한체크*/ + + $_REQUEST['board_id'] = $_REQUEST['board_oid']; + $rst = $brdObj->setBoard($_REQUEST); + }else{ + + if( _notAuth("W") ) break; /************ 권한체크*/ + + $binfo = $brdObj->getBoardId($_REQUEST['board_id']); + if( $binfo['board_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("이미 존재하는 게시판 코드입니다."); + }else{ + $rst = $brdObj->putBoard($_REQUEST); + } + } + + $retval['code'] = $rst; + } + break; + + //게시판 삭제 + case "delBoard" : + + if( _notAuth("D") ) break; /************ 권한체크*/ + + if( !$_REQUEST['board_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("올바르지 않은 접근입니다."); + }else{ + $retval['code'] = $brdObj->delBoard($_REQUEST['board_id']); + $retval['mesg'] = cUtil\Mlang::getText("삭제중 오류가 발생하였습니다."); + } + break; + + //게시물 리스트 + case "getContentsList" : + $lists = $brdObj->getAllContentsPage($_REQUEST); + $retval['code'] = 1; + $retval['data'] = $lists; + $retval['mesg'] = "리스트를 불러오는 도중 오류가 발생하였습니다."; + break; + + //게시물 삭제 + case "delContents" : + $retval['code'] = 1; + for( $a=0 ; $a<@count($_REQUEST['delchk']) ; $a++ ){ + $brdinfo = explode("|", $_REQUEST['delchk'][$a]); + $_brd = new Board( $brdinfo[0] ); + $retval['code'] = $retval['code'] && $_brd->delContents($brdinfo[1]); + } + $retval['mesg'] = "삭제중 오류가 발생하였습니다."; + break; + + case "stateChange" : + $new_state = $_REQUEST['state']==1?2:1; + $retval['data'] = $new_state; + $retval['code'] = $brdObj->stateChange(array("cid"=>$_REQUEST['cid'], "state"=>$new_state)); + $retval['mesg'] = "변경되지 않았습니다."; + break; + + case "getAdminList" : + $where = new DB_where("and"); + $where->add("member_status = ?", 1); + $subwhere = $where->sub_where("or"); + foreach( $GLOBALS['_varsAuthAdmin'] as $key => $val ){ + $subwhere->add("member_auth = ?", $key); + } + $retval['code'] = 1; + $retval['data'] = $baseObj->getMemberList("member_id, member_name", $where, "member_name asc"); + break; + +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/board/board_list.php b/www/kadm/board/board_list.php new file mode 100644 index 0000000..fd38d0b --- /dev/null +++ b/www/kadm/board/board_list.php @@ -0,0 +1,130 @@ + "게시판명", + "brard_id" => "게시판코드", +); + +include _ADM_INC_PATH_ ."/header.html"; +?> + +
    + + + +
    + +
    +
    게시판 리스트
    + +
    + +
    +
    +
    +
    + 게시판 정보 +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + rows as $brd ){ + switch( $brd['read_level'] ){ + case "M": + $brd['read_level_txt'] = "회원이상"; break; + break; + case "M": + $brd['read_level_txt'] = "관리자만"; break; + break; + default: + $brd['read_level_txt'] = "전체가능"; break; + break; + } + switch( $brd['write_level'] ){ + case "M": + $brd['write_level_txt'] = "회원이상"; break; + break; + case "M": + $brd['write_level_txt'] = "관리자만"; break; + break; + default: + $brd['write_level_txt'] = "전체가능"; break; + break; + } + ?> + + + + + + + + + + + rows) < 1 ){ + ?> + + + + + +
    번호게시판 코드게시판 명관리자읽기권한쓰기권한게시물수바로가기
    line_cnt--?>바로가기
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/www/kadm/board/board_put.php b/www/kadm/board/board_put.php new file mode 100644 index 0000000..a7c0306 --- /dev/null +++ b/www/kadm/board/board_put.php @@ -0,0 +1,327 @@ +board_info; + +$smnu_txt = "추가"; +if( $binfo['board_id'] ){ + $smnu_txt = "수정"; +} + +//권한 그룹 +$sgrp = array( + "M" => "회원", + "A" => "관리자", +); + +//소속 리스트 +$custObj = new Cust(); +$where = new DB_where("and"); +$where->add("cust_status = ?",1); +$where->add("cust_active = ?",1); +$cust_list = $custObj->getCustSelect("cust_id", "cust_name", $where); + +include _ADM_INC_PATH_ ."/header.html"; +?> + +
    +
    게시판
    +
    +
    +
    + +
    +
    + +
    + > + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + + + + + + + + +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    + +
    + + + + 리스트 + +
    + + +
    + + + +getAllContentsPage($_REQUEST); + $retval['code'] = 1; + $retval['data'] = $lists; + $retval['mesg'] = cUtil\Mlang::getText("리스트를 불러오는 도중 오류가 발생하였습니다."); + break; + + //게시물 삭제 + case "delContents" : + + if( _notAuth("D") ) break; /************ 권한체크*/ + + $retval['code'] = 1; + for( $a=0 ; $a<@count($_REQUEST['del_chk']) ; $a++ ){ + $binfo = explode("|", $_REQUEST['del_chk'][$a]); + $_brd = new Board( $binfo[0] ); + $retval['code'] = $retval['code'] && $_brd->delContents($binfo[1]); + } + $retval['mesg'] = "삭제중 오류가 발생하였습니다."; + break; + +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/board/contents_list.php b/www/kadm/board/contents_list.php new file mode 100644 index 0000000..04b82b0 --- /dev/null +++ b/www/kadm/board/contents_list.php @@ -0,0 +1,259 @@ +getBoardList("board_id, board_name", $where, "board_name asc"); +$board_list = array(); +foreach( (array)$blist as $row ){ + $board_list[$row['board_id']] = $row['board_name']; +} + +//검색필드 +$sfields = array( + "board_name" => "게시판명", + "brd_id" => "게시판코드", + "title" => "제목", + "uname" => "작성자", + "contents" => "내용", +); + +include _ADM_INC_PATH_ ."/header.html"; +?> + +
    + + + + + +
    + +
    +
    게시물 리스트
    +
    + +
    +
    + +
    +
    +
    +
    + 게시물 관리 +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + rows as $cont ){ + ?> + + + + + + + + + + + + + + + + rows) < 1 ){ + ?> + + + + + +
    게시판 명제목작성자날짜조회수바로가기삭제
    line_cnt--?> 0 ? "({$cont['onum']})" : ""?>바로가기
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/www/kadm/board/index.php b/www/kadm/board/index.php new file mode 100644 index 0000000..7ddafa0 --- /dev/null +++ b/www/kadm/board/index.php @@ -0,0 +1,2 @@ +getCust($_REQUEST['cust_id']); + + switch( $_REQUEST['mode'] ) { + case "getCustList": + $where = new DB_where("and"); + $retval['data'] = $custObj->getCustPage($_REQUEST, $where); + break; + + + + case "putCust": + case "setCust": + + if( !$_REQUEST['cust_oid'] ){ + if( !$_REQUEST['cust_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("소속코드를 입력하지 않았습니다."); break; + }else if( strlen(preg_replace("/[0-9a-z]/im","",$_REQUEST['cust_id'])) > 0 || strlen(preg_replace("/[^0-9a-z]/im","",$_REQUEST['cust_id'])) < $GLOBALS['_varsBaseCode']['cust_id_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("소속코드는 영문자/숫자 만으로 구성되며, {$GLOBALS['_varsBaseCode']['cust_id_len']}자리 이상이어야 합니다."); break; + }else if( $cinfo['cust_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("이미 존재하는 코드 입니다."); break; + } + } + + $sqlrow = Array( + "cust_id" => $_REQUEST['cust_id'], + "cust_name" => $_REQUEST['cust_name'], + "cust_fullname" => $_REQUEST['cust_fullname'], + "cust_charger" => $_REQUEST['cust_charger'], + "cust_phone" => $_REQUEST['cust_phone'], + "cust_mail" => $_REQUEST['cust_mail'], + "cust_status" => $_REQUEST['cust_status'], + "mod_date" => $custObj->DB->sqleval("getdate()"), + ); + if( !$_REQUEST['cust_oid'] ){ + if( _notAuth("W") ) break; /************ 권한체크*/ + + $sqlrow['cust_active'] = 1; + $sqlrow['reg_date'] = $custObj->DB->sqleval("getdate()"); + $rst = $custObj->putCust($sqlrow); + }else{ + if( _notAuth("D") ) break; /************ 권한체크*/ + + $_REQUEST['cust_id'] = $_REQUEST['cust_oid']; + $rst = $custObj->setCust($sqlrow); + } + $retval['code'] = $rst; + $retval['mesg'] = cUtil\Mlang::getText("등록에 실패하였습니다."); + break; + + + + case "delCust": + case "setCustState": + if( _notAuth("D") ) break; /************ 권한체크*/ + + if( !$_REQUEST['cust_status'] && $_REQUEST['cust_status'] !== "0" && $_REQUEST['cust_delete'] != "true" ){ + $retval['mesg'] = cUtil\Mlang::getText("상태를 선택하지 않았습니다."); break; + } + if( !$_REQUEST['delchk'] ){ + $retval['mesg'] = cUtil\Mlang::getText("대상을 선택하지 않았습니다."); break; + } + + if( $_REQUEST['cust_delete'] == "true" || $_REQUEST['mode'] == "delCust" ){ + $sqlrow = Array( + "cust_status" => 0, + "cust_active" => 0, + ); + }else{ + $sqlrow = Array( + "cust_status" => $_REQUEST['cust_status'], + ); + } + + $retval['code'] = $custObj->setCustParts($sqlrow, "cust_id", $_REQUEST['delchk']); + $retval['mesg'] = cUtil\Mlang::getText("적용에 실패하였습니다."); + break; + } +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/cust/cust_list.php b/www/kadm/cust/cust_list.php new file mode 100644 index 0000000..d2e015c --- /dev/null +++ b/www/kadm/cust/cust_list.php @@ -0,0 +1,166 @@ + + +
    + + + + +
    + +
    +
    소속 리스트
    + +
    + +
    +
    +
    +
    + 소속 정보 +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + rows as $row ){ + switch( $row['cust_status'] ){ //기준정보로 대체 + case "1" : + $row['cust_status_txt'] = "사용중"; break; + default : + $row['cust_status_txt'] = "정지"; break; + } + ?> + + + + + + + + + + + + + +
    소속 ID소속명담당자연락처메일Active등록일수정일
    +
    + +
    +
    +
    +
    + + + + + diff --git a/www/kadm/cust/cust_put.php b/www/kadm/cust/cust_put.php new file mode 100644 index 0000000..debdad7 --- /dev/null +++ b/www/kadm/cust/cust_put.php @@ -0,0 +1,114 @@ +getCust($_REQUEST['cust_id']); + $smnu_txt = "수정"; +} +?> + +
    +
    소속
    +
    +
    +
    + +
    +
    + +
    + > + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + 리스트 + +
    + + +
    + + + + \ No newline at end of file diff --git a/www/kadm/cust/index.php b/www/kadm/cust/index.php new file mode 100644 index 0000000..f45834f --- /dev/null +++ b/www/kadm/cust/index.php @@ -0,0 +1,2 @@ +cate_area = "admin"; \ No newline at end of file diff --git a/www/kadm/inc/body.html b/www/kadm/inc/body.html new file mode 100644 index 0000000..1ba5724 --- /dev/null +++ b/www/kadm/inc/body.html @@ -0,0 +1,17 @@ + +
    +
    +
    Dash Board ##: 상단 대쉬보드 / 현위치 / 로그인 / mnb / Info 등등
    +
    ■ Admin Home > Home +
    +
    +
    본문 +





















    +





















    +





















    +





















    +





















    +





















    +





















    +
    +
    \ No newline at end of file diff --git a/www/kadm/inc/common.ajax.php b/www/kadm/inc/common.ajax.php new file mode 100644 index 0000000..e5efa23 --- /dev/null +++ b/www/kadm/inc/common.ajax.php @@ -0,0 +1,111 @@ +getMember($_REQUEST['admin_id']); + +$_REQUEST['mode'] = isset($_REQUEST['mode'])?$_REQUEST['mode']:""; +switch ($_REQUEST['mode']) { + + case "adminLogin" : + if( csrf_check('adminLogin') ){ + $retval['mesg'] = cUtil\Mlang::getText("정상적인 접근이 아닙니다."); + }else if( !$_REQUEST['admin_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디를 입력하지 않았습니다."); + }else if( !$_REQUEST['admin_pw'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호를 입력하지 않았습니다."); + }else{ + $row = $baseObj->login($_REQUEST['admin_id'],$_REQUEST['admin_pw']); + if( $row ){ + if( !array_key_exists($row['member_auth'],$GLOBALS['_varsAuthAdmin']) ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디나 비밀번호를 확인해 주세요."); + }else if( $row['member_status'] != 1 ){ + $retval['mesg'] = cUtil\Mlang::getText("해당 계정은 [{@1}] 상태입니다.", array($GLOBALS['_varsMemStatus'][$row['member_status']])); + }else{ + $retval['code'] = 1; + } + }else{ + $retval['mesg'] = cUtil\Mlang::getText("아이디나 비밀번호를 확인해 주세요."); + } + $baseObj->logRec($_REQUEST['admin_id'], "admin", $retval['code']); + + } + + break; + + + + + + + + + case "adminJoin" : + if( csrf_check('adminJoin') ){ + $retval['mesg'] = cUtil\Mlang::getText("정상적인 접근이 아닙니다."); + }else if( !$_REQUEST['admin_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디를 입력하지 않았습니다."); + }else if( strlen(preg_replace("/[0-9a-z]/im","",$_REQUEST['admin_id'])) > 0 || strlen(preg_replace("/[^0-9a-z]/im","",$_REQUEST['admin_id'])) < $GLOBALS['_varsBaseCode']['id_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디는 영문자/숫자 만으로 구성되며, {$GLOBALS['_varsBaseCode']['id_len']}자리 이상이어야 합니다."); + }else if( !$_REQUEST['admin_pw'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호를 입력하지 않았습니다."); + }else if( !$_REQUEST['admin_pwf'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호 확인을 입력하지 않았습니다."); + }else if( strlen($_REQUEST['admin_pw']) < $GLOBALS['_varsBaseCode']['pw_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호는 {$GLOBALS['_varsBaseCode']['pw_len']}자 이상이어야 합니다."); + }else if( $_REQUEST['admin_pw'] != $_REQUEST['admin_pwf'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호가 일치하지 않습니다."); + }else if( $admrow['member_id'] || in_array($_REQUEST['admin_id'], array("admin","root")) ){ + $retval['mesg'] = cUtil\Mlang::getText("이미 존재하는 아이디 또는 사용 불가능한 아이디 입니다."); + }else if( !$_REQUEST['admin_name'] ){ + $retval['mesg'] = cUtil\Mlang::getText("관리자명을 입력하지 않았습니다."); + }else{ + $ins_row = Array( + "member_id" => $_REQUEST['admin_id'], + "member_pw" => $_REQUEST['admin_pw'], + "member_name" => $_REQUEST['admin_name'], + "member_auth" => "A", + "member_status" => 2, + ); + $retval['code'] = $baseObj->join($ins_row); + $retval['mesg'] = cUtil\Mlang::getText("등록에 실패하였습니다."); + } + + break; + + + + + + + + + case "adminLogout" : + $retval['code'] = $baseObj->logout(); + break; + + + + + + + + + case "getSiteMenuList": + $mnuObj = new Menu(TB_menu_list); + $mnuObj->cate_area = "admin"; + + $rows = $mnuObj->getTreeListForTreeView("",$_REQUEST['menu_code']); + if( $rows ){ + $retval['code'] = 1; + $retval['data'] = $rows; + }else{ + $retval['mesg'] = "불러오지 못하였습니다."; + } + break; +} + + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/inc/css/admin_form.css b/www/kadm/inc/css/admin_form.css new file mode 100644 index 0000000..f87e851 --- /dev/null +++ b/www/kadm/inc/css/admin_form.css @@ -0,0 +1,448 @@ +.fadmin { + /*max-width: 990px;*/ + margin: 20px auto; + border: solid 1px #e3e3e3; + padding: 20px; + box-shadow: 1px 1px 2px #aaa; + border-radius: 3px; +} +.fadmin .form-control, +.fadmin .form-select { + border-top: none; + border-left: none; + border-right: none; + border-radius: 0; + min-width: 180px; + font-size: 0.85rem; +} + +.fadmin .form-control.inline { + width: 180px; +} + +.form-select.inline { + display: inline-block; + width: auto; +} + +.fadmin .fld-block { + display: flex; + border-bottom: solid 1px #e4e4e4; + padding-bottom: 6px; +} + +form.fadmin label { + min-width: 160px; + border-right: solid 1px gray; + padding-right: 12px; + margin-right: 12px; + text-align: right; + margin-bottom: 0px; +} +form.fadmin .form-control label { + min-width: auto; + border-right: none; +} + +form.mform { + display: flex; + flex-direction: column; + place-content: center; + margin-bottom: 6px; +} + +form.sform { + display: flex; + place-content: flex-end; + margin-bottom: 6px; +} + +form.sform input[type=text], +form.sform input[type=date], +form.sform input[type=number], +form.sform input[type=password] { + width: 136px; +} +form.sform input[type=button], +form.sform button, +form.sform label { + margin-left: 6px; +} +form.sform label span, +form.mform label span { + padding-right: 4px; +} +.form-select, +.form-select-sm { + vertical-align: middle; + border:1px solid #ced4da; +} +.bg-light-pink { + background-color: lightpink !important; +} +.bg-light-blue { + background-color: lightblue !important; +} + +th label, td label { + display: block; + width:100%; + height:100%; + margin:0; +} + +.top_sticky { + position:sticky; + top:0; +} +.bottom_sticky { + position:sticky; + bottom:0; +} +.left_sticky { + position:sticky; + left:0; +} +.right_sticky { + position:sticky; + right:0; +} + +#base_info_body table tbody .code-start td{ + border-top: double 1px gray; + border-bottom: solid 1px gray; +} +#base_info_body table tbody .code-start td:nth-child(1){ + border-bottom: none; +} +#base_info_body table tbody .code-start td:nth-child(2){ + border-left: solid 1px gray; + border-right: solid 1px gray; +} + +.cont_hfix { + height:calc( 100vh - 225px ); + overflow: auto; +} + +/*tree view*/ +.treeview span.icon.glyphicon { + display: inline-block; + width: 14px; +} +.treeview .icon::before, .treeview [class^="glyphicon-"]::before, .treeview [class*=" glyphicon-"]::before { + display: inline-block; + font-family: bootstrap-icons !important; + font-style: normal; + font-weight: normal !important; + font-variant: normal; + text-transform: none; + line-height: 1; + vertical-align: -0.125em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.treeview .glyphicon-minus::before { + content: "\f2e9"; +} + +.treeview .glyphicon-plus::before { + content: "\f4fc"; +} + +.treeview .glyphicon-bookmark::before { + content: "\f1a2"; +} + +.treeview .list-group-item { + padding: .5rem 1.25rem +} + +.treeview .badge { + background-color: dodgerblue; + float: right; + padding: 5px; + margin-left: 3px; +} + +#root li.node-tree { + padding-left: 16px; +} + +/* JSTree */ +#trmenu_top { + cursor: pointer; + background-color: #fff; + border: 1px solid rgba(0,0,0,.125); + line-height: 36px; + height: 36px; + width:100%; + display: block; + font-weight: bold; +} + +.jstree-container-ul { + display: flex; + flex-direction: column; + padding-left: 0; + margin-bottom: 0; + border-radius: 0.25rem; +} +.jstree-default .jstree-node { + min-height: initial; + line-height: initial; + margin-left: initial; + min-width: initial; +} +.jstree-default .jstree-wholerow, +.jstree-default .jstree-anchor { + line-height: 36px; + height: 36px; +} +.jstree-container-ul .jstree-node { + display: block; + padding: 0; + padding-left: 16px !important; + text-decoration: none; +} +.jstree-container-ul .jstree-node .jstree-wholerow { + cursor: pointer; + background-color: #fff; + border: 1px solid rgba(0,0,0,.125); + color: var(--bs-list-group-color); +} +.jstree-default .jstree-wholerow-clicked { + backgoround: linear-gradient(to bottom, #fff 0, #fff 0%); +} +.jstree-container-ul .jstree-node .jstree-wholerow-clicked *{ + color:#fff; +} +.jstree-icon, +.jstree-icon:empty { + margin-top: 7px; +} +.jstree-default .jstree-node, +.jstree-default .jstree-icon { + background-image: none; +} +.jstree-default .jstree-node::before, +.jstree-default .jstree-icon::before { + display: inline-block; + font-family: bootstrap-icons !important; + font-size: 1.1em; + font-style: normal; + font-weight: normal !important; + font-variant: normal; + text-transform: none; + line-height: 1; + vertical-align: -0.125em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.jstree-icon.jstree-ocl { + /*margin-left: 10px;*/ +} +.jstree-closed > .jstree-icon.jstree-ocl, +.jstree-open > .jstree-icon.jstree-ocl { + /*margin-left: 0px;*/ +} +.jstree-closed > .jstree-icon.jstree-ocl::before { + content: "\f4fc"; +} +.jstree-open > .jstree-icon.jstree-ocl::before { + content: "\f2e9"; +} +.jstree-default .jstree-themeicon::before { + content: "\f1a2"; +} +.jstree-default .jstree-themeicon-fill::before { + content: "\f199"; +} +.jstree-default .jstree-node:has("> a > i.jstree-notuse") { + color: #cc6600; +} +.jstree-default .bi-bookmark-x-fill::before, +.jstree-default .jstree-disabled .jstree-themeicon::before { + content: "\f1a0"; + color: red; +} +.jstree-default .jstree-node:has("> a.jstree-disabled") > a > i, +.jstree-default .jstree-node > a.jstree-disabled { + color: #aa0000; + opacity: initial; + filter: initial; + -webkit-filter: initial; +} + +#jstree-marker { + border: none; + z-index: 55; + display: inline-block; + font-family: bootstrap-icons !important; + font-size: 1.1em; + font-style: normal; + font-weight: normal !important; + font-variant: normal; + text-transform: none; + line-height: 1; + vertical-align: -0.125em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +#jstree-marker::before{ + content: "\f1c3"; + font-weight: bold; + color:darkorange; +} + +#jstree-dnd { + border: solid 1px silver; + border-radius: 5px; + background: #eee; +} + +#jstree-dnd.jstree-default { + padding: 10px; + min-width: 150px; +} + +#jstree-dnd.jstree-default .jstree-ok, +#jstree-dnd.jstree-default .jstree-er { + background-image: none; + font-size: 1.6em; +} + +#jstree-dnd.jstree-default .jstree-ok::before{ + content: "\f26a"; + color: green; + margin-top:3px; +} +#jstree-dnd.jstree-default .jstree-er::before{ + content: "\f2e5"; + color: darkorange; +} + +/* auth table */ +table.auth_table {} +table.auth_table td { + vertical-align: top; +} + +table.grid_table { + table-layout: fixed; + border-right:solid 1px silver; +} +table.grid_table th, +table.grid_table td { + border:solid 1px silver; + border-right:none; + padding-left:10px; + padding-right:10px; + white-space: nowrap; + overflow: hidden; +} +table.grid_table th { + text-align: center; +} +table.grid_table td.sptd { + border: solid 1px silver; + border-left: none; + border-right: none; +} +table.grid_table .rowspan2 { + height: 3.4em; +} +table.grid_table.chk_table th, +table.grid_table.chk_table td { + padding-left:0px; + padding-right:0px; +} +table.grid_table.chk_table td label{ + padding-left:10px; + padding-right:10px; + cursor: pointer; +} +.hand { + cursor: pointer; +} + +/* sticky table */ +.sticky_table { + background-color: #fff; +} +.sticky_table th, +.sticky_table td, +.sticky_table table{ + background-color: #fff; +} +.sticky_table .stk_field_left { + position: sticky; + left: 0; + z-index: 90; +} +.sticky_table .stk_field_right { + position: sticky; + right: 0; + z-index: 90; +} +.sticky_table thead { + position: sticky; + top: 0; + z-index: 100; +} +.sticky_table tfoot { + position: sticky; + bottom: 0; + z-index: 100; +} +.sticky_table .sticky_table .stk_field_left { + z-index: 70; +} +.sticky_table .sticky_table .stk_field_right { + z-index: 70; +} +.sticky_table .sticky_table thead { + top: 27px; + z-index: 80; +} +.sticky_table .sticky_table tfoot { + z-index: 80; +} +.sticky_table .sticky_table th { + background-color: lightgrey; +} + +/* awesome notifications */ +#awn-popup-wrapper .awn-popup-body { + max-width: 100%; +} +#awn-popup-wrapper .awn-buttons .awn-btn-success { + background:grey; +} +#awn-popup-wrapper .awn-buttons .awn-btn-success:hover { + background: dimgrey; +} +#awn-popup-wrapper .awn-buttons .awn-btn-cancel { + background:darkorange; +} +#awn-popup-wrapper .awn-buttons .awn-btn-cancel:hover { + background: orangered; +} +#awn-popup-wrapper .awn-buttons .awn-btn-success:focus { + outline: 0px; +} +#awn-popup-wrapper .awn-popup-title { + width:100%; + margin-top: -3px; + margin-bottom: 10px; + border-bottom: solid 1px silver; + padding: 0px 10px 5px 10px; +} + +/* tippy */ +.tippy-box[data-theme~='kuls'] { + background-color: darkcyan; + color: yellow; +} \ No newline at end of file diff --git a/www/kadm/inc/css/admin_frame.css b/www/kadm/inc/css/admin_frame.css new file mode 100644 index 0000000..dad7504 --- /dev/null +++ b/www/kadm/inc/css/admin_frame.css @@ -0,0 +1,358 @@ +/* +https://bootstrap.build/app + +** 메인색 +#1F2937 - prim +#BAC5D7 - secon +#F0BC74 - X +#F1F1E6 - X +$spacer : 0.5rem +$font-size-base: 0.85rem +$input-btn-padding-y : .25rem +$input-btn-padding-x : .5rem +$input-btn-padding-y-sm : .15rem +$input-btn-padding-x-sm : .4rem +$input-btn-padding-y-lg : .3rem +$input-btn-padding-x-lg : .7em +$table-cell-padding: .36em + +@import url(//fonts.googleapis.com/earlyaccess/notosanskr.css); +*/ +@import url(//cdn.jsdelivr.net/npm/@openfonts/noto-sans-kr_korean@1.44.1/index.min.css); + +* { + font-family: 'Noto Sans KR', sans-serif; +} + +#root { + border:none; +} + +[v-cloak] { + display: none; +} + +/* 초기 Sidebar */ +#root #sidebar { + position: fixed; + top: 0; + left: 0; + bottom: 0; + float: left; + width: 250px; + color: #fff; + background: #1F2937; + z-index: 100; +} + +#root #sidebar .head-logo { + display: flex; + align-items: center; + justify-content: center; + height: 64px; + padding: 0 20px; + background-image: url("/include/img/kuls_ict.png"); + background-repeat: no-repeat; + background-position: center center; + background-size: 70%; + background-color: #ffffff; +} + +#root #sidebar #side-pos { + display: flex; + align-items: center; + justify-content: center; + height: 46px; + font-size: large; + background: #00000033; +} + +#root #sidebar #side-nav { + position:absolute; + top:0; + left:0; + margin-top: 110px; + width:100%; + height: calc(100% - 110px); + overflow: auto; +} + +/* TreeView.js */ +#side-nav .list-group { + border-radius: 0px; +} +#side-nav .list-group .list-group-item { + background-color: transparent; + color: #fff; + padding-left: 18px; +} +#side-nav span.icon.glyphicon { + position: absolute; + top: 0; + right: 0px; + padding-top: 6px; + width: 30px; + height: 100%; + text-align: center; +} +#side-nav .node-side-nav.node-selected, +#side-nav .node-side-nav.node-selected:hover { + /*background-color: var(--bs-secondary);*/ +} +#side-nav .node-side-nav:hover { + background-color: #fff3; + color: orange; + cursor: pointer; +} +#side-nav.treeview .glyphicon-minus::before { + content: "\f282"; +} +#side-nav.treeview .glyphicon-plus::before { + content: "\f285"; +} +#side-nav .node-side-nav a { + text-decoration: none; +} + +#root #main { + position:relative; + width: 100%; + padding-left: 250px; + background: #F4F5F7; + z-index: 50; +} + +#root #main .header-static { + position: sticky; + top:0; + height: 110px; + background: #F4F5F7; + z-index: 2; +} + +#root #main .header-static .header-status { + display: flex; + align-items: center; + justify-content: space-between; + height: 64px; + padding: 0 10px; +} + +#root #main .header-static .header-status .icon-title { + font-size: x-large; + padding-right: 20px; + vertical-align: baseline; +} + +#root #main .header-static .header-status .icon-link { + font-size: small; + padding-right: 10px; + vertical-align: baseline; +} + +#root #main .header-static .header-bcrumb { + display: flex; + align-items: center; + height: 46px; + padding: 5px 20px; + border-top: 1px #BAC5D7 solid; + border-bottom: 1px #BAC5D7 solid; +} + +#root #main .body { + padding: 10px 30px 20px 30px; + min-height: calc(100vh - 110px); + z-index: 1; +} + +#root #main #cmd_bar { + display: flex; + align-items: center; + justify-content: space-between; + + padding-bottom: 6px; + border-bottom: solid 2px #1F2937; +} + +#root ul, #root li { + list-style-type: none; + margin-left: 0px; + padding-left: 0px; +} + +#root #sidebar .side-gnb { + display: flex; + flex-direction: column; +} + +#root #sidebar .side-gnb > li > a, +#root #sidebar .side-gnb > li .side-lnb > li > a { + display: block; + padding: 10px; + padding-left: 20px; + text-decoration: none; + /*border-bottom: solid 1px #2D3C50;*/ +} + +#root #sidebar .side-gnb > li .side-lnb > li > a { + padding: 7px 10px 7px 40px; +} + +#root #sidebar #side-nav li { + position: relative; +} + +#root #sidebar #side-nav li .bi { + margin-right: 10px; +} + +#root #sidebar #side-nav li .bi.selmnu, #root #sidebar #side-nav li .bi.selmnusub{ + display: none; +} + +#root #sidebar #side-nav li.active > a > .bi.selmnu { + display: block; + position: absolute; + color: #F0BC74; + font-size: large; + left: 3px; + top: 8px; +} + +#root #sidebar #side-nav li.hassub .bi.selmnusub { + display: block; + position: absolute; + right: 3px; + top: 10px; + + -webkit-transition-duration: 0.5s; + transition-duration: 0.5s; +} + +#root #sidebar #side-nav li.hassub.open .bi.selmnusub { + transform: rotate(180deg); +} + +#root #sidebar .side-gnb > li:hover { + background-color: #fff3; + cursor: pointer; +} + +#root #sidebar .side-gnb > li .side-lnb > li:hover { + background-color: #0006; + cursor: pointer; +} + +#root #sidebar .side-gnb li a { + color: #fff; +} +#root #sidebar .side-gnb li a:hover { + color: orange; +} + +#root.full-width #sidebar { + left: -250px; + + -webkit-transition: all 0.3s, -webkit-transform 0.3s; + transition: all 0.3s, transform 0.3s; +} +#root.full-width #main { + padding-left: 0px; + + -webkit-transition: all 0.3s, -webkit-transform 0.3s; + transition: all 0.3s, transform 0.3s; +} +.btn-sidemenu { + cursor: pointer; +} + +/*********** login ************/ +#login { + display: flex; + align-items: center; + justify-content: center; + height: 100vh; + background-color: #F4F5F7; +} + +#login-box { + display: flex; + flex-direction: row; + padding: 20px; + width: 50%; + min-width: 600px; + border-radius: 6px; +} + +#login-info { + display: flex; + align-items: center; + justify-content: center; + flex:1; + height: 38vh; + min-height: 360px; + + background-image: url("/include/img/kuls_ict.png"); + background-repeat: no-repeat; + background-position: center center; + background-size: 80%; +} + +#login-form { + display: flex; + align-items: center; + justify-content: center; + flex:1; + height: 38vh; + min-height: 360px; + border-left: solid 1px #BAC5D7; +} + +.fld-block { + padding-top: 10px; +} + +.table { + font-size: small; +} +.table th, .table td { + vertical-align: middle; +} + +.table tbody tr:hover { + /*background: #ededed;*/ + background: #bac5d7; +} + +.pagination a { + border: solid 1px silver; + margin: 0 2px; +} + +.bg-lightgray, .bg-lightgrey { + background-color: #e5e9ef; +} + +select option:disabled { + color:lightcoral; +} + +@media (max-width: 640px) { + #login-box { + display: block; + padding: 20px; + width: 90%; + min-width: 90%; + border-radius: 6px; + } + + #login-info { + height: 10vh; + min-height: 10vh; + } + + #login-form { + border:none; + border-top: solid 1px #BAC5D7; + } +} \ No newline at end of file diff --git a/www/kadm/inc/footer.html b/www/kadm/inc/footer.html new file mode 100644 index 0000000..8e1fa6e --- /dev/null +++ b/www/kadm/inc/footer.html @@ -0,0 +1,10 @@ + + + + + + +putVisitRec("admin",$cate_id); \ No newline at end of file diff --git a/www/kadm/inc/footer_common.html b/www/kadm/inc/footer_common.html new file mode 100644 index 0000000..e445d21 --- /dev/null +++ b/www/kadm/inc/footer_common.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/kadm/inc/footer_frame.html b/www/kadm/inc/footer_frame.html new file mode 100644 index 0000000..f822d82 --- /dev/null +++ b/www/kadm/inc/footer_frame.html @@ -0,0 +1,4 @@ + + + + diff --git a/www/kadm/inc/footer_inc.html b/www/kadm/inc/footer_inc.html new file mode 100644 index 0000000..507d46d --- /dev/null +++ b/www/kadm/inc/footer_inc.html @@ -0,0 +1,84 @@ + + + \ No newline at end of file diff --git a/www/kadm/inc/header.html b/www/kadm/inc/header.html new file mode 100644 index 0000000..ad28c40 --- /dev/null +++ b/www/kadm/inc/header.html @@ -0,0 +1,50 @@ +getMenuBrdcom($GLOBALS['_Auth_']['cate_id']); +} + +if( $menu_hist ){ + $GLOBALS['_Menu_'] = array( + "menu_code" => $menu_hist['cate_code'][count($menu_hist['cate_id'])-1], + "menu_name" => $menu_hist['cate_name'][count($menu_hist['cate_id'])-1], + "menu_exp" => $menu_hist['cate_exp'][count($menu_hist['cate_id'])-1], + ); +} +?> + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + () + Logout +
    +
    +
    + + Home + + + + "> + + +
    +
    +
    \ No newline at end of file diff --git a/www/kadm/inc/header_common.html b/www/kadm/inc/header_common.html new file mode 100644 index 0000000..7f9d556 --- /dev/null +++ b/www/kadm/inc/header_common.html @@ -0,0 +1,22 @@ + + (주)Kuls Admin + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/kadm/inc/header_frame.html b/www/kadm/inc/header_frame.html new file mode 100644 index 0000000..7f86c8b --- /dev/null +++ b/www/kadm/inc/header_frame.html @@ -0,0 +1,2 @@ + +
    \ No newline at end of file diff --git a/www/kadm/inc/header_inc.html b/www/kadm/inc/header_inc.html new file mode 100644 index 0000000..1be6e54 --- /dev/null +++ b/www/kadm/inc/header_inc.html @@ -0,0 +1,17 @@ +hasMenuAuth("R", $GLOBALS['_Auth_']['cate_id']) ){ +// hback($GLOBALS['_Auth_']['deny_view']); +//} + +if( _notAuth("R", $__null__, $GLOBALS['_Auth_']['cate_id']) ){ //Up and This are Same Same OK? + hback($GLOBALS['_Auth_']['deny_view']); +} \ No newline at end of file diff --git a/www/kadm/inc/js/common.js b/www/kadm/inc/js/common.js new file mode 100644 index 0000000..4b0291c --- /dev/null +++ b/www/kadm/inc/js/common.js @@ -0,0 +1,63 @@ + +/* +* 로그아웃 +* */ +const logout = function(){ + ajax_json({ + url: "/kadm/inc/common.ajax.php", + type: "POST", + data: {mode: 'adminLogout'}, + success: function (data) { + if ( data.code ) { + kuls_alert("로그아웃 되었습니다.",function(){ + location.href="/kadm/"; + }); + } + }, + error: function (request, status, error) { + kuls_alert(error.message); + } + }); +}; + +const menu_toggle = function(){ + jQuery("#root").toggleClass("full-width"); +} + +const cont_hfix = function(){ + jQuery(".cont_hfix").css('height',0); + let win_h = jQuery(window).outerHeight(); + jQuery(".cont_hfix").toArray().forEach( tgt => { + let cont_y = jQuery(tgt).offset().top; + let cont_height = win_h - cont_y - 20; + jQuery(tgt).css('height',cont_height); + }); +} + +const menu_mobile = function(){ + let win_w = jQuery(window).innerWidth(); + if( win_w < 640 ){ + jQuery("#root").addClass("full-width"); + }else{ + jQuery("#root").removeClass("full-width"); + } +} + +jQuery(document).ready(function(){ + jQuery(".btn-sidemenu").on("click",menu_toggle); + + //사이드메뉴 스크롤바 + if( document.querySelector('#side-nav') ){ + new PerfectScrollbar(document.querySelector('#side-nav')); + } + + window.setTimeout(function(){ //vue 동작때문에 + cont_hfix(); + menu_mobile(); + },100); +}); + +jQuery(window).on("resize",function(){ + cont_hfix(); + menu_mobile(); +}); \ No newline at end of file diff --git a/www/kadm/inc/js/treeitem.vue.js b/www/kadm/inc/js/treeitem.vue.js new file mode 100644 index 0000000..fe271f9 --- /dev/null +++ b/www/kadm/inc/js/treeitem.vue.js @@ -0,0 +1,42 @@ +export default { + name: 'TreeItem', + props: { + itemdata: Object, + }, + data() { + return { + } + }, + computed: { + isFolder() { + return this.itemdata.children && this.itemdata.children.length + } + }, + methods: { + toggle() { + if (this.isFolder) { + this.itemdata.isOpen = !this.itemdata.isOpen + } + }, + changeType() { + if (!this.isFolder) { + this.itemdata.children = [] + this.addChild() + this.itemdata.isOpen = true + } + }, + addChild() { + this.itemdata.children.push({ + name: '새 카테고리' + }) + } + }, + template: ` +
  3. +
    {{ itemdata.name }} [{{ itemdata.isOpen ? '-' : '+' }}]
    +
      + +
    +
  4. + ` +} \ No newline at end of file diff --git a/www/kadm/inc/js/treeview.vue.js b/www/kadm/inc/js/treeview.vue.js new file mode 100644 index 0000000..e57e8c6 --- /dev/null +++ b/www/kadm/inc/js/treeview.vue.js @@ -0,0 +1,33 @@ +import TreeItem from './treeitem.vue.js' + + + +export default { + name: "Tree", + props: { + treedata: Object + }, + components: { + TreeItem + }, + data() { + return { + } + }, + template: ` +
      + +
    + `, + css: ` + .item { + cursor: pointer; + line-height: 1.5; + color:red; + } + .bold { + font-weight: bold; + color:green; + } + ` +} \ No newline at end of file diff --git a/www/kadm/inc/sidemenu.html b/www/kadm/inc/sidemenu.html new file mode 100644 index 0000000..4328a4b --- /dev/null +++ b/www/kadm/inc/sidemenu.html @@ -0,0 +1,48 @@ + + \ No newline at end of file diff --git a/www/kadm/index.php b/www/kadm/index.php new file mode 100644 index 0000000..610cb3c --- /dev/null +++ b/www/kadm/index.php @@ -0,0 +1,8 @@ + + +
      +
    • ※ Todo List - 기본 1차
    • +
    • 1. DB - MSSQL 기본 Class 99%
    • +
    • 2. 리스트 관리 Class 99%
    • +
    • 3. 기본 데이터관리 클래스 99%
    • +
    • 4. 회원관리 90%
    • +
    • - 4.1 회원관리 100%
    • +
    • - 4.2 회원로그인 100%
    • +
    • - 4.3 토큰로그인 80%
    • +
    • 5. 기준정보 99%
    • +
    • 6. 메뉴관리 99%
    • +
    • - 6.1 카테고리 Class 99%
    • +
    • - 6.2 관리자 메뉴 Script 99%
    • +
    • - 6.3 메뉴 코드로 페이지 내용 / Breadcumb 적용 99%
    • +
    • 7. 권한관리 99%
    • +
    • - 7.1 관리자 페이지 권한 적용 99%
    • +
    • 8. 간단게시판 50%
    • +
    • - 8.1 웹에디터 80%
    • +
    • - 8.2 첨부파일 관리 Class 10%
    • +
    • 9. 기본페이지 100%
    • +
    • - 9.1 기본페이지 100%
    • +
    • - 9.2 Grid Api 적용 100%
    • +
    • - 9.3 엑셀 다운로드 100%
    • +
    • 10. 반응형 코딩99%
    • +
    • - 10.1 반응형 프레임 99%
    • +
    • - 10.2 미디어 쿼리 99%
    • +
    • 11. 사용자 기준정보 99%
    • +
    • - 11.1 사용자 기준정보 (창고관리) 99%
    • +
    • - 11.2 사용자 기준정보 (거래처관리) 99%
    • +
    + + \ No newline at end of file diff --git a/www/kadm/member/_backup/join.php b/www/kadm/member/_backup/join.php new file mode 100644 index 0000000..b0de529 --- /dev/null +++ b/www/kadm/member/_backup/join.php @@ -0,0 +1,44 @@ + + + + + + + + + +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/www/kadm/member/_backup/member.ajax.php b/www/kadm/member/_backup/member.ajax.php new file mode 100644 index 0000000..ca0ea69 --- /dev/null +++ b/www/kadm/member/_backup/member.ajax.php @@ -0,0 +1,39 @@ +add("member_auth != ?", "SA"); +$where->add("member_auth != ?", "A"); +$admrow = $baseObj->getMember($_REQUEST['admin_id'], $where); + +if( !_notAuth("R") ){/************ 권한체크*/ + switch ($_REQUEST['mode']) { + + case "getMemberList" : + $where = new DB_where(); + $where->add("member_auth != ?", "SA"); + $where->add("member_auth != ?", "A"); + $retval['data'] = $baseObj->getMemberPage(Array(),Array(),$where); + break; + + + + + + + + case "getMemberLogList" : + $where = new DB_where(); + $where->add("member_auth != ?", "SA"); + $where->add("member_auth != ?", "A"); + $retval['data'] = $baseObj->getMemberLogPage(Array(),Array(),$where); + break; + } +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/member/_backup/member_list.php b/www/kadm/member/_backup/member_list.php new file mode 100644 index 0000000..45c52fc --- /dev/null +++ b/www/kadm/member/_backup/member_list.php @@ -0,0 +1,74 @@ + + +
    + 사원 추가 +
    + +
    +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + rows as $row ){ + ?> + + + + + + + + + + + +
    No사원 ID사원명권한등록일수정일최종로그인
    line_cnt--?>
    + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +

    Admin Login

    +
    + + +
    +
    + + +
    +
    + +
    + +
    + +
    + + + +
    + + + +
    +

    Admin Join

    +
    (You can log in after approval.)
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    + +
    + +
    + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/www/kadm/member/mem.ajax.php b/www/kadm/member/mem.ajax.php new file mode 100644 index 0000000..120f35d --- /dev/null +++ b/www/kadm/member/mem.ajax.php @@ -0,0 +1,180 @@ +getMember($_REQUEST['member_id']); + +if( !_notAuth("R") ){/************ 권한체크*/ + switch ($_REQUEST['mode']) { + + case "getMemberList" : + $where = new DB_where(); + $subwhere = $where->sub_where("or"); + foreach( (array)$authDest as $key => $val ){ + $subwhere->add("member_auth = ?",$key); + } + + $addquery = Array( + "member_status" => $_REQUEST['member_status']?:"", + "member_auth" => $_REQUEST['member_auth']?:"", + "cust_id" => $_REQUEST['cust_id']?:"", + ); + foreach( $addquery as $key => $val ){ + if( $val ) $where->add("{$key} = ?",$val); + } + + $retval['data'] = $baseObj->getMemberPage($_REQUEST,$addquery,$where,"",1); + break; + + + + + + + + + + + + case "getMemberLogList" : + $where = new DB_where(); + $where->add("login_page = ?", $cate_area); + + $addquery = Array( + "login_success" => hasval($_REQUEST['login_success'])?$_REQUEST['login_success']:"", + ); + foreach( $addquery as $key => $val ){ + if( hasval($val) ) $where->add("{$key} = ?",$val); + } + + $retval['data'] = $baseObj->getMemberLogPage($_REQUEST,$addquery,$where); + break; + + + + + + + + + + + + case "putMember" : + + if( csrf_check('putMember') ){ + $retval['mesg'] = cUtil\Mlang::getText("정상적인 접근이 아닙니다."); break; + } + + if( !$_REQUEST['member_oid'] ){ + if( !$_REQUEST['member_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디를 입력하지 않았습니다."); break; + }else if( strlen(preg_replace("/[0-9a-z]/im","",$_REQUEST['member_id'])) > 0 || strlen(preg_replace("/[^0-9a-z]/im","",$_REQUEST['member_id'])) < $GLOBALS['_varsBaseCode']['id_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디는 영문자/숫자 만으로 구성되며, {$GLOBALS['_varsBaseCode']['id_len']}자리 이상이어야 합니다."); break; + }else if( $minfo['member_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("이미 존재하거나 사용 금지된 아이디 입니다."); break; + } + } + + if( !$_REQUEST['member_oid'] || $_REQUEST['member_pw'] || $_REQUEST['member_pwf'] ){ + if( !$_REQUEST['member_pw'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호를 입력하지 않았습니다."); break; + }else if( !$_REQUEST['member_pwf'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호 확인을 입력하지 않았습니다."); break; + }else if( strlen($_REQUEST['member_pw']) < $GLOBALS['_varsBaseCode']['pw_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호는 {$GLOBALS['_varsBaseCode']['pw_len']}자 이상이어야 합니다."); break; + }else if( $_REQUEST['member_pw'] != $_REQUEST['member_pwf'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호가 일치하지 않습니다."); break; + } + } + + if( !$_REQUEST['member_name'] ){ + $retval['mesg'] = cUtil\Mlang::getText("회원명을 입력하지 않았습니다."); break; + } + + $ins_row = Array( + "member_name" => $_REQUEST['member_name'], + "member_auth" => $_REQUEST['member_auth'], + "member_status" => $_REQUEST['member_status']?:2, + ); + + if( $_REQUEST['cust_id'] && !$_REQUEST['cust_name'] ){ + $custObj = new Cust(); + $cinfo = $custObj->getCust($_REQUEST['cust_id']); + $_REQUEST['cust_name'] = $cinfo['cust_name']; + } + + if( !$_REQUEST['member_oid'] ){ + + if( _notAuth("W") ) break; /************ 권한체크*/ + + $ins_row['member_id'] = $_REQUEST['member_id']; + $ins_row['member_pw'] = $_REQUEST['member_pw']; + + $retval['code'] = $baseObj->putMember($ins_row); + }else{ + + if( _notAuth("D") ) break; /************ 권한체크*/ + + $_REQUEST['member_id'] = $_REQUEST['member_oid']; + $ins_row['member_id'] = $_REQUEST['member_oid']; + if( $_REQUEST['member_pw'] ){ + $ins_row['member_pw'] = $_REQUEST['member_pw']; + } + + $retval['code'] = $baseObj->setMember($ins_row); + } + if( $retval['code'] ){ + $baseObj->setMemberUnion($_REQUEST); + } + + $retval['mesg'] = cUtil\Mlang::getText("등록에 실패하였습니다."); + break; + + + + + + + + + + + + case "setMemberState" : + + if( _notAuth("D") ) break; /************ 권한체크*/ + + if( !$_REQUEST['member_status'] ){ + $retval['mesg'] = cUtil\Mlang::getText("상태를 선택하지 않았습니다."); break; + } + if( !$_REQUEST['delchk'] ){ + $retval['mesg'] = cUtil\Mlang::getText("대상회원을 선택하지 않았습니다."); break; + } + + $ins_row = Array( + "member_id" => $_REQUEST['delchk'], + "member_status" => $_REQUEST['member_status'], + ); + $retval['code'] = $baseObj->setMemberParts($ins_row); + $retval['mesg'] = cUtil\Mlang::getText("등록에 실패하였습니다."); + break; + } +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/member/mem_list.php b/www/kadm/member/mem_list.php new file mode 100644 index 0000000..f86164d --- /dev/null +++ b/www/kadm/member/mem_list.php @@ -0,0 +1,211 @@ +add("cust_status = ?",1); +$where->add("cust_active = ?",1); +$cust_list = $custObj->getCustSelect("cust_id", "cust_name", $where); + +include _ADM_INC_PATH_ ."/header.html"; +?> + +
    + + + + + + + + + +
    + +
    +
    리스트
    + +
    + +
    +
    +
    +
    + 정보 +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + rows as $row ){ + switch( $row['member_status'] ){ //기준정보로 대체 + case "2" : + $row['member_status_txt'] = "승인대기"; break; + case "1" : + $row['member_status_txt'] = "활동중"; break; + default : + $row['member_status_txt'] = "정지됨"; break; + } + ?> + + + + + + + + + + + + + + rows) < 1 ){ + ?> + + + + + +
    회원 ID회원명 + + 소속권한Active등록일수정일최종로그인
    +
    + +
    +
    +
    +
    + + + + + diff --git a/www/kadm/member/mem_log_list.php b/www/kadm/member/mem_log_list.php new file mode 100644 index 0000000..25ed290 --- /dev/null +++ b/www/kadm/member/mem_log_list.php @@ -0,0 +1,125 @@ + + +
    + + + + + + + +
    + +
    +
    로그인 기록
    +
    +
    +
    + +
    +
    +
    +
    + 로그인 기록 +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + rows as $row ){ + switch( $row['login_success'] ){ + case "1" : + $row['login_result'] = "성공"; break; + default : + $row['login_result'] = "실패"; break; + } + ?> + + + + + + + + + + + + rows) < 1 ){ + ?> + + + + + +
    No회원 ID회원명접속일자성공여부IP 주소접속브라우저접속주소운영체제
    line_cnt--?>
    + +
    +
    +
    +
    + 관리자 변경.. 하지말자. +//switch( $GLOBALS['_Umem']['member_auth'] ){ +// case "SA": +// $authDest = array_merge($GLOBALS['_varsAuthAdmin'], $GLOBALS['_varsAuthMember']); +// break; +// +// default: +// $authDest = $GLOBALS['_varsAuthMember']; +// break; +//} +switch( $cate_area ){ + case "admin": + $authDest = $GLOBALS['_varsAuthAdmin']; + break; + + case "service": + $authDest = $GLOBALS['_varsAuthMember']; + break; +} + +$custObj = new Cust(); +$where = new DB_where("and"); +$where->add("cust_status = ?",1); +$where->add("cust_active = ?",1); +$cust_list = $custObj->getCustSelect("cust_id", "cust_name", $where); + +$memObj = new Member(); + +$minfo = array(); +$smnu_txt = "추가"; +if( isset($_REQUEST['member_id']) ){ + $minfo = $memObj->getMember($_REQUEST['member_id']); + $smnu_txt = "수정"; +} + +unset($authDest['Y']); //비회원제거 + +include _ADM_INC_PATH_ ."/header.html"; +?> + +
    +
    +
    +
    +
    + +
    +
    + +
    + > + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    + 리스트 + +
    + + +
    + + + + \ No newline at end of file diff --git a/www/kadm/member/member.ajax.php b/www/kadm/member/member.ajax.php new file mode 100644 index 0000000..b415487 --- /dev/null +++ b/www/kadm/member/member.ajax.php @@ -0,0 +1,8 @@ + + +
    +
    메뉴 관리
    +
    +
    +
    + +
    +
    +
    +
    메뉴 리스트
    +
    +
    + +
    + +
    +
    +
    +
    +
    메뉴 정보
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ ID는 분류내에서 유일한(Unique)한 값이어야 합니다. +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ 출력순서를 지정합니다. 입력한 index의 후순위 코드들은 자동으로 순위가 변경 적용됩니다. +
    +
    +
    + +
    + + ※ 사용하지 않을경우 체크해제 합니다. +
    +
    +
    + +
    +
    +
    +
    +
    + + + diff --git a/www/kadm/menu/_backup/test.html b/www/kadm/menu/_backup/test.html new file mode 100644 index 0000000..011fb0e --- /dev/null +++ b/www/kadm/menu/_backup/test.html @@ -0,0 +1,33 @@ + + + + + + +
    + +
    + + + + + + + \ No newline at end of file diff --git a/www/kadm/menu/index.php b/www/kadm/menu/index.php new file mode 100644 index 0000000..25dcf2e --- /dev/null +++ b/www/kadm/menu/index.php @@ -0,0 +1,2 @@ +cate_area = $_REQUEST['cate_area']; + +if( !_notAuth("R") ){/************ 권한체크*/ + switch( $_REQUEST['mode'] ) { + case "getMenuList": + $rows = $mnuObj->getMenuAuthList(""); + for( $a=0 ; $a $name ){ + // $rows[$a]['cate_auth_read'][$auth_area] = $mnuObj->AUTH->getHasAuthRow($rows[$a]['auth'][$auth_area], "READ"); + // $rows[$a]['cate_auth_write'][$auth_area] = $mnuObj->AUTH->getHasAuthRow($rows[$a]['auth'][$auth_area], "WRITE"); + // $rows[$a]['cate_auth_delete'][$auth_area] = $mnuObj->AUTH->getHasAuthRow($rows[$a]['auth'][$auth_area], "DELETE"); + // } + $rows[$a]['data']['cate_auth_read'] = $mnuObj->AUTH->getHasAuthRow($rows[$a]['data']['auth']['G'], "READ"); + $rows[$a]['data']['cate_auth_write'] = $mnuObj->AUTH->getHasAuthRow($rows[$a]['data']['auth']['G'], "WRITE"); + $rows[$a]['data']['cate_auth_delete'] = $mnuObj->AUTH->getHasAuthRow($rows[$a]['data']['auth']['G'], "DELETE"); + $rows[$a]['icon'] = $rows[$a]['data']['cate_use']!="Y"?"jstree-notuse text-danger bi bi-bookmark-x-fill":""; + //$rows[$a]['state']['disabled'] = $rows[$a]['data']['cate_use']!="Y"?"1":""; + } + if( $rows ){ + $retval['code'] = 1; + $retval['data'] = $rows; + }else{ + $retval['mesg'] = "불러오지 못하였습니다."; + } + break; + + case "putMenu": + + if( !$_REQUEST['cate_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("메뉴 ID를 입력하지 않았습니다."); break; + } + if( !$_REQUEST['cate_name'] ){ + $retval['mesg'] = cUtil\Mlang::getText("메뉴명을 입력하지 않았습니다."); break; + } + + if( $_REQUEST['cate_mode'] == "N" ){ + + if( _notAuth("W") ) break; /************ 권한체크*/ + + $caterow = $mnuObj->cate_info_id($_REQUEST['cate_id']); + if( $caterow['cate_id'] == $_REQUEST['cate_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("같은 메뉴 ID를 사용하는 항목이 존재합니다."); break; + } + + $rst = $mnuObj->putMenu($_REQUEST, "G"); + }else{ + + if( _notAuth("D") ) break; /************ 권한체크*/ + + $where = new DB_where("and"); + $where->add("cate_id != ?",$_REQUEST['parent_id']); + $caterow = $mnuObj->cate_info_id($_REQUEST['cate_id'], $where); + if( $caterow['cate_id'] == $_REQUEST['cate_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("같은 메뉴 ID를 사용하는 항목이 존재합니다."); break; + } + + $rst = $mnuObj->setMenu($_REQUEST, "G"); + } + + $retval['code'] = $rst; + $retval['mesg'] = cUtil\Mlang::getText("등록에 실패하였습니다."); + break; + + case "delMenu": + + if( _notAuth("D") ) break; /************ 권한체크*/ + + if( !$_REQUEST['parent_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("삭제할 메뉴를 선택하지 않았습니다."); break; + } + + $rst = $mnuObj->delMenu($_REQUEST['cate_id']); + + $retval['code'] = $rst; + $retval['mesg'] = cUtil\Mlang::getText("삭제되지 않았습니다. 다시 확인해 주세요."); + break; + + case "sortMenu": + $retval['code'] = $mnuObj->move_target_cate_id($_REQUEST['cate_id'],$_REQUEST['target_id'],$_REQUEST['pos_num']); + break; + + } +} + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/kadm/menu/menu_admin.php b/www/kadm/menu/menu_admin.php new file mode 100644 index 0000000..d7cfa2a --- /dev/null +++ b/www/kadm/menu/menu_admin.php @@ -0,0 +1,8 @@ +cate_area = $cate_area; +?> + +
    +
    메뉴 관리
    +
    +
    +
    + +
    +
    +
    +
    + 메뉴 리스트 + ※ 순서 및 위치는 마우스로 드래그 하여 변경합니다. +
    +
    +
    최상위
    +
    +
    +
    +
    +
    메뉴 정보
    +
    + +
    + +
    + 최상위 + 바로가기 +
    +
    +
    + +
    + +
    +
    +
    + +
    + + ※ ID는 전체 메뉴에서 고유한 값이어야 합니다. +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + 조 회 : +
    + authDest)?> +
    +
    +
    + 작 성 : +
    + authDest)?> +
    +
    +
    + 수정/삭제 : +
    + authDest)?> +
    +
    + hasMenuAuth("R","mnu_auth") ){?> + ※ 상세 권한 관리는 [권한관리] 메뉴를 이용하세요. + +
    +
    +
    + +
    + + ※ 페이지 內 코드가 우선시 되며, 페이지내 코드가 없을 경우 위 페이지들의 접근(조회) 권한을 적용합니다. +
    +
    +
    + + + +
    +
    +
    +
    +
    + + + diff --git a/www/kadm/menu/menu_service.php b/www/kadm/menu/menu_service.php new file mode 100644 index 0000000..fc030b7 --- /dev/null +++ b/www/kadm/menu/menu_service.php @@ -0,0 +1,8 @@ +/Build/.htaccess" +# NOTE: "mod_mime" Apache module must be enabled for this configuration to work. + + +# The following lines are required for builds without decompression fallback, compressed with gzip +RemoveType .gz +AddEncoding gzip .gz +AddType application/octet-stream .data.gz +AddType application/wasm .wasm.gz +AddType application/javascript .js.gz +AddType application/octet-stream .symbols.json.gz + +# The following lines are required for builds without decompression fallback, compressed with Brotli +RemoveType .br +RemoveLanguage .br +AddEncoding br .br +AddType application/octet-stream .data.br +AddType application/wasm .wasm.br +AddType application/javascript .js.br +AddType application/octet-stream .symbols.json.br + +# The following line improves loading performance for uncompressed builds +AddType application/wasm .wasm + +# Uncomment the following line to improve loading performance for gzip-compressed builds with decompression fallback +AddEncoding gzip .unityweb + +# Uncomment the following line to improve loading performance for brotli-compressed builds with decompression fallback +AddEncoding br .unityweb + + diff --git a/www/ksvc/WEBGL/Build/.htaccess b/www/ksvc/WEBGL/Build/.htaccess new file mode 100644 index 0000000..1a38836 --- /dev/null +++ b/www/ksvc/WEBGL/Build/.htaccess @@ -0,0 +1,31 @@ +# This configuration file should be uploaded to the server as "/Build/.htaccess" +# NOTE: "mod_mime" Apache module must be enabled for this configuration to work. + + +# The following lines are required for builds without decompression fallback, compressed with gzip +RemoveType .gz +AddEncoding gzip .gz +AddType application/octet-stream .data.gz +AddType application/wasm .wasm.gz +AddType application/javascript .js.gz +AddType application/octet-stream .symbols.json.gz + +# The following lines are required for builds without decompression fallback, compressed with Brotli +RemoveType .br +RemoveLanguage .br +AddEncoding br .br +AddType application/octet-stream .data.br +AddType application/wasm .wasm.br +AddType application/javascript .js.br +AddType application/octet-stream .symbols.json.br + +# The following line improves loading performance for uncompressed builds +AddType application/wasm .wasm + +# Uncomment the following line to improve loading performance for gzip-compressed builds with decompression fallback +AddEncoding gzip .unityweb + +# Uncomment the following line to improve loading performance for brotli-compressed builds with decompression fallback +AddEncoding br .unityweb + + diff --git a/www/ksvc/WEBGL/Build/WEBGL.data.gz b/www/ksvc/WEBGL/Build/WEBGL.data.gz new file mode 100644 index 0000000..12965ab Binary files /dev/null and b/www/ksvc/WEBGL/Build/WEBGL.data.gz differ diff --git a/www/ksvc/WEBGL/Build/WEBGL.framework.js.gz b/www/ksvc/WEBGL/Build/WEBGL.framework.js.gz new file mode 100644 index 0000000..3b3faac Binary files /dev/null and b/www/ksvc/WEBGL/Build/WEBGL.framework.js.gz differ diff --git a/www/ksvc/WEBGL/Build/WEBGL.loader.js b/www/ksvc/WEBGL/Build/WEBGL.loader.js new file mode 100644 index 0000000..c3cd737 --- /dev/null +++ b/www/ksvc/WEBGL/Build/WEBGL.loader.js @@ -0,0 +1 @@ +function createUnityInstance(e,t,n){function r(e,n){if(!r.aborted&&t.showBanner)return"error"==n&&(r.aborted=!0),t.showBanner(e,n);switch(n){case"error":console.error(e);break;case"warning":console.warn(e);break;default:console.log(e)}}function o(e){var t=e.reason||e.error,n=t?t.toString():e.message||e.reason||"",r=t&&t.stack?t.stack.toString():"";if(r.startsWith(n)&&(r=r.substring(n.length)),n+="\n"+r.trim(),n&&l.stackTraceRegExp&&l.stackTraceRegExp.test(n)){var o=e.filename||t&&(t.fileName||t.sourceURL)||"",a=e.lineno||t&&(t.lineNumber||t.line)||0;i(n,o,a)}}function a(e){e.preventDefault()}function i(e,t,n){if(e.indexOf("fullscreen error")==-1){if(l.startupErrorHandler)return void l.startupErrorHandler(e,t,n);if(!(l.errorHandler&&l.errorHandler(e,t,n)||(console.log("Invoking error handler due to\n"+e),"function"==typeof dump&&dump("Invoking error handler due to\n"+e),i.didShowErrorMessage))){var e="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+e;e.indexOf("DISABLE_EXCEPTION_CATCHING")!=-1?e="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":e.indexOf("Cannot enlarge memory arrays")!=-1?e="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":e.indexOf("Invalid array buffer length")==-1&&e.indexOf("Invalid typed array length")==-1&&e.indexOf("out of memory")==-1&&e.indexOf("could not allocate memory")==-1||(e="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(e),i.didShowErrorMessage=!0}}}function s(e,t){if("symbolsUrl"!=e){var r=l.downloadProgress[e];r||(r=l.downloadProgress[e]={started:!1,finished:!1,lengthComputable:!1,total:0,loaded:0}),"object"!=typeof t||"progress"!=t.type&&"load"!=t.type||(r.started||(r.started=!0,r.lengthComputable=t.lengthComputable),r.total=t.total,r.loaded=t.loaded,"load"==t.type&&(r.finished=!0));var o=0,a=0,i=0,s=0,u=0;for(var e in l.downloadProgress){var r=l.downloadProgress[e];if(!r.started)return 0;i++,r.lengthComputable?(o+=r.loaded,a+=r.total,s++):r.finished||u++}var c=i?(i-u-(a?s*(a-o)/a:0))/i:0;n(.9*c)}}function u(e){s(e);var t=l.cacheControl(l[e]),n=l.companyName&&l.productName?l.cachedFetch:l.fetchWithProgress,o=l[e],a=/file:\/\//.exec(o)?"same-origin":void 0,i=n(l[e],{method:"GET",companyName:l.companyName,productName:l.productName,productVersion:l.productVersion,control:t,mode:a,onProgress:function(t){s(e,t)}});return i.then(function(e){return e.parsedBody}).catch(function(t){var n="Failed to download file "+l[e];"file:"==location.protocol?r(n+". Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.","error"):console.error(n)})}function c(){return new Promise(function(e,t){var n=document.createElement("script");n.src=l.frameworkUrl,n.onload=function(){if("undefined"==typeof unityFramework||!unityFramework){var t=[["br","br"],["gz","gzip"]];for(var o in t){var a=t[o];if(l.frameworkUrl.endsWith("."+a[0])){var i="Unable to parse "+l.frameworkUrl+"!";if("file:"==location.protocol)return void r(i+" Loading pre-compressed (brotli or gzip) content via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host compressed Unity content, or use the Unity Build and Run option.","error");if(i+=' This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: '+a[1]+'" present. Check browser Console and Devtools Network tab to debug.',"br"==a[0]&&"http:"==location.protocol){var s=["localhost","127.0.0.1"].indexOf(location.hostname)!=-1?"":"Migrate your server to use HTTPS.";i=/Firefox/.test(navigator.userAgent)?"Unable to parse "+l.frameworkUrl+'!
    If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported in Firefox over HTTP connections. '+s+' See https://bugzilla.mozilla.org/show_bug.cgi?id=1670675 for more information.':"Unable to parse "+l.frameworkUrl+'!
    If using custom web server, verify that web server is sending .br files with HTTP Response Header "Content-Encoding: br". Brotli compression may not be supported over HTTP connections. Migrate your server to use HTTPS.'}return void r(i,"error")}}r("Unable to parse "+l.frameworkUrl+"! The file is corrupt, or compression was misconfigured? (check Content-Encoding HTTP Response Header on web server)","error")}var u=unityFramework;unityFramework=null,n.onload=null,e(u)},n.onerror=function(e){r("Unable to load file "+l.frameworkUrl+"! Check that the file exists on the remote server. (also check browser Console and Devtools Network tab to debug)","error")},document.body.appendChild(n),l.deinitializers.push(function(){document.body.removeChild(n)})})}function d(){c().then(function(e){e(l)});var e=u("dataUrl");l.preRun.push(function(){l.addRunDependency("dataUrl"),e.then(function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=0,r="UnityWebData1.0\0";if(!String.fromCharCode.apply(null,e.subarray(n,n+r.length))==r)throw"unknown data format";n+=r.length;var o=t.getUint32(n,!0);for(n+=4;n0;c=d,d=u.indexOf("/",c)+1)l.FS_createPath(u.substring(0,c),u.substring(c,d-1),!0,!0);l.FS_createDataFile(u,null,e.subarray(a,a+i),!0,!0,!0)}l.removeRunDependency("dataUrl")})})}n=n||function(){};var l={canvas:e,webglContextAttributes:{preserveDrawingBuffer:!1,powerPreference:2},cacheControl:function(e){return e==l.dataUrl||e.match(/\.bundle/)?"must-revalidate":"no-store"},streamingAssetsUrl:"StreamingAssets",downloadProgress:{},deinitializers:[],intervals:{},setInterval:function(e,t){var n=window.setInterval(e,t);return this.intervals[n]=!0,n},clearInterval:function(e){delete this.intervals[e],window.clearInterval(e)},preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e),"string"==typeof e&&e.indexOf("wasm streaming compile failed")!=-1&&(e.toLowerCase().indexOf("mime")!=-1?r('HTTP Response Header "Content-Type" configured incorrectly on the server for file '+l.codeUrl+' , should be "application/wasm". Startup time performance will suffer.',"warning"):r('WebAssembly streaming compilation failed! This can happen for example if "Content-Encoding" HTTP header is incorrectly enabled on the server for file '+l.codeUrl+", but the file is not pre-compressed on disk (or vice versa). Check the Network tab in browser Devtools to debug server header configuration.","warning"))},locateFile:function(e){return"build.wasm"==e?this.codeUrl:e},disabledCanvasEvents:["contextmenu","dragstart"]};for(var h in t)l[h]=t[h];l.streamingAssetsUrl=new URL(l.streamingAssetsUrl,document.URL).href;var f=l.disabledCanvasEvents.slice();f.forEach(function(t){e.addEventListener(t,a)}),window.addEventListener("error",o),window.addEventListener("unhandledrejection",o);var p="",m="";document.addEventListener("webkitfullscreenchange",function(t){var n=document.webkitCurrentFullScreenElement;n===e?e.style.width&&(p=e.style.width,m=e.style.height,e.style.width="100%",e.style.height="100%"):p&&(e.style.width=p,e.style.height=m,p="",m="")}),l.deinitializers.push(function(){l.disableAccessToMediaDevices(),f.forEach(function(t){e.removeEventListener(t,a)}),window.removeEventListener("error",o),window.removeEventListener("unhandledrejection",o);for(var t in l.intervals)window.clearInterval(t);l.intervals={}}),l.QuitCleanup=function(){for(var e=0;e1?"\nUpgrade to iOS 15 or later.":"\nUpgrade to Safari 15 or later."),t(r)}else l.SystemInfo.hasWasm?(l.startupErrorHandler=t,n(0),l.postRun.push(function(){n(1),delete l.startupErrorHandler,e(g)}),d()):t("Your browser does not support WebAssembly.");else t("Your browser does not support WebGL.")})} \ No newline at end of file diff --git a/www/ksvc/WEBGL/Build/WEBGL.wasm.gz b/www/ksvc/WEBGL/Build/WEBGL.wasm.gz new file mode 100644 index 0000000..faee34e Binary files /dev/null and b/www/ksvc/WEBGL/Build/WEBGL.wasm.gz differ diff --git a/www/ksvc/WEBGL/StreamingAssets/UnityServicesProjectConfiguration.json b/www/ksvc/WEBGL/StreamingAssets/UnityServicesProjectConfiguration.json new file mode 100644 index 0000000..c0a91ee --- /dev/null +++ b/www/ksvc/WEBGL/StreamingAssets/UnityServicesProjectConfiguration.json @@ -0,0 +1 @@ +{"Keys":["com.unity.services.core.cloud-environment","com.unity.services.core.version"],"Values":[{"m_Value":"production","m_IsReadOnly":false},{"m_Value":"1.4.3","m_IsReadOnly":true}]} \ No newline at end of file diff --git a/www/ksvc/WEBGL/TemplateData/favicon.ico b/www/ksvc/WEBGL/TemplateData/favicon.ico new file mode 100644 index 0000000..07db393 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/favicon.ico differ diff --git a/www/ksvc/WEBGL/TemplateData/fullscreen-button.png b/www/ksvc/WEBGL/TemplateData/fullscreen-button.png new file mode 100644 index 0000000..e7b6496 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/fullscreen-button.png differ diff --git a/www/ksvc/WEBGL/TemplateData/progress-bar-empty-dark.png b/www/ksvc/WEBGL/TemplateData/progress-bar-empty-dark.png new file mode 100644 index 0000000..d01612f Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/progress-bar-empty-dark.png differ diff --git a/www/ksvc/WEBGL/TemplateData/progress-bar-empty-light.png b/www/ksvc/WEBGL/TemplateData/progress-bar-empty-light.png new file mode 100644 index 0000000..593a329 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/progress-bar-empty-light.png differ diff --git a/www/ksvc/WEBGL/TemplateData/progress-bar-full-dark.png b/www/ksvc/WEBGL/TemplateData/progress-bar-full-dark.png new file mode 100644 index 0000000..c432c86 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/progress-bar-full-dark.png differ diff --git a/www/ksvc/WEBGL/TemplateData/progress-bar-full-light.png b/www/ksvc/WEBGL/TemplateData/progress-bar-full-light.png new file mode 100644 index 0000000..e683131 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/progress-bar-full-light.png differ diff --git a/www/ksvc/WEBGL/TemplateData/style.css b/www/ksvc/WEBGL/TemplateData/style.css new file mode 100644 index 0000000..b8633d2 --- /dev/null +++ b/www/ksvc/WEBGL/TemplateData/style.css @@ -0,0 +1,16 @@ +body { padding: 0; margin: 0 } +#unity-container { position: absolute } +#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) } +#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% } +#unity-canvas { background: #231F20 } +.unity-mobile #unity-canvas { width: 100%; height: 100% } +#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none } +#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center } +#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center } +#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center } +#unity-footer { position: relative } +.unity-mobile #unity-footer { display: none } +#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center } +#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px } +#unity-fullscreen-button { float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center } +#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none } diff --git a/www/ksvc/WEBGL/TemplateData/unity-logo-dark.png b/www/ksvc/WEBGL/TemplateData/unity-logo-dark.png new file mode 100644 index 0000000..2c33238 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/unity-logo-dark.png differ diff --git a/www/ksvc/WEBGL/TemplateData/unity-logo-light.png b/www/ksvc/WEBGL/TemplateData/unity-logo-light.png new file mode 100644 index 0000000..9f0ab84 Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/unity-logo-light.png differ diff --git a/www/ksvc/WEBGL/TemplateData/webgl-logo.png b/www/ksvc/WEBGL/TemplateData/webgl-logo.png new file mode 100644 index 0000000..338b1ae Binary files /dev/null and b/www/ksvc/WEBGL/TemplateData/webgl-logo.png differ diff --git a/www/ksvc/WEBGL/index.html b/www/ksvc/WEBGL/index.html new file mode 100644 index 0000000..a62f58c --- /dev/null +++ b/www/ksvc/WEBGL/index.html @@ -0,0 +1,117 @@ + + + + + + Unity WebGL Player | FACTORY_MONITORING + + + + +
    + +
    + +
    +
    +
    +
    +
    + +
    + + + diff --git a/www/ksvc/WEBGL/o.html b/www/ksvc/WEBGL/o.html new file mode 100644 index 0000000..1888fc7 --- /dev/null +++ b/www/ksvc/WEBGL/o.html @@ -0,0 +1,12 @@ + + + + + + + Document + + + + + \ No newline at end of file diff --git a/www/ksvc/_main.php b/www/ksvc/_main.php new file mode 100644 index 0000000..bbc1717 --- /dev/null +++ b/www/ksvc/_main.php @@ -0,0 +1,506 @@ + +
    + + + +
    +
    +
    + + +
    + +
    + 알림아이콘 +
    + +
    +

    전체알림

    +
    +
    + [알림] + 통합게시판에 공지사항이 등록되었습니다. +

    3분전

    +
    +
    + 알림창삭제 +
    +
    + +
    +
    + [댓글] + 휴가신청서에 댓글이 등록되었습니다. +

    08.10 pm 02:45

    +
    +
    + 알림창삭제 +
    +
    + +
    +
    + [알림] + 통합게시판에 공지사항이 등록되었습니다. +

    08.10 am 11:32

    +
    +
    + 알림창삭제 +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    + + 2022년 8월 + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + 123456
    78910 + + 111213
    14151617181920
    2122 + + 2324252627
    28293031
    +
    + +
    +
    +
    일정목록
    +
    + +
    +
    + +
    + + + + + + + + + +
    +
    + +
    +
    + +
    +
    +
    근태현황
    +
    + +
    +
    + +
    +
    2022년 08월 10일(수)
    +
    am 11:49
    +
    + + +
    +
    + + +
    +
    +
    +
    일일업무보고
    +
    + +
    +
    + +
    + 수정 + 저장 +
    + +
    +

    08월 10일(수)

    +
      +
    1. 1. 블라블라
    2. +
    3. 2. 어쩌구저쩌구
    4. +
    +
    +
    + + +
    +
    +
    TO DO 리스트
    +
    + +
    +
    + +
    + + + + + +
    +
    + +
    + +
    +
    +
    +
    통합게시판
    +
    + +
    +
    + +
    +
    공지사항
    +
    사내소식
    +
    경조사
    +
    + + + + + + + + +
    + +
    +
    +
    전자결재
    +
    + +
    +
    + +
    +
    +

    결제진행

    +
    1
    +
    + +
    +

    결제완료

    +
    0
    +
    + +
    +

    결제대기

    +
    0
    +
    +
    + +
    +
    결재진행
    +
    결제완료
    +
    결제대기
    +
    + +
    + + + + + +
    + + + + +
    + +
    + +
    + +
    + +
    +
    + + + + + + \ No newline at end of file diff --git a/www/ksvc/inc/auth_check.php b/www/ksvc/inc/auth_check.php new file mode 100644 index 0000000..0578909 --- /dev/null +++ b/www/ksvc/inc/auth_check.php @@ -0,0 +1,12 @@ +cate_area = "service"; \ No newline at end of file diff --git a/www/ksvc/inc/common.ajax.php b/www/ksvc/inc/common.ajax.php new file mode 100644 index 0000000..6992400 --- /dev/null +++ b/www/ksvc/inc/common.ajax.php @@ -0,0 +1,137 @@ +login($_REQUEST['member_id'],$_REQUEST['member_auth']); + if( $row ){ + if( !array_key_exists($row['member_auth'], array_merge($GLOBALS['_varsAuthMember'],$GLOBALS['_varsAuthAdmin'])) ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디나 비밀번호를 확인해 주세요."); + }else if( $row['member_status'] != 1 ){ + $retval['mesg'] = cUtil\Mlang::getText("해당 계정은 [{@1}] 상태입니다.", array($GLOBALS['_varsMemStatus'][$row['member_status']])); + }else{ + $retval['code'] = 1; + } + }else{ + $retval['mesg'] = cUtil\Mlang::getText("아이디나 비밀번호를 확인해 주세요."); + } + $baseObj->logRec($_REQUEST['member_id'], "service", $retval['code']); + + if( $_REQUEST['save_id'] ){ + setcookie('kuls_save_session', $_REQUEST['member_id'], strtotime("+1 years"), "/"); + }else{ + unset($_COOKIE['kuls_save_session']); + } + } + + break; + + case "memberTokenLogin" : + if( csrf_check('memberLogin') ){ + $retval['mesg'] = cUtil\Mlang::getText("정상적인 접근이 아닙니다."); + }else if( !$_REQUEST['member_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디를 입력하지 않았습니다."); + }else if( !$_REQUEST['member_auth'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호를 입력하지 않았습니다."); + }else{ + $row = $baseObj->login($_REQUEST['member_id'],$_REQUEST['member_auth']); + if( $row ){ + if( !array_key_exists($row['member_auth'], array_merge($GLOBALS['_varsAuthMember'],$GLOBALS['_varsAuthAdmin'])) ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디나 비밀번호를 확인해 주세요."); + }else if( $row['member_status'] != 1 ){ + $retval['mesg'] = cUtil\Mlang::getText("해당 계정은 [{@1}] 상태입니다.", array($GLOBALS['_varsMemStatus'][$row['member_status']])); + }else{ + $retval['code'] = 1; + + $tkObj = new Token(); + $retval['data']['token'] = $tkObj->putToken($_REQUEST['member_id']); + } + }else{ + $retval['mesg'] = cUtil\Mlang::getText("아이디나 비밀번호를 확인해 주세요."); + } + $baseObj->logRec($_REQUEST['member_id'], "service", $retval['code']); + + if( $_REQUEST['save_id'] ){ + $retval['data']['save_id'] = $_REQUEST['member_id']; + }else{ + $retval['data']['save_id'] = ''; + } + } + + break; + + + + + + + + + case "memberJoin" : + $minfo = $baseObj->getMember($_REQUEST['member_id']); + if( csrf_check('memberJoin') ){ + $retval['mesg'] = cUtil\Mlang::getText("정상적인 접근이 아닙니다."); + }else if( !$_REQUEST['member_id'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디를 입력하지 않았습니다."); + }else if( strlen(preg_replace("/[0-9a-z]/im","",$_REQUEST['member_id'])) > 0 || strlen(preg_replace("/[^0-9a-z]/im","",$_REQUEST['member_id'])) < $GLOBALS['_varsBaseCode']['id_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("아이디는 영문자/숫자 만으로 구성되며, {$GLOBALS['_varsBaseCode']['id_len']}자리 이상이어야 합니다."); + }else if( !$_REQUEST['member_pw'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호를 입력하지 않았습니다."); + }else if( !$_REQUEST['member_pwf'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호 확인을 입력하지 않았습니다."); + }else if( strlen($_REQUEST['member_pw']) < $GLOBALS['_varsBaseCode']['pw_len'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호는 {$GLOBALS['_varsBaseCode']['pw_len']}자 이상이어야 합니다."); + }else if( $_REQUEST['member_pw'] != $_REQUEST['member_pwf'] ){ + $retval['mesg'] = cUtil\Mlang::getText("비밀번호가 일치하지 않습니다."); + }else if( $minfo['member_id'] || in_array($_REQUEST['member_id'], array("admin","root")) ){ + $retval['mesg'] = cUtil\Mlang::getText("이미 존재하는 아이디 또는 사용 불가능한 아이디 입니다."); + }else if( !$_REQUEST['member_name'] ){ + $retval['mesg'] = cUtil\Mlang::getText("관리자명을 입력하지 않았습니다."); + }else{ + $ins_row = Array( + "member_id" => $_REQUEST['member_id'], + "member_pw" => $_REQUEST['member_pw'], + "member_name" => $_REQUEST['member_name'], + "member_auth" => "M", + "member_status" => 2, + ); + $retval['code'] = $baseObj->join($ins_row); + $retval['mesg'] = cUtil\Mlang::getText("등록에 실패하였습니다."); + } + + break; + + + + + + + + + case "memberLogout" : + $retval['code'] = $baseObj->logout(); + break; + + + + + + + + +} + + +if( !$_REQUEST['no_echo'] ){ + echo json_encode($retval); +} \ No newline at end of file diff --git a/www/ksvc/inc/css/_backup/adjust.css b/www/ksvc/inc/css/_backup/adjust.css new file mode 100644 index 0000000..2f8448a --- /dev/null +++ b/www/ksvc/inc/css/_backup/adjust.css @@ -0,0 +1,3 @@ +.logo { + width: 120px; +} \ No newline at end of file diff --git a/www/ksvc/inc/css/_backup/common.css b/www/ksvc/inc/css/_backup/common.css new file mode 100644 index 0000000..065f660 --- /dev/null +++ b/www/ksvc/inc/css/_backup/common.css @@ -0,0 +1,625 @@ +@charset "utf-8"; + +@font-face { + font-family: "Pretendard-Regular"; + src: url("https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff") + format("woff"); + font-weight: 400; + font-style: normal; +} + +@import url(//fonts.googleapis.com/earlyaccess/notosanskr.css); + +.notosanskr * { + font-family: "Noto Sans KR", sans-serif; +} + +* { + padding: 0; + margin: 0; +} + +body, +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +form, +fieldset, +p, +button, +input, +figure, +textarea, +select { + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: "Pretendard", "Noto Sans KR", sans-serif; + color: #666; +} + +li { + list-style: none; +} + +a { + text-decoration: none; + color: inherit; + cursor: pointer; +} + +img { + max-width: 100%; + height: auto; +} + +table { + border-spacing:0; + box-sizing: border-box; +} + +#main { + width: 100%; +} + +#sidenav { + width: 240px; + height: 100vh; + position: fixed; + top:0; + left:0; + background: #fff; + box-shadow: 2px 0px 6px #2020200a; + + -webkit-transition: left 0.3s; + transition: left 0.3s; + z-index: 1; +} + +#main.mnu_hide #sidenav { + left: -174px; +} + +#wrap { + min-width: 70%; + margin-left: 240px; + height: 100vh; + + -webkit-transition:margin-left 0.3s; + transition:margin-left 0.3s; +} + +#main.mnu_hide #wrap { + margin-left: 67px; +} + +#wrap .header { + width: 100%; + height: 60px; + background: #234164; + padding: 15px 25px; + position: relative; +} + +#wrap .layout { + width: 1395px; + display: flex; + justify-content: space-evenly; +} + +.wrap { + background: #efefef; +} + +.layout:last-child{ + padding-bottom: 25px; +} + +.layout .section { + margin-top: 25px; + border-radius: 10px; + background: #fff; + padding: 20px; +} + +.layout .section.sechalf { + width: calc( (100% - 75px)/2 ); +} + +.layout ul { + display: flex; + width: 100%; +} + +.layout ul li { + padding: 10px 0; + border-bottom: 1px solid #efefef; + width: 100%; +} + +.layout ul:last-child li { + border-bottom: 0; +} + +.layout ul .txt { + width: 70%; + font-size: 0.9rem; +} + +.layout ul .time { + width: 30%; + font-size: 0.9rem; + color: #666666; + text-align: right; + line-height: 21px; +} + + +@media (max-width: 1630px) { + #wrap .layout { width: 100%; } +} +@media (max-width: 1525px) { + #wrap .layout .section.schedule .calendar { display: none; } +} +@media (max-width: 967px) { + #wrap .layout { flex-wrap: wrap; } + .layout .section.sechalf { width: calc( 100% - 50px ); } +} +@media (max-width: 796px) { + #main #wrap { margin-left: 67px; } +} + +/*서브페이지 상단메뉴*/ + +.submenu1 { + width: 100%; + border-bottom: 1px solid #d9d9d9; + background: #fff; + padding:12px 20px; + } + +.submenu1 ul { + display: flex; +} + +.submenu1 ul a { + display: block; + width:160px; + height: 40px; + line-height: 40px; + text-align: center; +} + +.submenu1 ul a.on { + border-radius: 40px; + border:2px solid #3D76E8; +} + +.submenu1 ul a.on li{ + color:#3D76E8; + font-weight: 600; +} + +.submenu2 { + width: 100%; + height: 40px; + background: #fff; + border-bottom:1px solid #d9d9d9; + padding:0 20px; +} + +.submenu2 ul { + display: flex; +} + +.submenu2 ul a { + padding:0 30px; +} + +.submenu2 ul a li { + line-height: 40px; + color:#666; +} + +.submenu2 ul a.on li { + color:#3D76E8; +} + +.submenu3 { + width: 100%; + height: 70px; + background: #EFEFEF; + border-bottom: 1px solid #d9d9d9; + position: relative; +} + +.submenu3 .container { + padding:15px 20px; +} + +.submenu3 .container:after { + display: block; + content:''; + clear:both; +} + +.submenu3 .container button { + width: 160px; + height: 40px; + border-radius: 10px; + background: #3D76E8; + color:#fff; + cursor: pointer; + text-align: center; + line-height: 40px; + border:0; + float:left; +} + +.submenu3 .container .bt2{ + margin-left:10px; + background: #666666; +} + +.submenu3 .container .sub2_check { + float:right; + margin-top: 10px; + font-size: 15px; + color:#666; +} + +.submenu3 .container .sub2_check span { + font-size: 15px; + padding-left:5px; +} + +.submenu3 .container .detailSearch { + margin-top: 10px; + float:right; + padding-right: 20px; + cursor: pointer; +} + +.submenu3 .container .detailSearch:after { + display: block; + clear:both; + content:''; +} + +.submenu3 .container .detailSearch img { + float:left; + display: block; +} + +.submenu3 .container .detailSearch span { + font-size: 15px; + color:#666; + padding-left: 5px; + float:left; + display: block; +} + +.submenu3 .detailBox { + background: #EFEFEF; + width: 100%; + box-shadow: 0px 3px 6px #00000029; + position: absolute; + top:70px; + left:0; + display: none; +} + +.submenu3 .detailBox ul:after { + content:''; + display: block; + clear:both; +} + +.submenu3 .detailBox ul li { + float:left; + font-size: 15px; + color:#666; + margin-right:30px; + margin-top: 10px; + width:295x; +} + +.submenu3 .detailBox .container { + padding:40px 45px; +} + +.submenu3 .detailBox ul:first-child li { + margin-top: 0; +} + +.submenu3 .detailBox ul li span { + padding-right: 20px; + display: inline-block; + width: 65px; +} + +.submenu3 .detailBox ul li input { + border-radius: 5px; + border:1px solid #d9d9d9; + height:30px; + width: 210px; + padding-left:5px; +} + +.submenu3 .detailBox ul .dateBox { + width:426px; +} + +.submenu3 .detailBox ul li .date { + width: 120px; +} + +.submenu3 .detailBox ul li select { + border-radius: 5px; + border:1px solid #d9d9d9; + height:30px; + width: 70px; +} + +.submenu3 .detailBox .detailBox_bt { + float:right; + margin-top: 20px; +} + +.submenu3 .detailBox .detailBox_bt button { + width: 100px; + height: 35px; + border-radius: 5px; + background: #3D76E8; + color:#fff; + font-size: 15px; + margin-left: 10px; + line-height: 34px; +} + +.submenu3 .detailBox .detailBox_bt button:last-child { + background: #666666; +} + +/*content영역*/ +#content { +background: #fff; +} + +/*등록 팝업창*/ +.popUp { + box-shadow: 0px 3px 6px #00000029; + background: #fff; + border-radius: 10px; + position: absolute; + padding:40px 20px; + border: 1px solid #EFEFEF; + left:50%; + top:50%; + transform:translate(-50%,-50%); +} + +.poptop { + display: flex; + justify-content: space-between; +} + +.poptop .popup_tit { + font-size: 1.2rem; + color:#121212; + font-weight: 600; +} + +.pop_checkbox { + display: flex; + margin-top: 20px; +} + +.pop_checkbox .sharingCheck { + display: flex; + align-items: center; +} + +.pop_checkbox .sharingCheck:first-child { + margin-right:20px; +} + +.pop_checkbox .sharingCheck input { + margin-right: 5px; + border:1px solid #d9d9d9; + width: 18px; + height: 18px; +} + +.pop_checkbox .sharingCheck span { + font-size: 15px; + color:#666; +} + +.pop_bt { + width: 170px; + height: 35px; + margin:40px auto 0; + display: flex; +} + +.pop_bt button { + width: 80px; + height:35px; + border-radius: 5px; + font-size: 15px; + color:#fff; + text-align: center; + line-height: 35px; + border:0; + cursor: pointer; +} + +.pop_bt .bt01 { + background: #3D76E8; + margin-right: 5px; +} + +.pop_bt .bt02 { + background: #666666; +} + + +/*게시판보드 style*/ +.public { + width: 100%; + padding: 45px; + border-spacing: 0; +} + +.public tr { + height: 50px; +} + +.public tr td input { + padding:0 20px; +} + +.public thead tr td { + border:1px solid #666; + border-right:1px solid #d9d9d9; + border-left: 0; + text-align: center; + color:#666; + font-weight: bold; +} + +.public thead tr td:last-child { + border-right: 0; +} + +.public tbody tr td { + border-bottom: 1px solid #EFEFEF; + text-align: center; + font-size: 14px; + color:#666; +} + +.public tbody .noRead td { + font-weight: bold; +} + +.public tbody tr .refuse { + color:#E81919; +} + + +/*페이징버튼*/ +.paging { + position: relative; + width: 100%; +} + +.paging ul { + display: flex; + position: absolute; + left: 50%; + transform: translateX(-50%); +} + +.paging ul li img{ + padding-right: 10px; + cursor: pointer; + height: 24px; + margin-bottom: 45px; +} + +.paging ul li:last-child img { + padding-right: 0; +} + +.paging ul li a { + padding:0 10px; + font-size: 15px; + color:#666; +} + +.paging ul li a.on { + color:#1B7BE9; +} + +.paging ul .lastPage{ + padding-left: 10px; +} + +/*사용자등록 개인정보설정 프로필영역*/ + + .profileEdit { + width: 260px; + border-right: 1px solid #d9d9d9; + padding:45px 25px; +} + + .profileEdit .profile { + text-align: center; +} + + .profileEdit .profile .profileImg { + width: 154px; + height: 154px; + margin: 0 auto; + background: #000; + border-radius: 100%; + position: relative; +} + + .profileEdit .profile .profileImg span { + position: absolute; + top:50%; + left:50%; + transform: translate(-50%,-50%); + color:#fff; + font-size: 13px; +} + + .profileEdit .profile .profileImg a img { + width: 100%; + height: 100%; + opacity: 50%; +} + + .profileEdit .profile .id p{ + margin-top: 20px; + font-size: 15px; +} + + .profileEdit .profile .id span { + color:#3D76E8; +} + + .profileEdit .profileExplain { + margin-top: 45px; + color:#d9d9d9; + text-align: center; + font-size: 15px; +} + + .profileEdit .profileExplain span { + color:#3D76E8; +} + + .profileEdit .delete { + width: 56px; + height: 30px; + border:1px solid #D9D9D9; + border-radius: 3px; + cursor:pointer; + text-align: center; + line-height: 30px; + font-size: 15px; + margin:15px auto; + } diff --git a/www/ksvc/inc/css/_backup/style.css b/www/ksvc/inc/css/_backup/style.css new file mode 100644 index 0000000..2c56ebb --- /dev/null +++ b/www/ksvc/inc/css/_backup/style.css @@ -0,0 +1,2375 @@ +@charset "utf-8"; + +/*좌측메뉴*/ + +nav .top { + padding: 15px 25px; +} + +nav .top:after { + display: block; + clear: both; + content: ""; +} + +nav .top .logo { + float: left; +} + +nav .top .menubar { + float: right; + cursor: pointer; + margin-top: 8px; +} + +nav .profile { + padding: 50px 0; + width: 100%; + position: relative; +} + +nav .profile .profileImg { + display: block; + text-align: center; +} + +nav .profile .pro_setting { + width: 30px; + height: 30px; + border-radius: 50px; + border: 1px solid #234164; + padding: 6px 0; + position: absolute; + top: 45px; + right: 70px; + background: #fff; + cursor: pointer; +} + +nav .profile .pro_setting img { + width: 15px; + height: 16px; + display: block; + margin: 0 auto; +} + +nav .profile .info { + text-align: center; + margin-top: 15px; +} + +nav .profile .info span { + display: inline-block; + width: 9px; + height: 9px; + background: #169227; + border-radius: 50px; +} + +nav .profile .info .name { + display: inline; + font-weight: 600; + font-size: 1.1rem; +} + +nav .profile .info p { + margin-top: 10px; + font-size: 0.8rem; +} + +nav .profile .logout { + margin-top: 35px; + text-align: center; +} + +nav .profile .logout a { + font-size: 0.8rem; + color: #145097; + text-decoration: underline; +} + +nav .leftMenu li { + height: 50px; + padding-left: 25px; + line-height: 50px; + position: relative; + color: #666666; + font-size: 1.1rem; + cursor: pointer; +} + +nav .leftMenu li.on { + background: #f8f8f8; + color: #1b7be9; +} + +nav .leftMenu li.on :after { + content: ""; + display: block; + width: 4px; + height: 50px; + background: #1b7be9; + position: absolute; + top: 0; + left: 0; +} + +nav .leftMenu li span { + margin-left: 12px; +} + +nav .organization { + position: absolute; + bottom: 0; + width: 100%; + height: 50px; +} +nav .organization a { + display: block; + padding-left: 25px; + color: #666666; +} + +nav .organization a span { + margin-left: 12px; +} + +/*헤더*/ +.header .search_wrap { + width: 240px; + height: 30px; + border-radius: 20px; + background: #fff; + padding: 3px 10px; + position: absolute; + right: 110px; +} + +.header .search_wrap .search { + border: 0; + width: 90%; + height: 100%; +} + +.header .search_wrap .search_bt { + position: absolute; + right: 10px; + top: 5px; + border: 0; + background: url('../img/search.svg') no-repeat; + width: 17px; + height: 16px; + cursor: pointer; + margin-top: 3px; +} + +.header .alarm { + width: 25px; + height: 28px; + position: absolute; + right: 50px; + cursor: pointer; +} + +.header .alarm .newAlarm { + width: 10px; + height: 10px; + background: #F32828; + border-radius: 50%; + position: absolute; + top: 0; + right: 0; +} + +.header .alarm .alarm_box { + width: 410px; + height: 266px; + border-radius: 8px; + box-shadow: 0px 1px 6px #00000029; + padding: 20px; + background: #fff; + position: absolute; + top: 38px; + left: -380px; + display: none; +} + +.header .alarm .alarm_box.show { + display: block; +} + +.header .alarm .alarm_box p { + font-weight: 600; + color: #121212; +} + +.header .alarm .alarm_box .alarm_cont { + display: flex; + padding: 16px 0; + border-bottom: 1px solid #efefef; + justify-content: space-between; + align-items: center; +} + +.header .alarm .alarm_box .alarm_cont:last-child { + border-bottom: 0; +} + +.header .alarm .alarm_box .alarm_cont .alarm_txt span { + font-size: 0.9rem; + color: #666; +} + +.header .alarm .alarm_box .alarm_cont .alarm_txt p { + font-size: 0.9rem; + color: #3d76e8; + padding-top: 5px; +} + +/*로그인페이지*/ +.loginBox { + width: 520px; + padding:68px 45px; + border:1px solid #D9D9D9; + background: #fff; + border-radius: 10px; + position: absolute; + left:50%; + top:50%; + transform: translate(-50%,-50%); + margin: 0; + box-sizing: border-box; + color: #666; +} + +.loginBox img { + width: 194px; + height: 73px; + margin:0 auto; + margin-bottom: 65px; + display: block; +} + +.loginBox div input { + margin-bottom: 20px; + width: 428px; + height: 50px; + border: 1px solid #D9D9D9; + border-radius: 5px; + background: #fff; + padding-left:5px; +} + +.loginBox button { + width: 428px; + height: 50px; + background: #3D76E8; + border-radius: 5px; + color:#fff; + cursor:pointer; + margin-bottom: 25px; + border:0; +} + +.loginBox .save { + display: flex; + align-items: center; +} + + +.loginBox .save input { + width: 20px; + height: 20px; + margin-bottom: 0; +} + +.loginBox .save span { + padding-left: 10px; + font-size: 13px; +} + + +/*메인 레이아웃*/ + +.layout .schedule { + width: 100%; + height: 280px; + margin:0 25px; +} + +.layout .schedule .article { + display: flex; +} + +.layout .schedule .article .calendar { + width: 340px; + border-right: 1px solid #efefef; + padding-right: 20px; +} + +.layout .schedule .article .calendar .calTit { + text-align: center; + margin-bottom: 15px; +} + +.layout .schedule .article .calendar .calTit img { + width: 20px; + height: 20px; +} + +.layout .schedule .article .calendar .calTit .date { + font-size: 1.2rem; + font-weight: bold; + color: #121212; + padding: 0 20px; +} + +.layout .schedule .article .calendar .calendar_mini thead th { + font-size: 13px; + padding: 0 15px; + text-align: center; +} + +.layout .schedule .article .calendar .calendar_mini thead th:first-child { + padding-left: 8px; +} + +.layout .schedule .article .calendar .calendar_mini tbody td { + font-size: 13px; + padding: 10px 15px; + text-align: center; + cursor: pointer; + position: relative; +} + +.layout .schedule .article .calendar .calendar_mini tbody td:first-child { + padding-left: 8px; +} + +.layout .schedule .article .calendar .calendar_mini tbody .sun { + color: #e51a1a; +} + +.layout .schedule .article .calendar .calendar_mini tbody .sat { + color: #1671d8; +} + +.layout .schedule .article .calendar .calendar_mini tbody tr td.today { + background: #3d76e8; + color: #fff; +} + +.layout .schedule .article .calendar .calendar_mini tbody td span.badge { + width: 4px; + height: 4px; + background: #f9cc2b; + border-radius: 20px; + z-index: 999; + display: block; + position: absolute; + top: 9px; + right: 9px; +} + +.layout .section .title { + display: flex; +} + +.layout .section .title div { + font-weight: bold; + color: #121212; + padding-right: 15px; +} + +.layout .schedule .article .list { + padding-left: 20px; + width: 100%; +} + +.layout .schedule .article .list .title { + margin-bottom: 10px; +} + +.layout .schedule .article .list .listbox ul li.holiday a { + color: #de1212; +} + +.layout .schedule .article .list .listbox ul li.work a { + color: #126ade; +} + +.layout .attendance { + width: 320px; + height: 280px; + display: none; +} + +.layout .attendance .clock { + text-align: left; + margin: 25px 0 20px 0; +} + +.layout .attendance .clock div { + color: #666; + font-size: 1.4rem; + line-height: 35px; +} + +.layout .attendance .bt { + width: 100%; +} + +.layout .attendance .bt button { + width: 135px; + height: 45px; + background: #5fa5f5; + border-radius: 10px; + border: none; +} + +.layout .attendance .bt button a { + color: #fff; + display: block; +} + +.layout .attendance .bt .in { + margin-right: 4px; +} + +.layout .attendance .bt .goal { + margin-top: 10px; + width: 100%; +} + +.layout .report { + height: 254px; + display: none; + justify-content: space-between; + flex-wrap: wrap; +} + +.layout .report .edit_bt span { + font-size: 0.9rem; + color: #666; + padding-left: 20px; + cursor: pointer; +} + +.layout .report .edit_box { + width: 100%; + height: 170px; + background: #f5f5f5; + border-radius: 10px; + margin-top: 20px; + padding: 20px; +} + +.layout .report .edit_box p { + font-weight: 600; + color: #666; + font-size: 0.9rem; +} + +.layout .report .edit_box ol { + margin-top: 20px; +} + +.layout .report .edit_box ol li { + font-size: 0.9rem; + color: #666; + line-height: 24px; +} + +.layout .todo { + height: 254px; + display: none; +} + +.layout .todo_box { + margin-top: 20px; + display: flex; + width: 100%; + justify-content: space-between; +} + +.layout .todo_box input { + width: calc( (100% - 20px) / 2 ); + height: 170px; + background: #efefef; + border-radius: 10px; + padding: 20px; + border: 0; +} + +/* + .layout .todo_box div{ + width: 300px; + height: 170px; + background: #efefef; + border-radius: 10px; + padding:20px; + }*/ + +.layout .todo_box div p { + font-size: 0.9rem; + color: #666; + line-height: 24px; + cursor: pointer; +} + +.layout .todo_box div p.line { + text-decoration: line-through; +} + +.layout .board { + height: 345px; +} + +.layout .board .board_tab { + display: flex; + justify-content: space-around; + margin-top: 25px; +} + +.layout .board .board_tab div { + color: #121212; + font-size: 0.9rem; + border-bottom: 1px solid #efefef; + width: 33.3%; + text-align: center; + padding-bottom: 5px; + cursor: pointer; +} + +.layout .board .board_tab div.underline { + border-bottom: 2px solid #3d76e8; +} + +.layout .board .boardbox { + display: none; +} + +.layout .board .boardbox.notice { + display: block; +} + +.layout .board .boardbox ul li a span { + padding-right: 20px; +} + +.layout .document { + height: 345px; +} + +.layout .document .document_box { + display: flex; + justify-content: space-between; + margin-top: 20px; +} + +.layout .document .document_box .doc_box01 { + width: calc( (100% - 40px) / 3 ); + height: 105px; + background: #efefef; + border-radius: 10px; + text-align: center; + padding: 20px 0; +} + +.layout .document .document_box .doc_box01 p { + font-size: 0.9rem; + color: #666666; +} + +.layout .document .document_box .doc_box01 div { + font-size: 2.4rem; + font-weight: bold; + color: #666666; +} + +.layout .document .document_box > div.ing p { + color: #3d76e8; +} + +.layout .document .document_box > div.ing div { + color: #3d76e8; +} + +.layout .document .doc_tab { + display: flex; + justify-content: space-around; + margin-top: 20px; +} + +.layout .document .doc_tab div { + color: #121212; + font-size: 0.9rem; + border-bottom: 1px solid #efefef; + width: 33.3%; + text-align: center; + padding-bottom: 5px; + cursor: pointer; +} + +.layout .document .doc_tab div.underline { + border-bottom: 2px solid #3d76e8; +} + +.layout .document .doc_list { + display: none; +} + +.layout .document .doc_list.file { + display: block; +} + +.layout .document .doc_list ul li a span { + padding-right: 20px; +} + +/*일정관리 달력형*/ + +.schedule_manage { + padding:45px 25px; +} + +.separate { + float:right; + display: flex; + margin-top: 10px; +} + +.separate .separate_color { + display: flex; + margin-right: 20px; +} + +.separate .separate_color:last-child { + margin-right: 0; +} + +.separate .separate_color img { + margin-right: 10px; +} + +.separate .separate_color span { + font-size: 15px; + color:#666; +} + +.schedule_top { + position: relative; + width: 360px; + margin:0 auto; +} + +.schedule_top .month { + display: flex; + align-items: center; +} + +.schedule_top .month div { + font-size: 15px; +} + +.schedule_top .month .present { + font-size: 24px; + font-weight: 600; + padding:0 121px; +} + +.schedule_top .type { + position:absolute; + bottom: 5px; + left:380px; + display: flex; +} + +.schedule_top .type button { + width: 50px; + height: 20px; + border-radius: 3px; + background: #fff; + color:#3D76E8; + border:1px solid #D9D9D9; + cursor: pointer; + font-size: 11px; + margin-right: 5px; +} + +.schedule_top .type button.on { + background: #3D76E8; + color:#fff; + border:0; +} + +.schedule_manage table { + width: 100%; + margin-top: 45px; +} + +.schedule_manage table tr td { + width:140px; + height: 115px; + border-left:1px solid #d9d9d9; + border-bottom: 1px solid #d9d9d9; + font-size: 14px; + vertical-align: top; + padding-top: 8px; + position: relative; + } + +.schedule_manage table tr td span { + padding-left: 8px; +} + +.schedule_manage table tr td:last-child{ + border-right: 1px solid #d9d9d9; +} + +.schedule_manage table thead td { + border-top:2px solid #8C8C8C; + text-align: center; + height: 30px; + vertical-align: middle; + padding:0; +} + +.schedule_manage table thead .sun{ + color:#e51a1a; +} + +.schedule_manage table thead .sat{ + color:#1671d8; +} + +.schedule_manage table tbody td div { + width: 100%; + padding: 4px; + color: #fff; + margin-top: 10px; + font-size: 12px; +} + +.schedule_manage table tbody td div a { + display: block; +} + +.schedule_manage table tbody td .schedule02 { + background: #1A5CB4; +} + +.schedule_manage table tbody td .schedule01 { + background: #01B7B0; +} + +.schedule_manage table tbody td .today { + background: #F1FBFC; +} + +.schedule_manage table tbody tr td .moreview { + border: 1px solid #D9D9D9; + position: absolute; + bottom: 110px; + left: 50px; + padding: 0 20px; + width: 253px; + background: #f5f5f5; + z-index: 999; + display: none; +} + +.schedule_manage table tbody tr td .moreview:after { + content:''; + position: absolute; + border-top:15px solid #f5f5f5; + border-right:10px solid transparent; + border-bottom:15px solid transparent; + border-left:10px solid transparent; + bottom:-30px; + left:140px; +} + +.schedule_manage table tbody tr td .moreview .moreviewList { + padding-top:20px; + padding-bottom:20px; + border-top: 1px solid #d9d9d9; + margin-top: 0; +} + +.schedule_manage table tbody tr td .moreview .list01 { + border-top: 0; +} + +.schedule_manage table tbody tr td .moreview .moreviewList p{ + padding:3px 10px; + border-radius: 25px; + background: #1A5CB4; + color:#fff; + display: inline; +} + +.schedule_manage table tbody tr td .moreview .list01 p { + background: #01B7B0; +} + +.schedule_manage table tbody tr td .moreview .moreviewList div{ + color:#666; + padding: 0; +} + +.schedule_manage table tbody tr td .moreview .moreviewList .listTit a { + font-weight: bold; + font-size: 13px; +} + +.schedule_manage table tbody tr td .moreview .moreviewList div:first-child { + font-weight: bold; +} + +.schedule_manage table tbody tr td .moreview .moreviewList .writer span{ + padding-left: 0; + padding-right: 5px; + color:#1A5CB4; +} + +.schedule_manage table tbody tr td .moreview .list01 .writer span{ + color:#01B7B0; +} + +/*일정관리 리스트형*/ + +.schedule_list{ + margin:45px 0; +} + +.schedule_list tbody tr td a { + color:#1A5CB4; +} + + +/*일정등록시 팝업*/ + +#register { + width: 800px; + position: relative; + transform: none; + left:0; +} + +.register .register_cont { + margin-top:20px; + display: flex; + align-items: center; +} + +.register .first { + margin-top: 45px; +} + +.register .register_cont div { + font-size: 15px; + width: 75px; +} + +.register .register_cont select { + width: 692px; + height:30px; + border: 1px solid #D9D9D9; + border-radius: 3px; +} + +.register .register_cont input { + width: 692px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; + padding:0 5px; +} + +.register .register_cont .check { + width: 18px; + height: 18px; + margin-left: 10px; + border: 1px solid #D9D9D9; +} + +.register .register_cont span { + font-size: 15px; + padding-left: 5px; + color:#666; +} + +.register .time input{ + width: 120px; +} + +.register .time .startTime { + padding-left: 20px; +} + +.register .repeat { + margin-left: 75px; + display: flex; + flex-wrap:wrap; +} + +.register .repeat .repeatbox { + margin-right:30px; + margin-top: 20px; +} + +.register .repeat .repeatbox select{ + width: 70px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; + padding: 0 5px; +} + +.register .repeat .repeatbox span { + font-size: 13px; + padding-right: 20px; +} + +.register .content input{ + height: 220px; +} + +.register .attendance div span { + font-size: 10px; +} + +.register .attendance input { + width: 578px; +} + +.register .attendance button { + width: 105px; + height: 30px; + border:1px solid #3D76E8; + border-radius: 5px; + color:#3D76E8; + margin-left: 10px; + background: #fff; + cursor: pointer; +} + +.register .repeatCheck { + margin:35px 0 20px 0; + font-size: 15px; +} + +.register .radio { + display: flex; +} + +.register .radio div { + margin-right: 20px; +} + +.register .radio div span { + padding-left:5px; +} + + +/*행선지등록*/ + +.destination .schedule_top { + position:relative; +} + +.destination .schedule_top .month{ + margin-top: 45px; +} + +.destination .schedule_top .month .present { + padding:0 103px; +} + +.destination .schedule_top .month .calendarIcon { + padding-right:10px; +} + +.destination .schedule_top .calendar { + box-shadow: 0px 3px 6px #00000029; + border: 1px solid #D9D9D9; + border-radius: 5px; + position: absolute; + top: 30px; + left: 50%; + margin-left:-160px; + background: #fff; + padding:20px; +} + +.destination .schedule_top .calendar .calTit { + text-align: center; + display: flex; + justify-content: space-evenly; +} + +.destination .schedule_top .calendar .calTit span { + display: block; +} + +.destination .schedule_top .calendar .calTit .date { + font-size: 15px; + font-weight: bold; +} + +.destination .schedule_top .calendar table { + margin-top: 10px; +} + +.destination .schedule_top .calendar table tr th { + font-size: 13px; + text-align: center; + padding:10px; +} + + +.destination .schedule_top .calendar table tr td { + font-size: 13px; + text-align: center; + padding:10px; + cursor:pointer; +} + +.destination .schedule_top .calendar table .sat { + color:#1671D8; +} + +.destination .schedule_top .calendar table .sun { + color:#E51A1A; +} + +.destination .schedule_top .calendar .inquiry { + width: 100%; + height: 35px; + background: #3D76E8; + border-radius: 5px; + text-align: center; + margin-top: 10px; +} + +.destination .schedule_top .calendar .inquiry a { + color:#fff; + font-size: 13px; + line-height: 35px; +} + +.destination .schedule_top .calendar .inquiryRange { + background: #3D76E8; +} + +.destination .schedule_top .calendar .inquiryRange span { + color:#fff; +} + +.destination .schedule_top .calendar .inquiryRange2 { + background: #D1E0FF; +} + +.destination .destinationPop { + width: 690px; +} + +.destination .destinationPop .destinationCont { + display: flex; + align-items: center; + margin-top: 20px; +} + +.destination .destinationPop .first { + margin-top: 45px; + border:0; +} + +.destination .destinationPop .destinationCont div{ + width: 75px; + font-size: 15px; +} + +.destination .destinationPop .destinationCont span{ + font-size: 10px; +} + +.destination .destinationPop .destinationCont input{ + width: 580px; + height: 30px; + border:1px solid #d9d9d9; + border-radius: 5px; + padding:0 5px; +} + +.destination .destinationPop .destinationCont select{ + width: 580px; + height: 30px; + border:1px solid #d9d9d9; + border-radius: 5px; +} + +.destination .destinationPop .time input{ + width: 150px; +} + +.destination .destinationPop .time span { + padding:0 10px; +} + +.destination .destinationPop .fellow input { + width:460px; +} + +.destination .destinationPop .fellow button { + width: 105px; + height: 30px; + border: 1px solid #3D76E8; + border-radius: 5px; + color: #3D76E8; + margin-left: 10px; + background: #fff; + cursor: pointer; +} + + +/*업무보고서*/ + +.reportPop .first{ + margin-top: 45px; +} + +.reportPop .reportCont { + margin-top: 20px; + display: flex; + align-items: center; +} + +.reportPop .reportCont div { + width: 70px; + font-size: 15px; +} + +.reportPop .reportCont input { + width: 692px; + height: 30px; + border:1px solid #d9d9d9; + border-radius: 5px; + background: #fff; + padding:0 5px; +} + +.reportPop .date input{ + width: 240px; +} + +.reportPop .text input{ + height: 300px; +} + + +/*회의록 등록*/ + .minutes .minutesPop { + width: 800px; + } + + .minutes .minutesPop .minutesCont { + display: flex; + align-items: center; + margin-top: 20px; + } + + .minutes .minutesPop .first { + margin-top: 45px; + } + + .minutes .minutesPop .minutesCont div { + width: 70px; + font-size: 15px; + } + + .minutes .minutesPop .minutesCont input { + width: 690px; + height: 30px; + border-radius: 5px; + border: 1px solid #d9d9d9; + background: #fff; + padding:0 5px; + } + + .minutes .minutesPop .minutesCont button { + width: 105px; + height: 30px; + border: 1px solid #3d76e8; + border-radius: 5px; + background: #fff; + margin-left: 10px; + color:#3d76e8; + font-size: 13px; + cursor:pointer; + } + + .minutes .minutesPop .minutesCont span { + font-size: 10px; + } + + .minutes .minutesPop .date input { + width: 140px; + } + + .minutes .minutesPop .company input{ + width: 300px; + } + + .minutes .minutesPop .company .person { + margin-left: 20px; + } + + .minutes .minutesPop .fellowIn input { + width: 578px; + } + +/*전자결재 개인문서함*/ +.document_box .paging { + padding-bottom:60px; +} + +/*전자결재 문서양식선택*/ + + .document_form .form_box { + padding:25px 45px; + display: flex; + flex-wrap: wrap; + align-content: flex-start; + } + + .document_form .form_box .form_cont { + margin:20px 20px 0 0; + width: 205px; + height: 280px; + border:1px solid #EEEEEE; + cursor: pointer; + } + + .document_form .form_box .form_cont img { + display: block; + margin: 60px auto 0; + } + + .document_form .form_box .form_cont p { + font-size: 15px; + text-align: center; + padding:20px 0; + + } + + .document_form .form_box .form_cont div { + font-weight:600; + color:#121212; + line-height: 21px; + text-align: center; + font-size: 18px; + } + + +/*전자결재 기안문서보기*/ + +.document_view { + background: #fff; + display: flex; +} + + +.document_view .container { + padding:45px; + width: 1070px; +} + +.document_view .container .doc_number { + font-size: 0.8rem; +} + +.document_view .container h1 { + text-align: center; + margin-top: 60px; +} + +.document_view .container .doc_icon { + text-align: right; + padding-bottom: 20px; +} + +.document_view .container .doc_icon a img { + padding-right: 20px; +} + + .t1 { + width: 100%; + height: 140px; + border-top: 1px solid #666666; + border-bottom: 1px solid #666666; + border-spacing: 0; +} + +.t1 tr { + border-bottom: 1px solid #d9d9d9; + height: 25px; +} + +.t1 tr:nth-child(2) { + height: 90px; +} + + .t1 tr:last-child { + border-bottom: 0; +} + + .t1 tr td { + width: 100px; + border-right: 1px solid #d9d9d9; + text-align: center; + font-size: 14px; + color:#666; + border-bottom: 1px solid #d9d9d9; +} + + .t1 tr td:last-child { + border-right: 0; +} + + .t1 tr .thead { + background: #EFEFEF +} + + .t1 tr td span { + display: block; + height: 44px; + line-height: 44px; + color:#666; +} + + .t1 tr td p { + padding-top: 5px; +} + + .t2 { + width: 100%; + margin-top: 40px; + border-top: 1px solid #d9d9d9; + border-bottom: 1px solid #d9d9d9; + border-spacing: 0; +} + + .t2 tr td { + border-right: 1px solid #d9d9d9; + border-bottom: 1px solid #d9d9d9; + height: 35px; + font-size: 14px; + color:#666; + padding-left: 20px; + height: 35px; +} + +.t2 tr td a { + color:#666; +} + + .t2 tr td:last-child { + border-right: 0; +} + + .t2 tr:last-child td { + border-bottom:0; +} + + .t2 tr .thead { + width: 100px; + background: #efefef; + text-align: center; + padding-left: 0; +} + +.textbox { + width: 100%; + border: 1px solid #d9d9d9; + height: 500px; + text-align: center; + margin-top: 40px; + line-height: 500px; +} + +.document_view aside { + width: 210px; + border-left: 1px solid #EFEFEF; + border-right: 1px solid #EFEFEF; + padding: 100px 20px 0 20px; +} + +.document_view aside .a_tit { + font-size: 18px; + } + + .document_view aside .comment_box { + margin-top: 20px; + } + +.document_view aside .comment_box .comment_profile{ + display: flex; +} + +.document_view aside .comment_box .comment_profile .profileImg { + width:40px; + height: 40px; +} + +.document_view aside .comment_box .comment_profile .profileInfo { + padding-left: 5px; +} + +.document_view aside .comment_box .comment_profile .profileInfo p { + font-size: 13px; +} + +.document_view aside .comment_box .comment_profile .profileInfo p:first-child{ + padding-bottom: 5px; +} + +.document_view aside .comment_box .comment { + width: 100%; + height: auto; + background: #efefef; + border-radius: 5px; + margin-top: 10px; + padding:10px; + font-size: 13px; +} + +.document_view .doc_pop { + width: 400px; +} + +.document_view .doc_pop .approval { + margin-top:35px; +} + +.document_view .doc_pop .approval label { + font-size: 14px; +} + +.document_view .doc_pop .approval label:first-child { + padding-right: 5px; +} + +.document_view .doc_pop .comment { + width: 100%; + height: 95px; + margin-top:15px; + border: 1px solid #d9d9d9; + border-radius: 5px; +} + +/*전자결재 기안하기*/ + +.document_write { + width: 1070px; + padding:45px; +} + +.document_write .top_bt { + display: flex; +} + +.document_write .top_bt li { + width:80px; + height: 30px; + border:1px solid #D9D9D9; +} + +.document_write .top_bt li:first-child{ + border-radius: 5px 0px 0px 5px; +} + +.document_write .top_bt li:nth-child(2){ + border-left:0; + border-right: 0; +} + +.document_write .top_bt li:last-child{ + border-radius: 0px 5px 5px 0px; +} + +.document_write .top_bt li a{ + font-weight:600; + color:#666; + text-align: center; + display: block; + line-height: 30px; + font-size: 15px; +} + +.document_write h1 { + text-align: center; + margin-top:60px; +} + +.document_write .amount { + display: flex; + justify-content: space-between; + align-items: center; + margin:20px 0; +} + +.document_write .amount select { + width: 172px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; +} + +.document_write .amount .setting a{ + color:#1B7BE9; + font-size: 15px; +} + +.document_write .refer_doc { + width: 670px; + display: none; +} + +.document_write .refer_doc .refer_docSearch { + display: flex; + margin-top: 20px; +} + +.document_write .refer_doc .refer_docSearch select { + width: 80px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; + margin-right: 10px; +} + +.document_write .refer_doc .refer_docSearch .search_wrap { + position: relative; +} + +.document_write .refer_doc .refer_docSearch .search_wrap input{ + width: 540px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; + padding:0 5px; +} + +.document_write .refer_doc .refer_docSearch .search_wrap button { + background: url('../img/search.svg') no-repeat; + width: 17px; + height: 16px; + cursor: pointer; + position: absolute; + top: 7px; + right: 7px; + border: 0; +} + +.document_write .refer_doc table { + width: 100%; + margin-top: 20px; + border-spacing:0; +} + +.document_write .refer_doc table td { + height: 35px; + line-height: 35px; + border-bottom: 1px solid #EFEFEF; + border-spacing:0; + text-align: center; + font-size: 15px; + color:#666; +} + +.document_write .refer_doc table thead td { + font-weight: bold; + border-bottom: 1px solid #666; + border-top: 1px solid #666; + border-right:1px solid #d9d9d9; +} + +.document_write .refer_doc table thead td:last-child{ + border-right: 0; +} + +.document_write .refer_doc .paging { + padding:20px 0; +} + + +/*전자결재 결재라인설정 팝업창*/ + + +.paypop { + width:800px; +} + +.paypop .payWrap:after { + display: block; + content:''; + clear:both; +} + +.paypop .payWrap { + width: 100%; + height:610px; +} + +.paypop .pay_left { + margin-top: 40px; + float:left; +} + +.paypop .pay_left .search_wrap { + width: 280px; + position:relative; +} + +.paypop .pay_left .search_wrap .search { + width: 100%; + height: 30px; + border:1px solid #d9d9d9; + border-radius: 3px; + background: #fff; + padding:5px; +} + +.paypop .pay_left .search_wrap .search_bt{ + background: url('../img/search.svg') no-repeat; + width: 17px; + height: 16px; + cursor: pointer; + position: absolute; + top:7px; + right: 7px; + border:0; +} + +.paypop .pay_left .pay_select{ + width: 280px; + height: 520px; + border:1px solid #d9d9d9; + border-radius: 5px; + margin-top:20px; +} + +.paypop .pay_left .pay_select .team { + border-bottom: 1px solid #d9d9d9; +} + +.paypop .pay_left .pay_select .team li:first-child{ + padding:12px; + border-bottom: 1px solid #d9d9d9; + color:#707070; + font-size: 1.1rem; + font-weight: bold; +} + + +.paypop .pay_left .pay_select .team li.on { + background: #EFEFEF; + font-weight: bold; +} + +.paypop .pay_left .pay_select .team li.on a { + color:#3D76E8; +} + +.paypop .pay_left .pay_select .team li a{ + padding: 10px 40px; + font-size: 0.9rem; + display: block; +} + +.paypop .pay_left .pay_select .team li span{ + padding:0 6px; + border:1px solid #707070; + border-radius: 3px; + margin-right: 5px; +} + +.paypop .pay_left .unnamed { + width: 280px; + height: 40px; + border-bottom: 1px solid #d9d9d9; + display: flex; +} + +.paypop .pay_left .unnamed span { + display: block; + width: 138px; + line-height: 40px; + text-align: center; + font-size: 15px; +} + +.paypop .pay_left .unnamed span:first-child { + border-right: 1px solid #d9d9d9; +} + +.paypop .pay_left .team_memberBox .team_member { + width: 100%; + display: flex; + padding:5px 0; +} + +.paypop .pay_left .team_memberBox .team_member div{ + width: 50%; + text-align: center; + padding:7px; + font-size: 14px; +} + +.paypop .pay_left .team_memberBox .team_member .pay_bt a { + font-size:0.8rem; + color:#3D76E8; +} + +.paypop .pay_left .team_memberBox .team_member .pay_bt span { + padding: 6px 15px; + border-radius: 5px; + border:1px solid #3D76E8; +} + +.paypop .pay_right { + width: 460px; + height: 570px; + margin-top: 40px; + float:right; +} + +.paypop .pay_right .line_select { + width: 100%; + height: 30px; + border-radius: 3px; + border:1px solid #d9d9d9; + padding:5px; +} + +.paypop .pay_right .payline_wrap .payline_list { + width: 460px; + height:225px; + border-radius: 4px; + border:1px solid #d9d9d9; + margin-top: 20px; +} + +.paypop .pay_right .payline_wrap .payline_list:after { + display: block; + content:''; + clear:both; +} + +.paypop .pay_right .payline_wrap .payline_list .payment { + float:left; + width: 120px; + height: 223px; + background: #F1F1F1; + text-align: center; + line-height: 225px; +} + +.paypop .pay_right .payline_wrap .payline_list .paymentList { + width: 338px; + float:right; +} + +.paypop .pay_right .payline_wrap .payline_list .paymentList ul li{ + width: 100%; + height: 36px; + border-bottom:1px solid #d9d9d9; +} + +.paypop .pay_right .payline_wrap .payline_list .paymentList ul li div { + display: inline; + line-height: 36px; + font-size: 0.9rem; +} + +.paypop .pay_right .payline_wrap .payline_list .paymentList ul li .number { + padding:9px; + border-right: 1px solid #d9d9d9; +} + +.paypop .pay_right .payline_wrap .payline_list .paymentList ul li .delete { + float: right; + padding-right: 10px; +} + +.paypop .pay_right .payline_wrap .payline_list .paymentList ul li .delete a img { + width: 9px; + height: 9px; +} + +.paypop .pay_right .lineSave { + display: flex; + width: 460px; + justify-content: space-between; + margin-top:20px; +} + +.paypop .pay_right .lineSave input { + width: 350px; + height: 30px; + border-radius: 3px; + border:1px solid #d9d9d9; + padding:0 5px; +} + +.paypop .pay_right .lineSave button { + width: 100px; + height: 30px; + border-radius: 3px; + background:#fff; + border:1px solid #3D76E8; + color:#3D76E8; + cursor:pointer; +} + +/*통합게시판 공지사항*/ + +.notice .public{ + padding-top: 20px; +} + +.board_bottom { + width: 100%; + position: relative; + padding-left:25px; + padding-top: 45px; +} + +.board_bottom .board_search { + display: flex; + width: 410px; + float:right; + margin-right: 45px; +} + +.board_bottom .board_search select { + width: 80px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; +} + +.board_bottom .board_search .search_wrap { + position: relative; + margin-left: 10px; +} + +.board_bottom .board_search .search_wrap input{ + width: 320px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; + padding:0 5px; + } + +.board_bottom .board_search .search_wrap button { + background: url('../img/search.svg') no-repeat; + width: 17px; + height: 16px; + cursor: pointer; + position: absolute; + top: 7px; + right: 7px; + border: 0; +} + +.board_bottom .writeBt { + display: flex; + position: absolute; + top: 45px; + left:45px; +} + +.board_bottom .writeBt div a { + font-size: 15px; + color:#666; + display: block; + text-align: center; + line-height: 30px; +} + +.board_bottom .writeBt .writing{ + width: 79px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px 0px 0px 3px; + border-right: 0; +} + +.board_bottom .writeBt .delete{ + width: 55px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 0px 3px 3px 0px; +} + +/*게시판글 페이지*/ + +.notice_page { + padding:60px 25px 0; +} + +.notice_page .noticeTop { + display: flex; + justify-content: space-between; +} + +.notice_page .noticeTop .bt_wrap { + display: flex; +} + +.notice_page .noticeTop .bt_wrap div { + padding-left: 20px; +} + +.notice_page .noticeTop .bt_wrap div a { + font-size: 13px; + color:#666; +} + +.notice_page .noticeTop .bt_wrap .move span { + font-size: 10px; +} + +.notice_page .noticeTop .icon_wrap a img { + padding-right: 20px; +} + +.notice_page .noticeCont .noticeTit { + width: 100%; + height: 50px; + border-top: 1px solid #d9d9d9; + border-bottom: 1px solid #d9d9d9; + display: flex; + justify-content: space-between; + margin-top: 10px; +} + +.notice_page .noticeCont .noticeTit .title { + font-size: 17px; + font-weight: bold; + line-height: 50px; + padding-left: 20px; +} + +.notice_page .noticeCont .noticeTit .noticeInfo { + display: flex; + line-height: 50px; +} + +.notice_page .noticeCont .noticeTit .noticeInfo div { + margin-right: 20px; + font-size: 15px; +} + +.notice_page .noticeCont .noticeTit .noticeInfo span { + padding-left: 5px; + font-size: 15px; + font-weight: bold; + color:#666; +} + +.notice_page .noticeCont .content { + padding:40px 20px; + min-height: 480px; + } + +.notice_page .noticeComment { + width: 100%; + background: #F8F8F8; + position: relative; +} + +.notice_page .noticeComment .pagemove{ + display: flex; + position: absolute; + top: -40px; + right:0; + } + +.notice_page .noticeComment .pagemove div{ + margin-right: 20px; +} + +.notice_page .noticeComment .pagemove div a { + font-size: 13px; + color:#666; +} + +.notice_page .noticeComment .commentList { + border-top: 1px solid #EFEFEF; + border-bottom: 1px solid #efefef; + padding:20px; +} + +.notice_page .noticeComment .commentList:after { + content:''; + display: block; + clear:both; +} + +.notice_page .noticeComment .commentList .commentText{ + float:left; + display: flex; +} + +.notice_page .noticeComment .commentList .re{ + float:right; + display: flex; + font-size: 13px; +} + +.notice_page .noticeComment .commentList .re div:first-child { + margin-right: 20px; +} + +.notice_page .noticeComment .commentList .commentText div img{ + width: 35px; + height: 35px; +} + +.notice_page .noticeComment .commentList .commentText .writer { + margin-left: 10px; +} + +.notice_page .noticeComment .commentList .commentText .writer span { + font-size: 13px; + color:#9A9A9A; +} + +.notice_page .noticeComment .commentList .commentText .writer .name { + font-weight: bold; + padding-right: 10px; +} + +.notice_page .noticeComment .commentList .commentText .writer div { + font-size: 15px; + margin-top: 5px; +} + +.notice_page .commentBox { + width: 100%; + background: #F8F8F8; + padding:20px; + display: flex; +} + +.notice_page .commentBox input { + width: 100%; + min-height:75px; + border: 1px solid #D9D9D9; + padding:0 5px; +} + +.notice_page .commentBox button { + width: 95px; + height: 75px; + background: #3D76E8; + border-radius: 4px; + color:#fff; + text-align: center; + border:0; + margin-left: 10px; + cursor:pointer; +} + +.notice_page .movePop { + width: 310px; +} + +.notice_page .movePop p { + margin:35px 0 20px 0; + font-size: 15px; +} + +.notice_page .movePop .radio { + display: flex; +} + +.notice_page .movePop .radio div { + margin-right: 20px; +} + +.notice_page .movePop .radio span { + font-size: 15px; + color:#666; + padding-left:5px; +} + +/*중식신청*/ +.lunch { + padding:60px 0 45px 25px; + width: 1005px; +} + +.lunch .schedule_top .month .present{ + padding: 0 34px; +} + +.lunch .schedule_top .month div { + padding-right: 8px; +} + +.lunch .lunchTableWrap { + width: 980px; + display: flex; + margin-top:45px; +} + +.lunch .lunchTableWrap .lunchTable { + width: 20%; + text-align: center; +} + +.lunch .lunchTableWrap .lunchTable ul{ + border:1px solid #D9D9D9; + border-right: 0; +} + +.lunch .lunchTableWrap .lunchTable ul li:first-child{ + border-bottom: 1px solid #d9d9d9; +} + +.lunch .lunchTableWrap .lunchTable:last-child ul{ + border-right: 1px solid #d9d9d9; +} + +.lunch .lunchTableWrap .lunchTable ul li{ + font-size:15px; + padding:10px 0; +} + +.lunch .lunchTableWrap .lunchTable .application { + width: 95%; + height: 40px; + margin:20px auto; + border-radius: 5px; + background: #666; + color:#fff; + line-height: 40px; + font-size: 15px; + cursor:pointer; +} + +.lunch .lunchTableWrap .lunchTable:last-child .application { + background: #3D76E8; +} + +.lunch .lunchTableOption { + margin:45px 0 20px 0; + float:right; +} + +.lunch .lunchTableOption span { + font-size: 15px; + color:#666; +} + +.lunch .lunchTableOption select { + width: 120px; + height: 30px; + border: 1px solid #D9D9D9; + border-radius: 3px; + margin-left: 20px; +} + +.lunch .public { + padding:0; +} + +.lunch .public .all{ + border-top: 1px solid #D9D9D9; + border-bottom: 1px solid #D9D9D9; + background: #F6F6F6; +} + +.lunch .public .all td:first-child { + border-right: 1px solid #D9D9D9; + font-weight: bold; + color:#666; +} + +.lunch .public .all td { + color:#3D76E8; + font-weight:bold; +} + +/*개인정보관리*/ + +.profile_setting { + display: flex; +} + +.profile_setting .profileInput { + padding:45px; + width: 100%; +} + +.profile_setting .profileInput .profileInputSection{ + padding: 45px 0; + border-bottom: 1px solid #efefef; +} + +.profile_setting .profileInput .profileInputSection:first-child { + padding-top: 0; +} + +.profile_setting .profileInput .profileInputSection .profileTit { + font-weight: bold; + color:#3D76E8; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm { + display: flex; + flex-wrap: wrap; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm .form{ + margin-right:20px; + margin-top: 20px; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm .form p{ + font-size: 15px; + margin-bottom:10px; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm .form input { + width: 430px; + height: 35px; + border-radius: 4px; + border:1px solid #d9d9d9; + padding:0 5px; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm .form .address { + margin-right: 20px; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm .form select { + width: 430px; + height: 35px; + border-radius: 4px; + border:1px solid #d9d9d9; + padding:0 5px; +} + +.profile_setting .profileInput .profileInputSection .profileInputForm .form button { + width: 100px; + height: 35px; + background: #3D76E8; + color:#fff; + border:0; + cursor:pointer; + border-radius: 5px; +} + +.profile_setting .profileInput .modifyBt { + width: 200px; + height: 40px; + background: #3D76E8; + border-radius: 5px; + border:0; + margin:45px auto; + color:#fff; + display: block; +} + +/*사용자 리스트*/ +.userlist .public{ + padding-top: 20px; +} + +/*사용자정보 등록 페이지*/ + +.userpage { + display: flex; +} + +.user_registration { + display: flex; +} + +.userInform { + padding:45px; +} + + .userInform .element { + margin-top:20px; +} + + .userInform .element div { + font-size: 15px; +} + +.userInform .element input { + width: 430px; + height: 35px; + border-radius: 4px; + background: #fff; + border:1px solid #D9D9D9; + padding-left:5px; + line-height: 35px; + margin-top: 10px; +} + + .userInform .element .elementBox { + width: 430px; + height: 35px; + border-radius: 4px; + background: #fff; + border:1px solid #D9D9D9; + padding-left:5px; + line-height: 35px; + margin-top: 10px; +} + + .userInform ul { + display: flex; +} + + .userInform ul li { + margin-right: 20px; +} + + .userpageBt { + margin: 190px auto 0; + width: 415px; +} + + .userpageBt button { + width: 200px; + height: 40px; + border-radius: 5px; + color:#fff; + text-align: center; + line-height: 40px; + border:0; +} + + .userpageBt .bt1 { + background: #3D76E8; + margin-right: 10px; +} + + .userpageBt .bt2 { + background: #666666; +} + +.user_registration .userpageBt { + margin: 260px auto 0; +} + +/*사용자등록 페이지*/ diff --git a/www/ksvc/inc/css/_variable_svc.scss b/www/ksvc/inc/css/_variable_svc.scss new file mode 100644 index 0000000..5fb98ee --- /dev/null +++ b/www/ksvc/inc/css/_variable_svc.scss @@ -0,0 +1,17 @@ + +$primary: #1F2937; +$secondary: #BAC5D7; +$spacer: 0.5rem; +$font-size-base: 0.85rem; +$input-btn-padding-y: .25rem; +$input-btn-padding-x: .5rem; +$input-btn-padding-y-sm: .1rem; +$input-btn-padding-x-sm: .3rem; +$input-btn-padding-y-lg: .3rem; +$input-btn-padding-x-lg: .7rem; +$table-cell-padding: .36rem; + +/* +.btn-group>.btn:not(:first-child) to +.btn-group>:not(.btn-check:first-child)+.btn +*/ \ No newline at end of file diff --git a/www/ksvc/inc/css/base.css.php b/www/ksvc/inc/css/base.css.php new file mode 100644 index 0000000..1724a1a --- /dev/null +++ b/www/ksvc/inc/css/base.css.php @@ -0,0 +1,11 @@ + + +@charset "utf-8"; + +@import "./bootstrap_svc.min.css?v=1668054628"; +@import "./common.css?v="; +@import "./frame.css?v="; +@import "./top.css?v="; +@import "./sidebar.css?v="; +@import "./contents.css?v="; +@import "./tabulator.css?v="; \ No newline at end of file diff --git a/www/ksvc/inc/css/bootstrap_svc.min.css b/www/ksvc/inc/css/bootstrap_svc.min.css new file mode 100644 index 0000000..29c43be --- /dev/null +++ b/www/ksvc/inc/css/bootstrap_svc.min.css @@ -0,0 +1 @@ +:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#1F2937;--secondary:#BAC5D7;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:.85rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.25rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#1f2937;text-decoration:none;background-color:transparent}a:hover{color:#030506;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.36rem;padding-bottom:.36rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.25rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.125rem}.h2,h2{font-size:1.7rem}.h3,h3{font-size:1.4875rem}.h4,h4{font-size:1.275rem}.h5,h5{font-size:1.0625rem}.h6,h6{font-size:.85rem}.lead{font-size:1.0625rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:.5rem;margin-bottom:.5rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:.5rem;font-size:1.0625rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.25rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row{display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{flex-basis:0;flex-grow:1;min-width:0;max-width:100%}.row-cols-1>*{flex:0 0 100%;max-width:100%}.row-cols-2>*{flex:0 0 50%;max-width:50%}.row-cols-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-4>*{flex:0 0 25%;max-width:25%}.row-cols-5>*{flex:0 0 20%;max-width:20%}.row-cols-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-auto{flex:0 0 auto;width:auto;max-width:100%}.col-1{flex:0 0 8.33333%;max-width:8.33333%}.col-2{flex:0 0 16.66667%;max-width:16.66667%}.col-3{flex:0 0 25%;max-width:25%}.col-4{flex:0 0 33.33333%;max-width:33.33333%}.col-5{flex:0 0 41.66667%;max-width:41.66667%}.col-6{flex:0 0 50%;max-width:50%}.col-7{flex:0 0 58.33333%;max-width:58.33333%}.col-8{flex:0 0 66.66667%;max-width:66.66667%}.col-9{flex:0 0 75%;max-width:75%}.col-10{flex:0 0 83.33333%;max-width:83.33333%}.col-11{flex:0 0 91.66667%;max-width:91.66667%}.col-12{flex:0 0 100%;max-width:100%}.order-first{order:-1}.order-last{order:13}.order-0{order:0}.order-1{order:1}.order-2{order:2}.order-3{order:3}.order-4{order:4}.order-5{order:5}.order-6{order:6}.order-7{order:7}.order-8{order:8}.order-9{order:9}.order-10{order:10}.order-11{order:11}.order-12{order:12}.offset-1{margin-left:8.33333%}.offset-2{margin-left:16.66667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.33333%}.offset-5{margin-left:41.66667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.33333%}.offset-8{margin-left:66.66667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.33333%}.offset-11{margin-left:91.66667%}@media (min-width:576px){.col-sm{flex-basis:0;flex-grow:1;min-width:0;max-width:100%}.row-cols-sm-1>*{flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-sm-4>*{flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-sm-auto{flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{flex:0 0 8.33333%;max-width:8.33333%}.col-sm-2{flex:0 0 16.66667%;max-width:16.66667%}.col-sm-3{flex:0 0 25%;max-width:25%}.col-sm-4{flex:0 0 33.33333%;max-width:33.33333%}.col-sm-5{flex:0 0 41.66667%;max-width:41.66667%}.col-sm-6{flex:0 0 50%;max-width:50%}.col-sm-7{flex:0 0 58.33333%;max-width:58.33333%}.col-sm-8{flex:0 0 66.66667%;max-width:66.66667%}.col-sm-9{flex:0 0 75%;max-width:75%}.col-sm-10{flex:0 0 83.33333%;max-width:83.33333%}.col-sm-11{flex:0 0 91.66667%;max-width:91.66667%}.col-sm-12{flex:0 0 100%;max-width:100%}.order-sm-first{order:-1}.order-sm-last{order:13}.order-sm-0{order:0}.order-sm-1{order:1}.order-sm-2{order:2}.order-sm-3{order:3}.order-sm-4{order:4}.order-sm-5{order:5}.order-sm-6{order:6}.order-sm-7{order:7}.order-sm-8{order:8}.order-sm-9{order:9}.order-sm-10{order:10}.order-sm-11{order:11}.order-sm-12{order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.33333%}.offset-sm-2{margin-left:16.66667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.33333%}.offset-sm-5{margin-left:41.66667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.33333%}.offset-sm-8{margin-left:66.66667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.33333%}.offset-sm-11{margin-left:91.66667%}}@media (min-width:768px){.col-md{flex-basis:0;flex-grow:1;min-width:0;max-width:100%}.row-cols-md-1>*{flex:0 0 100%;max-width:100%}.row-cols-md-2>*{flex:0 0 50%;max-width:50%}.row-cols-md-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-md-4>*{flex:0 0 25%;max-width:25%}.row-cols-md-5>*{flex:0 0 20%;max-width:20%}.row-cols-md-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-md-auto{flex:0 0 auto;width:auto;max-width:100%}.col-md-1{flex:0 0 8.33333%;max-width:8.33333%}.col-md-2{flex:0 0 16.66667%;max-width:16.66667%}.col-md-3{flex:0 0 25%;max-width:25%}.col-md-4{flex:0 0 33.33333%;max-width:33.33333%}.col-md-5{flex:0 0 41.66667%;max-width:41.66667%}.col-md-6{flex:0 0 50%;max-width:50%}.col-md-7{flex:0 0 58.33333%;max-width:58.33333%}.col-md-8{flex:0 0 66.66667%;max-width:66.66667%}.col-md-9{flex:0 0 75%;max-width:75%}.col-md-10{flex:0 0 83.33333%;max-width:83.33333%}.col-md-11{flex:0 0 91.66667%;max-width:91.66667%}.col-md-12{flex:0 0 100%;max-width:100%}.order-md-first{order:-1}.order-md-last{order:13}.order-md-0{order:0}.order-md-1{order:1}.order-md-2{order:2}.order-md-3{order:3}.order-md-4{order:4}.order-md-5{order:5}.order-md-6{order:6}.order-md-7{order:7}.order-md-8{order:8}.order-md-9{order:9}.order-md-10{order:10}.order-md-11{order:11}.order-md-12{order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.33333%}.offset-md-2{margin-left:16.66667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.33333%}.offset-md-5{margin-left:41.66667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.33333%}.offset-md-8{margin-left:66.66667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.33333%}.offset-md-11{margin-left:91.66667%}}@media (min-width:992px){.col-lg{flex-basis:0;flex-grow:1;min-width:0;max-width:100%}.row-cols-lg-1>*{flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-lg-4>*{flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-lg-auto{flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{flex:0 0 8.33333%;max-width:8.33333%}.col-lg-2{flex:0 0 16.66667%;max-width:16.66667%}.col-lg-3{flex:0 0 25%;max-width:25%}.col-lg-4{flex:0 0 33.33333%;max-width:33.33333%}.col-lg-5{flex:0 0 41.66667%;max-width:41.66667%}.col-lg-6{flex:0 0 50%;max-width:50%}.col-lg-7{flex:0 0 58.33333%;max-width:58.33333%}.col-lg-8{flex:0 0 66.66667%;max-width:66.66667%}.col-lg-9{flex:0 0 75%;max-width:75%}.col-lg-10{flex:0 0 83.33333%;max-width:83.33333%}.col-lg-11{flex:0 0 91.66667%;max-width:91.66667%}.col-lg-12{flex:0 0 100%;max-width:100%}.order-lg-first{order:-1}.order-lg-last{order:13}.order-lg-0{order:0}.order-lg-1{order:1}.order-lg-2{order:2}.order-lg-3{order:3}.order-lg-4{order:4}.order-lg-5{order:5}.order-lg-6{order:6}.order-lg-7{order:7}.order-lg-8{order:8}.order-lg-9{order:9}.order-lg-10{order:10}.order-lg-11{order:11}.order-lg-12{order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.33333%}.offset-lg-2{margin-left:16.66667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.33333%}.offset-lg-5{margin-left:41.66667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.33333%}.offset-lg-8{margin-left:66.66667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.33333%}.offset-lg-11{margin-left:91.66667%}}@media (min-width:1200px){.col-xl{flex-basis:0;flex-grow:1;min-width:0;max-width:100%}.row-cols-xl-1>*{flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{flex:0 0 33.33333%;max-width:33.33333%}.row-cols-xl-4>*{flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{flex:0 0 16.66667%;max-width:16.66667%}.col-xl-auto{flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{flex:0 0 8.33333%;max-width:8.33333%}.col-xl-2{flex:0 0 16.66667%;max-width:16.66667%}.col-xl-3{flex:0 0 25%;max-width:25%}.col-xl-4{flex:0 0 33.33333%;max-width:33.33333%}.col-xl-5{flex:0 0 41.66667%;max-width:41.66667%}.col-xl-6{flex:0 0 50%;max-width:50%}.col-xl-7{flex:0 0 58.33333%;max-width:58.33333%}.col-xl-8{flex:0 0 66.66667%;max-width:66.66667%}.col-xl-9{flex:0 0 75%;max-width:75%}.col-xl-10{flex:0 0 83.33333%;max-width:83.33333%}.col-xl-11{flex:0 0 91.66667%;max-width:91.66667%}.col-xl-12{flex:0 0 100%;max-width:100%}.order-xl-first{order:-1}.order-xl-last{order:13}.order-xl-0{order:0}.order-xl-1{order:1}.order-xl-2{order:2}.order-xl-3{order:3}.order-xl-4{order:4}.order-xl-5{order:5}.order-xl-6{order:6}.order-xl-7{order:7}.order-xl-8{order:8}.order-xl-9{order:9}.order-xl-10{order:10}.order-xl-11{order:11}.order-xl-12{order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.33333%}.offset-xl-2{margin-left:16.66667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.33333%}.offset-xl-5{margin-left:41.66667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.33333%}.offset-xl-8{margin-left:66.66667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.33333%}.offset-xl-11{margin-left:91.66667%}}.table{width:100%;margin-bottom:.5rem;color:#212529}.table td,.table th{padding:.36rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#c0c3c7}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#8b9097}.table-hover .table-primary:hover{background-color:#b3b6bb}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#b3b6bb}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#eceff4}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#dbe1ea}.table-hover .table-secondary:hover{background-color:#dce1eb}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#dce1eb}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.85rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-control:focus{color:#495057;background-color:#fff;border-color:#4d6689;outline:0;box-shadow:0 0 0 .2rem rgba(31,41,55,.25)}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{appearance:none}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.3rem + 1px);padding-bottom:calc(.3rem + 1px);font-size:1.0625rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.1rem + 1px);padding-bottom:calc(.1rem + 1px);font-size:.74375rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.25rem 0;margin-bottom:0;font-size:.85rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .2rem + 2px);padding:.1rem .3rem;font-size:.74375rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + .6rem + 2px);padding:.3rem .7rem;font-size:1.0625rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:flex;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:inline-flex;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.74375rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .5rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .125rem) center;background-size:calc(.75em + .25rem) calc(.75em + .25rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .5rem);background-position:top calc(.375em + .125rem) right calc(.375em + .125rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 1.875rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .5rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.5rem/calc(.75em + .25rem) calc(.75em + .25rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.74375rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .5rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .125rem) center;background-size:calc(.75em + .25rem) calc(.75em + .25rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .5rem);background-position:top calc(.375em + .125rem) right calc(.375em + .125rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 1.875rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .5rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.5rem/calc(.75em + .25rem) calc(.75em + .25rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:flex;flex-flow:row wrap;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:flex;align-items:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:flex;flex:0 0 auto;flex-flow:row wrap;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:flex;align-items:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{align-items:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;user-select:none;background-color:transparent;border:1px solid transparent;padding:.25rem .5rem;font-size:.85rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(31,41,55,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#1f2937;border-color:#1f2937}.btn-primary:hover{color:#fff;background-color:#11171f;border-color:#0d1116}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#11171f;border-color:#0d1116;box-shadow:0 0 0 .2rem rgba(65,73,85,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#1f2937;border-color:#1f2937}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0d1116;border-color:#080b0e}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(65,73,85,.5)}.btn-secondary{color:#212529;background-color:#bac5d7;border-color:#bac5d7}.btn-secondary:hover{color:#212529;background-color:#a2b1c9;border-color:#9aaac4}.btn-secondary.focus,.btn-secondary:focus{color:#212529;background-color:#a2b1c9;border-color:#9aaac4;box-shadow:0 0 0 .2rem rgba(163,173,189,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#212529;background-color:#bac5d7;border-color:#bac5d7}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#212529;background-color:#9aaac4;border-color:#92a3c0}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(163,173,189,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#218838;border-color:#1e7e34;box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#138496;border-color:#117a8b;box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{color:#212529;background-color:#e0a800;border-color:#d39e00;box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c82333;border-color:#bd2130;box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{color:#212529;background-color:#e2e6ea;border-color:#dae0e5;box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{color:#fff;background-color:#23272b;border-color:#1d2124;box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#1f2937;border-color:#1f2937}.btn-outline-primary:hover{color:#fff;background-color:#1f2937;border-color:#1f2937}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(31,41,55,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#1f2937;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#1f2937;border-color:#1f2937}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(31,41,55,.5)}.btn-outline-secondary{color:#bac5d7;border-color:#bac5d7}.btn-outline-secondary:hover{color:#212529;background-color:#bac5d7;border-color:#bac5d7}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(186,197,215,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#bac5d7;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#212529;background-color:#bac5d7;border-color:#bac5d7}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(186,197,215,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#1f2937;text-decoration:none}.btn-link:hover{color:#030506;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.3rem .7rem;font-size:1.0625rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.1rem .3rem;font-size:.74375rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:.85rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.25rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#1f2937}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.74375rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>:not(.btn-check:first-child)+.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.225rem;padding-left:.225rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.525rem;padding-left:.525rem}.btn-group-vertical{flex-direction:column;align-items:flex-start;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:flex;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:flex;align-items:center;padding:.25rem .5rem;margin-bottom:0;font-size:.85rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + .6rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.3rem .7rem;font-size:1.0625rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .2rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.1rem .3rem;font-size:.74375rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.5rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.275rem;padding-left:1.5rem}.custom-control-inline{display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.1375rem;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#1f2937;background-color:#1f2937}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(31,41,55,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#4d6689}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#627fa7;border-color:#627fa7}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before,.custom-control-input[disabled]~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.1375rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.1375rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#1f2937;background-color:#1f2937}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(31,41,55,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(31,41,55,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(31,41,55,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.1375rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(31,41,55,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .5rem + 2px);padding:.25rem 1.5rem .25rem .5rem;font-size:.85rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .5rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;appearance:none}.custom-select:focus{border-color:#4d6689;outline:0;box-shadow:0 0 0 .2rem rgba(31,41,55,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.5rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .2rem + 2px);padding-top:.1rem;padding-bottom:.1rem;padding-left:.3rem;font-size:.74375rem}.custom-select-lg{height:calc(1.5em + .6rem + 2px);padding-top:.3rem;padding-bottom:.3rem;padding-left:.7rem;font-size:1.0625rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .5rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .5rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#4d6689;box-shadow:0 0 0 .2rem rgba(31,41,55,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .5rem);padding:.25rem .5rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(31,41,55,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(31,41,55,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(31,41,55,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#1f2937;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#627fa7}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#1f2937;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{transition:none}}.custom-range::-moz-range-thumb:active{background-color:#627fa7}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#1f2937;border:0;border-radius:1rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{transition:none}}.custom-range::-ms-thumb:active{background-color:#627fa7}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:flex;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#1f2937}.nav-fill .nav-item{flex:1 1 auto;text-align:center}.nav-justified .nav-item{flex-basis:0;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:.25rem .5rem}.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.34062rem;padding-bottom:.34062rem;margin-right:.5rem;font-size:1.0625rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{flex-basis:100%;flex-grow:1;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.0625rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-sm .navbar-nav{flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-md .navbar-nav{flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-lg .navbar-nav{flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand-xl .navbar-nav{flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{flex-flow:row nowrap;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:flex!important;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:flex;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-body{flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img,.card-img-bottom,.card-img-top{flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{display:flex;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{display:flex;flex-flow:row wrap}.card-group>.card{flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{column-count:3;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:flex;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item{display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#1f2937;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#030506;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(31,41,55,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#1f2937;border-color:#1f2937}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.0625rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.74375rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#1f2937}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0d1116}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(31,41,55,.5)}.badge-secondary{color:#212529;background-color:#bac5d7}a.badge-secondary:focus,a.badge-secondary:hover{color:#212529;background-color:#9aaac4}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(186,197,215,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3.775rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#10151d;background-color:#d2d4d7;border-color:#c0c3c7}.alert-primary hr{border-top-color:#b3b6bb}.alert-primary .alert-link{color:#000}.alert-secondary{color:#616670;background-color:#f1f3f7;border-color:#eceff4}.alert-secondary hr{border-top-color:#dce1eb}.alert-secondary .alert-link{color:#494d55}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:flex;height:1rem;overflow:hidden;line-height:0;font-size:.6375rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#1f2937;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{animation:none}}.media{display:flex;align-items:flex-start}.media-body{flex:1}.list-group{display:flex;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#1f2937;border-color:#1f2937}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#10151d;background-color:#c0c3c7}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#10151d;background-color:#b3b6bb}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#10151d;border-color:#10151d}.list-group-item-secondary{color:#616670;background-color:#eceff4}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#616670;background-color:#dce1eb}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#616670;border-color:#616670}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.275rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:flex;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:transform .3s ease-out;transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{transform:none}.modal.modal-static .modal-dialog{transform:scale(1.02)}.modal-dialog-scrollable{display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:flex;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{flex-direction:column;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:flex;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:flex;align-items:flex-start;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;flex:1 1 auto;padding:1rem}.modal-footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.74375rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.74375rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:.85rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;backface-visibility:hidden;transition:transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:flex;align-items:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:flex;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@keyframes spinner-border{to{transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@keyframes spinner-grow{0%{transform:scale(0)}50%{opacity:1;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#1f2937!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0d1116!important}.bg-secondary{background-color:#bac5d7!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#9aaac4!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#1f2937!important}.border-secondary{border-color:#bac5d7!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:flex!important}.d-sm-inline-flex{display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:flex!important}.d-md-inline-flex{display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:flex!important}.d-lg-inline-flex{display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:flex!important}.d-xl-inline-flex{display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:flex!important}.d-print-inline-flex{display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.85714%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-column-reverse{flex-direction:column-reverse!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.flex-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-fill{flex:1 1 auto!important}.flex-grow-0{flex-grow:0!important}.flex-grow-1{flex-grow:1!important}.flex-shrink-0{flex-shrink:0!important}.flex-shrink-1{flex-shrink:1!important}.justify-content-start{justify-content:flex-start!important}.justify-content-end{justify-content:flex-end!important}.justify-content-center{justify-content:center!important}.justify-content-between{justify-content:space-between!important}.justify-content-around{justify-content:space-around!important}.align-items-start{align-items:flex-start!important}.align-items-end{align-items:flex-end!important}.align-items-center{align-items:center!important}.align-items-baseline{align-items:baseline!important}.align-items-stretch{align-items:stretch!important}.align-content-start{align-content:flex-start!important}.align-content-end{align-content:flex-end!important}.align-content-center{align-content:center!important}.align-content-between{align-content:space-between!important}.align-content-around{align-content:space-around!important}.align-content-stretch{align-content:stretch!important}.align-self-auto{align-self:auto!important}.align-self-start{align-self:flex-start!important}.align-self-end{align-self:flex-end!important}.align-self-center{align-self:center!important}.align-self-baseline{align-self:baseline!important}.align-self-stretch{align-self:stretch!important}@media (min-width:576px){.flex-sm-row{flex-direction:row!important}.flex-sm-column{flex-direction:column!important}.flex-sm-row-reverse{flex-direction:row-reverse!important}.flex-sm-column-reverse{flex-direction:column-reverse!important}.flex-sm-wrap{flex-wrap:wrap!important}.flex-sm-nowrap{flex-wrap:nowrap!important}.flex-sm-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-sm-fill{flex:1 1 auto!important}.flex-sm-grow-0{flex-grow:0!important}.flex-sm-grow-1{flex-grow:1!important}.flex-sm-shrink-0{flex-shrink:0!important}.flex-sm-shrink-1{flex-shrink:1!important}.justify-content-sm-start{justify-content:flex-start!important}.justify-content-sm-end{justify-content:flex-end!important}.justify-content-sm-center{justify-content:center!important}.justify-content-sm-between{justify-content:space-between!important}.justify-content-sm-around{justify-content:space-around!important}.align-items-sm-start{align-items:flex-start!important}.align-items-sm-end{align-items:flex-end!important}.align-items-sm-center{align-items:center!important}.align-items-sm-baseline{align-items:baseline!important}.align-items-sm-stretch{align-items:stretch!important}.align-content-sm-start{align-content:flex-start!important}.align-content-sm-end{align-content:flex-end!important}.align-content-sm-center{align-content:center!important}.align-content-sm-between{align-content:space-between!important}.align-content-sm-around{align-content:space-around!important}.align-content-sm-stretch{align-content:stretch!important}.align-self-sm-auto{align-self:auto!important}.align-self-sm-start{align-self:flex-start!important}.align-self-sm-end{align-self:flex-end!important}.align-self-sm-center{align-self:center!important}.align-self-sm-baseline{align-self:baseline!important}.align-self-sm-stretch{align-self:stretch!important}}@media (min-width:768px){.flex-md-row{flex-direction:row!important}.flex-md-column{flex-direction:column!important}.flex-md-row-reverse{flex-direction:row-reverse!important}.flex-md-column-reverse{flex-direction:column-reverse!important}.flex-md-wrap{flex-wrap:wrap!important}.flex-md-nowrap{flex-wrap:nowrap!important}.flex-md-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-md-fill{flex:1 1 auto!important}.flex-md-grow-0{flex-grow:0!important}.flex-md-grow-1{flex-grow:1!important}.flex-md-shrink-0{flex-shrink:0!important}.flex-md-shrink-1{flex-shrink:1!important}.justify-content-md-start{justify-content:flex-start!important}.justify-content-md-end{justify-content:flex-end!important}.justify-content-md-center{justify-content:center!important}.justify-content-md-between{justify-content:space-between!important}.justify-content-md-around{justify-content:space-around!important}.align-items-md-start{align-items:flex-start!important}.align-items-md-end{align-items:flex-end!important}.align-items-md-center{align-items:center!important}.align-items-md-baseline{align-items:baseline!important}.align-items-md-stretch{align-items:stretch!important}.align-content-md-start{align-content:flex-start!important}.align-content-md-end{align-content:flex-end!important}.align-content-md-center{align-content:center!important}.align-content-md-between{align-content:space-between!important}.align-content-md-around{align-content:space-around!important}.align-content-md-stretch{align-content:stretch!important}.align-self-md-auto{align-self:auto!important}.align-self-md-start{align-self:flex-start!important}.align-self-md-end{align-self:flex-end!important}.align-self-md-center{align-self:center!important}.align-self-md-baseline{align-self:baseline!important}.align-self-md-stretch{align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{flex-direction:row!important}.flex-lg-column{flex-direction:column!important}.flex-lg-row-reverse{flex-direction:row-reverse!important}.flex-lg-column-reverse{flex-direction:column-reverse!important}.flex-lg-wrap{flex-wrap:wrap!important}.flex-lg-nowrap{flex-wrap:nowrap!important}.flex-lg-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-lg-fill{flex:1 1 auto!important}.flex-lg-grow-0{flex-grow:0!important}.flex-lg-grow-1{flex-grow:1!important}.flex-lg-shrink-0{flex-shrink:0!important}.flex-lg-shrink-1{flex-shrink:1!important}.justify-content-lg-start{justify-content:flex-start!important}.justify-content-lg-end{justify-content:flex-end!important}.justify-content-lg-center{justify-content:center!important}.justify-content-lg-between{justify-content:space-between!important}.justify-content-lg-around{justify-content:space-around!important}.align-items-lg-start{align-items:flex-start!important}.align-items-lg-end{align-items:flex-end!important}.align-items-lg-center{align-items:center!important}.align-items-lg-baseline{align-items:baseline!important}.align-items-lg-stretch{align-items:stretch!important}.align-content-lg-start{align-content:flex-start!important}.align-content-lg-end{align-content:flex-end!important}.align-content-lg-center{align-content:center!important}.align-content-lg-between{align-content:space-between!important}.align-content-lg-around{align-content:space-around!important}.align-content-lg-stretch{align-content:stretch!important}.align-self-lg-auto{align-self:auto!important}.align-self-lg-start{align-self:flex-start!important}.align-self-lg-end{align-self:flex-end!important}.align-self-lg-center{align-self:center!important}.align-self-lg-baseline{align-self:baseline!important}.align-self-lg-stretch{align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{flex-direction:row!important}.flex-xl-column{flex-direction:column!important}.flex-xl-row-reverse{flex-direction:row-reverse!important}.flex-xl-column-reverse{flex-direction:column-reverse!important}.flex-xl-wrap{flex-wrap:wrap!important}.flex-xl-nowrap{flex-wrap:nowrap!important}.flex-xl-wrap-reverse{flex-wrap:wrap-reverse!important}.flex-xl-fill{flex:1 1 auto!important}.flex-xl-grow-0{flex-grow:0!important}.flex-xl-grow-1{flex-grow:1!important}.flex-xl-shrink-0{flex-shrink:0!important}.flex-xl-shrink-1{flex-shrink:1!important}.justify-content-xl-start{justify-content:flex-start!important}.justify-content-xl-end{justify-content:flex-end!important}.justify-content-xl-center{justify-content:center!important}.justify-content-xl-between{justify-content:space-between!important}.justify-content-xl-around{justify-content:space-around!important}.align-items-xl-start{align-items:flex-start!important}.align-items-xl-end{align-items:flex-end!important}.align-items-xl-center{align-items:center!important}.align-items-xl-baseline{align-items:baseline!important}.align-items-xl-stretch{align-items:stretch!important}.align-content-xl-start{align-content:flex-start!important}.align-content-xl-end{align-content:flex-end!important}.align-content-xl-center{align-content:center!important}.align-content-xl-between{align-content:space-between!important}.align-content-xl-around{align-content:space-around!important}.align-content-xl-stretch{align-content:stretch!important}.align-self-xl-auto{align-self:auto!important}.align-self-xl-start{align-self:flex-start!important}.align-self-xl-end{align-self:flex-end!important}.align-self-xl-center{align-self:center!important}.align-self-xl-baseline{align-self:baseline!important}.align-self-xl-stretch{align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{user-select:all!important}.user-select-auto{user-select:auto!important}.user-select-none{user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports (position:sticky){.sticky-top{position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.125rem!important}.mt-1,.my-1{margin-top:.125rem!important}.mr-1,.mx-1{margin-right:.125rem!important}.mb-1,.my-1{margin-bottom:.125rem!important}.ml-1,.mx-1{margin-left:.125rem!important}.m-2{margin:.25rem!important}.mt-2,.my-2{margin-top:.25rem!important}.mr-2,.mx-2{margin-right:.25rem!important}.mb-2,.my-2{margin-bottom:.25rem!important}.ml-2,.mx-2{margin-left:.25rem!important}.m-3{margin:.5rem!important}.mt-3,.my-3{margin-top:.5rem!important}.mr-3,.mx-3{margin-right:.5rem!important}.mb-3,.my-3{margin-bottom:.5rem!important}.ml-3,.mx-3{margin-left:.5rem!important}.m-4{margin:.75rem!important}.mt-4,.my-4{margin-top:.75rem!important}.mr-4,.mx-4{margin-right:.75rem!important}.mb-4,.my-4{margin-bottom:.75rem!important}.ml-4,.mx-4{margin-left:.75rem!important}.m-5{margin:1.5rem!important}.mt-5,.my-5{margin-top:1.5rem!important}.mr-5,.mx-5{margin-right:1.5rem!important}.mb-5,.my-5{margin-bottom:1.5rem!important}.ml-5,.mx-5{margin-left:1.5rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.125rem!important}.pt-1,.py-1{padding-top:.125rem!important}.pr-1,.px-1{padding-right:.125rem!important}.pb-1,.py-1{padding-bottom:.125rem!important}.pl-1,.px-1{padding-left:.125rem!important}.p-2{padding:.25rem!important}.pt-2,.py-2{padding-top:.25rem!important}.pr-2,.px-2{padding-right:.25rem!important}.pb-2,.py-2{padding-bottom:.25rem!important}.pl-2,.px-2{padding-left:.25rem!important}.p-3{padding:.5rem!important}.pt-3,.py-3{padding-top:.5rem!important}.pr-3,.px-3{padding-right:.5rem!important}.pb-3,.py-3{padding-bottom:.5rem!important}.pl-3,.px-3{padding-left:.5rem!important}.p-4{padding:.75rem!important}.pt-4,.py-4{padding-top:.75rem!important}.pr-4,.px-4{padding-right:.75rem!important}.pb-4,.py-4{padding-bottom:.75rem!important}.pl-4,.px-4{padding-left:.75rem!important}.p-5{padding:1.5rem!important}.pt-5,.py-5{padding-top:1.5rem!important}.pr-5,.px-5{padding-right:1.5rem!important}.pb-5,.py-5{padding-bottom:1.5rem!important}.pl-5,.px-5{padding-left:1.5rem!important}.m-n1{margin:-.125rem!important}.mt-n1,.my-n1{margin-top:-.125rem!important}.mr-n1,.mx-n1{margin-right:-.125rem!important}.mb-n1,.my-n1{margin-bottom:-.125rem!important}.ml-n1,.mx-n1{margin-left:-.125rem!important}.m-n2{margin:-.25rem!important}.mt-n2,.my-n2{margin-top:-.25rem!important}.mr-n2,.mx-n2{margin-right:-.25rem!important}.mb-n2,.my-n2{margin-bottom:-.25rem!important}.ml-n2,.mx-n2{margin-left:-.25rem!important}.m-n3{margin:-.5rem!important}.mt-n3,.my-n3{margin-top:-.5rem!important}.mr-n3,.mx-n3{margin-right:-.5rem!important}.mb-n3,.my-n3{margin-bottom:-.5rem!important}.ml-n3,.mx-n3{margin-left:-.5rem!important}.m-n4{margin:-.75rem!important}.mt-n4,.my-n4{margin-top:-.75rem!important}.mr-n4,.mx-n4{margin-right:-.75rem!important}.mb-n4,.my-n4{margin-bottom:-.75rem!important}.ml-n4,.mx-n4{margin-left:-.75rem!important}.m-n5{margin:-1.5rem!important}.mt-n5,.my-n5{margin-top:-1.5rem!important}.mr-n5,.mx-n5{margin-right:-1.5rem!important}.mb-n5,.my-n5{margin-bottom:-1.5rem!important}.ml-n5,.mx-n5{margin-left:-1.5rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.125rem!important}.mt-sm-1,.my-sm-1{margin-top:.125rem!important}.mr-sm-1,.mx-sm-1{margin-right:.125rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.125rem!important}.ml-sm-1,.mx-sm-1{margin-left:.125rem!important}.m-sm-2{margin:.25rem!important}.mt-sm-2,.my-sm-2{margin-top:.25rem!important}.mr-sm-2,.mx-sm-2{margin-right:.25rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.25rem!important}.ml-sm-2,.mx-sm-2{margin-left:.25rem!important}.m-sm-3{margin:.5rem!important}.mt-sm-3,.my-sm-3{margin-top:.5rem!important}.mr-sm-3,.mx-sm-3{margin-right:.5rem!important}.mb-sm-3,.my-sm-3{margin-bottom:.5rem!important}.ml-sm-3,.mx-sm-3{margin-left:.5rem!important}.m-sm-4{margin:.75rem!important}.mt-sm-4,.my-sm-4{margin-top:.75rem!important}.mr-sm-4,.mx-sm-4{margin-right:.75rem!important}.mb-sm-4,.my-sm-4{margin-bottom:.75rem!important}.ml-sm-4,.mx-sm-4{margin-left:.75rem!important}.m-sm-5{margin:1.5rem!important}.mt-sm-5,.my-sm-5{margin-top:1.5rem!important}.mr-sm-5,.mx-sm-5{margin-right:1.5rem!important}.mb-sm-5,.my-sm-5{margin-bottom:1.5rem!important}.ml-sm-5,.mx-sm-5{margin-left:1.5rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.125rem!important}.pt-sm-1,.py-sm-1{padding-top:.125rem!important}.pr-sm-1,.px-sm-1{padding-right:.125rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.125rem!important}.pl-sm-1,.px-sm-1{padding-left:.125rem!important}.p-sm-2{padding:.25rem!important}.pt-sm-2,.py-sm-2{padding-top:.25rem!important}.pr-sm-2,.px-sm-2{padding-right:.25rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.25rem!important}.pl-sm-2,.px-sm-2{padding-left:.25rem!important}.p-sm-3{padding:.5rem!important}.pt-sm-3,.py-sm-3{padding-top:.5rem!important}.pr-sm-3,.px-sm-3{padding-right:.5rem!important}.pb-sm-3,.py-sm-3{padding-bottom:.5rem!important}.pl-sm-3,.px-sm-3{padding-left:.5rem!important}.p-sm-4{padding:.75rem!important}.pt-sm-4,.py-sm-4{padding-top:.75rem!important}.pr-sm-4,.px-sm-4{padding-right:.75rem!important}.pb-sm-4,.py-sm-4{padding-bottom:.75rem!important}.pl-sm-4,.px-sm-4{padding-left:.75rem!important}.p-sm-5{padding:1.5rem!important}.pt-sm-5,.py-sm-5{padding-top:1.5rem!important}.pr-sm-5,.px-sm-5{padding-right:1.5rem!important}.pb-sm-5,.py-sm-5{padding-bottom:1.5rem!important}.pl-sm-5,.px-sm-5{padding-left:1.5rem!important}.m-sm-n1{margin:-.125rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.125rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.125rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.125rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.125rem!important}.m-sm-n2{margin:-.25rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.25rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.25rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.25rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.25rem!important}.m-sm-n3{margin:-.5rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-.5rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-.5rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-.5rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-.5rem!important}.m-sm-n4{margin:-.75rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-.75rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-.75rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-.75rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-.75rem!important}.m-sm-n5{margin:-1.5rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-1.5rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-1.5rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-1.5rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-1.5rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.125rem!important}.mt-md-1,.my-md-1{margin-top:.125rem!important}.mr-md-1,.mx-md-1{margin-right:.125rem!important}.mb-md-1,.my-md-1{margin-bottom:.125rem!important}.ml-md-1,.mx-md-1{margin-left:.125rem!important}.m-md-2{margin:.25rem!important}.mt-md-2,.my-md-2{margin-top:.25rem!important}.mr-md-2,.mx-md-2{margin-right:.25rem!important}.mb-md-2,.my-md-2{margin-bottom:.25rem!important}.ml-md-2,.mx-md-2{margin-left:.25rem!important}.m-md-3{margin:.5rem!important}.mt-md-3,.my-md-3{margin-top:.5rem!important}.mr-md-3,.mx-md-3{margin-right:.5rem!important}.mb-md-3,.my-md-3{margin-bottom:.5rem!important}.ml-md-3,.mx-md-3{margin-left:.5rem!important}.m-md-4{margin:.75rem!important}.mt-md-4,.my-md-4{margin-top:.75rem!important}.mr-md-4,.mx-md-4{margin-right:.75rem!important}.mb-md-4,.my-md-4{margin-bottom:.75rem!important}.ml-md-4,.mx-md-4{margin-left:.75rem!important}.m-md-5{margin:1.5rem!important}.mt-md-5,.my-md-5{margin-top:1.5rem!important}.mr-md-5,.mx-md-5{margin-right:1.5rem!important}.mb-md-5,.my-md-5{margin-bottom:1.5rem!important}.ml-md-5,.mx-md-5{margin-left:1.5rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.125rem!important}.pt-md-1,.py-md-1{padding-top:.125rem!important}.pr-md-1,.px-md-1{padding-right:.125rem!important}.pb-md-1,.py-md-1{padding-bottom:.125rem!important}.pl-md-1,.px-md-1{padding-left:.125rem!important}.p-md-2{padding:.25rem!important}.pt-md-2,.py-md-2{padding-top:.25rem!important}.pr-md-2,.px-md-2{padding-right:.25rem!important}.pb-md-2,.py-md-2{padding-bottom:.25rem!important}.pl-md-2,.px-md-2{padding-left:.25rem!important}.p-md-3{padding:.5rem!important}.pt-md-3,.py-md-3{padding-top:.5rem!important}.pr-md-3,.px-md-3{padding-right:.5rem!important}.pb-md-3,.py-md-3{padding-bottom:.5rem!important}.pl-md-3,.px-md-3{padding-left:.5rem!important}.p-md-4{padding:.75rem!important}.pt-md-4,.py-md-4{padding-top:.75rem!important}.pr-md-4,.px-md-4{padding-right:.75rem!important}.pb-md-4,.py-md-4{padding-bottom:.75rem!important}.pl-md-4,.px-md-4{padding-left:.75rem!important}.p-md-5{padding:1.5rem!important}.pt-md-5,.py-md-5{padding-top:1.5rem!important}.pr-md-5,.px-md-5{padding-right:1.5rem!important}.pb-md-5,.py-md-5{padding-bottom:1.5rem!important}.pl-md-5,.px-md-5{padding-left:1.5rem!important}.m-md-n1{margin:-.125rem!important}.mt-md-n1,.my-md-n1{margin-top:-.125rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.125rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.125rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.125rem!important}.m-md-n2{margin:-.25rem!important}.mt-md-n2,.my-md-n2{margin-top:-.25rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.25rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.25rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.25rem!important}.m-md-n3{margin:-.5rem!important}.mt-md-n3,.my-md-n3{margin-top:-.5rem!important}.mr-md-n3,.mx-md-n3{margin-right:-.5rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-.5rem!important}.ml-md-n3,.mx-md-n3{margin-left:-.5rem!important}.m-md-n4{margin:-.75rem!important}.mt-md-n4,.my-md-n4{margin-top:-.75rem!important}.mr-md-n4,.mx-md-n4{margin-right:-.75rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-.75rem!important}.ml-md-n4,.mx-md-n4{margin-left:-.75rem!important}.m-md-n5{margin:-1.5rem!important}.mt-md-n5,.my-md-n5{margin-top:-1.5rem!important}.mr-md-n5,.mx-md-n5{margin-right:-1.5rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-1.5rem!important}.ml-md-n5,.mx-md-n5{margin-left:-1.5rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.125rem!important}.mt-lg-1,.my-lg-1{margin-top:.125rem!important}.mr-lg-1,.mx-lg-1{margin-right:.125rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.125rem!important}.ml-lg-1,.mx-lg-1{margin-left:.125rem!important}.m-lg-2{margin:.25rem!important}.mt-lg-2,.my-lg-2{margin-top:.25rem!important}.mr-lg-2,.mx-lg-2{margin-right:.25rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.25rem!important}.ml-lg-2,.mx-lg-2{margin-left:.25rem!important}.m-lg-3{margin:.5rem!important}.mt-lg-3,.my-lg-3{margin-top:.5rem!important}.mr-lg-3,.mx-lg-3{margin-right:.5rem!important}.mb-lg-3,.my-lg-3{margin-bottom:.5rem!important}.ml-lg-3,.mx-lg-3{margin-left:.5rem!important}.m-lg-4{margin:.75rem!important}.mt-lg-4,.my-lg-4{margin-top:.75rem!important}.mr-lg-4,.mx-lg-4{margin-right:.75rem!important}.mb-lg-4,.my-lg-4{margin-bottom:.75rem!important}.ml-lg-4,.mx-lg-4{margin-left:.75rem!important}.m-lg-5{margin:1.5rem!important}.mt-lg-5,.my-lg-5{margin-top:1.5rem!important}.mr-lg-5,.mx-lg-5{margin-right:1.5rem!important}.mb-lg-5,.my-lg-5{margin-bottom:1.5rem!important}.ml-lg-5,.mx-lg-5{margin-left:1.5rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.125rem!important}.pt-lg-1,.py-lg-1{padding-top:.125rem!important}.pr-lg-1,.px-lg-1{padding-right:.125rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.125rem!important}.pl-lg-1,.px-lg-1{padding-left:.125rem!important}.p-lg-2{padding:.25rem!important}.pt-lg-2,.py-lg-2{padding-top:.25rem!important}.pr-lg-2,.px-lg-2{padding-right:.25rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.25rem!important}.pl-lg-2,.px-lg-2{padding-left:.25rem!important}.p-lg-3{padding:.5rem!important}.pt-lg-3,.py-lg-3{padding-top:.5rem!important}.pr-lg-3,.px-lg-3{padding-right:.5rem!important}.pb-lg-3,.py-lg-3{padding-bottom:.5rem!important}.pl-lg-3,.px-lg-3{padding-left:.5rem!important}.p-lg-4{padding:.75rem!important}.pt-lg-4,.py-lg-4{padding-top:.75rem!important}.pr-lg-4,.px-lg-4{padding-right:.75rem!important}.pb-lg-4,.py-lg-4{padding-bottom:.75rem!important}.pl-lg-4,.px-lg-4{padding-left:.75rem!important}.p-lg-5{padding:1.5rem!important}.pt-lg-5,.py-lg-5{padding-top:1.5rem!important}.pr-lg-5,.px-lg-5{padding-right:1.5rem!important}.pb-lg-5,.py-lg-5{padding-bottom:1.5rem!important}.pl-lg-5,.px-lg-5{padding-left:1.5rem!important}.m-lg-n1{margin:-.125rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.125rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.125rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.125rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.125rem!important}.m-lg-n2{margin:-.25rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.25rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.25rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.25rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.25rem!important}.m-lg-n3{margin:-.5rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-.5rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-.5rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-.5rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-.5rem!important}.m-lg-n4{margin:-.75rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-.75rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-.75rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-.75rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-.75rem!important}.m-lg-n5{margin:-1.5rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-1.5rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-1.5rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-1.5rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-1.5rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.125rem!important}.mt-xl-1,.my-xl-1{margin-top:.125rem!important}.mr-xl-1,.mx-xl-1{margin-right:.125rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.125rem!important}.ml-xl-1,.mx-xl-1{margin-left:.125rem!important}.m-xl-2{margin:.25rem!important}.mt-xl-2,.my-xl-2{margin-top:.25rem!important}.mr-xl-2,.mx-xl-2{margin-right:.25rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.25rem!important}.ml-xl-2,.mx-xl-2{margin-left:.25rem!important}.m-xl-3{margin:.5rem!important}.mt-xl-3,.my-xl-3{margin-top:.5rem!important}.mr-xl-3,.mx-xl-3{margin-right:.5rem!important}.mb-xl-3,.my-xl-3{margin-bottom:.5rem!important}.ml-xl-3,.mx-xl-3{margin-left:.5rem!important}.m-xl-4{margin:.75rem!important}.mt-xl-4,.my-xl-4{margin-top:.75rem!important}.mr-xl-4,.mx-xl-4{margin-right:.75rem!important}.mb-xl-4,.my-xl-4{margin-bottom:.75rem!important}.ml-xl-4,.mx-xl-4{margin-left:.75rem!important}.m-xl-5{margin:1.5rem!important}.mt-xl-5,.my-xl-5{margin-top:1.5rem!important}.mr-xl-5,.mx-xl-5{margin-right:1.5rem!important}.mb-xl-5,.my-xl-5{margin-bottom:1.5rem!important}.ml-xl-5,.mx-xl-5{margin-left:1.5rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.125rem!important}.pt-xl-1,.py-xl-1{padding-top:.125rem!important}.pr-xl-1,.px-xl-1{padding-right:.125rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.125rem!important}.pl-xl-1,.px-xl-1{padding-left:.125rem!important}.p-xl-2{padding:.25rem!important}.pt-xl-2,.py-xl-2{padding-top:.25rem!important}.pr-xl-2,.px-xl-2{padding-right:.25rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.25rem!important}.pl-xl-2,.px-xl-2{padding-left:.25rem!important}.p-xl-3{padding:.5rem!important}.pt-xl-3,.py-xl-3{padding-top:.5rem!important}.pr-xl-3,.px-xl-3{padding-right:.5rem!important}.pb-xl-3,.py-xl-3{padding-bottom:.5rem!important}.pl-xl-3,.px-xl-3{padding-left:.5rem!important}.p-xl-4{padding:.75rem!important}.pt-xl-4,.py-xl-4{padding-top:.75rem!important}.pr-xl-4,.px-xl-4{padding-right:.75rem!important}.pb-xl-4,.py-xl-4{padding-bottom:.75rem!important}.pl-xl-4,.px-xl-4{padding-left:.75rem!important}.p-xl-5{padding:1.5rem!important}.pt-xl-5,.py-xl-5{padding-top:1.5rem!important}.pr-xl-5,.px-xl-5{padding-right:1.5rem!important}.pb-xl-5,.py-xl-5{padding-bottom:1.5rem!important}.pl-xl-5,.px-xl-5{padding-left:1.5rem!important}.m-xl-n1{margin:-.125rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.125rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.125rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.125rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.125rem!important}.m-xl-n2{margin:-.25rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.25rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.25rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.25rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.25rem!important}.m-xl-n3{margin:-.5rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-.5rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-.5rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-.5rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-.5rem!important}.m-xl-n4{margin:-.75rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-.75rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-.75rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-.75rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-.75rem!important}.m-xl-n5{margin:-1.5rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-1.5rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-1.5rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-1.5rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-1.5rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#1f2937!important}a.text-primary:focus,a.text-primary:hover{color:#030506!important}.text-secondary{color:#bac5d7!important}a.text-secondary:focus,a.text-secondary:hover{color:#8a9cbb!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}} \ No newline at end of file diff --git a/www/ksvc/inc/css/common.css b/www/ksvc/inc/css/common.css new file mode 100644 index 0000000..0ecf9c8 --- /dev/null +++ b/www/ksvc/inc/css/common.css @@ -0,0 +1,260 @@ +:root { + --frame_top_height: 60px; + --frame_side_panel_width: 240px; + --frame_bgcolor_top: /*#234164*/#fff; + --frame_bgcolor_sidebar: #FFFFFF; + --frame_bgcolor_contents: #EFEFEF; + + --bgcolor_frame : #ffffff; /* 프레임 배경색 */ + --bgcolor_body : #EFEFEF; /* 페이지 기본 배경색 */ + --bgcolor_leftmenu : #FFFFFF; /* 좌측메뉴 배경색 */ + --bgcolor_main_title : #234164; /* 페이지 메인 타이틀 */ + --bgcolor_sub_title : #F5F5F5; /* 페이지 서브 타이틀 */ + --bgcolor_impt_title : #D9D9D9; /* 페이지 서브 타이틀 */ + + --bdcolor_base : #DEDEDE; /* 기본 Border 색상 */ + --radius_base : 8px; + + --width_leftmenu : 220px; /* 좌측메뉴 넓이 */ + --small_leftmenu : 75px; /*축소된 메뉴 넓이*/ + --height_main_title : 60px; /* 페이지 메인 타이틀 높이 */ + --height_sub_title : 60px; /* 페이지 서브 타이틀 높이 */ + --padding_base : 20px; /* main padding */ + --margin_base : 24px; /* main margin */ + --margin_sub : 3px; /* sub margin */ + --height_logo_block : 60px; /* 로고 영역 높이 */ + --height_menu_block : 65px; /* 메뉴 / 기능 영역 높이 */ + + --color_font_base : #545454; /* 기본폰트 색상 */ + --color_font_impt : #E5E5E5; /* 강조폰트 색상 */ + --color_font_impt2 : #F7941D; /* 강조폰트 색상2 */ + --color_font_impt3 : #2bbfd4; /* 강조폰트 색상2 */ + --color_font_impt4 : #125bbb; /* 강조폰트 색상2 */ + --color_font_red : #FF0000; /* 강조폰트 색상 */ + --color_font_orange : #d2801b; /* 강조폰트 색상 */ + --color_logo_text : #126E91; /* 로고 색상 */ + + --color_icon_main : #1770e3; /* 메인 아이콘 Color */ + --color_icon_sub : #528cec; /* 서브 아이콘 Color */ + --color_bg_icon : #6292cf; /* 서브 아이콘 Color */ + + --color_text_main : #545454; /* 문자 기본 Color */ + --color_text_title : #3782e5; /* 문자 타이틀 Color */ + --color_text_impt : #413C31; /* 문자 강조 Color */ + --color_text_sub : #666666; /* 문자 보조 Color */ + --color_text_dsub : #555555; /* 문자 보조 Color */ + --color_text_tsub : #7fa5f8; /* 문자 보조 Color */ + --color_text_bsub : #ECF1FC; /* 문자 보조 Color */ + --color_text_del : #bac5d7; /* 문자 보조 Color */ + --color_text_link : #294C95; /* 문자 보조 Color */ + + /* 테이블 Color */ + --color_border_table_top : #a0a0a0; /* 메인테이블 상단선 Color */ + --color_border_table_bottom : #959595; /* 메인테이블 하단선 Color */ + --color_border_table_bline : #e8e8e8; /* 테이블 전체 구분선(하단) Color */ + --color_border_table_rline : #e8e8e8; /* 테이블 전체 구분선(오른쪽) Color */ + --color_border_table_selbline : #e8e8e8; /* 테이블 선택 Row 구분선(하단) Color */ + --color_bg_table_main : #fff; /*테이블 전체 배경 Color*/ + --color_border_main : #3660d5; /* 메인테이블 임시 Color */ + --color_border_table_hbottom : #a0a0a0; /* 메인테이블 타이틀 구분선(하단) Color */ + --color_border_table_hright : #DEDEDE; /* 메인테이블 타이틀 구분선(오른쪽) Color */ + --color_bg_table_title : #FFFFFF; /* 메인테이블 타이틀 배경색 */ + --color_check_table_label : #2D7EE8; /* 메인테이블 토글Label 색상 */ + --color_sort_table_asc : #090; /* 메인테이블 정렬아이콘 (ASC) */ + --color_sort_table_desc : #f00; /* 메인테이블 정렬아이콘 (DESC) */ + --color_text_table_next : #999999; /* 메인테이블 설명 */ + --color_bg_table_hover : white; /* 메인테이블 Row hover 배경 */ + --color_bg_table_selected : #d6e59a; /* 메인테이블 선택Row 배경 */ + --color_bg_table_hselected : #eef9cd; /* 메인테이블 선택 hover Row 배경 */ + --color_bg_table_selected_sub : #EEFAFC; /*#ffca8e; /* 메인테이블 선택Row 배경 */ + --color_bg_table_hselected_sub : #EEFAFC; /* 메인테이블 선택 hover Row 배경 */ + --color_bg_table_checked : #ffe8b7; /* 메인테이블 checked Row 배경 */ + --color_bg_table_hchecked : #e8c58d; /* 메인테이블 checked hover Row 배경 */ + --color_bg_table_checked_u : #ddeeff; /* 메인테이블 사용자 checked Row 배경 */ + --color_bg_table_checked_usub : #ccddee; /* 메인테이블 사용자 checked Row 배경 */ + /*스크롤 Color*/ + --color_bg_scroll_main : #eee; /* 스크롤바 배경*/ + --color_bg_scroll_float : var(--frame_bgcolor_sidebar); /* 스크롤바 float thumb */ + --color_bg_scroll_smain : #eee; /*#eee;*/ /* 스크롤바 배경*/ + --color_bg_scroll_sfloat : #71a1ee; /* 스크롤바 float thumb */ + --color_bg_select_block : #f5f5f5; /* 선택 Block 배경 */ + --btn_bd_main : #c0c0c0; /* 메인 버튼 Border Color */ + +} + +body { + padding:0; + margin:0; + color: var(--color_text_main); +} + +a { + text-decoration: none; + color: inherit; + cursor: pointer; +} + +img { + max-width: 100%; + height: auto; +} + +table { + border-spacing:0; + box-sizing: border-box; +} + +.w20 { width: 20px !important; } +.w30 { width: 30px !important; } +.w50 { width: 50px !important; } +.w80 { width: 80px !important; } +.w100 { width: 100px !important; } +.w120 { width: 120px !important; } +.w150 { width: 150px !important; } +.w200 { width: 200px !important; } +.w250 { width: 250px !important; } +.w300 { width: 300px !important; } +.w400 { width: 400px !important; } +.w500 { width: 500px !important; } +.w600 { width: 600px !important; } +.w700 { width: 700px !important; } +.w800 { width: 800px !important; } +.w900 { width: 900px !important; } + +.h20 { height: 20px !important; } +.h30 { height: 30px !important; } +.h50 { height: 50px !important; } +.h80 { height: 80px !important; } +.h100 { height: 100px !important; } +.h120 { height: 120px !important; } +.h150 { height: 150px !important; } +.h200 { height: 200px !important; } +.h250 { height: 250px !important; } +.h300 { height: 300px !important; } +.h400 { height: 400px !important; } +.h500 { height: 500px !important; } +.h600 { height: 600px !important; } +.h700 { height: 700px !important; } +.h800 { height: 800px !important; } +.h900 { height: 900px !important; } + + +/** 상단 Badge 용 tippy **/ +.tippy-box { + background-color: #ffffff; + color: initial; + border-radius: 8px; + box-shadow: 0px 1px 6px #00000029; +} +.tippy-arrow { + color: #ffffff; +} + +.alarm_box { + width: 410px; + max-height: 300px; + padding: 10px; + overflow-y: auto; +} + +.alarm_box .alarm_title { + width: 100%; + font-weight: bold; +} + +.alarm_box .alarm_cont { + position: relative; + display: flex; + padding: 16px 0; + border-bottom: 1px solid #efefef; + justify-content: space-between; + align-items: center; +} + +.alarm_box .alarm_cont:last-child { + border-bottom: 0; +} + +.alarm_box .alarm_cont .alarm_txt .alarm_type, +.alarm_box .alarm_cont .alarm_txt .alarm_msg { + font-size: 0.9rem; + color: #666; +} + +.alarm_box .alarm_cont .alarm_txt .alarm_sec { + font-size: 0.9rem; + font-weight: bold; + color: #3d76e8; + padding-top: 5px; + margin: 0; +} + +.alarm_box .btnAlarmClose { + display: inline-block; + position: absolute; + right: 10px; + top: 1.8rem; + width: 24px; + height: 24px; + background-image: url(/ksvc/inc/img/x.svg); + background-repeat: no-repeat; + background-position: center center; +} + +/* Checkbox && Radio && Toggle */ +label.form_checkbox, label.form_radio, label.form_toggle { + position: relative; + margin-bottom: 0; + cursor: pointer; +} +label.form_checkbox > input, +label.form_radio > input, +label.form_toggle > input { + position: absolute; + top: -1000px; + left: -1000px; +} +label.form_checkbox::after, +label.form_radio::after { + font-size: 1.2em; + line-height: 100%; + font-weight: 100 !important; + vertical-align: middle; + margin-left:3px; + font-family: bootstrap-icons !important; +} +label.form_toggle::after { + font-size: 1.8em; + font-weight: 100 !important; + line-height: 100%; + vertical-align: middle; + margin-left:3px; + font-family: bootstrap-icons !important; +} + +/* Checkbox */ +label.form_checkbox::after { + content:'\F584'; +} +label.form_checkbox:has(input:checked)::after { + content:'\F26C'; + color: #1770e3; + font-weight: 900; +} +/* Radio */ +label.form_radio::after { + content:'\F28A'; +} +label.form_radio:has(input:checked)::after { + content:'\F26A'; + color: #1770e3; + font-weight: 900; +} +/* Toggle */ +label.form_toggle::after { + content:'\F5D5'; +} +label.form_toggle:has(input:checked)::after { + content:'\F5D6'; + color: #1770e3; +} diff --git a/www/ksvc/inc/css/contents.css b/www/ksvc/inc/css/contents.css new file mode 100644 index 0000000..6114d76 --- /dev/null +++ b/www/ksvc/inc/css/contents.css @@ -0,0 +1,54 @@ + +/** 컨텐츠 기본 상자 **/ +#frame_contents .content-main { + display: flex; + + border-radius: 10px; + background: var(--frame_bgcolor_contents); + + width: 100%; + height: 100%; + padding: 20px; +} + +#frame_contents .content-box { + background: var(--bgcolor_frame); + padding: var(--padding_base); + border-radius: var(--radius_base); +} + + +/* 기본테이블 */ +.basetable { + width: 100%; + border-collapse: separate; + border-bottom: 1px solid var(--color_border_table_bottom); +} +.basetable th { + text-align: center; + background-color: var(--color_bg_table_title); + border-top: 1px solid var(--color_border_table_top); + border-bottom: 1px solid var(--color_border_table_hbottom); + color: var(--color_text_dsub); font-weight: normal; + height: 26px; +} +.basetable th:not(:first-child) { + border-left: 1px solid var(--color_border_table_hright); +} +.basetable td { + white-space: nowrap; + text-align: center; + border-bottom: 1px solid var(--color_border_table_bline); + height: 26px; +} +.basetable td:not(:last-child:first-child) { + border-left: 1px solid var(--color_border_table_rline); +} +.basetable td:last-child:first-child { + border-right: 1px solid var(--color_border_table_rline); +} +.basetable thead.top_sticky, .basetable thead.top_sticky th { + position: sticky; + top:0; + left:0; +} \ No newline at end of file diff --git a/www/ksvc/inc/css/frame.css b/www/ksvc/inc/css/frame.css new file mode 100644 index 0000000..1f0022f --- /dev/null +++ b/www/ksvc/inc/css/frame.css @@ -0,0 +1,153 @@ + + +#frame_main { + display: flex; + width: 100%; + position:relative; +} + +#frame_main #frame_side_panel { + position: sticky; + flex: 0; + flex-basis: var(--frame_side_panel_width); + background-color: var(--frame_bgcolor_sidebar); + overflow-y: auto; + overflow-x: hidden; + z-index: 101; +} + +#frame_main #frame_body { + display: flex; + flex-direction: column; + + flex:1; + flex-basis: calc(100vh - var(--frame_side_panel_width)); +} + +#frame_main #frame_body #frame_top { + position: sticky; + top:0; + left:0; + width: 100%; + height: var(--frame_top_height); + background-color: var(--frame_bgcolor_top); + z-index: 101; +} + +#frame_main #frame_body #frame_contents { + flex: 1; + flex-basis: calc(100vh - var(--frame_top_height)); + width: 100%; + background-color: var(--frame_bgcolor_contents); +} + +/*flex*/ +.flexcol { + display: flex; + flex-direction: column; + align-items: flex-start; +} +.flexrow { + display: flex; + flex-direction: row; +} + +.flexstart { + justify-content: flex-start; +} +.flexend { + justify-content: flex-end; +} +.flexcenter { + justify-content: center; +} +.flexbetween { + justify-content: space-between; +} +.flexaround { + justify-content: space-around; +} +.flexevenly { + justify-content: space-evenly; +} + +.flexfillstart { + align-items: flex-start; +} +.flexfillend { + align-items: flex-end; +} +.flexfillcenter { + align-items: center; +} +.flexfillstrech { + align-items: stretch; +} +.flexfillbaseline { + align-items: baseline; +} + +.flex-auto { flex: auto ;} +.flex-1 { flex: 1; } +.flex-2 { flex: 2; } +.flex-3 { flex: 3; } +.flex-4 { flex: 4; } +.flex-5 { flex: 5; } +.flex-6 { flex: 6; } +.flex-7 { flex: 7; } +.flex-8 { flex: 8; } +.flex-9 { flex: 9; } +.flex-10 { flex: 10; } +.flex-11 { flex: 11; } +.flex-12 { flex: 12; } + +.grow-0 { flex-grow: 0; } +.grow-1 { flex-grow: 1; } +.grow-2 { flex-grow: 2; } +.grow-3 { flex-grow: 3; } +.grow-4 { flex-grow: 4; } +.grow-5 { flex-grow: 5; } +.grow-6 { flex-grow: 6; } +.grow-7 { flex-grow: 7; } +.grow-8 { flex-grow: 8; } +.grow-9 { flex-grow: 9; } +.grow-10 { flex-grow: 10; } +.grow-11 { flex-grow: 11; } +.grow-12 { flex-grow: 12; } + +.shrink-0 { flex-shrink: 0; } +.shrink-1 { flex-shrink: 1; } +.shrink-2 { flex-shrink: 2; } +.shrink-3 { flex-shrink: 3; } +.shrink-4 { flex-shrink: 4; } +.shrink-5 { flex-shrink: 5; } +.shrink-6 { flex-shrink: 6; } +.shrink-7 { flex-shrink: 7; } +.shrink-8 { flex-shrink: 8; } +.shrink-9 { flex-shrink: 9; } +.shrink-10 { flex-shrink: 10; } +.shrink-11 { flex-shrink: 11; } +.shrink-12 { flex-shrink: 12; } + +.gap10 { gap: 10px; } +.gap20 { gap: 20px; } +.gap30 { gap: 30px; } +.gap40 { gap: 40px; } +.gap50 { gap: 50px; } +.gap60 { gap: 60px; } +.gap70 { gap: 70px; } +.gap80 { gap: 80px; } +.gap90 { gap: 90px; } +.gap100 { gap: 100px; } +.gap120 { gap: 120px; } +.gap150 { gap: 150px; } +.gap200 { gap: 200px; } +.gap250 { gap: 250px; } +.gap300 { gap: 300px; } + +.posrel { + position: relative; +} +.posabs { + position: absolute; +} \ No newline at end of file diff --git a/www/ksvc/inc/css/login.css b/www/ksvc/inc/css/login.css new file mode 100644 index 0000000..3042335 --- /dev/null +++ b/www/ksvc/inc/css/login.css @@ -0,0 +1,72 @@ +@charset "utf-8"; + +/*로그인페이지*/ +.loginBox { + width: 90%; + max-width: 520px; + padding:68px 45px; + border:1px solid #D9D9D9; + background-color: #fff; + border-radius: 10px; + position: absolute; + left:50%; + top:50%; + transform: translate(-50%,-50%); + margin: 0; + box-sizing: border-box; + color: #666; +} + +.loginBox img { + width: 100%; + max-width: 300px; + margin:0 auto; + margin-bottom: 65px; + display: block; +} + +.loginBox div input { + margin-bottom: 20px; + width: 100%; + height: 50px; + border: 1px solid #D9D9D9; + border-radius: 5px; + background-color: #fff; + padding-left:5px; +} + +.loginBox button { + width: 100%; + height: 50px; + background-color: #3D76E8; + border-radius: 5px; + color:#fff; + cursor:pointer; + margin-bottom: 25px; + border:0; +} + +.loginBox .save { + display: flex; + align-items: center; +} + + +.loginBox .save input { + width: 20px; + height: 20px; + margin-bottom: 0; +} + +.loginBox .save span { + padding-left: 10px; + font-size: 13px; +} + + + +@media all and (max-width: 740px) { + .loginBox { + padding: 50px 30px; + } +} \ No newline at end of file diff --git a/www/ksvc/inc/css/sidebar.css b/www/ksvc/inc/css/sidebar.css new file mode 100644 index 0000000..e09134f --- /dev/null +++ b/www/ksvc/inc/css/sidebar.css @@ -0,0 +1,149 @@ +#frame_side_panel #head_logo { + position: relative; + width: 100%; + height: var(--frame_top_height); + background-color: var(--frame_bgcolor_sidebar); +} + +#frame_side_panel #head_logo .logo { + display: inline-block; + background-image: url(/ksvc/inc/img/logo.svg); + background-position: center center; + background-repeat: no-repeat; + background-size: 60%; + width: 80%; + height: 100%; + max-height: var(--frame_top_height); + cursor: hand; +} + +#frame_side_panel #head_logo .btnHamburger { + display: inline-block; + position: absolute; + right:22px; + top: 18px; + background-image: url(/ksvc/inc/img/menubar.svg); + background-position: center; + background-repeat: no-repeat; + width: 24px; + height: 24px; + cursor: hand; +} + +/*******프로필*******/ +#side-profile .profile { + padding: 50px 0; + width: 100%; + position: relative; +} + +#side-profile .profile .profileImg { + display: block; + text-align: center; +} + +#side-profile .profile .pro_setting { + width: 30px; + height: 30px; + border-radius: 50px; + border: 1px solid #234164; + padding: 6px 0; + position: absolute; + top: 45px; + right: 70px; + background: #fff; + cursor: pointer; +} + +#side-profile .profile .pro_setting img { + width: 15px; + height: 16px; + display: block; + margin: 0 auto; +} + +#side-profile .profile .info { + text-align: center; + margin-top: 15px; +} + +#side-profile .profile .info span { + display: inline-block; + width: 9px; + height: 9px; + background: #169227; + border-radius: 50px; +} + +#side-profile .profile .info .name { + display: inline; + font-weight: 600; + font-size: 1.1rem; +} + +#side-profile .profile .info p { + margin-top: 10px; + font-size: 0.8rem; +} + +#side-profile .profile .logout { + margin-top: 35px; + text-align: center; +} + +#side-profile .profile .logout a { + font-size: 0.8rem; + color: #145097; + text-decoration: underline; +} + +/****** 기타 수정 요망 *****/ +#side-nav .sidebar { + padding-left: 0; +} +#side-nav .sidebar li { + height: 50px; + padding-left: 25px; + line-height: 50px; + position: relative; + color: #666666; + font-size: 1.1rem; + cursor: pointer; + list-style: none; +} + +#side-nav .sidebar li.on { + background: #f8f8f8; + color: #1b7be9; +} + +#side-nav .sidebar li.on :after { + content: ""; + display: block; + width: 4px; + height: 50px; + background: #1b7be9; + position: absolute; + top: 0; + left: 0; +} + +#side-nav .sidebar li span { + margin-left: 12px; +} + +#side-footer .organization { + position: absolute; + bottom: 0; + width: 100%; + height: 50px; +} +#side-footer .organization a { + display: block; + padding-left: 25px; + color: #666666; +} + +#side-footer .organization a span { + margin-left: 12px; +} \ No newline at end of file diff --git a/www/ksvc/inc/css/tabulator.css b/www/ksvc/inc/css/tabulator.css new file mode 100644 index 0000000..e69de29 diff --git a/www/ksvc/inc/css/top.css b/www/ksvc/inc/css/top.css new file mode 100644 index 0000000..daa36f6 --- /dev/null +++ b/www/ksvc/inc/css/top.css @@ -0,0 +1,62 @@ +#frame_top #head_block { + padding: 0 var(--padding_base); +} + +#frame_top #head_search { + display: flex; + align-items: center; +} + +#frame_top #head_search .search_list { + margin: 0 20px; + position: relative; +} + +#frame_top #head_search .search_frm { + position: relative; + margin: 0; + padding: 4px 20px; + border: 1px solid var(--bdcolor_base); + border-radius: 15px; + width: 200px; +} + +#frame_top #head_search .search_frm .search_field { + border: none; + width: calc(100% - 14px); + font-size: 1.2em; + background-color: var(--bdcolor_base); +} + +#frame_top #head_search .search_frm .btnSearch { + position: absolute; + top: 6px; + right: 10px; + width: 20px; + padding: 0; + border: none; + background: #FFFFFF; + background-image: url(/ksvc/inc/img/search.svg); + background-repeat: no-repeat; + background-position: center center; +} + +#frame_top #head_search .badge { + display: inline-block; + width: 25px; + height: 28px; + background-image: url(/ksvc/inc/img/alarm.svg); + background-repeat: no-repeat; + background-position: center center; + padding: 0; +} + +#frame_top #head_search .badge .newAlarm { + position: absolute; + top: 0; + right: 0; + width: 10px; + height: 10px; + background: #F32828; + border-radius: 50%; +} \ No newline at end of file diff --git a/www/ksvc/inc/footer.php b/www/ksvc/inc/footer.php new file mode 100644 index 0000000..8fbe1fd --- /dev/null +++ b/www/ksvc/inc/footer.php @@ -0,0 +1,12 @@ + + + + + +putVisitRec("service",$cate_id); \ No newline at end of file diff --git a/www/ksvc/inc/footer_common.php b/www/ksvc/inc/footer_common.php new file mode 100644 index 0000000..c563d9d --- /dev/null +++ b/www/ksvc/inc/footer_common.php @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/www/ksvc/inc/frame_footer.php b/www/ksvc/inc/frame_footer.php new file mode 100644 index 0000000..f5ebeeb --- /dev/null +++ b/www/ksvc/inc/frame_footer.php @@ -0,0 +1,7 @@ +
    + + +
    + + + \ No newline at end of file diff --git a/www/ksvc/inc/frame_header.php b/www/ksvc/inc/frame_header.php new file mode 100644 index 0000000..382aeb7 --- /dev/null +++ b/www/ksvc/inc/frame_header.php @@ -0,0 +1,20 @@ +
    + + +
    + +
    + + + +
    + + +
    + +
    + + + + +
    \ No newline at end of file diff --git a/www/ksvc/inc/frame_sidebar.php b/www/ksvc/inc/frame_sidebar.php new file mode 100644 index 0000000..78c7579 --- /dev/null +++ b/www/ksvc/inc/frame_sidebar.php @@ -0,0 +1,59 @@ + + + +
    +
    +
    + 프로필이미지 +
    + +
    + + 설정아이콘 + +
    + +
    + +

    김쿨스

    +

    개발팀 / 사원

    +
    + + +
    +
    +
    + +
    + diff --git a/www/ksvc/inc/frame_top.php b/www/ksvc/inc/frame_top.php new file mode 100644 index 0000000..a20d49f --- /dev/null +++ b/www/ksvc/inc/frame_top.php @@ -0,0 +1,9 @@ + +
    +
    +

    메뉴명

    +
    + +
    \ No newline at end of file diff --git a/www/ksvc/inc/header.php b/www/ksvc/inc/header.php new file mode 100644 index 0000000..52f46f1 --- /dev/null +++ b/www/ksvc/inc/header.php @@ -0,0 +1,39 @@ +hasMenuAuth("R", $GLOBALS['_Auth_']['cate_id']) ){ + hback($GLOBALS['_Auth_']['deny_view']); +} + +$menu_hist = array(); +if( $GLOBALS['_Auth_']['menuObj'] ){ + $menu_hist = $GLOBALS['_Auth_']['menuObj']->getMenuBrdcom($GLOBALS['_Auth_']['cate_id']); +} + +if( $menu_hist ){ + $GLOBALS['_Menu_'] = array( + "menu_code" => $menu_hist['cate_code'][count($menu_hist['cate_id'])-1], + "menu_name" => $menu_hist['cate_name'][count($menu_hist['cate_id'])-1], + "menu_class" => $menu_hist['cate_class'][count($menu_hist['cate_id'])-1], + "menu_exp" => $menu_hist['cate_exp'][count($menu_hist['cate_id'])-1], + ); +} +?> + + + + + + + 쿨스 + + + + \ No newline at end of file diff --git a/www/ksvc/inc/header_common.php b/www/ksvc/inc/header_common.php new file mode 100644 index 0000000..a846f6c --- /dev/null +++ b/www/ksvc/inc/header_common.php @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/www/ksvc/inc/header_public.php b/www/ksvc/inc/header_public.php new file mode 100644 index 0000000..1b9f7cf --- /dev/null +++ b/www/ksvc/inc/header_public.php @@ -0,0 +1,28 @@ +getMenuBrdcom($GLOBALS['_Auth_']['cate_id']); +} + +if( $menu_hist ){ + $GLOBALS['_Menu_'] = array( + "menu_code" => $menu_hist['cate_code'][count($menu_hist['cate_id'])-1], + "menu_name" => $menu_hist['cate_name'][count($menu_hist['cate_id'])-1], + "menu_class" => $menu_hist['cate_class'][count($menu_hist['cate_id'])-1], + "menu_exp" => $menu_hist['cate_exp'][count($menu_hist['cate_id'])-1], + ); +} +?> + + + + + + + 쿨스 + + + + \ No newline at end of file diff --git a/www/ksvc/inc/img/KULS_ENC.png b/www/ksvc/inc/img/KULS_ENC.png new file mode 100644 index 0000000..b8c3527 Binary files /dev/null and b/www/ksvc/inc/img/KULS_ENC.png differ diff --git a/www/ksvc/inc/img/alarm.svg b/www/ksvc/inc/img/alarm.svg new file mode 100644 index 0000000..d957687 --- /dev/null +++ b/www/ksvc/inc/img/alarm.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/www/ksvc/inc/img/arr_bottom.svg b/www/ksvc/inc/img/arr_bottom.svg new file mode 100644 index 0000000..2e16123 --- /dev/null +++ b/www/ksvc/inc/img/arr_bottom.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/arr_l.svg b/www/ksvc/inc/img/arr_l.svg new file mode 100644 index 0000000..01201dd --- /dev/null +++ b/www/ksvc/inc/img/arr_l.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/arr_r.svg b/www/ksvc/inc/img/arr_r.svg new file mode 100644 index 0000000..7199f80 --- /dev/null +++ b/www/ksvc/inc/img/arr_r.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/board_more_l.svg b/www/ksvc/inc/img/board_more_l.svg new file mode 100644 index 0000000..30c0fcd --- /dev/null +++ b/www/ksvc/inc/img/board_more_l.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/www/ksvc/inc/img/board_more_r.svg b/www/ksvc/inc/img/board_more_r.svg new file mode 100644 index 0000000..c5d39ec --- /dev/null +++ b/www/ksvc/inc/img/board_more_r.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/www/ksvc/inc/img/calendar-alt-solid.svg b/www/ksvc/inc/img/calendar-alt-solid.svg new file mode 100644 index 0000000..a6f5143 --- /dev/null +++ b/www/ksvc/inc/img/calendar-alt-solid.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/checkbox1.svg b/www/ksvc/inc/img/checkbox1.svg new file mode 100644 index 0000000..b211d04 --- /dev/null +++ b/www/ksvc/inc/img/checkbox1.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/www/ksvc/inc/img/checkbox2.svg b/www/ksvc/inc/img/checkbox2.svg new file mode 100644 index 0000000..2750ceb --- /dev/null +++ b/www/ksvc/inc/img/checkbox2.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/www/ksvc/inc/img/checkbox3.svg b/www/ksvc/inc/img/checkbox3.svg new file mode 100644 index 0000000..657f3ed --- /dev/null +++ b/www/ksvc/inc/img/checkbox3.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/www/ksvc/inc/img/detail_search.svg b/www/ksvc/inc/img/detail_search.svg new file mode 100644 index 0000000..bef5657 --- /dev/null +++ b/www/ksvc/inc/img/detail_search.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/www/ksvc/inc/img/doc_icon.svg b/www/ksvc/inc/img/doc_icon.svg new file mode 100644 index 0000000..57b6c05 --- /dev/null +++ b/www/ksvc/inc/img/doc_icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/www/ksvc/inc/img/home.png b/www/ksvc/inc/img/home.png new file mode 100644 index 0000000..4961a0d Binary files /dev/null and b/www/ksvc/inc/img/home.png differ diff --git a/www/ksvc/inc/img/list-ul-solid.svg b/www/ksvc/inc/img/list-ul-solid.svg new file mode 100644 index 0000000..126683b --- /dev/null +++ b/www/ksvc/inc/img/list-ul-solid.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/logo.svg b/www/ksvc/inc/img/logo.svg new file mode 100644 index 0000000..b149006 --- /dev/null +++ b/www/ksvc/inc/img/logo.svg @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/www/ksvc/inc/img/logo_tank.png b/www/ksvc/inc/img/logo_tank.png new file mode 100644 index 0000000..773cb4a Binary files /dev/null and b/www/ksvc/inc/img/logo_tank.png differ diff --git a/www/ksvc/inc/img/mark.svg b/www/ksvc/inc/img/mark.svg new file mode 100644 index 0000000..5e2f9d6 --- /dev/null +++ b/www/ksvc/inc/img/mark.svg @@ -0,0 +1,9 @@ + + + + + + + 승인 + + diff --git a/www/ksvc/inc/img/mark2.svg b/www/ksvc/inc/img/mark2.svg new file mode 100644 index 0000000..0404d5f --- /dev/null +++ b/www/ksvc/inc/img/mark2.svg @@ -0,0 +1,9 @@ + + + + + + + 승인 + + diff --git a/www/ksvc/inc/img/menubar.svg b/www/ksvc/inc/img/menubar.svg new file mode 100644 index 0000000..c0500ad --- /dev/null +++ b/www/ksvc/inc/img/menubar.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/www/ksvc/inc/img/more.svg b/www/ksvc/inc/img/more.svg new file mode 100644 index 0000000..c5d39ec --- /dev/null +++ b/www/ksvc/inc/img/more.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/www/ksvc/inc/img/more_final_l.svg b/www/ksvc/inc/img/more_final_l.svg new file mode 100644 index 0000000..270e0b3 --- /dev/null +++ b/www/ksvc/inc/img/more_final_l.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/www/ksvc/inc/img/more_final_r.svg b/www/ksvc/inc/img/more_final_r.svg new file mode 100644 index 0000000..fc16ae6 --- /dev/null +++ b/www/ksvc/inc/img/more_final_r.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/www/ksvc/inc/img/more_l.svg b/www/ksvc/inc/img/more_l.svg new file mode 100644 index 0000000..b372eec --- /dev/null +++ b/www/ksvc/inc/img/more_l.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/www/ksvc/inc/img/more_r.svg b/www/ksvc/inc/img/more_r.svg new file mode 100644 index 0000000..6e712d9 --- /dev/null +++ b/www/ksvc/inc/img/more_r.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/www/ksvc/inc/img/paperclip-solid.svg b/www/ksvc/inc/img/paperclip-solid.svg new file mode 100644 index 0000000..2dea9d1 --- /dev/null +++ b/www/ksvc/inc/img/paperclip-solid.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/print-solid.svg b/www/ksvc/inc/img/print-solid.svg new file mode 100644 index 0000000..1478ab5 --- /dev/null +++ b/www/ksvc/inc/img/print-solid.svg @@ -0,0 +1,3 @@ + + + diff --git a/www/ksvc/inc/img/profile_img.svg b/www/ksvc/inc/img/profile_img.svg new file mode 100644 index 0000000..cb8e3f1 --- /dev/null +++ b/www/ksvc/inc/img/profile_img.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/www/ksvc/inc/img/search.svg b/www/ksvc/inc/img/search.svg new file mode 100644 index 0000000..61c3078 --- /dev/null +++ b/www/ksvc/inc/img/search.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/www/ksvc/inc/img/setting.svg b/www/ksvc/inc/img/setting.svg new file mode 100644 index 0000000..304d389 --- /dev/null +++ b/www/ksvc/inc/img/setting.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/www/ksvc/inc/img/x.svg b/www/ksvc/inc/img/x.svg new file mode 100644 index 0000000..2a19e65 --- /dev/null +++ b/www/ksvc/inc/img/x.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/www/ksvc/inc/js/common.js b/www/ksvc/inc/js/common.js new file mode 100644 index 0000000..ec5b755 --- /dev/null +++ b/www/ksvc/inc/js/common.js @@ -0,0 +1,89 @@ + +/* +* 로그아웃 +* */ +const logout = function(){ + ajax_json({ + url: "/inc/common.ajax.php", + type: "POST", + data: {mode: 'memberLogout'}, + success: function (data) { + if ( data.code ) { + kuls_alert("로그아웃 되었습니다.",function(){ + location.href="/ksvc/"; + }); + } + }, + error: function (request, status, error) { + kuls_alert(error.message); + } + }); +}; + +const side_menu_load = function( menu_code ){ + ajax_json({ + url: "/inc/common.ajax.php", + type: "POST", + data: { + mode:'getSiteMenuList', + menu_code:menu_code + }, + success: function(data){ + if( data.code ){ + jQuery('#side-nav').treeview({ + nodeIcon: '', + showTags: true, + enableLinks: true, + data: data.data + }); + } + }, + error: function(request, status, error) { + }, + complete: function(request, status){ + jQuery("#side-nav").on("click","a",function(e){ + e.preventDefault(); + }); + + jQuery("#side-nav").on("click",".node-side-nav",function(e){ + if( jQuery(this).find(".expand-icon").length == 0 ){ + let href = jQuery(this).find("> a").attr("href"); + href && (location.href = href); + } + }); + } + }); +}; + + +const cont_hfix = function(){ + jQuery(".cont_hfix").css('height',0); + let win_h = jQuery(window).outerHeight(); + jQuery(".cont_hfix").toArray().forEach( tgt => { + let cont_y = jQuery(tgt).offset().top; + let cont_height = win_h - cont_y - 20; + jQuery(tgt).css('height',cont_height); + }); +} + +jQuery(document).ready(function(){ + if( jQuery("#side-nav").length ){ + side_menu_load(menu_code); + } + + cont_hfix(); +}); + +jQuery(window).on("resize",function(){ + cont_hfix(); +}); + + +jQuery(".btnHamburger").on("click",function(){ + jQuery("#frame_side_panel").toggleClass("show_side_panel"); +}); + + +jQuery("#btnLogout").on("click",function(){ + logout(); +}); \ No newline at end of file diff --git a/www/ksvc/index.php b/www/ksvc/index.php new file mode 100644 index 0000000..e854472 --- /dev/null +++ b/www/ksvc/index.php @@ -0,0 +1,8 @@ + + + + + +
    +
    + + + + +
    + +
    +
    +
    + + + diff --git a/www/ksvc/kbrd/in.up.php b/www/ksvc/kbrd/in.up.php new file mode 100644 index 0000000..5a0f143 --- /dev/null +++ b/www/ksvc/kbrd/in.up.php @@ -0,0 +1,8 @@ + 0, + "mesg" => "", + "data" => array(), +); + +if( !$_REQUEST['board_id'] ) return; +$ret_mode = $_REQUEST['ret_mode']; +$mesg = ""; + +$kbrd_obj = new Board($_REQUEST['board_id']); +switch( true ){ + case $_REQUEST['mode'] == "getBoardList" : + $kbrd_list = $kbrd_obj->getBoardPage(); + break; + + case $_REQUEST['mode'] == "getContentsPage" : + $kbrd_cont_list = $kbrd_obj->getContentsPage($_REQUEST); + break; + + case $_REQUEST['mode'] == "putContents" : $ret_mode = "action"; + $retval['mesg'] = array(); + if( !$_REQUEST['board_id'] ){ + $retval['mesg'][] = "잘못된 접근방식입니다."; + }else if( !$kbrd_obj->chkUseOnly("input") ){ //쓰기권한이 있는지 확인 + $retval['mesg'][] = "이용 권한이 없습니다."; + }else{ + if( $kbrd_obj->board_info['ness_name'] && !$_REQUEST['uname'] ){ + $retval['mesg'][] = "이름을 입력하지 않았습니다."; + } + if( !$kbrd_obj->isAdmin() && !$kbrd_obj->chkSecretAuth($_REQUEST['cid']) ){ //비밀번호를 체크하지 않는 권한을 가졌는지 체크 + if( $kbrd_obj->board_info['ness_passwd'] && !$_REQUEST['passwd'] ){ //비밀번호 필수항목에 입력안하면 + $retval['mesg'][] = "비밀번호를 입력하지 않았습니다."; + } + if( $_REQUEST['passwd'] && strlen($_REQUEST['passwd']) < 6 ){ //비밀번호를 입력했는데 6자 이하면 + $retval['mesg'][] = "비밀번호는 6자 이상이어야 합니다."; + } + if( $_REQUEST['cid'] && $kbrd_obj->board_info['ness_passwd'] && !$kbrd_obj->chkPasswd( $_REQUEST['cid'], $_REQUEST['passwd'] ) ){ + $retval['mesg'][] = "입력하신 비밀번호가 일치하지 않습니다."; + } + } + if( $kbrd_obj->board_info['ness_title'] && !$_REQUEST['title'] ){ + $retval['mesg'][] = "제목을 입력하지 않았습니다."; + } + if( $kbrd_obj->board_info['ness_homepage'] && !$_REQUEST['homepage'] ){ + $retval['mesg'][] = "홈페이지를 입력하지 않았습니다."; + }elseif( !chkValiDomain($_REQUEST['homepage']) ){ + $retval['mesg'][] = "홈페이지 형식이 올바르지 않습니다."; + } + if( $kbrd_obj->board_info['ness_mail'] && !$_REQUEST['mail'] ){ + $retval['mesg'][] = "메일을 입력하지 않았습니다."; + }else if( !chkValiMail($_REQUEST['mail']) ){ + $retval['mesg'][] = "메일 형식이 올바르지 않습니다."; + } + if( $kbrd_obj->board_info['ness_mobile'] && !$_REQUEST['mobile'] ){ + $retval['mesg'][] = "연락처를 입력하지 않았습니다."; + }elseif( !chkValiPhone($_REQUEST['mobile']) ){ + $retval['mesg'][] = "연락처 형식이 올바르지 않습니다."; + } + if( $kbrd_obj->board_info['ness_contents'] && !$_REQUEST['contents'] ){ + $retval['mesg'][] = "내용을 입력하지 않았습니다."; + } +// if( !$_REQUEST['cid'] && $kbrd_obj->board_info['ness_image'] && !count($_FILES['image']['name']) ){ //최초 입력일경우에 체크 +// $retval['mesg'][] = "이미지 파일을 입력하지 않았습니다."; +// } +// if( !$_REQUEST['cid'] && $kbrd_obj->board_info['ness_file'] && !count($_FILES['file']['name']) ){ //최초 입력일경우에 체크 +// $retval['mesg'][] = "첨부파일을 입력하지 않았습니다."; +// } +// if( !$_REQUEST['cid'] && $kbrd_obj->board_info['ness_movie'] && !count($_FILES['movie']['name']) ){ //최초 입력일경우에 체크 +// $retval['mesg'][] = "동영상을 입력하지 않았습니다."; +// } + if( !$_REQUEST['cid'] && $kbrd_obj->board_info['ness_image'] && !$kbrd_obj->chkHasImageFile($_REQUEST) ){ //최초 입력일경우에 체크 + $retval['mesg'][] = "이미지 파일을 입력하지 않았습니다."; + } + if( !$_REQUEST['cid'] && $kbrd_obj->board_info['ness_file'] && !$kbrd_obj->chkHasFile($_REQUEST) ){ //최초 입력일경우에 체크 + $retval['mesg'][] = "첨부 파일을 입력하지 않았습니다."; + } + } + print_r($retval); + if( count($retval['mesg']) ){ + $retval['code'] = false; + }else{ + if( $_REQUEST['cid'] ){ + $rst = $kbrd_obj->setContents($_REQUEST); + $exemode = "수정"; + }else{ + $rst = $kbrd_obj->putContents($_REQUEST); + $exemode = "등록"; + if( $rst ) $move_page = "./kbrd_list.php?board_id={$_REQUEST['board_id']}"; + } + if( $rst ){ + $retval['mesg'][] = "{$exemode}되었습니다."; + }else{ + $retval['mesg'][] = "{$exemode}중 오류가 발생하였습니다."; + } + } + break; + +// case $_REQUEST['mode'] == "getContents" : $ret_mode = "error_action"; +// $retval['mesg'] = array(); +// if( !$_REQUEST['board_id'] ){ +// $retval['mesg'][] = "잘못된 접근방식입니다."; +// }else if( !$kbrd_obj->chkUseOnly( "read" ) ){ //읽기권한이 있는지 확인 +// $retval['mesg'][] = "이용 권한이 없습니다."; +// }else{ +// $kbrd_cont = $kbrd_obj->getContents($_REQUEST['cid']); +// if( ($kbrd_cont['secret'] || $_REQUEST['use_secret']) && !$kbrd_obj->chkSecretAuth($kbrd_cont) ){ //비밀글 모드이거나, 수정진입인데 비밀번호 통과권한이 없으면. +// $ret_mode = "action"; +// $move_page = "./kbrd_secret.php?board_id={$_REQUEST['board_id']}&cid={$kbrd_cont['cid']}"; +// } +// } +// break; + + case $_REQUEST['mode'] == "getContents" : //내용 불러오기 + case $_REQUEST['mode'] == "mgetContents" : $ret_mode = "error_action"; //수정용 내용 불러오기 + + $kbrd_cont = $kbrd_obj->getContents($_REQUEST['cid']); + if( $_REQUEST['mode'] == "getContents" ){ + $needmode = "read"; //필요 권한 + $secmode = $kbrd_cont['secret']; //비밀글모드 + } + if( $_REQUEST['mode'] == "mgetContents" ){ + $needmode = "input"; //필요권한 + $secmode = true; //비밀글모드 + } + + $retval['mesg'] = array(); + if( !$_REQUEST['board_id'] ){ + $retval['mesg'][] = "잘못된 접근방식입니다."; + }else if( !$kbrd_obj->chkUseOnly( $needmode ) ){ //권한이 있는지 확인 + $retval['mesg'][] = "이용 권한이 없습니다."; + }else{ + $kbrd_cont['files'] = $kbrd_obj->getFiles($kbrd_cont['cid'])?:array(); + + if( $secmode && !$kbrd_obj->chkSecretAuth($kbrd_cont) ){ //비밀글 모드인데 비밀번호 통과권한이 없으면. + $ret_mode = "action"; + $move_page = "./kbrd_secret.php?board_id={$_REQUEST['board_id']}&cid={$kbrd_cont['cid']}"; + }else if( $_REQUEST['mode'] == "getContents" && $kbrd_obj->addContentsViews($_REQUEST['cid']) ){ //조회수 카운트 올림 + $kbrd_cont['views'] += 1; + } + } + case $_REQUEST['mode'] == "" : //새글 등록 +// if( $kbrd_obj->DB->tableExists( $kbrd_obj->TB_kbrd_attach ) ){ +// //require_once _INCLUDE_PATH_."/vendor/tinymce5/tinymce_file_board.php"; +// } + break; + + case $_REQUEST['mode'] == "delContents" : $ret_mode = "error_action"; + $retval['mesg'] = array(); + if( !$_REQUEST['board_id'] ){ + $retval['mesg'][] = "잘못된 접근방식입니다."; + }else if( !$kbrd_obj->chkUseOnly( "write" ) ){ //권한이 있는지 확인 + $retval['mesg'][] = "이용 권한이 없습니다."; + }else if( !$kbrd_obj->chkSecretAuth($_REQUEST['cid']) ){ //비밀번호 통과권한이 있는지 확인 + $retval['mesg'][] = "이용 권한이 없습니다."; + }else{ + $rst = $kbrd_obj->delContents($_REQUEST['cid']); + if( $rst ){ + $retval['mesg'][] = "삭제되었습니다."; + $move_page = base64url_decode($_REQUEST['referer']); + }else{ + $retval['mesg'][] = "삭제중 오류가 발생하였습니다."; + } + } + break; + + case $_REQUEST['mode'] == "putOpinion" : $ret_mode = "ajax"; + if( !$_REQUEST['opinion'] ){ + $retval['mesg'] = "내용을 입력하지 않았습니다."; + }else if( !$_REQUEST['uname'] ){ + $retval['mesg'] = "작성자를 입력하지 않았습니다."; + }else if( !$_REQUEST['passwd'] ){ + $retval['mesg'] = "비밀번호를 입력하지 않았습니다."; + }else{ + $retval['code'] = $kbrd_obj->putOpinion($_REQUEST); + $retval['mesg'] = "등록되지 않았습니다."; + } + break; + + case $_REQUEST['mode'] == "getOpinionList" : + $opinion_list = $kbrd_obj->getOpinionList($_REQUEST['cid']); + break; + + case $_REQUEST['mode'] == "getOpinionSubList" : + $opinion_sublist = $kbrd_obj->getOpinionSubList($_REQUEST['cid'], $_REQUEST['uid']); + break; + + case $_REQUEST['mode'] == "delOpinion" : $ret_mode = "ajax"; + if( !$_REQUEST['board_id'] || !$_REQUEST['cid'] || !$_REQUEST['uid'] || !$_REQUEST['oid'] ){ + $retval['mesg'] = "잘못된 접근방식입니다."; + }else if( !$_REQUEST['passwd'] ){ + $retval['mesg'] = "비밀번호를 입력하지 않았습니다."; + }else if( !$kbrd_obj->chkOpinionPasswd( $_REQUEST['cid'], $_REQUEST['oid'], $_REQUEST['passwd'] ) ){ + $retval['mesg'] = "비밀번호가 일치하지 않습니다."; + }else{ + $retval['code'] = $kbrd_obj->delOpinion($_REQUEST); + $retval['mesg'] = "삭제되지 않았습니다."; + } + break; + + case $_REQUEST['mode'] == "rejOpinion" : $ret_mode = "ajax"; + if( !$_REQUEST['board_id'] || !$_REQUEST['cid'] || !$_REQUEST['uid'] || !$_REQUEST['oid'] ){ + $retval['mesg'] = "잘못된 접근방식입니다."; + }else if( !$kbrd_obj->isAdmin() ){ + $retval['mesg'] = "권한이 없습니다."; + }else{ + $retval['code'] = $kbrd_obj->delOpinion($_REQUEST); + $retval['mesg'] = "차단되지 않았습니다."; + } + break; + + case $_REQUEST['mode'] == "chkSecret" : $ret_mode = "error_action"; + $retval['mesg'] = array(); + if( !$_REQUEST['board_id'] || !$_REQUEST['cid'] ){ + $retval['mesg'][] = "잘못된 접근방식입니다."; + }else if( !$_REQUEST['passwd'] ){ + $retval['mesg'][] = "비밀번호를 입력하지 않았습니다."; + }else if( !$kbrd_obj->chkPasswd( $_REQUEST['cid'], $_REQUEST['passwd'] ) ){ + $retval['mesg'][] = "비밀번호가 일치하지 않습니다."; + }else{ + if( $_REQUEST['referer'] ){ + $ret_mode = "action"; + $move_page = $_REQUEST['referer']; + } + } + break; +} + +if( is_array($retval['mesg']) && count($retval['mesg']) ){ //메세지가 있으면 합친다. + $mesg = implode("\\n\\n",$retval['mesg']); +}else{ + $mesg = $retval['mesg']; +} + +switch( $ret_mode ){ + case "ajax" : + echo json_encode($retval); + break; + + case "error_action" : + if( $mesg ){ + alert($mesg); + if( $move_page ){ + move_page($move_page); + }else{ + hback(); + } + } + break; + + case "action" : + if( $mesg ){ + alert($mesg); + } + if( $move_page ){ + move_page($move_page); + }else{ + hback(); + } + break; +} \ No newline at end of file diff --git a/www/ksvc/kbrd/kbrd.js b/www/ksvc/kbrd/kbrd.js new file mode 100644 index 0000000..8de1b0c --- /dev/null +++ b/www/ksvc/kbrd/kbrd.js @@ -0,0 +1,47 @@ +jQuery("#frmBoard").on("submit", function(event){ + event.preventDefault(); + + var that = this; + + var fld_title = jQuery(that).find("input[name=title]"); + var fld_uname = jQuery(that).find("input[name=uname]"); + var fld_passwd = jQuery(that).find("input[name=passwd]"); + var fld_homepage = jQuery(that).find("input[name=homepage]"); + var fld_mail = jQuery(that).find("input[name=mail]"); + var fld_mobile = jQuery(that).find("input[name=mobile]"); + var fld_contents = jQuery(that).find("textarea[name=contents]"); + + if( fld_title.prop("required") ){ + if( !fld_title.val().trim() ){ kuls_alert("제목을 입력하지 않았습니다."); return false; } + } + + if( fld_uname.prop("required") ){ + if( !fld_uname.val().trim() ){ kuls_alert("이름을 입력하지 않았습니다."); return false; } + } + + if( fld_passwd.prop("required") ){ + if( !fld_passwd.val().trim() ){ kuls_alert("비밀번호를 입력하지 않았습니다."); return false; } + else if( fld_passwd.val().trim().length < 6 ){ kuls_alert("비밀번호는 6자 이상을 입력해 주세요."); return false; } + } + + if( fld_homepage.prop("required") ){ + if( !fld_homepage.val().trim() ){ kuls_alert("홈페이지를 입력하지 않았습니다."); return false; } + } + if( fld_homepage.val().trim() && !/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/.test(fld_homepage.val().trim()) ){ kuls_alert("홈페이지 형식이 올바르지 않습니다."); return false; } + + if( fld_mail.prop("required") ){ + if( !fld_mail.val().trim() ){ kuls_alert("메일을 입력하지 않았습니다."); return false; } + } + if( fld_mail.val().trim() && !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(fld_mail.val().trim()) ){ kuls_alert("메일 형식이 올바르지 않습니다."); return false; } + + if( fld_mobile.prop("required") ){ + if( !fld_mobile.val().trim() ){ kuls_alert("휴대폰을 입력하지 않았습니다."); return false; } + } + if( fld_mobile.val().trim() && !/^\d{2,3}-\d{3,4}-\d{4}$/.test(fld_mobile.val().trim()) ){ kuls_alert("휴대폰 형식이 올바르지 않습니다."); return false; } + + if( fld_contents.prop("required") ){ + if( !fld_contents.val().trim() ){ kuls_alert("내용을 입력하지 않았습니다."); return false; } + } + + that.submit(); +}); \ No newline at end of file diff --git a/www/ksvc/kbrd/kbrd.opinion.js b/www/ksvc/kbrd/kbrd.opinion.js new file mode 100644 index 0000000..a895a8a --- /dev/null +++ b/www/ksvc/kbrd/kbrd.opinion.js @@ -0,0 +1,156 @@ +jQuery(document).on("click",".btnOpinionSub",function(){ + let opinion_item = jQuery(this).parents(".opinion_item").eq(0); + opinion_item.find(".opinion_sub").toggleClass("d-none"); +}); + +jQuery(document).on("submit","form[name=opinionForm]",function(event){ + event.preventDefault(); + + let that = this; + let board_id = jQuery(that).data('board_id'); + let cid = jQuery(that).data('cid'); + let uid = jQuery(that).data('uid'); + let opinion = that.opinion.value.trim(); + let uname = that.uname.value.trim(); + let passwd = that.passwd.value.trim(); + if( !opinion ){ + kuls_alert("내용을 입력하지 않았습니다."); return; + } + if( !uname ){ + kuls_alert("작성자를 입력하지 않았습니다."); return; + } + if( !passwd ){ + kuls_alert("비밀번호를 입력하지 않았습니다."); return; + } + let post_data = new FormData(that); + post_data.append("mode","putOpinion"); + post_data.append("board_id",board_id); + post_data.append("cid",cid); + post_data.append("uid",uid); + + ajax_form({ + url: "./kbrd.ajax.php", + type: "POST", + data: post_data, + success: function (data) { + if (!data.code) { + kuls_alert(data.mesg); + return; + } + if( uid ){ + jQuery("#opinion_sublist_"+uid).load('./kbrd_opinion_sublist.php?board_id='+board_id+'&cid='+cid+'&uid='+uid); + }else{ + jQuery("#opinion_list").load('./kbrd_opinion.php?board_id='+board_id+'&cid='+cid); + } + }, + error: function (request, status, error) { + kuls_alert(error.message); + }, + complete: function(){ + that.reset(); + } + }); +}); + +jQuery(document).on("click",".btnOpinionDel",function(event){ + let frm = jQuery("form[name=frmOpinionDel]"); + let btn = event.target; + + frm.data('board_id', jQuery(btn).data('board_id')); + frm.data('cid', jQuery(btn).data('cid')); + frm.data('uid', jQuery(btn).data('uid')); + frm.data('oid', jQuery(btn).data('oid')); +}); + +jQuery("form[name=frmOpinionDel]").on("submit",function(event){ + event.preventDefault(); + + let that = this; + if( !that.passwd.value.trim() ){ + kuls_alert("비밀번호를 입력하지 않았습니다."); return; + } + let post_data = new FormData(that); + let board_id = jQuery(that).data("board_id"); + let cid = jQuery(that).data("cid"); + let uid = jQuery(that).data("uid"); + let oid = jQuery(that).data("oid"); + post_data.append("mode","delOpinion"); + post_data.append("board_id", board_id); + post_data.append("cid", cid); + post_data.append("uid", uid); + post_data.append("oid", oid); + + ajax_form({ + url: "./kbrd.ajax.php", + type: "POST", + data: post_data, + success: function (data) { + if (!data.code) { + kuls_alert(data.mesg); + return; + } + if( uid == oid ){ + jQuery("#opinion_list").load('./kbrd_opinion.php?board_id='+board_id+'&cid='+cid); + }else{ + jQuery("#opinion_sublist_"+uid).load('./kbrd_opinion_sublist.php?board_id='+board_id+'&cid='+cid+'&uid='+uid); + } + jQuery("#modalOpinionDel .btnClose").trigger("click"); + }, + error: function (request, status, error) { + kuls_alert(error.message); + }, + complete: function(){ + that.reset(); + } + }); +}); + +jQuery(document).on("click",".btnOpinionRej",function(event){ + let frm = jQuery("form[name=frmOpinionRej]"); + let btn = event.target; + + frm.data('board_id', jQuery(btn).data('board_id')); + frm.data('cid', jQuery(btn).data('cid')); + frm.data('uid', jQuery(btn).data('uid')); + frm.data('oid', jQuery(btn).data('oid')); +}); + +jQuery("form[name=frmOpinionRej]").on("submit",function(event){ + event.preventDefault(); + + let that = this; + let post_data = new FormData(that); + let board_id = jQuery(that).data("board_id"); + let cid = jQuery(that).data("cid"); + let uid = jQuery(that).data("uid"); + let oid = jQuery(that).data("oid"); + post_data.append("mode","rejOpinion"); + post_data.append("board_id", board_id); + post_data.append("cid", cid); + post_data.append("uid", uid); + post_data.append("oid", oid); + + ajax_form({ + url: "./kbrd.ajax.php", + type: "POST", + data: post_data, + success: function (data) { + if (!data.code) { + kuls_alert(data.mesg); + return; + } + if( uid == oid ){ + jQuery("#opinion_list").load('./kbrd_opinion.php?board_id='+board_id+'&cid='+cid); + }else{ + jQuery("#opinion_sublist_"+uid).load('./kbrd_opinion_sublist.php?board_id='+board_id+'&cid='+cid+'&uid='+uid); + } + jQuery("#modalOpinionRej .btnClose").trigger("click"); + }, + error: function (request, status, error) { + kuls_alert(error.message); + }, + complete: function(){ + that.reset(); + } + }); +}); \ No newline at end of file diff --git a/www/ksvc/kbrd/kbrd_delete.php b/www/ksvc/kbrd/kbrd_delete.php new file mode 100644 index 0000000..9d38303 --- /dev/null +++ b/www/ksvc/kbrd/kbrd_delete.php @@ -0,0 +1,34 @@ +chkSecretAuth($_REQUEST['cid']) ){ + move_page("./kbrd_secret.php?board_id={$_REQUEST['board_id']}&cid={$_REQUEST['cid']}"); +} +?> + + + + +
    +
    + + + + +
    + +
    +
    + 정말 삭제하시겠습니까? + +
    +
    + + +
    + + + + +



    diff --git a/www/ksvc/kbrd/kbrd_list.php b/www/ksvc/kbrd/kbrd_list.php new file mode 100644 index 0000000..7a8f2f2 --- /dev/null +++ b/www/ksvc/kbrd/kbrd_list.php @@ -0,0 +1,92 @@ +getSearchQueryRow(); +?> + + + + +
    +
    + + + + +
    +
    +

    게시판

    +
    +
    +

    +
    + + + $val ){?> + + +
    + + + +
    + +
    +
    + + +
    + + + + + + + + + + + + rows) ; $a++ ){ $kbrd = $kbrd_cont_list->rows[$a]; ?> + + + + + + + + + +
    ">번호">제목">작성자">등록일조회수
    line_cnt-$a?> 0)?"(".number_format($kbrd['onum']).")":"")?>
    +
    +
    + pages) ; $a++ ){ $page = $kbrd_cont_list->pages[$a];?> + + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/www/ksvc/kbrd/kbrd_opinion.php b/www/ksvc/kbrd/kbrd_opinion.php new file mode 100644 index 0000000..270d08d --- /dev/null +++ b/www/ksvc/kbrd/kbrd_opinion.php @@ -0,0 +1,60 @@ + +
      + + +
    • +
      +
      + 작성자 : / 작성일 : / IP : + + + isAdmin() ){ //관리자일경우?> + + + + 삭제됨 + +
      +
      +
      +
      +
      +
        + + + + + + +
      +
      +
      + 작성자 : + 비밀번호 : +
      +
      + + +
      +
      +
      + +
    • + + + + +
    diff --git a/www/ksvc/kbrd/kbrd_opinion_sublist.php b/www/ksvc/kbrd/kbrd_opinion_sublist.php new file mode 100644 index 0000000..eb5c8a4 --- /dev/null +++ b/www/ksvc/kbrd/kbrd_opinion_sublist.php @@ -0,0 +1,39 @@ + + +
  5. +
    +
    + 작성자 : / 작성일 : / IP : + + + isAdmin() ){ //관리자일경우?> + + + + 삭제됨 + +
    +
    +
    +
  6. + + + \ No newline at end of file diff --git a/www/ksvc/kbrd/kbrd_put.php b/www/ksvc/kbrd/kbrd_put.php new file mode 100644 index 0000000..ce0cfc8 --- /dev/null +++ b/www/ksvc/kbrd/kbrd_put.php @@ -0,0 +1,142 @@ +board_info; +?> + + + + +
    +
    +
    +
    +

    게시판

    +
    +
    + + + +
    + + > +
    + 제목을 입력하지 않았습니다. +
    +
    + +
    + + > +
    + 이름을 입력하지 않았습니다. +
    +
    + + isAdmin() && !$kbrd_obj->chkSecretAuth($kbrd_cont) ){?> +
    + + > +
    + 비밀번호를 입력하지 않았습니다. +
    +
    + + +
    + + > +
    + 홈페이지를 입력하지 않았습니다. +
    +
    + +
    + + > +
    + 메일을 입력하지 않았습니다. +
    +
    + +
    + + > +
    + 휴대폰을 입력하지 않았습니다. +
    +
    + +
    + + +
    + 내용을 입력하지 않았습니다. +
    + +
    + +
    + +
    + +
    + +
    + + +
    +
    +
    +
    + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + 비밀번호 확인 + + +
    +
    + 등록시 입력하신 비밀번호를 기입하세요. +
    +
    + +
    + + + + +



    diff --git a/www/ksvc/kbrd/kbrd_view.php b/www/ksvc/kbrd/kbrd_view.php new file mode 100644 index 0000000..4329b89 --- /dev/null +++ b/www/ksvc/kbrd/kbrd_view.php @@ -0,0 +1,117 @@ + + + + + +
    +
    + + + + +
    +
    +

    게시판

    +
    +
    +
    +

    +
    작성자 : / 작성일 : / 조회수 :
    +
    홈페이지 : / 메일 : / 휴대폰 :
    +
    + +
    +
    +
    + +
    +

    첨부파일

    +
      + + +
    • - getFileUrl($frow['cid'],$frow['aid']).'&cnt=1">다운로드'?>
    • + +
    +
    + +
    +
    +
    + +
    +
    +
    + 작성자 : + 비밀번호 : +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + + + + + + + + + diff --git a/www/ksvc/main.php b/www/ksvc/main.php new file mode 100644 index 0000000..4be53f5 --- /dev/null +++ b/www/ksvc/main.php @@ -0,0 +1,62 @@ + + +
    +
    +
    + 가. 서비스 시작 + --- --- + Logout +
    +
    +
    +
    +
    + 나. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NO제 목이 름작성일
    1소프트웨어고리아2000.12.12
    2전설의 죽방멸치강림호선2001.08.24
    3잠오는날의 수학책항상잠2022.07.07
    +
    +
    +
    +
    + + + +ss + + + + + + + + + 우성서비스 + + + + + + +
    + +
    + +
    +
    + +
    + +
    + "> + 아이디저장 +
    + +
    + + + + + + + \ No newline at end of file diff --git a/www/ksvc/t.php b/www/ksvc/t.php new file mode 100644 index 0000000..bb9f466 --- /dev/null +++ b/www/ksvc/t.php @@ -0,0 +1,3 @@ +