/home/mjc1/public_html/ryunen/shop/naver_id_sync.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
if($config['naver_client_id']!='' && $config['naver_client_secret']!='' && $config['naver_callback_url']!='' && $cinfo['naver_token']==''){
    
$client_id $config['naver_client_id'];
    
$redirectURI urlencode($config['naver_callback_url']);
    
$state md5(get_microtime());
    
$_SESSION['naver_login_state'] = $state;
    
$_SESSION['naver_do_mode'] = "sync";
    
$apiURL "https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=".$client_id."&redirect_uri=".$redirectURI."&state=".$state."&mode=join";
?>
    <a onclick="naver_sync()" style='cursor:pointer;'><img height="40" src="<?php echo $j3_img_url?>/small_g_sync.png"/></a>
    <script>
        function naver_sync(){
            if(confirm('현재 아이디를 네이버아이디로 로그인 할수 있도록 등록하시겠습니까?')){
                window.open('<?php echo $apiURL ?>','naver','width=640, height=480,scrollbars=yes');
            }
        }
    </script>
<?php
}
?>