/home/mjc1/public_html/common.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php
    error_reporting
E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_ERROR E_WARNING E_PARSE E_USER_ERROR E_USER_WARNING );
    
header("Content-type:text/html;charset=euc-kr"); 
    
date_default_timezone_set("Asia/Seoul");

    
//$browser = get_browser(null, true);

    //@session_start();
    
if(!function_exists('session_start_samesite')) {
        function 
session_start_samesite($options = array())
        {
            
$res = @session_start($options);

            
// IE 브라우저 또는 엣지브라우저 일때는 secure; SameSite=None 을 설정하지 않습니다.
            
if( preg_match('/Edge/i'$_SERVER['HTTP_USER_AGENT']) || preg_match('~MSIE|Internet Explorer~i'$_SERVER['HTTP_USER_AGENT']) || preg_match('~Trident/7.0(; Touch)?; rv:11.0~',$_SERVER['HTTP_USER_AGENT']) ){
                return 
$res;
            }

            
$headers headers_list();
            
krsort($headers);
            foreach (
$headers as $header) {
                if (!
preg_match('~^Set-Cookie: PHPSESSID=~'$header)) continue;
                
$header preg_replace('~; secure(; HttpOnly)?$~'''$header) . '; secure; SameSite=None';
                
header($headerfalse);
                break;
            }
            return 
$res;
        }
    }

    
session_start_samesite();

    @
extract($_REQUEST);
    @
extract($_SESSION);

    if(
$_SESSION['platform']==''){
        
$browser get_browser(nulltrue);
        
$_SESSION['platform'] = trim($browser['platform']);
        
$_SESSION['browser'] = trim($browser['browser']);
        
$_SESSION['version'] = trim($browser['version']);
    }

    if(
$freetalkpay=='Y'){

    } else {
        
        if(
$_SESSION['platform']=='Win32' || $_SESSION['platform']=='WinVista'){
            
$MJSOFT_SSL_USE "N"// 사용시 Y 입력
            
$MJSOFT_SSL_DOMAIN "mjsoft.co";
        } else {
            
// ssl 프로세서 사용 여부
            
$MJSOFT_SSL_USE "Y"// 사용시 Y 입력
            
$MJSOFT_SSL_DOMAIN "mjsoft.co";
        }

        if(
$_SERVER['SERVER_NAME']!=$MJSOFT_SSL_DOMAIN){
            echo 
"<script language='javascript' src='http://mjsoft.co/js/jquery-1.8.3.min.js'></script>";
            include_once(
$_SERVER['DOCUMENT_ROOT']."/come_ref.inc.php");
            
//if($_SERVER['REMOTE_ADDR']=='58.151.27.172'){ 

            //} else {
                
if($_SERVER['QUERY_STRING']==''){
                    
$add_key "session_key={$session_key}";
                } else {
                    
$add_key "&session_key={$session_key}";
                }
                echo 
"<script>document.location.href='https://{$MJSOFT_SSL_DOMAIN}{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}{$add_key}';</script>";
            
//}
            
exit;
        }

        if(
$_SERVER['HTTPS']=='on'){
            if(
strpos($_SERVER['SCRIPT_NAME'],"manage/")>0){ // 관리자 화면은 그냥 SSL되게 처리함

            
} else {
                
//echo "<script>document.location.href='http://{$MJSOFT_SSL_DOMAIN}{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}{$add_key}';</script>";
            
}
        } else {
            
//echo "<script>document.location.href='https://{$MJSOFT_SSL_DOMAIN}{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}{$add_key}';</script>";
        
}
    }


    if(
$ezsa_dbip!='' && $ezsa_uid!='' && $ezsa_dbname!=''){
        
// 각 계정 각자 DB
        
$DB_HOSTEZ  =  "$ezsa_dbip";
        
$DB_USEREZ  =  "$ezsa_uid";
        
$DB_PWDEZ   =  "mj007700";
        
$DB_NAMEEZ  =  "$ezsa_dbname";
        
$connect_ezbill    = @mysql_connect($DB_HOSTEZ,$DB_USEREZ,$DB_PWDEZ);
        @
mysql_select_db$DB_NAMEEZ,$connect_ezbill);

        
$sql "select compsn from office where 1=1 ";
        
$res mysql_query($sql,$connect_ezbill);
        
$info mysql_fetch_array($res);
        
$compsn preg_replace("/[^0-9]/"""$info['compsn']);
    }

    
// 세금계산서 DB
    
if($_SESSION['ezsa_uid']=='ryunen' || $compsn=='5021894746'){
        
$DB_HOSTtax  =  "119.201.210.68";
    } else {
        
$DB_HOSTtax  =  "114.108.136.204";
    }
    
$_SESSION['DB_HOSTtax'] = $DB_HOSTtax;
    
