- Session클래스 내에서 global setter, getter 재정의 - Session클래스에서 static 함수로 getUserID, getUserGrade 재정의 - 내부 서버에서 getUserID, getUserGrade를 쓰던 것 Session 클래스로 통일 - SESSION.php가 requireLogin 기능을 수행하던것을 Session의 static 함수로 통합
43 lines
828 B
PHP
43 lines
828 B
PHP
<?php
|
|
include('lib.php');
|
|
include('func.php');
|
|
|
|
$userID = Session::getUserID();
|
|
$generalID = getGeneralID();
|
|
session_write_close();
|
|
|
|
if(!$userID){
|
|
Json::die([
|
|
'result'=>false,
|
|
'reason'=>'로그인되지 않았습니다.'
|
|
]);
|
|
}
|
|
|
|
if(!$generalID){
|
|
Json::die([
|
|
'result'=>false,
|
|
'reason'=>'장수를 생성하지 않았습니다.'
|
|
]);
|
|
}
|
|
|
|
$rootDB = getRootDB();
|
|
$db = getDB();
|
|
|
|
$image = $rootDB->queryFirstRow('SELECT picture, imgsvr FROM `MEMBER` WHERE no = %i', $userID);
|
|
|
|
if(!$image){
|
|
Json::die([
|
|
'result'=>false,
|
|
'reason'=>'회원 기록 정보가 없습니다'
|
|
]);
|
|
}
|
|
|
|
$db->update('general', [
|
|
'picture'=>$image['picture'],
|
|
'imgsvr'=>$image['imgsvr']
|
|
], 'owner = %i and npc = 0', $userID);
|
|
|
|
Json::die([
|
|
'result'=>true,
|
|
'reason'=>'success'
|
|
]); |