autoloader 구성.
class 정의
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '.');
|
define('ROOT', '.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
{
|
{
|
||||||
|
"name":"sammo-hid/sammo",
|
||||||
|
"description":"삼국지 모의전투 HiD",
|
||||||
|
"license": [
|
||||||
|
"MIT",
|
||||||
|
"GPL-2.0-or-later",
|
||||||
|
"proprietary"
|
||||||
|
],
|
||||||
|
"version":"0.1.0-alpha",
|
||||||
"require": {
|
"require": {
|
||||||
"brandonwamboldt/utilphp": "^1.1",
|
"brandonwamboldt/utilphp": "^1.1",
|
||||||
"sergeytsalkov/meekrodb": "^2.3",
|
"sergeytsalkov/meekrodb": "^2.3",
|
||||||
@@ -7,5 +15,11 @@
|
|||||||
"leafo/scssphp": "^0.7.5",
|
"leafo/scssphp": "^0.7.5",
|
||||||
"monolog/monolog": "^1.23",
|
"monolog/monolog": "^1.23",
|
||||||
"firephp/firephp-core": "^0.4.0"
|
"firephp/firephp-core": "^0.4.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"sammo\\": "src"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "9f2a8e0b8a175d3788e6679dea1d18ff",
|
"content-hash": "63390482c0fd78af00c967100dc6d1a7",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brandonwamboldt/utilphp",
|
"name": "brandonwamboldt/utilphp",
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__dir__.'/../vendor/autoload.php');
|
require(__dir__.'/../vendor/autoload.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
namespace sammo;
|
||||||
class KakaoKey{
|
class KakaoKey{
|
||||||
const REST_KEY = '_tK_REST_API_KEY_';
|
const REST_KEY = '_tK_REST_API_KEY_';
|
||||||
const ADMIN_KEY = '_tK_ADMIN_KEY_';
|
const ADMIN_KEY = '_tK_ADMIN_KEY_';
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/SETTING.php');
|
require_once(ROOT.'/f_config/SETTING.php');
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_func/class._Mail.php');
|
require_once(ROOT.'/f_func/class._Mail.php');
|
||||||
require_once(ROOT.'/f_config/SETTING.php');
|
require_once(ROOT.'/f_config/SETTING.php');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_func/class._Session.php');
|
require_once(ROOT.'/f_func/class._Session.php');
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(__DIR__.'/../f_func/class._Setting.php');
|
require_once(__DIR__.'/../f_func/class._Setting.php');
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_func/class._Setting.php');
|
require_once(ROOT.'/f_func/class._Setting.php');
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__dir__.'/../vendor/autoload.php');
|
require(__dir__.'/../vendor/autoload.php');
|
||||||
define('__LINE__',__FILE__." ".__FUNCTION__." ".__LINE__." : ");
|
define('__LINE__',__FILE__." ".__FUNCTION__." ".__LINE__." : ");
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__dir__.'/../vendor/autoload.php');
|
require(__dir__.'/../vendor/autoload.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
class _Session {
|
class _Session {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
|
|
||||||
class _Setting {
|
class _Setting {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__dir__.'/../vendor/autoload.php');
|
require(__dir__.'/../vendor/autoload.php');
|
||||||
|
|
||||||
class _String {
|
class _String {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__dir__.'/../vendor/autoload.php');
|
require(__dir__.'/../vendor/autoload.php');
|
||||||
|
|
||||||
class _Time {
|
class _Time {
|
||||||
|
|||||||
+2
-20
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__dir__.'/../vendor/autoload.php');
|
require(__dir__.'/../vendor/autoload.php');
|
||||||
|
|
||||||
function SetHeaderNoCache(){
|
function SetHeaderNoCache(){
|
||||||
@@ -116,26 +118,6 @@ function delExpiredInDir($dir, $t) {
|
|||||||
return $success;
|
return $success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function returnJson($value, $noCache = true, $pretty = false, $die = true){
|
|
||||||
if($noCache){
|
|
||||||
SetHeaderNoCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
|
|
||||||
if($pretty){
|
|
||||||
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$flag = JSON_UNESCAPED_UNICODE;
|
|
||||||
}
|
|
||||||
echo json_encode($value, $flag);
|
|
||||||
if($die){
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hashPassword($salt, $password){
|
function hashPassword($salt, $password){
|
||||||
return hash('sha512', $salt.$password.$salt);
|
return hash('sha512', $salt.$password.$salt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(__DIR__.'/../f_config/SETTING.php');
|
require(__DIR__.'/../f_config/SETTING.php');
|
||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
session_destroy();
|
session_destroy();
|
||||||
@@ -14,21 +16,21 @@ $password = util::array_get($_POST['password']);
|
|||||||
$nickname = util::array_get($_POST['nickname']);
|
$nickname = util::array_get($_POST['nickname']);
|
||||||
|
|
||||||
if(!$username || !$password || !$nickname){
|
if(!$username || !$password || !$nickname){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'입력값이 설정되지 않았습니다.'
|
'reason'=>'입력값이 설정되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($password)!=128){
|
if(strlen($password)!=128){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.'
|
'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$SETTING->isExists()){
|
if(!$SETTING->isExists()){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'DB 설정이 완료되지 않았습니다.'
|
'reason'=>'DB 설정이 완료되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -42,7 +44,7 @@ $rootDB->query('LOCK TABLES member WRITE, member_log WRITE');
|
|||||||
|
|
||||||
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
|
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
|
||||||
if($memberCnt > 0){
|
if($memberCnt > 0){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>'false',
|
'result'=>'false',
|
||||||
'reason'=>'이미 계정이 생성되어 있습니다'
|
'reason'=>'이미 계정이 생성되어 있습니다'
|
||||||
]);
|
]);
|
||||||
@@ -76,7 +78,7 @@ $rootDB->insert('member_log', [
|
|||||||
], JSON_UNESCAPED_UNICODE)
|
], JSON_UNESCAPED_UNICODE)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success'
|
'reason'=>'success'
|
||||||
]);
|
]);
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(__DIR__.'/../f_config/SETTING.php');
|
require(__DIR__.'/../f_config/SETTING.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
|
|
||||||
function dbConnFail($params){
|
function dbConnFail($params){
|
||||||
returnJson([
|
Json::die([
|
||||||
'step'=>'conn_fail'
|
'step'=>'conn_fail'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbSQLFail($params){
|
function dbSQLFail($params){
|
||||||
returnJson([
|
Json::die([
|
||||||
'step'=>'sql_fail'
|
'step'=>'sql_fail'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$SETTING->isExists()){
|
if(!$SETTING->isExists()){
|
||||||
returnJson([
|
Json::die([
|
||||||
'step'=>'config'
|
'step'=>'config'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -32,13 +34,13 @@ $rootDB->error_handler = 'dbSQLFail';
|
|||||||
|
|
||||||
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from MEMBER');
|
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from MEMBER');
|
||||||
if($memberCnt === 0){
|
if($memberCnt === 0){
|
||||||
returnJson([
|
Json::die([
|
||||||
'step'=>'admin',
|
'step'=>'admin',
|
||||||
'globalSalt'=>getGlobalSalt()
|
'globalSalt'=>getGlobalSalt()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'step'=>'done'
|
'step'=>'done'
|
||||||
]);
|
]);
|
||||||
+16
-15
@@ -1,20 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(__DIR__.'/../f_config/SETTING.php');
|
require(__DIR__.'/../f_config/SETTING.php');
|
||||||
require(__DIR__.'/../f_func/class._Time.php');
|
require(__DIR__.'/../f_func/class._Time.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
|
|
||||||
function dbConnFail($params){
|
function dbConnFail($params){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'DB 접속에 실패했습니다.'
|
'reason'=>'DB 접속에 실패했습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbSQLFail($params){
|
function dbSQLFail($params){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.'
|
'reason'=>'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -28,28 +29,28 @@ $dbName = util::array_get($_POST['db_name']);
|
|||||||
$servHost = util::array_get($_POST['serv_host']);
|
$servHost = util::array_get($_POST['serv_host']);
|
||||||
|
|
||||||
if(!$host || !$port || !$username || !$password || !$dbName || !$servHost){
|
if(!$host || !$port || !$username || !$password || !$dbName || !$servHost){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'입력 값이 올바르지 않습니다'
|
'reason'=>'입력 값이 올바르지 않습니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!filter_var($servHost, FILTER_VALIDATE_URL)){
|
if(!filter_var($servHost, FILTER_VALIDATE_URL)){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'접속 경로가 올바르지 않습니다.'
|
'reason'=>'접속 경로가 올바르지 않습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists(ROOT.'/d_setting/conf.php') && is_dir(ROOT.'/d_setting/conf.php')){
|
if(file_exists(ROOT.'/d_setting/conf.php') && is_dir(ROOT.'/d_setting/conf.php')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_setting/conf.php 가 디렉토리입니다'
|
'reason'=>'d_setting/conf.php 가 디렉토리입니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($SETTING->isExists()){
|
if($SETTING->isExists()){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'이미 conf.php 파일이 있습니다'
|
'reason'=>'이미 conf.php 파일이 있습니다'
|
||||||
]);
|
]);
|
||||||
@@ -57,42 +58,42 @@ if($SETTING->isExists()){
|
|||||||
|
|
||||||
//파일 권한 검사
|
//파일 권한 검사
|
||||||
if(file_exists(ROOT.'/d_pic') && !is_dir(ROOT.'/d_pic')){
|
if(file_exists(ROOT.'/d_pic') && !is_dir(ROOT.'/d_pic')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_pic 이 디렉토리가 아닙니다'
|
'reason'=>'d_pic 이 디렉토리가 아닙니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists(ROOT.'/d_log') && !is_dir(ROOT.'/d_log')){
|
if(file_exists(ROOT.'/d_log') && !is_dir(ROOT.'/d_log')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_log 가 디렉토리가 아닙니다'
|
'reason'=>'d_log 가 디렉토리가 아닙니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!file_exists(ROOT.'/d_setting')){
|
if(!file_exists(ROOT.'/d_setting')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_setting 이 존재하지 않습니다'
|
'reason'=>'d_setting 이 존재하지 않습니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable(ROOT.'/d_pic')){
|
if(!is_writable(ROOT.'/d_pic')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_pic 디렉토리의 쓰기 권한이 없습니다'
|
'reason'=>'d_pic 디렉토리의 쓰기 권한이 없습니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable(ROOT.'/d_log')){
|
if(!is_writable(ROOT.'/d_log')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_log 디렉토리의 쓰기 권한이 없습니다'
|
'reason'=>'d_log 디렉토리의 쓰기 권한이 없습니다'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_writable(ROOT.'/d_setting')){
|
if(!is_writable(ROOT.'/d_setting')){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다.'
|
'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -155,13 +156,13 @@ $result = generateFileUsingSimpleTemplate(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if($result !== true){
|
if($result !== true){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>$result
|
'reason'=>$result
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success'
|
'reason'=>'success'
|
||||||
]);
|
]);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '.');
|
define('ROOT', '.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_config/SESSION.php');
|
require_once(ROOT.'/f_config/SESSION.php');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_config/SESSION.php');
|
require_once(ROOT.'/f_config/SESSION.php');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_func/class._Session.php');
|
require_once(ROOT.'/f_func/class._Session.php');
|
||||||
@@ -6,7 +8,7 @@ require_once(ROOT.'/f_func/class._Session.php');
|
|||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
|
|
||||||
if(!$SESSION->isLoggedIn()) {
|
if(!$SESSION->isLoggedIn()) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인되지 않았습니다.'
|
'reason'=>'로그인되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -38,7 +40,7 @@ if(!$db->affectedRows()){
|
|||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'현재 비밀번호가 일치하지 않습니다.'
|
'reason'=>'현재 비밀번호가 일치하지 않습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -53,7 +55,7 @@ $db->insert('member_log', [
|
|||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success'
|
'reason'=>'success'
|
||||||
]);
|
]);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_func/class._Time.php');
|
require_once(ROOT.'/f_func/class._Time.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
@@ -7,7 +9,7 @@ require_once(ROOT.'/f_func/class._Session.php');
|
|||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
|
|
||||||
if(!$SESSION->isLoggedIn()) {
|
if(!$SESSION->isLoggedIn()) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인되지 않았습니다.'
|
'reason'=>'로그인되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -18,7 +20,7 @@ if(!$SESSION->isLoggedIn()) {
|
|||||||
$pw = $_POST['pw'];
|
$pw = $_POST['pw'];
|
||||||
|
|
||||||
if(!$pw){
|
if(!$pw){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'패스워드를 입력해주세요.'
|
'reason'=>'패스워드를 입력해주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -32,14 +34,14 @@ $userInfo = $db->queryFirstRow('SELECT oauth_id, oauth_type, email, delete_after
|
|||||||
$SESSION->NoMember(), $pw);
|
$SESSION->NoMember(), $pw);
|
||||||
|
|
||||||
if(!$userInfo){
|
if(!$userInfo){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'현재 비밀번호가 일치하지 않습니다.'
|
'reason'=>'현재 비밀번호가 일치하지 않습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($userInfo['delete_after']){
|
if($userInfo['delete_after']){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'이미 탈퇴 처리되어있습니다.'
|
'reason'=>'이미 탈퇴 처리되어있습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -50,7 +52,7 @@ $db->update('member',[
|
|||||||
], 'no=%i', $SESSION->NoMember());
|
], 'no=%i', $SESSION->NoMember());
|
||||||
|
|
||||||
if(!$db->affectedRows()){
|
if(!$db->affectedRows()){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'알 수 없는 이유로 탈퇴에 실패했습니다.'
|
'reason'=>'알 수 없는 이유로 탈퇴에 실패했습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -67,7 +69,7 @@ $SESSION->logout();
|
|||||||
unset($_SESSION['access_token']);
|
unset($_SESSION['access_token']);
|
||||||
setcookie("hello", "", time()-3600);
|
setcookie("hello", "", time()-3600);
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success'
|
'reason'=>'success'
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_func/class._Session.php');
|
require_once(ROOT.'/f_func/class._Session.php');
|
||||||
@@ -6,7 +8,7 @@ require_once(ROOT.'/f_func/class._Session.php');
|
|||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
|
|
||||||
if(!$SESSION->isLoggedIn()) {
|
if(!$SESSION->isLoggedIn()) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인되지 않았습니다.'
|
'reason'=>'로그인되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -43,7 +45,7 @@ if($member['grade'] == 6) {
|
|||||||
$grade = '블럭회원';
|
$grade = '블럭회원';
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success',
|
'reason'=>'success',
|
||||||
'id'=>$member['id'],
|
'id'=>$member['id'],
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_func/class._Session.php');
|
require_once(ROOT.'/f_func/class._Session.php');
|
||||||
@@ -6,7 +8,7 @@ require_once(ROOT.'/f_func/class._Session.php');
|
|||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
|
|
||||||
if(!$SESSION->isLoggedIn()) {
|
if(!$SESSION->isLoggedIn()) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인되지 않았습니다.'
|
'reason'=>'로그인되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -105,4 +107,4 @@ if(!is_uploaded_file($image['tmp_name'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
returnJson($response);
|
Json::die($response);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_func/class._Session.php');
|
require_once(ROOT.'/f_func/class._Session.php');
|
||||||
@@ -6,7 +8,7 @@ require_once(ROOT.'/f_func/class._Session.php');
|
|||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
|
|
||||||
if(!$SESSION->isLoggedIn()) {
|
if(!$SESSION->isLoggedIn()) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인되지 않았습니다.'
|
'reason'=>'로그인되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -57,4 +59,4 @@ if($dt == $rf) {
|
|||||||
$response['result'] = true;
|
$response['result'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson($response);
|
Json::die($response);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_config/SESSION.php');
|
require_once(ROOT.'/f_config/SESSION.php');
|
||||||
@@ -11,6 +13,6 @@ unset($_SESSION['access_token']);
|
|||||||
session_write_close();
|
session_write_close();
|
||||||
setcookie("hello", "", time()-3600);
|
setcookie("hello", "", time()-3600);
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true
|
'result'=>true
|
||||||
]);
|
]);
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_config/SESSION.php');
|
require_once(ROOT.'/f_config/SESSION.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
// 외부 파라미터
|
// 외부 파라미터
|
||||||
// $_POST['action'] : 'notice', 'open', 'close', 'reset', 'reset_full'
|
// $_POST['action'] : 'notice', 'open', 'close', 'reset', 'reset_full'
|
||||||
@@ -23,7 +25,7 @@ $userGrade = $SESSION->getGrade();
|
|||||||
session_write_close();
|
session_write_close();
|
||||||
|
|
||||||
if($userGrade < 6) {
|
if($userGrade < 6) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>'FAIL',
|
'result'=>'FAIL',
|
||||||
'msg'=>'운영자 권한이 없습니다.'
|
'msg'=>'운영자 권한이 없습니다.'
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
// 외부 파라미터
|
// 외부 파라미터
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
@@ -57,4 +59,4 @@ foreach (getServerConfigList() as $server) {
|
|||||||
$result[] = $state;
|
$result[] = $state;
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson($result);
|
Json::die($result);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
|
|
||||||
@@ -19,6 +21,6 @@ foreach(getServerConfigList() as $serverInfo){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$response['result'] = 'SUCCESS';
|
$response['result'] = 'SUCCESS';
|
||||||
returnJson($response);
|
Json::die($response);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_config/SESSION.php');
|
require_once(ROOT.'/f_config/SESSION.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
// 외부 파라미터
|
// 외부 파라미터
|
||||||
// $_GET['select'] : 정렬선택
|
// $_GET['select'] : 정렬선택
|
||||||
@@ -12,7 +14,7 @@ $select = $_GET['select'];
|
|||||||
$db = getRootDB();
|
$db = getRootDB();
|
||||||
$userGrade = $SESSION->getGrade();
|
$userGrade = $SESSION->getGrade();
|
||||||
if($userGrade < 6) {
|
if($userGrade < 6) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>'FAIL',
|
'result'=>'FAIL',
|
||||||
'msg'=>'운영자 권한이 없습니다.'
|
'msg'=>'운영자 권한이 없습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -74,6 +76,6 @@ $response['state'] = "가입: {$system['REG']}, 로그인: {$system['LOGIN']}";
|
|||||||
|
|
||||||
$response['result'] = 'SUCCESS';
|
$response['result'] = 'SUCCESS';
|
||||||
|
|
||||||
returnJson($response);
|
Json::die($response);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
require_once(ROOT.'/f_config/SESSION.php');
|
require_once(ROOT.'/f_config/SESSION.php');
|
||||||
@@ -63,6 +65,6 @@ if($member['GRADE'] < 6) {
|
|||||||
$response['result'] = 'SUCCESS';
|
$response['result'] = 'SUCCESS';
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson($response);
|
Json::die($response);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '../..');
|
define('ROOT', '../..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '../..');
|
define('ROOT', '../..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
$category = util::array_get($_GET['category'], 0);
|
$category = util::array_get($_GET['category'], 0);
|
||||||
//FIXME: 겨우 category 구분을 위해 php를 써야하는가? JavaScript로 바꾸자
|
//FIXME: 겨우 category 구분을 위해 php를 써야하는가? JavaScript로 바꾸자
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
|
|
||||||
$images = IMAGES;
|
$images = IMAGES;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(ROOT.'/f_config/SETTING.php');
|
require(ROOT.'/f_config/SETTING.php');
|
||||||
|
|
||||||
@@ -13,7 +15,7 @@ require(ROOT.'/d_setting/conf_kakao.php');
|
|||||||
|
|
||||||
$SESSION = new _SESSION();
|
$SESSION = new _SESSION();
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
if($SESSION->isLoggedIn()){
|
if($SESSION->isLoggedIn()){
|
||||||
header ('Location:i_entrance/entrance.php');
|
header ('Location:i_entrance/entrance.php');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
|
|
||||||
header('location:f_install/install.php');
|
header('location:f_install/install.php');
|
||||||
+7
-7
@@ -5,7 +5,7 @@ require_once(ROOT.'/f_func/class._String.php');
|
|||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
require_once(ROOT.'/f_config/DB.php');
|
require_once(ROOT.'/f_config/DB.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
if($SESSION->isLoggedIn()){
|
if($SESSION->isLoggedIn()){
|
||||||
@@ -16,7 +16,7 @@ $username = mb_strtolower(util::array_get($_POST['username']), 'utf-8');
|
|||||||
$password = util::array_get($_POST['password']);
|
$password = util::array_get($_POST['password']);
|
||||||
|
|
||||||
if(!$username || !$password){
|
if(!$username || !$password){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'올바르지 않은 입력입니다.'
|
'reason'=>'올바르지 않은 입력입니다.'
|
||||||
]);
|
]);
|
||||||
@@ -24,7 +24,7 @@ if(!$username || !$password){
|
|||||||
|
|
||||||
$canLogin = getRootDB()->queryFirstField('SELECT `LOGIN` FROM `SYSTEM` WHERE `NO` = 1');
|
$canLogin = getRootDB()->queryFirstField('SELECT `LOGIN` FROM `SYSTEM` WHERE `NO` = 1');
|
||||||
if($canLogin != 'Y'){
|
if($canLogin != 'Y'){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'현재는 로그인이 금지되어있습니다!'
|
'reason'=>'현재는 로그인이 금지되어있습니다!'
|
||||||
]);
|
]);
|
||||||
@@ -39,7 +39,7 @@ $userInfo = getRootDB()->queryFirstRow(
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if(!$userInfo){
|
if(!$userInfo){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'아이디나 비밀번호가 올바르지 않습니다.'
|
'reason'=>'아이디나 비밀번호가 올바르지 않습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -49,13 +49,13 @@ $nowDate = _Time::DatetimeNow();
|
|||||||
if($userInfo['delete_after']){
|
if($userInfo['delete_after']){
|
||||||
if($userInfo['delete_after'] < $nowDate){
|
if($userInfo['delete_after'] < $nowDate){
|
||||||
getRootDB()->delete('member', 'no=%i', $userInfo['no']);
|
getRootDB()->delete('member', 'no=%i', $userInfo['no']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요."
|
'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요."
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
||||||
]);
|
]);
|
||||||
@@ -64,7 +64,7 @@ if($userInfo['delete_after']){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$SESSION->login($userInfo['no'], $userInfo['id'], $userInfo['grade']);
|
$SESSION->login($userInfo['no'], $userInfo['id'], $userInfo['grade']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'로그인 되었습니다.'
|
'reason'=>'로그인 되었습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
if(!defined('ROOT')){
|
if(!defined('ROOT')){
|
||||||
define('ROOT', '..');
|
define('ROOT', '..');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require(__DIR__.'/../d_setting/conf_kakao.php');
|
require(__DIR__.'/../d_setting/conf_kakao.php');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(ROOT.'/f_func/class._Session.php');
|
require(ROOT.'/f_func/class._Session.php');
|
||||||
@@ -6,12 +7,12 @@ require(ROOT.'/f_config/DB.php');
|
|||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
require('kakao.php');
|
require('kakao.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
$nowDate = _Time::DatetimeNow();
|
$nowDate = _Time::DatetimeNow();
|
||||||
|
|
||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
if(!$SESSION->isLoggedIn()){
|
if(!$SESSION->isLoggedIn()){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인이 되어있지 않습니다'
|
'reason'=>'로그인이 되어있지 않습니다'
|
||||||
]);
|
]);
|
||||||
@@ -23,7 +24,7 @@ $refresh_token = util::array_get($_SESSION['refresh_token']);
|
|||||||
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
||||||
|
|
||||||
if(!$access_token || !$expires){
|
if(!$access_token || !$expires){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오로그인이 이루어지지 않았습니다.'
|
'reason'=>'카카오로그인이 이루어지지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -34,7 +35,7 @@ if(!$access_token || !$expires){
|
|||||||
$restAPI = new Kakao_REST_API_Helper($access_token);
|
$restAPI = new Kakao_REST_API_Helper($access_token);
|
||||||
|
|
||||||
if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){
|
if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -46,7 +47,7 @@ if($expires < $nowDate){
|
|||||||
|
|
||||||
$result = $restAPI->refresh_access_token($refresh_token);
|
$result = $restAPI->refresh_access_token($refresh_token);
|
||||||
if(!isset($refresh_token)){
|
if(!isset($refresh_token)){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
||||||
]);
|
]);
|
||||||
@@ -65,7 +66,7 @@ getRootDB()->query("lock tables member write, member_log write");
|
|||||||
$isUser = getRootDB()->queryFirstRow(
|
$isUser = getRootDB()->queryFirstRow(
|
||||||
'SELECT count(`no`) from member where no=%i',$userID);
|
'SELECT count(`no`) from member where no=%i',$userID);
|
||||||
if(!$isUser){
|
if(!$isUser){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'회원이 아닙니다. 관리자에게 문의해주세요.'
|
'reason'=>'회원이 아닙니다. 관리자에게 문의해주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -87,7 +88,7 @@ $sendResult = $restAPI->talk_to_me_default([
|
|||||||
]);
|
]);
|
||||||
$sendResult['code'] = util::array_get($sendResult['code'], 0);
|
$sendResult['code'] = util::array_get($sendResult['code'], 0);
|
||||||
if($sendResult['code'] < 0){
|
if($sendResult['code'] < 0){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오톡 메시지를 보내지 못했습니다.'
|
'reason'=>'카카오톡 메시지를 보내지 못했습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -112,7 +113,7 @@ getRootDB()->insert('member_log', [
|
|||||||
getRootDB()->query("unlock tables");
|
getRootDB()->query("unlock tables");
|
||||||
|
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success'
|
'reason'=>'success'
|
||||||
]);
|
]);
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require('lib.join.php');
|
require('lib.join.php');
|
||||||
|
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
$access_token = util::array_get($_SESSION['access_token']);
|
$access_token = util::array_get($_SESSION['access_token']);
|
||||||
if(!$access_token){
|
if(!$access_token){
|
||||||
returnJson('로그인 토큰 에러. 다시 로그인을 수행해주세요.');
|
Json::die('로그인 토큰 에러. 다시 로그인을 수행해주세요.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$value = util::array_get($_POST['value']);
|
$value = util::array_get($_POST['value']);
|
||||||
switch(util::array_get($_POST['type'])){
|
switch(util::array_get($_POST['type'])){
|
||||||
case 'nickname':
|
case 'nickname':
|
||||||
returnJson(checkNicknameDup($value));
|
Json::die(checkNicknameDup($value));
|
||||||
case 'username':
|
case 'username':
|
||||||
returnJson(checkUsernameDup($value));
|
Json::die(checkUsernameDup($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
returnJson(false);
|
Json::die(false);
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require('lib.join.php');
|
require('lib.join.php');
|
||||||
require_once(ROOT.'/f_func/class._Time.php');
|
require_once(ROOT.'/f_func/class._Time.php');
|
||||||
require('kakao.php');
|
require('kakao.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
$canJoin = getRootDB()->queryFirstField('SELECT REG FROM `SYSTEM` WHERE `NO` = 1');
|
$canJoin = getRootDB()->queryFirstField('SELECT REG FROM `SYSTEM` WHERE `NO` = 1');
|
||||||
if($canJoin != 'Y'){
|
if($canJoin != 'Y'){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'현재는 가입이 금지되어있습니다!'
|
'reason'=>'현재는 가입이 금지되어있습니다!'
|
||||||
]);
|
]);
|
||||||
@@ -23,14 +25,14 @@ $expires = util::array_get($_SESSION['expires']);
|
|||||||
$refresh_token = util::array_get($_SESSION['refresh_token']);
|
$refresh_token = util::array_get($_SESSION['refresh_token']);
|
||||||
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
$refresh_token_expires = util::array_get($_SESSION['refresh_token_expires']);
|
||||||
if(!$access_token){
|
if(!$access_token){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인 토큰 에러. 다시 카카오로그인을 수행해주세요.'
|
'reason'=>'로그인 토큰 에러. 다시 카카오로그인을 수행해주세요.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){
|
if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){
|
||||||
unset($_SESSION['access_token']);
|
unset($_SESSION['access_token']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -41,21 +43,21 @@ $password = util::array_get($_POST['password']);
|
|||||||
$nickname = util::array_get($_POST['nickname']);
|
$nickname = util::array_get($_POST['nickname']);
|
||||||
|
|
||||||
if(!$username || !$password || !$nickname){
|
if(!$username || !$password || !$nickname){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'입력값이 설정되지 않았습니다.'
|
'reason'=>'입력값이 설정되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strlen($password)!=128){
|
if(strlen($password)!=128){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.'
|
'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$secret_agree){
|
if(!$secret_agree){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'약관에 동의해야 가입하실 수 있습니다.'
|
'reason'=>'약관에 동의해야 가입하실 수 있습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -63,7 +65,7 @@ if(!$secret_agree){
|
|||||||
|
|
||||||
$usernameChk = checkUsernameDup($username);
|
$usernameChk = checkUsernameDup($username);
|
||||||
if($usernameChk !== true){
|
if($usernameChk !== true){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>$usernameChk
|
'reason'=>$usernameChk
|
||||||
]);
|
]);
|
||||||
@@ -71,7 +73,7 @@ if($usernameChk !== true){
|
|||||||
|
|
||||||
$nicknameChk = checkNicknameDup($nickname);
|
$nicknameChk = checkNicknameDup($nickname);
|
||||||
if($nicknameChk !== true){
|
if($nicknameChk !== true){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>$nicknameChk
|
'reason'=>$nicknameChk
|
||||||
]);
|
]);
|
||||||
@@ -87,7 +89,7 @@ if($expires < $nowDate){
|
|||||||
$result = $restAPI->refresh_access_token($refresh_token);
|
$result = $restAPI->refresh_access_token($refresh_token);
|
||||||
if(!isset($refresh_token)){
|
if(!isset($refresh_token)){
|
||||||
unset($_SESSION['access_token']);
|
unset($_SESSION['access_token']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
||||||
]);
|
]);
|
||||||
@@ -106,7 +108,7 @@ $signupResult = $restAPI->signup();
|
|||||||
$kakaoID = util::array_get($signupResult['id']);
|
$kakaoID = util::array_get($signupResult['id']);
|
||||||
|
|
||||||
if(!$kakaoID && util::array_get($signupResult['msg'])!='already registered'){
|
if(!$kakaoID && util::array_get($signupResult['msg'])!='already registered'){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오 로그인 과정 중 앱 연결 절차를 실패했습니다'.json_encode($signupResult)
|
'reason'=>'카카오 로그인 과정 중 앱 연결 절차를 실패했습니다'.json_encode($signupResult)
|
||||||
]);
|
]);
|
||||||
@@ -116,7 +118,7 @@ $me = $restAPI->meWithEmail();
|
|||||||
$me['code'] = util::array_get($me['code'], 0);
|
$me['code'] = util::array_get($me['code'], 0);
|
||||||
if ($me['code']< 0) {
|
if ($me['code']< 0) {
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.'
|
'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -124,7 +126,7 @@ if ($me['code']< 0) {
|
|||||||
|
|
||||||
if(!util::array_get($me['kaccount_email_verified'],false)){
|
if(!util::array_get($me['kaccount_email_verified'],false)){
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다'
|
'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다'
|
||||||
]);
|
]);
|
||||||
@@ -135,7 +137,7 @@ $_SESSION['kaccount_email'] = $email;
|
|||||||
$emailChk = checkEmailDup($email);
|
$emailChk = checkEmailDup($email);
|
||||||
if($emailChk !== true){
|
if($emailChk !== true){
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>$emailChk
|
'reason'=>$emailChk
|
||||||
]);
|
]);
|
||||||
@@ -165,7 +167,7 @@ getRootDB()->insert('member_log', [
|
|||||||
], JSON_UNESCAPED_UNICODE)
|
], JSON_UNESCAPED_UNICODE)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'success'
|
'reason'=>'success'
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(ROOT.'/f_func/class._Session.php');
|
require(ROOT.'/f_func/class._Session.php');
|
||||||
require(ROOT.'/f_config/DB.php');
|
require(ROOT.'/f_config/DB.php');
|
||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
require('kakao.php');
|
require('kakao.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
$SESSION = new _Session();
|
$SESSION = new _Session();
|
||||||
if($SESSION->isLoggedIn()){
|
if($SESSION->isLoggedIn()){
|
||||||
@@ -13,7 +15,7 @@ if($SESSION->isLoggedIn()){
|
|||||||
|
|
||||||
$canLogin = getRootDB()->queryFirstField('SELECT `LOGIN` FROM `SYSTEM` WHERE `NO` = 1');
|
$canLogin = getRootDB()->queryFirstField('SELECT `LOGIN` FROM `SYSTEM` WHERE `NO` = 1');
|
||||||
if($canLogin != 'Y'){
|
if($canLogin != 'Y'){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'현재는 로그인이 금지되어있습니다!',
|
'reason'=>'현재는 로그인이 금지되어있습니다!',
|
||||||
'noRetry'=>true
|
'noRetry'=>true
|
||||||
@@ -30,7 +32,7 @@ $email = util::array_get($_SESSION['kaccount_email']);
|
|||||||
|
|
||||||
|
|
||||||
if(!$access_token || !$expires){
|
if(!$access_token || !$expires){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오로그인이 이루어지지 않았습니다.'
|
'reason'=>'카카오로그인이 이루어지지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -40,7 +42,7 @@ if(!$access_token || !$expires){
|
|||||||
$restAPI = new Kakao_REST_API_Helper($access_token);
|
$restAPI = new Kakao_REST_API_Helper($access_token);
|
||||||
|
|
||||||
if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){
|
if($expires < $nowDate && (!$refresh_token || ($refresh_token_expires < $nowDate))){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
'reason'=>'로그인 토큰 만료.'.$refresh_token_expires.' 다시 카카오로그인을 수행해주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -52,7 +54,7 @@ if($expires < $nowDate){
|
|||||||
|
|
||||||
$result = $restAPI->refresh_access_token($refresh_token);
|
$result = $restAPI->refresh_access_token($refresh_token);
|
||||||
if(!isset($refresh_token)){
|
if(!isset($refresh_token)){
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
'reason'=>'카카오 로그인 과정 중 추가 갱신 절차를 실패했습니다'
|
||||||
]);
|
]);
|
||||||
@@ -71,7 +73,7 @@ if(!$email){
|
|||||||
$me = $restAPI->meWithEmail();
|
$me = $restAPI->meWithEmail();
|
||||||
$me['code'] = util::array_get($me['code'], 0);
|
$me['code'] = util::array_get($me['code'], 0);
|
||||||
if ($me['code']< 0) {
|
if ($me['code']< 0) {
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.'
|
'reason'=>'카카오로그인이 정상적으로 수행되지 않았습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -79,7 +81,7 @@ if(!$email){
|
|||||||
|
|
||||||
if(!util::array_get($me['kaccount_email_verified'],false)){
|
if(!util::array_get($me['kaccount_email_verified'],false)){
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다'
|
'reason'=>'카카오 계정 이메일이 아직 인증되지 않았습니다'
|
||||||
]);
|
]);
|
||||||
@@ -96,7 +98,7 @@ $userInfo = getRootDB()->queryFirstRow(
|
|||||||
if(!$userInfo){
|
if(!$userInfo){
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
unset($_SESSION['access_token']);
|
unset($_SESSION['access_token']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'카카오로그인에 해당하는 계정이 없습니다. 재 가입을 시도해주세요.'
|
'reason'=>'카카오로그인에 해당하는 계정이 없습니다. 재 가입을 시도해주세요.'
|
||||||
]);
|
]);
|
||||||
@@ -107,7 +109,7 @@ if($userInfo['delete_after']){
|
|||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
unset($_SESSION['access_token']);
|
unset($_SESSION['access_token']);
|
||||||
getRootDB()->delete('member', 'no=%i', $userInfo['no']);
|
getRootDB()->delete('member', 'no=%i', $userInfo['no']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요."
|
'reason'=>"기간 만기로 삭제되었습니다. 재 가입을 시도해주세요."
|
||||||
]);
|
]);
|
||||||
@@ -115,7 +117,7 @@ if($userInfo['delete_after']){
|
|||||||
else{
|
else{
|
||||||
$restAPI->unlink();
|
$restAPI->unlink();
|
||||||
unset($_SESSION['access_token']);
|
unset($_SESSION['access_token']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
'reason'=>"삭제 요청된 계정입니다.[{$userInfo['delete_after']}]"
|
||||||
]);
|
]);
|
||||||
@@ -124,7 +126,7 @@ if($userInfo['delete_after']){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$SESSION->login($userInfo['no'], $userInfo['id'], $userInfo['grade']);
|
$SESSION->login($userInfo['no'], $userInfo['id'], $userInfo['grade']);
|
||||||
returnJson([
|
Json::die([
|
||||||
'result'=>true,
|
'result'=>true,
|
||||||
'reason'=>'로그인 되었습니다.'
|
'reason'=>'로그인 되었습니다.'
|
||||||
]);
|
]);
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
require_once(__dir__.'/../d_setting/conf.php');
|
require_once(__dir__.'/../d_setting/conf.php');
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require_once('_common.php');
|
require_once('_common.php');
|
||||||
require_once(__dir__.'/../d_setting/conf.php');
|
require_once(__dir__.'/../d_setting/conf.php');
|
||||||
require_once(__dir__.'/../f_func/func.php');
|
require_once(__dir__.'/../f_func/func.php');
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
require('_common.php');
|
require('_common.php');
|
||||||
require(ROOT.'/f_func/class._Time.php');
|
require(ROOT.'/f_func/class._Time.php');
|
||||||
require('kakao.php');
|
require('kakao.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
$auth_code = util::array_get($_GET['code']);
|
$auth_code = util::array_get($_GET['code']);
|
||||||
if(!$auth_code){
|
if(!$auth_code){
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
class Json{
|
||||||
|
private static function setHeaderNoCache(){
|
||||||
|
if(!headers_sent()) {
|
||||||
|
header('Expires: Wed, 01 Jan 2014 00:00:00 GMT');
|
||||||
|
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||||
|
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function encode($value, $pretty = false){
|
||||||
|
if($pretty){
|
||||||
|
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$flag = JSON_UNESCAPED_UNICODE;
|
||||||
|
}
|
||||||
|
return json_encode($value, $flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function decode($value){
|
||||||
|
return json_decode($value, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function die($value, $noCache = true, $pretty = false, $die = true){
|
||||||
|
if($noCache){
|
||||||
|
self::setHeaderNoCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
echo Json::encode($value, $pretty);
|
||||||
|
if($die){
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once('_common.php');
|
namespace sammo;
|
||||||
|
|
||||||
class _Lock {
|
class Lock {
|
||||||
private static $l = ROOT.'/d_log/lock.txt';
|
private static $l = ROOT.'/d_log/lock.txt';
|
||||||
|
|
||||||
public static function Busy() {
|
public static function Busy() {
|
||||||
$fp = fopen(_Lock::$l, 'r');
|
$fp = fopen(Lock::$l, 'r');
|
||||||
$lock = fread($fp, 1);
|
$lock = fread($fp, 1);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
@@ -14,13 +14,13 @@ class _Lock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static function LockFile() {
|
private static function LockFile() {
|
||||||
$fp = fopen(_Lock::$l, 'r');
|
$fp = fopen(Lock::$l, 'r');
|
||||||
$lock = fread($fp, 1);
|
$lock = fread($fp, 1);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
if($lock == 1) return false;
|
if($lock == 1) return false;
|
||||||
|
|
||||||
$fp = fopen(_Lock::$l, 'w');
|
$fp = fopen(Lock::$l, 'w');
|
||||||
if(!flock($fp, LOCK_EX)) { return false; }
|
if(!flock($fp, LOCK_EX)) { return false; }
|
||||||
fwrite($fp, '1');
|
fwrite($fp, '1');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@@ -30,13 +30,13 @@ class _Lock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static function UnlockFile() {
|
private static function UnlockFile() {
|
||||||
$fp = fopen(_Lock::$l, 'r');
|
$fp = fopen(Lock::$l, 'r');
|
||||||
$lock = fread($fp, 1);
|
$lock = fread($fp, 1);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
if($lock == 0) return false;
|
if($lock == 0) return false;
|
||||||
|
|
||||||
$fp = fopen(_Lock::$l, 'w');
|
$fp = fopen(Lock::$l, 'w');
|
||||||
if(!flock($fp, LOCK_EX)) { return false; }
|
if(!flock($fp, LOCK_EX)) { return false; }
|
||||||
fwrite($fp, '0');
|
fwrite($fp, '0');
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@@ -48,19 +48,19 @@ class _Lock {
|
|||||||
public static function Lock() {
|
public static function Lock() {
|
||||||
/*
|
/*
|
||||||
// 키 생성
|
// 키 생성
|
||||||
$key = fileinode(_Lock::$l);
|
$key = fileinode(Lock::$l);
|
||||||
// 뮤텍스 획득
|
// 뮤텍스 획득
|
||||||
$mutex = sem_get($key);
|
$mutex = sem_get($key);
|
||||||
// 락 획득
|
// 락 획득
|
||||||
sem_acquire($mutex);
|
sem_acquire($mutex);
|
||||||
*/
|
*/
|
||||||
// 파일에 잠금 걸기
|
// 파일에 잠금 걸기
|
||||||
return _Lock::LockFile();
|
return Lock::LockFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Unlock() {
|
public static function Unlock() {
|
||||||
// 파일에 잠금 풀기
|
// 파일에 잠금 풀기
|
||||||
$res = _Lock::UnlockFile();
|
$res = Lock::UnlockFile();
|
||||||
/*
|
/*
|
||||||
// 락 해제
|
// 락 해제
|
||||||
sem_release($mutex);
|
sem_release($mutex);
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
class util extends utilphp\util{
|
||||||
|
};
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
require('vendor/autoload.php');
|
||||||
|
|
||||||
|
Json::die([
|
||||||
|
'haha'
|
||||||
|
]);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../twe/lib.php');
|
require('../twe/lib.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
$jsonPost = parseJsonPost();
|
$jsonPost = parseJsonPost();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../twe/lib.php');
|
require('../twe/lib.php');
|
||||||
use utilphp\util as util;
|
|
||||||
/*
|
/*
|
||||||
원래대로라면 json을 돌려주는게 맞지만
|
원래대로라면 json을 돌려주는게 맞지만
|
||||||
refresh를 반영해야하므로 php로 중계해서 반환함!
|
refresh를 반영해야하므로 php로 중계해서 반환함!
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require('../twe/lib.php');
|
require('../twe/lib.php');
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
$jsonPost = parseJsonPost();
|
$jsonPost = parseJsonPost();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
|
||||||
function MYDB_connect($host, $id, $pw) {
|
function MYDB_connect($host, $id, $pw) {
|
||||||
$conn = mysqli_connect($host, $id, $pw);
|
$conn = mysqli_connect($host, $id, $pw);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
+3
-1
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
use utilphp\util as util;
|
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$yearmonth = $_POST['yearmonth'];
|
$yearmonth = $_POST['yearmonth'];
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user