$DB_USERtax  =  "ebill";
    
$DB_PWDtax   =  "ebill8680";
    
$DB_NAMEtax  =  "ebillv3";
    
//$connect_tax    = @mysql_connect($DB_HOSTtax,$DB_USERtax,$DB_PWDtax);
    //@mysql_select_db( $DB_NAMEtax,$connect_tax);

    // 앱관리자 DB
    
$DB_HOST  =  "114.108.136.196";    //87
    
$DB_USER  =  "app_admin";
    
$DB_PWD  =  "mj8585";
    
$DB_NAME  =  "app_admin";
    
$connect_app    = @mysql_connect($DB_HOST,$DB_USER,$DB_PWD);
    @
mysql_select_db$DB_NAME,$connect_app);

    
// 앱모니터 DB
    
$DBOP_HOST  =  "114.108.136.196";
    
$DBOP_USER  =  "app_monitor";
    
$DBOP_PWD   =  "mj753861";
    
$DBOP_NAME  =  "app_monitor";
    
$connect_appmon    = @mysql_connect($DBOP_HOST,$DBOP_USER,$DBOP_PWD);
    @
mysql_select_db$DBOP_NAME,$connect_appmon);

    
// 웹 홈페이지 DB
    
$DB_HOSTWEB2  =  "localhost";
    
$DB_USERWEB2  =  "WebHostUser";
    
$DB_PWDWEB2   =  "WebHost5263";
    
$DB_NAMEWEB2  =  "webhost";
    
$connect_web    = @mysql_connect($DB_HOSTWEB2,$DB_USERWEB2,$DB_PWDWEB2);
    @
mysql_select_db$DB_NAMEWEB2,$connect_web);

    
// 포인트(캐쉬) DB
    
$DB_HOSTCS  =  "114.108.136.196";
    
$DB_USERCS  =  "mjcash_fill";
    
$DB_PWDCS   =  "mj86808680";
    
$DB_NAMECS  =  "mj_cash";
    
$connect_cash    = @mysql_connect($DB_HOSTCS,$DB_USERCS,$DB_PWDCS);
    @
mysql_select_db$DB_NAMECS,$connect_cash);

    
// SMS(남은건수 조회용) DB
    
$DB_HOSTsms  =  "114.108.136.196";
    
$DB_USERsms  =  "sms_enduser";
    
$DB_PWDsms   =  "mjsmssk8680";
    
$DB_NAMEsms  =  "sms_sk";
    
$connect_sms    = @mysql_connect($DB_HOSTsms,$DB_USERsms,$DB_PWDsms);
    @
mysql_select_db$DB_NAMEsms,$connect_sms);

    
// 전자문서 비회원 조회용 DB
    
$DB_HOSTez  =  "localhost";
    
$DB_USERez  =  "mj_ezbill";
    
$DB_PWDez   =  "bill8526";
    
$DB_NAMEez  =  "mj_ezbill";

    
$connect_ezrecv    = @mysql_connect($DB_HOSTez,$DB_USERez,$DB_PWDez);
    @
mysql_select_db$DB_NAMEez,$connect_ezrecv);

    
// 비회원 접속시 로그인된 DB
    
$DB_HOSTEZC  =  "$ezc_dbip";
    
$DB_USEREZC  =  "$ezc_uid";
    
$DB_PWDEZC   =  "mj007700";
    
$DB_NAMEEZC  =  "$ezc_dbname";

    
$connect_out    = @mysql_connect($DB_HOSTEZC,$DB_USEREZC,$DB_PWDEZC);
    @
mysql_select_db$DB_NAMEEZC,$connect_out);

    
// 프리톡 서버
    /*
    $DB_HOSTFREE  =  "59.23.231.218";
    $DB_USERFREE  =  "mjfreechat";
    $DB_PWDFREE   =  "mjcptxldtjqj007";
    $DB_NAMEFREE  =  "mj_chat";
    $connect_free    = @mysql_connect($DB_HOSTFREE,$DB_USERFREE,$DB_PWDFREE);
    @mysql_select_db( $DB_NAMEFREE,$connect_free);
    */

    
if($ezsa_uid=='ryunen'){
        
$lgu_platform "test"// 실사용 : service, 테스트 : test
    
} else {
        
$lgu_platform "service"// 실사용 : service, 테스트 : test
    
}
    
//$lgu_mid = 'lgdacomxpay'; // 테스트용 (가상계좌 입금 테스트 불가)
    
$lgu_mid 'mjsoft007';

    
define('G5_MOBILE_AGENT',   'phone|samsung|lgtel|mobile|[^A]skt|nokia|blackberry|android|sony');

    
// 커먼 라이브러리 포함
    
include_once($_SERVER['DOCUMENT_ROOT']."/lib/common2.lib.php");
?>