Merge branch 'main' of https://gitea.hmac.kr/b24014/kngil_home
This commit is contained in:
16
.env.sample
Normal file
16
.env.sample
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# DB 접속 정보
|
||||||
|
DB_HOST=db
|
||||||
|
DB_PORT=5432
|
||||||
|
DB_NAME=kngil
|
||||||
|
DB_USER=postgres
|
||||||
|
DB_PASS=postgres
|
||||||
|
|
||||||
|
# 참고: kngil_DB 덤프의 소유자가 postgres이므로 DB_USER 변경 시 초기 복원 실패 가능
|
||||||
|
|
||||||
|
# OIDC 설정
|
||||||
|
OIDC_ISSUER=
|
||||||
|
OIDC_CLIENT_ID=
|
||||||
|
OIDC_CLIENT_SECRET=
|
||||||
|
OIDC_REDIRECT_URL=
|
||||||
|
OIDC_SCOPES=openid profile email
|
||||||
|
IDP_SERVICE_URL=
|
||||||
54
.gitea/workflows/deploy-registry.yml
Normal file
54
.gitea/workflows/deploy-registry.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: Deploy (registry)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ vars.HARBOR_ENDPOINT }}
|
||||||
|
username: ${{ vars.HARBOR_ROBOT_ACCOUNT }}
|
||||||
|
password: ${{ secrets.HARBOR_ROBOT_KEY }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ vars.HARBOR_ENDPOINT }}/${{ vars.IMAGE_NAME }}:latest
|
||||||
|
${{ vars.HARBOR_ENDPOINT }}/${{ vars.IMAGE_NAME }}:${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Deploy via SSH
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ vars.SSH_HOST }}
|
||||||
|
username: ${{ vars.SSH_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
port: ${{ vars.SSH_PORT }}
|
||||||
|
script: |
|
||||||
|
cd ${{ secrets.DEPLOY_PATH }}
|
||||||
|
cat << 'ENVEOF' > .env
|
||||||
|
${{ secrets.DEPLOY_ENV_FILE }}
|
||||||
|
ENVEOF
|
||||||
|
|
||||||
|
# Export variables from .env file
|
||||||
|
set -a
|
||||||
|
source .env
|
||||||
|
set +a
|
||||||
|
|
||||||
|
docker compose --env-file .env pull
|
||||||
|
docker compose --env-file .env up -d
|
||||||
54
.gitea/workflows/deploy.yml
Normal file
54
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: Deploy (build on server)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy via SSH
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
with:
|
||||||
|
host: ${{ vars.SSH_HOST }}
|
||||||
|
username: ${{ vars.SSH_USER }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
port: ${{ vars.SSH_PORT }}
|
||||||
|
script: |
|
||||||
|
set -e
|
||||||
|
cd ${{ vars.DEPLOY_PATH }}
|
||||||
|
# if [ ! -d .git ]; then
|
||||||
|
# git init
|
||||||
|
# git remote add origin ssh://git@127.0.0.1:222/b24014/kngil_home.git
|
||||||
|
# else
|
||||||
|
# git remote set-url origin ssh://git@127.0.0.1:222/b24014/kngil_home.git
|
||||||
|
# fi
|
||||||
|
cat << 'ENVEOF' > .env
|
||||||
|
WEB_HOST_PORT=${{ vars.WEB_HOST_PORT }}
|
||||||
|
DB_HOST=${{ vars.DB_HOST }}
|
||||||
|
DB_PORT=${{ vars.DB_PORT }}
|
||||||
|
DB_HOST_PORT=${{ vars.DB_HOST_PORT }}
|
||||||
|
DB_NAME=${{ vars.DB_NAME }}
|
||||||
|
DB_USER=${{ vars.DB_USER }}
|
||||||
|
DB_PASS=${{ secrets.DB_PASS }}
|
||||||
|
OIDC_ISSUER=${{ vars.OIDC_ISSUER }}
|
||||||
|
OIDC_CLIENT_ID=${{ vars.OIDC_CLIENT_ID }}
|
||||||
|
OIDC_CLIENT_SECRET=${{ secrets.OIDC_CLIENT_SECRET }}
|
||||||
|
OIDC_REDIRECT_URL=${{ vars.OIDC_REDIRECT_URL }}
|
||||||
|
OIDC_SCOPES=${{ vars.OIDC_SCOPES }}
|
||||||
|
IDP_SERVICE_URL=${{ vars.IDP_SERVICE_URL }}
|
||||||
|
ENVEOF
|
||||||
|
|
||||||
|
# Export variables from .env file
|
||||||
|
set -a
|
||||||
|
source .env
|
||||||
|
set +a
|
||||||
|
|
||||||
|
git fetch origin main
|
||||||
|
git checkout -B main origin/main
|
||||||
|
git pull --ff-only
|
||||||
|
|
||||||
|
docker compose --env-file .env up -d --build
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.env
|
||||||
|
/kngil/vendor/
|
||||||
23
.htaccess
Normal file
23
.htaccess
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# Skip existing files and directories.
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} -d
|
||||||
|
RewriteRule ^ - [L]
|
||||||
|
|
||||||
|
# Admin UI
|
||||||
|
RewriteRule ^admin/?$ /kngil/skin/adm.php [L]
|
||||||
|
RewriteRule ^admin/company/?$ /kngil/skin/adm_comp.php [L]
|
||||||
|
|
||||||
|
# Admin APIs
|
||||||
|
RewriteRule ^admin/api/super/?$ /kngil/bbs/adm.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/company/?$ /kngil/bbs/adm_comp.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/service/?$ /kngil/bbs/adm_service.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/purchase-history/?$ /kngil/bbs/adm_purch_popup.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/use-history/?$ /kngil/bbs/adm_use_history.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/product/?$ /kngil/bbs/adm_product_popup.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/product/save/?$ /kngil/bbs/adm_product_popup_save.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/product/delete/?$ /kngil/bbs/adm_product_popup_delete.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/faq/?$ /kngil/bbs/adm_faq_popup.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/faq/save/?$ /kngil/bbs/adm_faq_popup_save.php [QSA,L]
|
||||||
|
RewriteRule ^admin/api/faq/delete/?$ /kngil/bbs/adm_faq_popup_delete.php [QSA,L]
|
||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
FROM php:8.2-apache
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends git unzip libpq-dev \
|
||||||
|
&& docker-php-ext-install pdo_pgsql \
|
||||||
|
&& a2enmod rewrite \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY docker/apache.conf /etc/apache2/conf-available/kngil.conf
|
||||||
|
RUN a2enconf kngil
|
||||||
|
|
||||||
|
COPY docker/entrypoint.sh /usr/local/bin/kngil-entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/kngil-entrypoint.sh
|
||||||
|
ENTRYPOINT ["/usr/local/bin/kngil-entrypoint.sh"]
|
||||||
52
README.md
Normal file
52
README.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# KNGIL 로컬 실행 (Docker Compose)
|
||||||
|
|
||||||
|
## 빠른 시작
|
||||||
|
```bash
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
- 접속: `http://localhost:8080`
|
||||||
|
```bash
|
||||||
|
docker compose down
|
||||||
|
```
|
||||||
|
|
||||||
|
## 환경변수
|
||||||
|
`docker-compose.yml`에서 기본값을 사용하며, 필요 시 `.env`로 덮어쓸 수 있습니다.
|
||||||
|
|
||||||
|
- `DB_HOST` (기본값: `db`)
|
||||||
|
- `DB_PORT` (기본값: `5432`) - 웹 컨테이너가 DB에 접속할 때 사용하는 포트
|
||||||
|
- `DB_HOST_PORT` (기본값: `5432`) - 외부에서 포트포워딩으로 접속할 때 사용하는 호스트 포트
|
||||||
|
- `DB_NAME` (기본값: `kngil`)
|
||||||
|
- `DB_USER` (기본값: `postgres`)
|
||||||
|
- `DB_PASS` (기본값: `postgres`)
|
||||||
|
|
||||||
|
> 참고: `kngil_DB` 덤프가 `postgres` 소유자를 사용하므로, `DB_USER`를 변경하면 초기 복원에 실패할 수 있습니다.
|
||||||
|
|
||||||
|
### OIDC (선택)
|
||||||
|
로그인에서 OIDC를 사용하려면 아래 환경변수를 설정하세요.
|
||||||
|
|
||||||
|
- `OIDC_ISSUER`
|
||||||
|
- `OIDC_CLIENT_ID`
|
||||||
|
- `OIDC_CLIENT_SECRET`
|
||||||
|
- `OIDC_REDIRECT_URL`
|
||||||
|
- `OIDC_SCOPES` (예: `openid profile email`)
|
||||||
|
- `IDP_SERVICE_URL` (예: `https://idp.example.com`)
|
||||||
|
|
||||||
|
## DB 초기화
|
||||||
|
- `kngil_DB` 덤프는 **처음 실행 시** 자동으로 로드됩니다.
|
||||||
|
- 이미 생성된 볼륨이 있으면 재적용되지 않습니다. 다시 초기화하려면 아래를 실행하세요.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose down -v
|
||||||
|
```
|
||||||
|
|
||||||
|
## 덤프 호환성
|
||||||
|
- `docker/initdb/01_kngil_DB.sql`는 PostgreSQL 16에서도 동작하도록 `transaction_timeout` 설정을 제거한 버전입니다.
|
||||||
|
- 원본 덤프는 `kngil_DB`에 그대로 보관됩니다.
|
||||||
|
|
||||||
|
## 기능 비활성화
|
||||||
|
- MySQL 의존 기능은 현재 제외했습니다.
|
||||||
|
- `kngil/bbs/sales_results.php`는 410 응답으로 비활성 처리되어 있습니다.
|
||||||
|
|
||||||
|
## PostgreSQL 이미지 버전
|
||||||
|
- 기본값은 `postgres:16`입니다.
|
||||||
|
- 이미지 풀 실패 시 `docker-compose.yml`의 태그를 사용 가능한 버전으로 변경하세요.
|
||||||
45
docker-compose.yml
Normal file
45
docker-compose.yml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
services:
|
||||||
|
web:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "${WEB_HOST_PORT:-8080}:80"
|
||||||
|
volumes:
|
||||||
|
- ./:/var/www/html
|
||||||
|
environment:
|
||||||
|
DB_HOST: ${DB_HOST:-db}
|
||||||
|
DB_PORT: ${DB_PORT:-5432}
|
||||||
|
DB_NAME: ${DB_NAME:-kngil}
|
||||||
|
DB_USER: ${DB_USER:-postgres}
|
||||||
|
DB_PASS: ${DB_PASS:-postgres}
|
||||||
|
OIDC_ISSUER: ${OIDC_ISSUER:-}
|
||||||
|
OIDC_CLIENT_ID: ${OIDC_CLIENT_ID:-}
|
||||||
|
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET:-}
|
||||||
|
OIDC_REDIRECT_URL: ${OIDC_REDIRECT_URL:-}
|
||||||
|
OIDC_SCOPES: ${OIDC_SCOPES:-}
|
||||||
|
IDP_SERVICE_URL: ${IDP_SERVICE_URL:-}
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:16
|
||||||
|
ports:
|
||||||
|
- "0.0.0.0:${DB_HOST_PORT:-5432}:5432"
|
||||||
|
command:
|
||||||
|
- "postgres"
|
||||||
|
- "-c"
|
||||||
|
- "listen_addresses=*"
|
||||||
|
- "-c"
|
||||||
|
- "hba_file=/etc/postgresql/pg_hba.conf"
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${DB_NAME:-kngil}
|
||||||
|
POSTGRES_USER: ${DB_USER:-postgres}
|
||||||
|
POSTGRES_PASSWORD: ${DB_PASS:-postgres}
|
||||||
|
volumes:
|
||||||
|
- db_data:/var/lib/postgresql/data
|
||||||
|
- ./docker/initdb/01_kngil_DB.sql:/docker-entrypoint-initdb.d/01_kngil_DB.sql:ro
|
||||||
|
- ./docker/postgres/pg_hba.conf:/etc/postgresql/pg_hba.conf:ro
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db_data:
|
||||||
6
docker/apache.conf
Normal file
6
docker/apache.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
ServerName localhost
|
||||||
|
|
||||||
|
<Directory /var/www/html>
|
||||||
|
AllowOverride All
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
9
docker/entrypoint.sh
Normal file
9
docker/entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ ! -f /var/www/html/kngil/vendor/autoload.php ]; then
|
||||||
|
echo "[초기화] composer install을 실행합니다..."
|
||||||
|
php /var/www/html/kngil/composer.phar install --working-dir=/var/www/html/kngil --no-interaction --prefer-dist
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec apache2-foreground
|
||||||
12
docker/initdb/00_create_db.sh
Executable file
12
docker/initdb/00_create_db.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "postgres" <<'EOSQL'
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM pg_database WHERE datname = 'kngil') THEN
|
||||||
|
CREATE DATABASE kngil;
|
||||||
|
END IF;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
EOSQL
|
||||||
2380
docker/initdb/01_kngil_DB.sql
Normal file
2380
docker/initdb/01_kngil_DB.sql
Normal file
File diff suppressed because it is too large
Load Diff
11
docker/postgres/pg_hba.conf
Normal file
11
docker/postgres/pg_hba.conf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# 로컬 소켓 접속 허용(초기화/관리용). 운영에서는 정책에 맞게 조정하세요.
|
||||||
|
#
|
||||||
|
local all all trust
|
||||||
|
host all all 127.0.0.1/32 scram-sha-256
|
||||||
|
host all all ::1/128 scram-sha-256
|
||||||
|
#
|
||||||
|
# 외부 TCP 접속 허용. 운영에서는 허용 대역을 제한하세요.
|
||||||
|
#
|
||||||
|
host all all 0.0.0.0/0 scram-sha-256
|
||||||
|
host all all ::/0 scram-sha-256
|
||||||
@@ -7,7 +7,7 @@ declare(strict_types=1);
|
|||||||
// 1. 기본 상수
|
// 1. 기본 상수
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
define('ROOT', __DIR__);
|
define('ROOT', __DIR__);
|
||||||
define('SKIN_PATH', ROOT.'/skin');
|
define('SKIN_PATH', ROOT.'/kngil/skin');
|
||||||
|
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// 2. 페이지 결정
|
// 2. 페이지 결정
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
// /kngil/auth/oidc-callback.php
|
// /kngil/auth/oidc-callback.php
|
||||||
session_start();
|
session_start();
|
||||||
|
ini_set('log_errors', '1');
|
||||||
|
ini_set('error_log', '/proc/self/fd/2');
|
||||||
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
require_once dirname(__DIR__) . '/bbs/db_conn.php';
|
require_once dirname(__DIR__) . '/bbs/db_conn.php';
|
||||||
$config = require_once dirname(__DIR__) . '/bbs/oidc_config.php';
|
$config = require_once dirname(__DIR__) . '/bbs/oidc_config.php';
|
||||||
|
|
||||||
use Jumbojett\OpenIDConnectClient;
|
use Jumbojett\OpenIDConnectClient;
|
||||||
|
|
||||||
|
$usersTable = 'kngil.users';
|
||||||
|
$membersTable = 'kngil.members';
|
||||||
|
|
||||||
$oidc = new OpenIDConnectClient(
|
$oidc = new OpenIDConnectClient(
|
||||||
$config['issuer'],
|
$config['issuer'],
|
||||||
$config['client_id'],
|
$config['client_id'],
|
||||||
@@ -16,16 +21,124 @@ $oidc = new OpenIDConnectClient(
|
|||||||
$oidc->setRedirectURL($config['redirect_url']);
|
$oidc->setRedirectURL($config['redirect_url']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
$stmt = $pdo->query("SELECT to_regclass('kngil.users') AS reg");
|
||||||
|
$reg = $stmt ? $stmt->fetchColumn() : null;
|
||||||
|
if (!$reg) {
|
||||||
|
$stmt = $pdo->query("SELECT to_regclass('public.users') AS reg");
|
||||||
|
$reg = $stmt ? $stmt->fetchColumn() : null;
|
||||||
|
if ($reg) {
|
||||||
|
$usersTable = 'public.users';
|
||||||
|
$membersTable = 'public.members';
|
||||||
|
} else {
|
||||||
|
throw new Exception(
|
||||||
|
"사용자 테이블을 찾을 수 없습니다. DB 초기화가 필요합니다. "
|
||||||
|
. "docker compose down -v 후 다시 실행하거나, "
|
||||||
|
. "DB_NAME/DB_USER/DB_PASS 설정을 확인하세요."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$memberReg = $pdo->query("SELECT to_regclass('{$membersTable}') AS reg");
|
||||||
|
$memberReg = $memberReg ? $memberReg->fetchColumn() : null;
|
||||||
|
if (!$memberReg) {
|
||||||
|
$altMembersTable = $membersTable === 'kngil.members' ? 'public.members' : 'kngil.members';
|
||||||
|
$memberReg = $pdo->query("SELECT to_regclass('{$altMembersTable}') AS reg");
|
||||||
|
$memberReg = $memberReg ? $memberReg->fetchColumn() : null;
|
||||||
|
if ($memberReg) {
|
||||||
|
$membersTable = $altMembersTable;
|
||||||
|
} else {
|
||||||
|
throw new Exception("회원 테이블을 찾을 수 없습니다. DB 초기화가 필요합니다.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdo->exec("ALTER TABLE {$usersTable} ADD COLUMN IF NOT EXISTS oidc_sub VARCHAR(255) UNIQUE");
|
||||||
|
|
||||||
if (!$oidc->authenticate()) {
|
if (!$oidc->authenticate()) {
|
||||||
throw new Exception("Authentication failed");
|
throw new Exception("Authentication failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
$userInfo = $oidc->requestUserInfo();
|
$userInfo = $oidc->requestUserInfo();
|
||||||
|
$idToken = $oidc->getIdToken();
|
||||||
|
$accessToken = $oidc->getAccessToken();
|
||||||
|
$jwtClaims = [];
|
||||||
|
if (!empty($idToken)) {
|
||||||
|
$parts = explode('.', $idToken);
|
||||||
|
if (count($parts) >= 2) {
|
||||||
|
$payload = strtr($parts[1], '-_', '+/');
|
||||||
|
$padding = 4 - (strlen($payload) % 4);
|
||||||
|
if ($padding < 4) {
|
||||||
|
$payload .= str_repeat('=', $padding);
|
||||||
|
}
|
||||||
|
$decoded = json_decode(base64_decode($payload), true);
|
||||||
|
if (is_array($decoded)) {
|
||||||
|
$jwtClaims = $decoded;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 디버그용: ID 토큰 확보 여부 로그 출력 (파일)
|
||||||
|
$logDir = dirname(__DIR__) . '/log';
|
||||||
|
if (!is_dir($logDir)) {
|
||||||
|
@mkdir($logDir, 0775, true);
|
||||||
|
}
|
||||||
|
$logPath = $logDir . '/oidc_debug.log';
|
||||||
|
if (!is_writable($logDir)) {
|
||||||
|
$logPath = '/tmp/oidc_debug.log';
|
||||||
|
error_log('[OIDC_DEBUG] log_dir_not_writable, fallback=/tmp/oidc_debug.log');
|
||||||
|
}
|
||||||
|
$tokenInfo = empty($idToken) ? 'MISSING' : ('PRESENT len=' . strlen($idToken));
|
||||||
|
$claimKeys = empty($jwtClaims) ? 'none' : implode(',', array_keys($jwtClaims));
|
||||||
|
$logLine = sprintf(
|
||||||
|
"[%s] host=%s uri=%s sid=%s id_token=%s claims=%s\n",
|
||||||
|
date('c'),
|
||||||
|
$_SERVER['HTTP_HOST'] ?? '-',
|
||||||
|
$_SERVER['REQUEST_URI'] ?? '-',
|
||||||
|
session_id(),
|
||||||
|
$tokenInfo,
|
||||||
|
$claimKeys
|
||||||
|
);
|
||||||
|
$writeOk = @file_put_contents($logPath, $logLine, FILE_APPEND);
|
||||||
|
if ($writeOk === false) {
|
||||||
|
error_log('[OIDC_DEBUG] log_write_failed path=' . $logPath);
|
||||||
|
}
|
||||||
|
// 디버그용: userInfo/claims 전체 덤프 (토큰 제외)
|
||||||
|
$dump = [
|
||||||
|
'userInfo' => $userInfo,
|
||||||
|
'jwtClaims' => $jwtClaims
|
||||||
|
];
|
||||||
|
$dumpLine = sprintf(
|
||||||
|
"[%s] oidc_dump=%s\n",
|
||||||
|
date('c'),
|
||||||
|
json_encode($dump, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)
|
||||||
|
);
|
||||||
|
$dumpOk = @file_put_contents($logPath, $dumpLine, FILE_APPEND);
|
||||||
|
if ($dumpOk === false) {
|
||||||
|
error_log('[OIDC_DEBUG] dump_write_failed path=' . $logPath);
|
||||||
|
}
|
||||||
|
// 도커 로그로도 출력
|
||||||
|
error_log('[OIDC_DEBUG] ' . $dumpLine);
|
||||||
// $userInfo 에 포함된 데이터 예시: sub, email, name, preferred_username 등
|
// $userInfo 에 포함된 데이터 예시: sub, email, name, preferred_username 등
|
||||||
|
|
||||||
$email = $userInfo->email ?? null;
|
$email = $userInfo->email ?? null;
|
||||||
$sub = $userInfo->sub ?? null; // IDP 고유 식별자
|
$sub = $userInfo->sub ?? null; // IDP 고유 식별자
|
||||||
$name = $userInfo->name ?? ($userInfo->preferred_username ?? 'Unknown');
|
$preferred = $userInfo->preferred_username ?? null;
|
||||||
|
$name = $userInfo->name ?? null;
|
||||||
|
if (!$email && isset($jwtClaims['email'])) {
|
||||||
|
$email = $jwtClaims['email'];
|
||||||
|
}
|
||||||
|
if (!$name && isset($jwtClaims['name'])) {
|
||||||
|
$name = $jwtClaims['name'];
|
||||||
|
}
|
||||||
|
if (!$name && $preferred) {
|
||||||
|
$name = $preferred;
|
||||||
|
}
|
||||||
|
if (!$name && $email) {
|
||||||
|
$name = $email;
|
||||||
|
}
|
||||||
|
if (!$name && $sub) {
|
||||||
|
$seed = strtolower(preg_replace('/[^a-z0-9]/', '', (string)$sub));
|
||||||
|
$name = 'oidc_' . substr($seed, 0, 10);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$email && !$sub) {
|
if (!$email && !$sub) {
|
||||||
throw new Exception("IDP provided insufficient user information.");
|
throw new Exception("IDP provided insufficient user information.");
|
||||||
@@ -33,7 +146,7 @@ try {
|
|||||||
|
|
||||||
// 1. 사용자 매핑 (sub 또는 email 기준)
|
// 1. 사용자 매핑 (sub 또는 email 기준)
|
||||||
$stmt = $pdo->prepare("
|
$stmt = $pdo->prepare("
|
||||||
SELECT * FROM kngil.users
|
SELECT * FROM {$usersTable}
|
||||||
WHERE (oidc_sub = :sub OR LOWER(email) = LOWER(:email))
|
WHERE (oidc_sub = :sub OR LOWER(email) = LOWER(:email))
|
||||||
AND use_yn = 'Y'
|
AND use_yn = 'Y'
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
@@ -42,14 +155,99 @@ try {
|
|||||||
$user = $stmt->fetch(PDO::FETCH_ASSOC);
|
$user = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
// [정책 선택] 새 사용자 자동 생성 또는 로그인 거부
|
$defaultMemberId = getenv('OIDC_DEFAULT_MEMBER_ID') ?: '';
|
||||||
// 여기서는 예시로 로그인 거부 처리
|
if ($defaultMemberId !== '') {
|
||||||
throw new Exception("등록되지 않은 사용자입니다. 관리자에게 문의하세요. (IDP: $email)");
|
$checkMember = $pdo->prepare("SELECT 1 FROM {$membersTable} WHERE member_id = :member_id LIMIT 1");
|
||||||
|
$checkMember->execute([':member_id' => $defaultMemberId]);
|
||||||
|
if (!$checkMember->fetchColumn()) {
|
||||||
|
throw new Exception("OIDC_DEFAULT_MEMBER_ID가 members에 존재하지 않습니다: {$defaultMemberId}");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$memberStmt = $pdo->query("SELECT member_id FROM {$membersTable} ORDER BY member_id ASC LIMIT 1");
|
||||||
|
$defaultMemberId = $memberStmt ? $memberStmt->fetchColumn() : '';
|
||||||
|
if (!$defaultMemberId) {
|
||||||
|
throw new Exception("기본 member_id를 찾을 수 없습니다. OIDC_DEFAULT_MEMBER_ID를 설정하세요.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$defaultAuth = getenv('OIDC_DEFAULT_AUTH_BC') ?: 'BS100500';
|
||||||
|
|
||||||
|
$baseId = $userInfo->preferred_username ?? ($email ? explode('@', $email)[0] : '');
|
||||||
|
$baseId = strtolower(preg_replace('/[^a-z0-9]/', '', $baseId));
|
||||||
|
if ($baseId === '') {
|
||||||
|
$seed = strtolower(preg_replace('/[^a-z0-9]/', '', (string)($sub ?? 'oidc')));
|
||||||
|
$baseId = 'oidc' . substr($seed, 0, 10);
|
||||||
|
}
|
||||||
|
$baseId = substr($baseId, 0, 16);
|
||||||
|
$userId = $baseId;
|
||||||
|
|
||||||
|
$existsStmt = $pdo->prepare("SELECT 1 FROM {$usersTable} WHERE LOWER(user_id) = LOWER(:user_id) LIMIT 1");
|
||||||
|
$suffix = 1;
|
||||||
|
while (true) {
|
||||||
|
$existsStmt->execute([':user_id' => $userId]);
|
||||||
|
if (!$existsStmt->fetchColumn()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$tail = sprintf('%02d', $suffix);
|
||||||
|
$userId = substr($baseId, 0, 20 - strlen($tail)) . $tail;
|
||||||
|
$suffix++;
|
||||||
|
if ($suffix > 99) {
|
||||||
|
$userId = 'oidc' . bin2hex(random_bytes(4));
|
||||||
|
$userId = substr($userId, 0, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$userNm = $name ?: ($email ?: $userId);
|
||||||
|
$rawPhone = $userInfo->phone_number ?? '';
|
||||||
|
$digits = preg_replace('/\D/', '', $rawPhone);
|
||||||
|
if (strlen($digits) === 11) {
|
||||||
|
$telNo = substr($digits, 0, 3) . '-' . substr($digits, 3, 4) . '-' . substr($digits, 7, 4);
|
||||||
|
} elseif (strlen($digits) === 10) {
|
||||||
|
$telNo = substr($digits, 0, 3) . '-' . substr($digits, 3, 3) . '-' . substr($digits, 6, 4);
|
||||||
|
} else {
|
||||||
|
$telNo = '000-0000-0000';
|
||||||
|
}
|
||||||
|
|
||||||
|
$insert = $pdo->prepare("
|
||||||
|
INSERT INTO {$usersTable} (
|
||||||
|
member_id, user_id, user_pw, user_nm,
|
||||||
|
dept_nm, posit_nm, tel_no, email,
|
||||||
|
auth_bc, use_yn, rmks,
|
||||||
|
cid, cdt, mid, mdt, oidc_sub
|
||||||
|
) VALUES (
|
||||||
|
:member_id, :user_id, NULL, :user_nm,
|
||||||
|
:dept_nm, :posit_nm, :tel_no, :email,
|
||||||
|
:auth_bc, 'Y', :rmks,
|
||||||
|
:cid, CURRENT_TIMESTAMP, :mid, CURRENT_TIMESTAMP, :oidc_sub
|
||||||
|
)
|
||||||
|
");
|
||||||
|
$insert->execute([
|
||||||
|
':member_id' => $defaultMemberId,
|
||||||
|
':user_id' => $userId,
|
||||||
|
':user_nm' => $userNm,
|
||||||
|
':dept_nm' => $userInfo->department ?? null,
|
||||||
|
':posit_nm' => $userInfo->title ?? null,
|
||||||
|
':tel_no' => $telNo,
|
||||||
|
':email' => $email,
|
||||||
|
':auth_bc' => $defaultAuth,
|
||||||
|
':rmks' => 'OIDC auto-registered',
|
||||||
|
':cid' => $userId,
|
||||||
|
':mid' => $userId,
|
||||||
|
':oidc_sub' => $sub
|
||||||
|
]);
|
||||||
|
|
||||||
|
$stmt = $pdo->prepare("
|
||||||
|
SELECT * FROM {$usersTable}
|
||||||
|
WHERE LOWER(user_id) = LOWER(:user_id)
|
||||||
|
LIMIT 1
|
||||||
|
");
|
||||||
|
$stmt->execute([':user_id' => $userId]);
|
||||||
|
$user = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. oidc_sub 업데이트 (최초 연동 시)
|
// 2. oidc_sub 업데이트 (최초 연동 시)
|
||||||
if (empty($user['oidc_sub']) && $sub) {
|
if (empty($user['oidc_sub']) && $sub) {
|
||||||
$upd = $pdo->prepare("UPDATE kngil.users SET oidc_sub = :sub WHERE user_id = :id");
|
$upd = $pdo->prepare("UPDATE {$usersTable} SET oidc_sub = :sub WHERE user_id = :id");
|
||||||
$upd->execute([':sub' => $sub, ':id' => $user['user_id']]);
|
$upd->execute([':sub' => $sub, ':id' => $user['user_id']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,20 +261,42 @@ try {
|
|||||||
'dept_nm' => $user['dept_nm'] ?? null,
|
'dept_nm' => $user['dept_nm'] ?? null,
|
||||||
'tel_no' => $user['tel_no'] ?? null,
|
'tel_no' => $user['tel_no'] ?? null,
|
||||||
'email' => $user['email'] ?? null,
|
'email' => $user['email'] ?? null,
|
||||||
|
'idp_name' => $name ?: null,
|
||||||
|
'idp_email' => $email ?? null,
|
||||||
|
'idp_id_token' => $idToken ?? null,
|
||||||
|
'idp_access_token' => $accessToken ?? null,
|
||||||
|
'idp_claims' => $jwtClaims ?? null,
|
||||||
'oidc_mode' => true // OIDC 로그인을 나타내는 플래그
|
'oidc_mode' => true // OIDC 로그인을 나타내는 플래그
|
||||||
];
|
];
|
||||||
|
|
||||||
// 로그인 완료 후 부모 창에 알리고 종료
|
session_write_close();
|
||||||
|
|
||||||
|
// 로그인 완료 후 부모 창에 알리고 종료 (팝업이 아닐 경우 메인으로 이동)
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
if (window.opener) {
|
(function () {
|
||||||
window.opener.postMessage({ type: 'OIDC_LOGIN_SUCCESS' }, window.location.origin);
|
const target = '/kngil/skin/index.php';
|
||||||
}
|
if (window.opener && !window.opener.closed) {
|
||||||
window.close();
|
try {
|
||||||
|
window.opener.postMessage({ type: 'OIDC_LOGIN_SUCCESS' }, window.location.origin);
|
||||||
|
} catch (e) {
|
||||||
|
// 팝업 차단/보안 정책으로 실패할 수 있어 무시합니다.
|
||||||
|
}
|
||||||
|
window.close();
|
||||||
|
setTimeout(function () {
|
||||||
|
window.location.href = target;
|
||||||
|
}, 300);
|
||||||
|
} else {
|
||||||
|
window.location.href = target;
|
||||||
|
}
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<noscript>
|
||||||
|
<a href="/kngil/skin/index.php">메인으로 이동</a>
|
||||||
|
</noscript>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@@ -5,6 +5,21 @@ $config = require_once dirname(__DIR__) . '/bbs/oidc_config.php';
|
|||||||
|
|
||||||
use Jumbojett\OpenIDConnectClient;
|
use Jumbojett\OpenIDConnectClient;
|
||||||
|
|
||||||
|
$requiredKeys = ['issuer', 'client_id', 'client_secret', 'redirect_url'];
|
||||||
|
$missingKeys = [];
|
||||||
|
foreach ($requiredKeys as $key) {
|
||||||
|
if (empty($config[$key])) {
|
||||||
|
$missingKeys[] = $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($missingKeys)) {
|
||||||
|
http_response_code(500);
|
||||||
|
header('Content-Type: text/plain; charset=utf-8');
|
||||||
|
echo 'OIDC 설정 누락: ' . implode(', ', $missingKeys);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$oidc = new OpenIDConnectClient(
|
$oidc = new OpenIDConnectClient(
|
||||||
$config['issuer'],
|
$config['issuer'],
|
||||||
$config['client_id'],
|
$config['client_id'],
|
||||||
@@ -17,4 +32,12 @@ $oidc->addScope($config['scopes']);
|
|||||||
// 필요한 경우 PKCE 활성화
|
// 필요한 경우 PKCE 활성화
|
||||||
// $oidc->setCodeChallengeMethod('S256');
|
// $oidc->setCodeChallengeMethod('S256');
|
||||||
|
|
||||||
$oidc->authenticate();
|
try {
|
||||||
|
$oidc->authenticate();
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
error_log($e->getMessage());
|
||||||
|
http_response_code(500);
|
||||||
|
header('Content-Type: text/plain; charset=utf-8');
|
||||||
|
echo 'OIDC 인증 중 오류가 발생했습니다.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ if (session_status() === PHP_SESSION_NONE) {
|
|||||||
1. 로그인 체크
|
1. 로그인 체크
|
||||||
========================= */
|
========================= */
|
||||||
if (empty($_SESSION['login'])) {
|
if (empty($_SESSION['login'])) {
|
||||||
header('Location: /kngil/skin/index.php');
|
header('Location: /');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
$dsn = "pgsql:host=172.16.9.44;port=5432;dbname=KNGIL";
|
require_once __DIR__ . '/env.php';
|
||||||
$user = "postgres";
|
kngil_load_env_once(dirname(__DIR__, 2) . '/.env');
|
||||||
$pass = "erpteam1!";
|
|
||||||
|
$dbHost = getenv('DB_HOST') ?: 'db';
|
||||||
|
$dbPort = getenv('DB_PORT') ?: '5432';
|
||||||
|
$dbName = getenv('DB_NAME') ?: 'kngil';
|
||||||
|
$dbUser = getenv('DB_USER') ?: 'postgres';
|
||||||
|
$dbPass = getenv('DB_PASS') ?: 'postgres';
|
||||||
|
|
||||||
|
$dsn = "pgsql:host={$dbHost};port={$dbPort};dbname={$dbName}";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$pdo = new PDO($dsn, $user, $pass, [
|
$pdo = new PDO($dsn, $dbUser, $dbPass, [
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
|
||||||
]);
|
]);
|
||||||
// echo "PostgreSQL 연결 성공 🎉";
|
// echo "PostgreSQL 연결 성공 🎉";
|
||||||
|
|||||||
59
kngil/bbs/env.php
Normal file
59
kngil/bbs/env.php
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
// .env 파일을 한 번만 읽어 환경변수로 주입합니다.
|
||||||
|
function kngil_load_env_once(string $path): void
|
||||||
|
{
|
||||||
|
static $loaded = false;
|
||||||
|
if ($loaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$loaded = true;
|
||||||
|
|
||||||
|
if (!is_file($path) || !is_readable($path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$lines = file($path, FILE_IGNORE_NEW_LINES);
|
||||||
|
if ($lines === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
$line = trim($line);
|
||||||
|
if ($line === '' || str_starts_with($line, '#')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str_starts_with($line, 'export ')) {
|
||||||
|
$line = substr($line, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
$pos = strpos($line, '=');
|
||||||
|
if ($pos === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$name = trim(substr($line, 0, $pos));
|
||||||
|
$value = trim(substr($line, $pos + 1));
|
||||||
|
|
||||||
|
if ($name === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(str_starts_with($value, '"') && str_ends_with($value, '"')) ||
|
||||||
|
(str_starts_with($value, "'") && str_ends_with($value, "'"))
|
||||||
|
) {
|
||||||
|
$value = substr($value, 1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$current = getenv($name);
|
||||||
|
if ($current !== false && $current !== '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
putenv($name . '=' . $value);
|
||||||
|
$_ENV[$name] = $value;
|
||||||
|
$_SERVER[$name] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
// /kngil/bbs/oidc_config.php
|
// /kngil/bbs/oidc_config.php
|
||||||
|
require_once __DIR__ . '/env.php';
|
||||||
|
kngil_load_env_once(dirname(__DIR__, 2) . '/.env');
|
||||||
|
|
||||||
|
$issuer = getenv('OIDC_ISSUER') ?: '';
|
||||||
|
$clientId = getenv('OIDC_CLIENT_ID') ?: '';
|
||||||
|
$clientSecret = getenv('OIDC_CLIENT_SECRET') ?: '';
|
||||||
|
$redirectUrl = getenv('OIDC_REDIRECT_URL') ?: '';
|
||||||
|
$scopesRaw = getenv('OIDC_SCOPES');
|
||||||
|
$scopes = ['openid'];
|
||||||
|
if ($scopesRaw !== false && $scopesRaw !== '') {
|
||||||
|
$scopes = array_values(array_filter(preg_split('/\s*,\s*|\s+/', $scopesRaw)));
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'issuer' => 'https://sss.hmac.kr/oidc', // 예: https://idp.example.com/auth/realms/master
|
'issuer' => 'https://api.descope.com/v1/apps/P2x26KgEwOu0xIwgNZutJjIZc1zz', // 예: https://idp.example.com/auth/realms/master
|
||||||
'client_id' => 'cc6f2f41-2705-4c7d-bffc-24c1d6b484f1',
|
'client_id' => 'UDJ4MjZLZ0V3T3UweEl3Z05adXRKaklaYzF6ejpUUEEzOTVtSmx5MXhiczFwZWxrUHdDVFlvU2hiYXc=',
|
||||||
'client_secret' => 'ebjOE4I-gLnANV5KY623hClSAy',
|
'client_secret' => 'uTjiKweHYUINalroA1LVu9OacbEEMPtPbfFITfHu3r5',
|
||||||
'redirect_url' => "https://kngil.hmac.kr/kngil/auth/oidc-callback.php",
|
'redirect_url' => "https://kngil.hmac.kr/kngil/auth/oidc-callback.php",
|
||||||
'scopes' => ['openid', 'profile', 'email'],
|
'scopes' => ['openid'],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ ini_set('display_errors', 1);
|
|||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
header("Content-Type: application/json; charset=utf-8");
|
header("Content-Type: application/json; charset=utf-8");
|
||||||
|
|
||||||
|
// 기능 비활성화 (PostgreSQL만 사용)
|
||||||
|
http_response_code(410);
|
||||||
|
echo json_encode([
|
||||||
|
"status" => "disabled",
|
||||||
|
"message" => "해당 기능은 현재 비활성화되어 있습니다."
|
||||||
|
]);
|
||||||
|
exit;
|
||||||
|
|
||||||
/* -----------------------------------------------------
|
/* -----------------------------------------------------
|
||||||
🔵 DB 연결
|
🔵 DB 연결
|
||||||
----------------------------------------------------- */
|
----------------------------------------------------- */
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
@charset "UTF-8";
|
@charset "UTF-8";
|
||||||
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap");
|
||||||
|
:root {
|
||||||
|
--color-primary: #f95523;
|
||||||
|
--color-primary-border: #ca3f14;
|
||||||
|
}
|
||||||
html {
|
html {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ userGrid
|
|||||||
document.getElementById('detailCard').style.display = 'block'
|
document.getElementById('detailCard').style.display = 'block'
|
||||||
|
|
||||||
// 하단 사용자 로드
|
// 하단 사용자 로드
|
||||||
// fetch(`/kngil/bbs/adm.php?action=user_list&member_id=${record.member_id}`)
|
// fetch(`/admin/api/super?action=user_list&member_id=${record.member_id}`)
|
||||||
// .then(res => res.json())
|
// .then(res => res.json())
|
||||||
// .then(d => {
|
// .then(d => {
|
||||||
// if (d.status !== 'success') {
|
// if (d.status !== 'success') {
|
||||||
@@ -243,7 +243,7 @@ function formatBizNo(value) {
|
|||||||
상단 회사 목록 로드
|
상단 회사 목록 로드
|
||||||
---------------------------------------- */
|
---------------------------------------- */
|
||||||
function loadCompanies() {
|
function loadCompanies() {
|
||||||
fetch('/kngil/bbs/adm.php')
|
fetch('/admin/api/super')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (!json.records) return
|
if (!json.records) return
|
||||||
@@ -340,7 +340,7 @@ export function bindSaveButton() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm.php?action=save', {
|
fetch('/admin/api/super?action=save', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ function destroyGrid(name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadBaseCode(mainCd) {
|
function loadBaseCode(mainCd) {
|
||||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.status !== 'success') {
|
if (json.status !== 'success') {
|
||||||
@@ -144,7 +144,7 @@ export async function createUserGrid(boxId, options = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadUsers() {
|
function loadUsers() {
|
||||||
fetch('/kngil/bbs/adm_comp.php')
|
fetch('/admin/api/company')
|
||||||
.then(res => res.text()) // 🔥 먼저 text로 확인
|
.then(res => res.text()) // 🔥 먼저 text로 확인
|
||||||
.then(text => {
|
.then(text => {
|
||||||
try {
|
try {
|
||||||
@@ -168,7 +168,7 @@ export function loadUsersByMember(member_id) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php')
|
fetch('/admin/api/company')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
g.clear()
|
g.clear()
|
||||||
@@ -198,7 +198,7 @@ export function setUserGridMode(mode = 'view') {
|
|||||||
|
|
||||||
export function loadData({ loadSummary = true } = {}) {
|
export function loadData({ loadSummary = true } = {}) {
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php')
|
fetch('/admin/api/company')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(async d => {
|
.then(async d => {
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ document.getElementById('btnSave_comp')?.addEventListener('click', () => {
|
|||||||
console.log('INSERTS', inserts)
|
console.log('INSERTS', inserts)
|
||||||
console.log('UPDATES', updates)
|
console.log('UPDATES', updates)
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php', {
|
fetch('/admin/api/company', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -408,7 +408,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
|||||||
w2confirm(`선택한 ${ids.length}명의 사용자를 삭제하시겠습니까?`)
|
w2confirm(`선택한 ${ids.length}명의 사용자를 삭제하시겠습니까?`)
|
||||||
.yes(() => {
|
.yes(() => {
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php', {
|
fetch('/admin/api/company', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -436,7 +436,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function loadTotalArea(memberId) {
|
function loadTotalArea(memberId) {
|
||||||
return fetch(`/kngil/bbs/adm_comp.php?action=total_area&member_id=${memberId}`)
|
return fetch(`/admin/api/company?action=total_area&member_id=${memberId}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.status !== 'success') {
|
if (json.status !== 'success') {
|
||||||
@@ -467,7 +467,7 @@ function doSearch() {
|
|||||||
}
|
}
|
||||||
// ⚠️ type === 'id' 는 DB로 안 보냄
|
// ⚠️ type === 'id' 는 DB로 안 보냄
|
||||||
|
|
||||||
fetch(`/kngil/bbs/adm_comp.php?action=list`
|
fetch(`/admin/api/company?action=list`
|
||||||
+ `&user_nm=${encodeURIComponent(p_user_nm)}`
|
+ `&user_nm=${encodeURIComponent(p_user_nm)}`
|
||||||
+ `&dept_nm=${encodeURIComponent(p_dept_nm)}`
|
+ `&dept_nm=${encodeURIComponent(p_dept_nm)}`
|
||||||
+ `&use_yn=${useYn}`
|
+ `&use_yn=${useYn}`
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ function destroyGrid(name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadBaseCode(mainCd) {
|
function loadBaseCode(mainCd) {
|
||||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.status !== 'success') {
|
if (json.status !== 'success') {
|
||||||
@@ -252,7 +252,7 @@ export function loadUsersByMember(memberId) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(`/kngil/bbs/adm_comp.php?action=list&member_id=${memberId}`)
|
fetch(`/admin/api/company?action=list&member_id=${memberId}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(d => {
|
.then(d => {
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ export function setUserGridMode(mode = 'view') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function loadData({ loadSummary = true } = {}) {
|
export function loadData({ loadSummary = true } = {}) {
|
||||||
fetch('/kngil/bbs/adm_comp.php?action=list')
|
fetch('/admin/api/company?action=list')
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(async d => {
|
.then(async d => {
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ document.getElementById('btnSave_comp')?.addEventListener('click', () => {
|
|||||||
console.log('INSERTS', inserts)
|
console.log('INSERTS', inserts)
|
||||||
console.log('UPDATES', updates)
|
console.log('UPDATES', updates)
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php', {
|
fetch('/admin/api/company', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -490,7 +490,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
|||||||
w2confirm(`선택한 ${ids.length}명의 사용자를 삭제하시겠습니까?`)
|
w2confirm(`선택한 ${ids.length}명의 사용자를 삭제하시겠습니까?`)
|
||||||
.yes(() => {
|
.yes(() => {
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php', {
|
fetch('/admin/api/company', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -518,7 +518,7 @@ document.getElementById('btnDelete')?.addEventListener('click', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function loadTotalArea(memberId) {
|
function loadTotalArea(memberId) {
|
||||||
return fetch(`/kngil/bbs/adm_comp.php?action=total_area`)
|
return fetch(`/admin/api/company?action=total_area`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.status !== 'success') {
|
if (json.status !== 'success') {
|
||||||
@@ -549,7 +549,7 @@ function doSearch() {
|
|||||||
}
|
}
|
||||||
// ⚠️ type === 'id' 는 DB로 안 보냄
|
// ⚠️ type === 'id' 는 DB로 안 보냄
|
||||||
|
|
||||||
fetch(`/kngil/bbs/adm_comp.php?action=list`
|
fetch(`/admin/api/company?action=list`
|
||||||
+ `&user_nm=${encodeURIComponent(p_user_nm)}`
|
+ `&user_nm=${encodeURIComponent(p_user_nm)}`
|
||||||
+ `&dept_nm=${encodeURIComponent(p_dept_nm)}`
|
+ `&dept_nm=${encodeURIComponent(p_dept_nm)}`
|
||||||
+ `&use_yn=${useYn}`
|
+ `&use_yn=${useYn}`
|
||||||
@@ -671,7 +671,7 @@ function openBulkCreatePopup(memberId) {
|
|||||||
|
|
||||||
function runBulkCreate(memberId, csvUrl) {
|
function runBulkCreate(memberId, csvUrl) {
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_comp.php', {
|
fetch('/admin/api/company', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -772,7 +772,7 @@ function loadDataByMemberId(memberId) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(`/kngil/bbs/adm_comp.php?action=list&member_id=${encodeURIComponent(memberId)}`)
|
fetch(`/admin/api/company?action=list&member_id=${encodeURIComponent(memberId)}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(async d => {
|
.then(async d => {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function destroyGrid(name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadBaseCode(mainCd) {
|
function loadBaseCode(mainCd) {
|
||||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.status !== 'success') {
|
if (json.status !== 'success') {
|
||||||
@@ -101,7 +101,7 @@ export function openfaqPopup() {
|
|||||||
|
|
||||||
// 3. 브라우저 기본 확인창 사용 (가장 확실함)
|
// 3. 브라우저 기본 확인창 사용 (가장 확실함)
|
||||||
if (confirm(`선택한 ${ids.length}개의 상품을 삭제하시겠습니까?`)) {
|
if (confirm(`선택한 ${ids.length}개의 상품을 삭제하시겠습니까?`)) {
|
||||||
fetch('/kngil/bbs/adm_faq_popup_delete.php', {
|
fetch('/admin/api/faq/delete', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ action: 'delete', ids: ids })
|
body: JSON.stringify({ action: 'delete', ids: ids })
|
||||||
@@ -170,7 +170,7 @@ export function openfaqPopup() {
|
|||||||
console.log('INSERTS', inserts)
|
console.log('INSERTS', inserts)
|
||||||
console.log('UPDATES', updates)
|
console.log('UPDATES', updates)
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_faq_popup_save.php', {
|
fetch('/admin/api/faq/save', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -271,7 +271,7 @@ async function loadfaqData() {
|
|||||||
try {
|
try {
|
||||||
w2ui.faqGrid.lock('조회 중...', true);
|
w2ui.faqGrid.lock('조회 중...', true);
|
||||||
|
|
||||||
const response = await fetch('/kngil/bbs/adm_faq_popup.php'); // PHP 파일 호출
|
const response = await fetch('/admin/api/faq'); // PHP 파일 호출
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
w2ui.faqGrid.clear();
|
w2ui.faqGrid.clear();
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { w2grid, w2ui, w2popup, w2alert } from 'https://cdn.jsdelivr.net/gh/vitmalina/w2ui@master/dist/w2ui.es6.min.js'
|
import { w2grid, w2ui, w2popup, w2alert } from 'https://cdn.jsdelivr.net/gh/vitmalina/w2ui@master/dist/w2ui.es6.min.js'
|
||||||
|
|
||||||
const USE_YN_ITEMS = [
|
const USE_YN_ITEMS = [
|
||||||
{ id: 'Y', text: '사용' },
|
{ id: 'Y', text: '사용' },
|
||||||
{ id: 'N', text: '미사용' }
|
{ id: 'N', text: '미사용' }
|
||||||
]
|
]
|
||||||
/* -------------------------------------------------
|
/* -------------------------------------------------
|
||||||
공통 유틸
|
공통 유틸
|
||||||
@@ -14,7 +14,7 @@ function destroyGrid(name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadBaseCode(mainCd) {
|
function loadBaseCode(mainCd) {
|
||||||
return fetch(`/kngil/bbs/adm_comp.php?action=base_code&main_cd=${mainCd}`)
|
return fetch(`/admin/api/company?action=base_code&main_cd=${mainCd}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
if (json.status !== 'success') {
|
if (json.status !== 'success') {
|
||||||
@@ -60,7 +60,7 @@ export function openProductPopup() {
|
|||||||
createProductGrid('#productGrid');
|
createProductGrid('#productGrid');
|
||||||
|
|
||||||
|
|
||||||
// 1. 추가 버튼
|
// 1. 추가 버튼
|
||||||
document.getElementById('prodAdd').onclick = () => {
|
document.getElementById('prodAdd').onclick = () => {
|
||||||
const g = w2ui.productGrid
|
const g = w2ui.productGrid
|
||||||
if (!g) return
|
if (!g) return
|
||||||
@@ -106,33 +106,33 @@ export function openProductPopup() {
|
|||||||
|
|
||||||
// 3. 브라우저 기본 확인창 사용 (가장 확실함)
|
// 3. 브라우저 기본 확인창 사용 (가장 확실함)
|
||||||
if (confirm(`선택한 ${ids.length}개의 상품을 삭제하시겠습니까?`)) {
|
if (confirm(`선택한 ${ids.length}개의 상품을 삭제하시겠습니까?`)) {
|
||||||
fetch('/kngil/bbs/adm_product_popup_delete.php', {
|
fetch('/admin/api/product/delete', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ action: 'delete', ids: ids })
|
body: JSON.stringify({ action: 'delete', ids: ids })
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
// 서버 응답이 오면 일단 텍스트로 받아서 확인
|
// 서버 응답이 오면 일단 텍스트로 받아서 확인
|
||||||
return res.text();
|
return res.text();
|
||||||
})
|
})
|
||||||
.then(text => {
|
.then(text => {
|
||||||
try {
|
try {
|
||||||
const json = JSON.parse(text);
|
const json = JSON.parse(text);
|
||||||
if (json.status === 'success') {
|
if (json.status === 'success') {
|
||||||
alert('삭제 완료');
|
alert('삭제 완료');
|
||||||
loadProductData(); // 목록 새로고침
|
loadProductData(); // 목록 새로고침
|
||||||
} else {
|
} else {
|
||||||
alert(json.message || '삭제 실패');
|
alert(json.message || '삭제 실패');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('응답 파싱 에러:', text);
|
||||||
|
alert('서버 응답 처리 중 오류가 발생했습니다.');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
})
|
||||||
console.error('응답 파싱 에러:', text);
|
.catch(err => {
|
||||||
alert('서버 응답 처리 중 오류가 발생했습니다.');
|
console.error('통신 에러:', err);
|
||||||
}
|
alert('서버와 통신할 수 없습니다.');
|
||||||
})
|
});
|
||||||
.catch(err => {
|
|
||||||
console.error('통신 에러:', err);
|
|
||||||
alert('서버와 통신할 수 없습니다.');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -163,12 +163,12 @@ export function openProductPopup() {
|
|||||||
} else {
|
} else {
|
||||||
// UPDATE → PK + 변경 컬럼
|
// UPDATE → PK + 변경 컬럼
|
||||||
updates.push({
|
updates.push({
|
||||||
itm_cd : merged.itm_cd,
|
itm_cd: merged.itm_cd,
|
||||||
itm_nm : merged.itm_nm,
|
itm_nm: merged.itm_nm,
|
||||||
area : merged.area,
|
area: merged.area,
|
||||||
itm_amt: merged.itm_amt,
|
itm_amt: merged.itm_amt,
|
||||||
use_yn : merged.use_yn?.id || merged.use_yn,
|
use_yn: merged.use_yn?.id || merged.use_yn,
|
||||||
rmks : merged.rmks
|
rmks: merged.rmks
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ export function openProductPopup() {
|
|||||||
console.log('INSERTS', inserts)
|
console.log('INSERTS', inserts)
|
||||||
console.log('UPDATES', updates)
|
console.log('UPDATES', updates)
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_product_popup_save.php', {
|
fetch('/admin/api/product/save', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -186,26 +186,26 @@ export function openProductPopup() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(res => {
|
.then(res => {
|
||||||
// 서버가 준 응답이 괜찮은지 확인
|
// 서버가 준 응답이 괜찮은지 확인
|
||||||
if (!res.ok) throw new Error('서버 응답 오류');
|
if (!res.ok) throw new Error('서버 응답 오류');
|
||||||
return res.json(); // 처음부터 깔끔하게 데이터로 읽기
|
return res.json(); // 처음부터 깔끔하게 데이터로 읽기
|
||||||
})
|
})
|
||||||
|
|
||||||
.then(json => {
|
.then(json => {
|
||||||
// 이제 json.status를 바로 쓸 수 있습니다.
|
// 이제 json.status를 바로 쓸 수 있습니다.
|
||||||
if (json.status === 'success') {
|
if (json.status === 'success') {
|
||||||
w2alert('저장 완료');
|
w2alert('저장 완료');
|
||||||
w2ui.productGrid.save(); // 빨간 삼각형 없애기
|
w2ui.productGrid.save(); // 빨간 삼각형 없애기
|
||||||
loadProductData(); // 목록 새로고침
|
loadProductData(); // 목록 새로고침
|
||||||
} else {
|
} else {
|
||||||
w2alert(json.message || '저장 실패');
|
w2alert(json.message || '저장 실패');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error('에러 발생:', err);
|
console.error('에러 발생:', err);
|
||||||
w2alert('처리 중 오류가 발생했습니다.');
|
w2alert('처리 중 오류가 발생했습니다.');
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -230,27 +230,27 @@ export async function createProductGrid(boxId) {
|
|||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
|
|
||||||
{ field: 'itm_cd', text: '상품코드', size: '80px',style: 'text-align: center', attr: 'align=center', editable: { type: 'text' } ,sortable: true}, // name 아님!
|
{ field: 'itm_cd', text: '상품코드', size: '80px', style: 'text-align: center', attr: 'align=center', editable: { type: 'text' }, sortable: true }, // name 아님!
|
||||||
{ field: 'itm_nm', text: '상품명', size: '120px', style: 'text-align: center', editable: { type: 'text' } ,sortable: true}, // name 아님!
|
{ field: 'itm_nm', text: '상품명', size: '120px', style: 'text-align: center', editable: { type: 'text' }, sortable: true }, // name 아님!
|
||||||
{ field: 'area', text: '제공량', size: '100px', attr: 'align=center',render: 'number:0' , editable: { type: 'float' } ,sortable: true}, // volume 아님!
|
{ field: 'area', text: '제공량', size: '100px', attr: 'align=center', render: 'number:0', editable: { type: 'float' }, sortable: true }, // volume 아님!
|
||||||
{ field: 'itm_amt', text: '단가', size: '120px', attr: 'align=center',render: 'number:0', editable: { type: 'int' } ,sortable: true}, //
|
{ field: 'itm_amt', text: '단가', size: '120px', attr: 'align=center', render: 'number:0', editable: { type: 'int' }, sortable: true }, //
|
||||||
{
|
{
|
||||||
field: 'use_yn',
|
field: 'use_yn',
|
||||||
text: '사용여부',
|
text: '사용여부',
|
||||||
size: '80px',
|
size: '80px',
|
||||||
attr: 'align=center',
|
attr: 'align=center',
|
||||||
editable: {
|
editable: {
|
||||||
type: 'list',
|
type: 'list',
|
||||||
items: USE_YN_ITEMS,
|
items: USE_YN_ITEMS,
|
||||||
showAll: true,
|
showAll: true,
|
||||||
openOnFocus: true
|
openOnFocus: true
|
||||||
|
},
|
||||||
|
render(record, extra) {
|
||||||
|
return extra?.value?.text || ''
|
||||||
|
},
|
||||||
|
sortable: true
|
||||||
},
|
},
|
||||||
render(record, extra) {
|
{ field: 'rmks', text: '비고', size: '200px', editable: { type: 'text' }, sortable: true } // memo 아님!
|
||||||
return extra?.value?.text || ''
|
|
||||||
},
|
|
||||||
sortable: true
|
|
||||||
},
|
|
||||||
{ field: 'rmks', text: '비고', size: '200px', editable: { type: 'text' } ,sortable: true} // memo 아님!
|
|
||||||
],
|
],
|
||||||
records: [] // 처음엔 비워둠
|
records: [] // 처음엔 비워둠
|
||||||
});
|
});
|
||||||
@@ -268,9 +268,7 @@ async function loadProductData() {
|
|||||||
w2ui.productGrid.lock('조회 중...', true);
|
w2ui.productGrid.lock('조회 중...', true);
|
||||||
|
|
||||||
const response = await fetch('/kngil/bbs/adm_product_popup.php'); // PHP 파일 호출
|
const response = await fetch('/kngil/bbs/adm_product_popup.php'); // PHP 파일 호출
|
||||||
let data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
data = normalizeProductUseYn(data)
|
|
||||||
|
|
||||||
w2ui.productGrid.clear();
|
w2ui.productGrid.clear();
|
||||||
w2ui.productGrid.add(data);
|
w2ui.productGrid.add(data);
|
||||||
@@ -284,11 +282,11 @@ async function loadProductData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function normalizeProductUseYn(records) {
|
function normalizeProductUseYn(records) {
|
||||||
return records.map(r => {
|
return records.map(r => {
|
||||||
const item = USE_YN_ITEMS.find(u => u.id === r.use_yn)
|
const item = USE_YN_ITEMS.find(u => u.id === r.use_yn)
|
||||||
return {
|
return {
|
||||||
...r,
|
...r,
|
||||||
use_yn: item || null
|
use_yn: item || null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ async function loadPurchaseHistoryData() {
|
|||||||
searchParams.append('fbuy_dt', sfdt);
|
searchParams.append('fbuy_dt', sfdt);
|
||||||
searchParams.append('tbuy_dt', stdt);
|
searchParams.append('tbuy_dt', stdt);
|
||||||
|
|
||||||
const response = await fetch('/kngil/bbs/adm_purch_popup.php', {
|
const response = await fetch('/admin/api/purchase-history', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
body: searchParams
|
body: searchParams
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ function addServiceFromProduct(p) {
|
|||||||
------------------------------------------------- */
|
------------------------------------------------- */
|
||||||
function loadExistingPurchase(memberId, buyDate) {
|
function loadExistingPurchase(memberId, buyDate) {
|
||||||
|
|
||||||
fetch(`/kngil/bbs/adm_service.php?member_id=${memberId}&buy_date=${buyDate}`)
|
fetch(`/admin/api/service?member_id=${memberId}&buy_date=${buyDate}`)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
|
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ function deleteServiceImmediately(row) {
|
|||||||
sq_no: row.sq_no
|
sq_no: row.sq_no
|
||||||
})
|
})
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_service.php', {
|
fetch('/admin/api/service', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -484,7 +484,7 @@ function isServiceItem(r) {
|
|||||||
------------------------------------------------- */
|
------------------------------------------------- */
|
||||||
function loadExistingPurchase(memberId, buyDate) {
|
function loadExistingPurchase(memberId, buyDate) {
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_service.php', {
|
fetch('/admin/api/service', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -647,7 +647,7 @@ function saveService(ctx) {
|
|||||||
_deleted: !!r._deleted
|
_deleted: !!r._deleted
|
||||||
}))
|
}))
|
||||||
|
|
||||||
fetch('/kngil/bbs/adm_service.php', {
|
fetch('/admin/api/service', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ async function loadUseHistoryData(memberId = ''){
|
|||||||
searchParams.append('fuse_dt', sfdt);
|
searchParams.append('fuse_dt', sfdt);
|
||||||
searchParams.append('tuse_dt', stdt);
|
searchParams.append('tuse_dt', stdt);
|
||||||
|
|
||||||
const response = await fetch('/kngil/bbs/adm_use_history.php', {
|
const response = await fetch('/admin/api/use-history', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
body: searchParams
|
body: searchParams
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -894,6 +894,10 @@ function join() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function login() {
|
function login() {
|
||||||
|
if (typeof window.openOidcLogin === "function") {
|
||||||
|
window.openOidcLogin();
|
||||||
|
return;
|
||||||
|
}
|
||||||
$(".popup_wrap").hide();
|
$(".popup_wrap").hide();
|
||||||
//새로고침 없이 다시 팝업창 열었을때 자동 입력된 id, pw 제거
|
//새로고침 없이 다시 팝업창 열었을때 자동 입력된 id, pw 제거
|
||||||
$("#login_id").val("");
|
$("#login_id").val("");
|
||||||
@@ -906,6 +910,12 @@ function login() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mypage01() {
|
function mypage01() {
|
||||||
|
const raw = (window.IDP_SERVICE_URL || "").trim();
|
||||||
|
if (raw) {
|
||||||
|
const url = raw.replace(/\/+$/, "") + "/profile";
|
||||||
|
window.open(url, "idp_profile", "noopener,noreferrer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
$(".popup_wrap").hide();
|
$(".popup_wrap").hide();
|
||||||
$(".btn_close").show();
|
$(".btn_close").show();
|
||||||
$("#pop_mypage01").show(0, function () {
|
$("#pop_mypage01").show(0, function () {
|
||||||
|
|||||||
@@ -35,23 +35,6 @@ if (form) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// OIDC 로그인 처리
|
|
||||||
const btnOidc = document.getElementById('btn_oidc_login')
|
|
||||||
if (btnOidc) {
|
|
||||||
btnOidc.addEventListener('click', () => {
|
|
||||||
const width = 500;
|
|
||||||
const height = 600;
|
|
||||||
const left = (window.screen.width / 2) - (width / 2);
|
|
||||||
const top = (window.screen.height / 2) - (height / 2);
|
|
||||||
|
|
||||||
window.open(
|
|
||||||
'/kngil/auth/oidc-login.php',
|
|
||||||
'oidc_login_popup',
|
|
||||||
`width=${width},height=${height},left=${left},top=${top},scrollbars=yes`
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 팝업으로부터의 메시지 수신 (로그인 성공 시 새로고침)
|
// 팝업으로부터의 메시지 수신 (로그인 성공 시 새로고침)
|
||||||
window.addEventListener('message', (event) => {
|
window.addEventListener('message', (event) => {
|
||||||
// 보안을 위해 실제 서비스에서는 event.origin을 체크하는 것이 좋습니다.
|
// 보안을 위해 실제 서비스에서는 event.origin을 체크하는 것이 좋습니다.
|
||||||
|
|||||||
@@ -20,7 +20,27 @@ function hide(id) {
|
|||||||
마이페이지 1단계 (비밀번호 인증)
|
마이페이지 1단계 (비밀번호 인증)
|
||||||
- 헤더에서 호출
|
- 헤더에서 호출
|
||||||
========================= */
|
========================= */
|
||||||
|
function getIdpProfileUrl() {
|
||||||
|
const raw = (window.IDP_SERVICE_URL || '').trim()
|
||||||
|
if (!raw) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return raw.replace(/\/+$/, '') + '/profile'
|
||||||
|
}
|
||||||
|
|
||||||
|
function openIdpProfile() {
|
||||||
|
const url = getIdpProfileUrl()
|
||||||
|
if (!url) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
window.open(url, 'idp_profile', 'noopener,noreferrer')
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
window.mypage01 = function () {
|
window.mypage01 = function () {
|
||||||
|
if (openIdpProfile()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!window.IS_LOGIN) {
|
if (!window.IS_LOGIN) {
|
||||||
if (typeof window.login === 'function') {
|
if (typeof window.login === 'function') {
|
||||||
window.login()
|
window.login()
|
||||||
|
|||||||
@@ -894,6 +894,10 @@ function join() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function login() {
|
function login() {
|
||||||
|
if (typeof window.openOidcLogin === "function") {
|
||||||
|
window.openOidcLogin();
|
||||||
|
return;
|
||||||
|
}
|
||||||
$(".popup_wrap").hide();
|
$(".popup_wrap").hide();
|
||||||
//새로고침 없이 다시 팝업창 열었을때 자동 입력된 id, pw 제거
|
//새로고침 없이 다시 팝업창 열었을때 자동 입력된 id, pw 제거
|
||||||
$("#login_id").val("");
|
$("#login_id").val("");
|
||||||
@@ -906,6 +910,12 @@ function login() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mypage01() {
|
function mypage01() {
|
||||||
|
const raw = (window.IDP_SERVICE_URL || "").trim();
|
||||||
|
if (raw) {
|
||||||
|
const url = raw.replace(/\/+$/, "") + "/profile";
|
||||||
|
window.open(url, "idp_profile", "noopener,noreferrer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
$(".popup_wrap").hide();
|
$(".popup_wrap").hide();
|
||||||
$(".btn_close").show();
|
$(".btn_close").show();
|
||||||
$("#pop_mypage01").show(0, function () {
|
$("#pop_mypage01").show(0, function () {
|
||||||
|
|||||||
0
kngil/log/join.log
Normal file → Executable file
0
kngil/log/join.log
Normal file → Executable file
@@ -3,8 +3,28 @@ if (session_status() === PHP_SESSION_NONE) {
|
|||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../bbs/env.php';
|
||||||
|
kngil_load_env_once(dirname(__DIR__, 2) . '/.env');
|
||||||
|
|
||||||
$isLogin = isset($_SESSION['login']);
|
$isLogin = isset($_SESSION['login']);
|
||||||
$auth = $_SESSION['login']['auth_bc'] ?? '';
|
$auth = $_SESSION['login']['auth_bc'] ?? '';
|
||||||
|
$idpServiceUrl = getenv('IDP_SERVICE_URL') ?: '';
|
||||||
|
$loginName = $_SESSION['login']['idp_name'] ?? ($_SESSION['login']['user_nm'] ?? '');
|
||||||
|
$loginEmail = $_SESSION['login']['idp_email'] ?? ($_SESSION['login']['email'] ?? '');
|
||||||
|
$displayName = $loginName ?: ($loginEmail ?: '');
|
||||||
|
$displayEmail = $loginEmail;
|
||||||
|
if ($displayName === 'Unknown') {
|
||||||
|
$displayName = '';
|
||||||
|
}
|
||||||
|
if ($displayEmail === 'Unknown') {
|
||||||
|
$displayEmail = '';
|
||||||
|
}
|
||||||
|
if ($displayName === $displayEmail) {
|
||||||
|
$displayEmail = '';
|
||||||
|
}
|
||||||
|
if ($displayName === '') {
|
||||||
|
$displayName = '사용자';
|
||||||
|
}
|
||||||
|
|
||||||
// 권한 그룹
|
// 권한 그룹
|
||||||
$isSuperAdmin = in_array($auth, ['BS100100', 'BS100200']);
|
$isSuperAdmin = in_array($auth, ['BS100100', 'BS100200']);
|
||||||
@@ -30,6 +50,53 @@ $isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400
|
|||||||
.icon-btn:hover img {
|
.icon-btn:hover img {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
.auth-status {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-oidc-top {
|
||||||
|
--color-primary: #f95523;
|
||||||
|
--color-primary-border: #ca3f14;
|
||||||
|
background: var(--color-primary, #f95523);
|
||||||
|
border: 1px solid var(--color-primary-border, #ca3f14);
|
||||||
|
color: #fff;
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-oidc-top:hover {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-user {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.btn-logout-top {
|
||||||
|
--color-secondary: #3a3a3a;
|
||||||
|
--color-secondary-border: #2a2a2a;
|
||||||
|
background: var(--color-secondary, #3a3a3a);
|
||||||
|
border: 1px solid var(--color-secondary-border, #2a2a2a);
|
||||||
|
color: #fff;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-left: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-logout-top:hover {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
/* 툴팁 래퍼 */
|
/* 툴팁 래퍼 */
|
||||||
.tooltip {
|
.tooltip {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -78,6 +145,7 @@ $isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
window.IS_LOGIN = <?= isset($_SESSION['login']) ? 'true' : 'false' ?>;
|
window.IS_LOGIN = <?= isset($_SESSION['login']) ? 'true' : 'false' ?>;
|
||||||
|
window.IDP_SERVICE_URL = <?= json_encode($idpServiceUrl, JSON_UNESCAPED_SLASHES) ?>;
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -85,16 +153,29 @@ $isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400
|
|||||||
<div class="header-wrap">
|
<div class="header-wrap">
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<h1>
|
<h1>
|
||||||
<a href="/kngil/skin/index.php">KNGIL</a>
|
<a href="/">KNGIL</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
|
<div class="auth-status">
|
||||||
|
<?php if ($isLogin): ?>
|
||||||
|
<span class="auth-user">
|
||||||
|
<?= htmlspecialchars($displayName) ?>
|
||||||
|
<?php if ($displayEmail): ?>
|
||||||
|
(<?= htmlspecialchars($displayEmail) ?>)
|
||||||
|
<?php endif; ?>
|
||||||
|
</span>
|
||||||
|
<a href="/kngil/bbs/logout.php" class="btn-logout-top">로그아웃</a>
|
||||||
|
<?php else: ?>
|
||||||
|
<button type="button" class="btn-oidc-top" data-oidc-login>[바론 통합로그인]</button>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php if ($isLogin): ?>
|
<?php if ($isLogin): ?>
|
||||||
|
|
||||||
<!-- 통합 회원관리 (관리자/개발자만) -->
|
<!-- 통합 회원관리 (관리자/개발자만) -->
|
||||||
<?php if ($isSuperAdmin): ?>
|
<?php if ($isSuperAdmin): ?>
|
||||||
<a href="/kngil/skin/adm.php"
|
<a href="/admin"
|
||||||
class="icon-btn tooltip">
|
class="icon-btn tooltip">
|
||||||
<img src="/kngil/img/ico/ico_super_admin.svg" class="header-icon" alt="통합 회원관리">
|
<img src="/kngil/img/ico/ico_super_admin.svg" class="header-icon" alt="통합 회원관리">
|
||||||
<span class="tooltip-text">통합 회원관리</span>
|
<span class="tooltip-text">통합 회원관리</span>
|
||||||
@@ -103,7 +184,7 @@ $isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400
|
|||||||
|
|
||||||
<!-- 회사 관리자 (관리자/개발자/메인/서브) -->
|
<!-- 회사 관리자 (관리자/개발자/메인/서브) -->
|
||||||
<?php if ($isCompanyAdmin): ?>
|
<?php if ($isCompanyAdmin): ?>
|
||||||
<a href="/kngil/skin/adm_comp.php"
|
<a href="/admin/company"
|
||||||
class="icon-btn tooltip">
|
class="icon-btn tooltip">
|
||||||
<img src="/kngil/img/ico/ico_company_admin.svg" class="header-icon" alt="회사 관리자">
|
<img src="/kngil/img/ico/ico_company_admin.svg" class="header-icon" alt="회사 관리자">
|
||||||
<span class="tooltip-text">회사 관리자</span>
|
<span class="tooltip-text">회사 관리자</span>
|
||||||
@@ -112,30 +193,23 @@ $isCompanyAdmin = in_array($auth, ['BS100100', 'BS100200', 'BS100300', 'BS100400
|
|||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<!-- 기존 사용자 메뉴 -->
|
<?php if ($isLogin): ?>
|
||||||
<div class="menu-box">
|
<!-- 기존 사용자 메뉴 -->
|
||||||
<button class="menu-user">
|
<div class="menu-box">
|
||||||
<img src="/kngil/img/ico/ico_user.svg" alt="user">
|
<button class="menu-user">
|
||||||
</button>
|
<img src="/kngil/img/ico/ico_user.svg" alt="user">
|
||||||
|
</button>
|
||||||
|
|
||||||
<ul class="menu-list">
|
<ul class="menu-list">
|
||||||
<!-- 비로그인 -->
|
<li>
|
||||||
<li class="<?= $isLogin ? 'd-none' : '' ?>">
|
<a class="my-join" href="javascript:mypage01()">마이페이지</a>
|
||||||
<a class="my-join" href="javascript:agreement();">회원가입</a>
|
</li>
|
||||||
</li>
|
<li>
|
||||||
<li class="<?= $isLogin ? 'd-none' : '' ?>">
|
<a class="my-login" href="/kngil/bbs/logout.php">로그아웃</a>
|
||||||
<a class="my-login" href="javascript:login();">로그인</a>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
|
</div>
|
||||||
<!-- 로그인 -->
|
<?php endif; ?>
|
||||||
<li class="<?= $isLogin ? '' : 'd-none' ?>">
|
|
||||||
<a class="my-join" href="javascript:mypage01()">마이페이지</a>
|
|
||||||
</li>
|
|
||||||
<li class="<?= $isLogin ? '' : 'd-none' ?>">
|
|
||||||
<a class="my-login" href="/kngil/bbs/logout.php">로그아웃</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button class="menu-all">
|
<button class="menu-all">
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<a href="/kngil/skin/index.php" class="btn-home-fixed" title="홈으로">
|
<a href="/" class="btn-home-fixed" title="홈으로">
|
||||||
<svg class="icon-home"
|
<svg class="icon-home"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<a href="/kngil/skin/index.php" class="btn-home-fixed" title="홈으로">
|
<a href="/" class="btn-home-fixed" title="홈으로">
|
||||||
<svg class="icon-home"
|
<svg class="icon-home"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="page-admin">
|
<body class="page-admin">
|
||||||
<a href="/kngil/skin/index.php" class="btn-home-fixed" title="홈으로">
|
<a href="/" class="btn-home-fixed" title="홈으로">
|
||||||
<svg class="icon-home"
|
<svg class="icon-home"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|||||||
@@ -42,7 +42,6 @@
|
|||||||
<!-- //HEADER -->
|
<!-- //HEADER -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include __DIR__ . "/pop_login.php";
|
|
||||||
include __DIR__ . "/pop_join.php";
|
include __DIR__ . "/pop_join.php";
|
||||||
include __DIR__ . "/pop_agreement.php";
|
include __DIR__ . "/pop_agreement.php";
|
||||||
include __DIR__ . "/pop_mypage01.php";
|
include __DIR__ . "/pop_mypage01.php";
|
||||||
@@ -153,7 +152,6 @@
|
|||||||
<script src="/kngil/js/index.js"></script>
|
<script src="/kngil/js/index.js"></script>
|
||||||
<script src="/kngil/js/mypage.js"></script>
|
<script src="/kngil/js/mypage.js"></script>
|
||||||
<script src="/kngil/js/join.js"></script>
|
<script src="/kngil/js/join.js"></script>
|
||||||
<script type="module" src="/kngil/js/login.js"></script>
|
|
||||||
<script src="/kngil/js/login_sms.js"></script>
|
<script src="/kngil/js/login_sms.js"></script>
|
||||||
<script>
|
<script>
|
||||||
AOS.init();
|
AOS.init();
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!--index.php-->
|
<!--index.php-->
|
||||||
<html lang="ko">
|
<html lang="ko">
|
||||||
@@ -60,7 +65,6 @@
|
|||||||
<!-- // Intro Screen -->
|
<!-- // Intro Screen -->
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
include __DIR__ . "/pop_login.php";
|
|
||||||
include __DIR__ . "/pop_join.php";
|
include __DIR__ . "/pop_join.php";
|
||||||
include __DIR__ . "/pop_agreement.php";
|
include __DIR__ . "/pop_agreement.php";
|
||||||
include __DIR__ . "/pop_mypage01.php";
|
include __DIR__ . "/pop_mypage01.php";
|
||||||
@@ -77,7 +81,6 @@
|
|||||||
<script src="/kngil/js/index.js"></script>
|
<script src="/kngil/js/index.js"></script>
|
||||||
<script src="/kngil/js/mypage.js"></script>
|
<script src="/kngil/js/mypage.js"></script>
|
||||||
<script src="/kngil/js/join.js"></script>
|
<script src="/kngil/js/join.js"></script>
|
||||||
<script type="module" src="/kngil/js/login.js"></script>
|
|
||||||
<script src="/kngil/js/login_sms.js"></script>
|
<script src="/kngil/js/login_sms.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,119 +0,0 @@
|
|||||||
<!-- popup_wrap -->
|
|
||||||
<div class="popup-wrap" id="pop_login" role="dialog" aria-labelledby="login_title" aria-modal="true">
|
|
||||||
<!-- popup_in -->
|
|
||||||
<div class="popup-in member">
|
|
||||||
<button class="btn-close" type="button" aria-label="팝업 닫기">
|
|
||||||
<img src="/kngil/img/ico/ico_close.svg" alt="닫기">
|
|
||||||
</button>
|
|
||||||
<!-- popup_container -->
|
|
||||||
<div class="popup-container login">
|
|
||||||
<!-- pop_header -->
|
|
||||||
<div class="pop-header">
|
|
||||||
<h2 class="tit" id="login_title">로그인</h2>
|
|
||||||
<p class="sub-txt">
|
|
||||||
KNGIL 로그인 시<br class="pc-only">
|
|
||||||
<em>다운로드 및 1:1문의 서비스를</em><br class="pc-only" /> 이용하실 수 있습니다.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- //pop_header -->
|
|
||||||
<!-- pop_body -->
|
|
||||||
<div class="pop-body">
|
|
||||||
<div class="contents-wrap">
|
|
||||||
<ul class="tab-menu round">
|
|
||||||
<li class="tab-phone on"><span>휴대폰 인증</span></li>
|
|
||||||
<li class="tab-id"><span>아이디 로그인</span></li>
|
|
||||||
</ul>
|
|
||||||
<div class="tab-content phone">
|
|
||||||
<form action="" method="post" novalidate>
|
|
||||||
<div class="form-wrap">
|
|
||||||
<div class="input-box group">
|
|
||||||
<i class="phone" aria-hidden="true"></i>
|
|
||||||
<input type="tel" id="login_phone" name="userPhone" placeholder="휴대폰 번호 (예: 010-1234-5678)" required aria-label="휴대폰 번호">
|
|
||||||
<span class="timer d-none">03:00</span>
|
|
||||||
<!-- ✅ 재요청 버튼 -->
|
|
||||||
<button type="button"
|
|
||||||
class="btn-resend d-none"
|
|
||||||
id="sms_resend">
|
|
||||||
재요청
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="info-box d-none">
|
|
||||||
<p>
|
|
||||||
<em>인증 링크를 문자로 발송했습니다</em><br />
|
|
||||||
인증 문자가 오지 않으면 인증 링크를 재요청 해보세요
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="btn-wrap">
|
|
||||||
<button class="btn-full" id="sms_button" type="submit">인증 링크 요청</button>
|
|
||||||
</div>
|
|
||||||
<div class="btn-wrap">
|
|
||||||
<a class="go-signup" href="javascript:agreement();">
|
|
||||||
<span>회원가입</span><i class="arrow-r" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="tab-content id">
|
|
||||||
<form action="" method="post" novalidate>
|
|
||||||
<div class="form-wrap">
|
|
||||||
<div class="input-box group">
|
|
||||||
<i class="id" aria-hidden="true"></i>
|
|
||||||
<input type="text" id="login_id" name="userId" placeholder="아이디" required aria-label="아이디">
|
|
||||||
</div>
|
|
||||||
<div class="input-box group">
|
|
||||||
<i class="pw" aria-hidden="true"></i>
|
|
||||||
<input type="password" id="login_password" name="userPassword" placeholder="비밀번호" required aria-label="비밀번호">
|
|
||||||
</div>
|
|
||||||
<div class="btn-wrap">
|
|
||||||
<button class="btn-full" type="submit">로그인</button>
|
|
||||||
</div>
|
|
||||||
<div class="btn-wrap">
|
|
||||||
<a class="go-signup" href="javascript:agreement();">
|
|
||||||
<span>회원가입</span>
|
|
||||||
<i class="arrow-r" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
<!-- 로그인 팝업 이동 -->
|
|
||||||
<a class="go-login" href="http://172.16.9.44/kngil/skin/popup/callback">
|
|
||||||
<span>로그인</span>
|
|
||||||
<i class="arrow-r" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<style>
|
|
||||||
.btn-oidc {
|
|
||||||
background-color: #000; /* IDP 브랜드 컬러에 맞춰 조정 가능 */
|
|
||||||
color: #fff;
|
|
||||||
border: none;
|
|
||||||
width: 100%;
|
|
||||||
padding: 12px;
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-top: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: bold;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
.btn-oidc:hover {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div class="btn-wrap">
|
|
||||||
<button type="button" class="btn-oidc" id="btn_oidc_login">
|
|
||||||
OIDC 통합 로그인
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- //pop_body -->
|
|
||||||
</div>
|
|
||||||
<!-- //popup_container -->
|
|
||||||
</div>
|
|
||||||
<!-- //popup_in -->
|
|
||||||
</div>
|
|
||||||
<!-- //popup_wrap -->
|
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include __DIR__ . "/pop_login.php";
|
|
||||||
include __DIR__ . "/pop_join.php";
|
include __DIR__ . "/pop_join.php";
|
||||||
include __DIR__ . "/pop_agreement.php";
|
include __DIR__ . "/pop_agreement.php";
|
||||||
include __DIR__ . "/pop_mypage01.php";
|
include __DIR__ . "/pop_mypage01.php";
|
||||||
@@ -347,7 +346,6 @@
|
|||||||
<script src="/kngil/js/index.js"></script>
|
<script src="/kngil/js/index.js"></script>
|
||||||
<script src="/kngil/js/mypage.js"></script>
|
<script src="/kngil/js/mypage.js"></script>
|
||||||
<script src="/kngil/js/join.js"></script>
|
<script src="/kngil/js/join.js"></script>
|
||||||
<script type="module" src="/kngil/js/login.js"></script>
|
|
||||||
<script src="/kngil/js/login_sms.js"></script>
|
<script src="/kngil/js/login_sms.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -611,4 +609,3 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
<?php include __DIR__ . "/_header.php"; ?>
|
<?php include __DIR__ . "/_header.php"; ?>
|
||||||
<!-- //HEADER -->
|
<!-- //HEADER -->
|
||||||
<?php
|
<?php
|
||||||
include __DIR__ . "/pop_login.php";
|
|
||||||
include __DIR__ . "/pop_join.php";
|
include __DIR__ . "/pop_join.php";
|
||||||
include __DIR__ . "/pop_agreement.php";
|
include __DIR__ . "/pop_agreement.php";
|
||||||
include __DIR__ . "/pop_mypage01.php";
|
include __DIR__ . "/pop_mypage01.php";
|
||||||
@@ -262,7 +261,6 @@
|
|||||||
<script src="/kngil/js/index.js"></script>
|
<script src="/kngil/js/index.js"></script>
|
||||||
<script src="/kngil/js/mypage.js"></script>
|
<script src="/kngil/js/mypage.js"></script>
|
||||||
<script src="/kngil/js/join.js"></script>
|
<script src="/kngil/js/join.js"></script>
|
||||||
<script type="module" src="/kngil/js/login.js"></script>
|
|
||||||
<script src="/kngil/js/login_sms.js"></script>
|
<script src="/kngil/js/login_sms.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
<?php include __DIR__ . "/_header.php"; ?>
|
<?php include __DIR__ . "/_header.php"; ?>
|
||||||
<!-- //HEADER -->
|
<!-- //HEADER -->
|
||||||
<?php
|
<?php
|
||||||
include __DIR__ . "/pop_login.php";
|
|
||||||
include __DIR__ . "/pop_join.php";
|
include __DIR__ . "/pop_join.php";
|
||||||
include __DIR__ . "/pop_agreement.php";
|
include __DIR__ . "/pop_agreement.php";
|
||||||
include __DIR__ . "/pop_mypage01.php";
|
include __DIR__ . "/pop_mypage01.php";
|
||||||
@@ -254,7 +253,6 @@
|
|||||||
<script src="/kngil/js/index.js"></script>
|
<script src="/kngil/js/index.js"></script>
|
||||||
<script src="/kngil/js/mypage.js"></script>
|
<script src="/kngil/js/mypage.js"></script>
|
||||||
<script src="/kngil/js/join.js"></script>
|
<script src="/kngil/js/join.js"></script>
|
||||||
<script type="module" src="/kngil/js/login.js"></script>
|
|
||||||
<script src="/kngil/js/login_sms.js"></script>
|
<script src="/kngil/js/login_sms.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include __DIR__ . "/pop_login.php";
|
|
||||||
include __DIR__ . "/pop_join.php";
|
include __DIR__ . "/pop_join.php";
|
||||||
include __DIR__ . "/pop_agreement.php";
|
include __DIR__ . "/pop_agreement.php";
|
||||||
include __DIR__ . "/pop_mypage01.php";
|
include __DIR__ . "/pop_mypage01.php";
|
||||||
@@ -154,7 +153,6 @@
|
|||||||
<script src="/kngil/js/index.js"></script>
|
<script src="/kngil/js/index.js"></script>
|
||||||
<script src="/kngil/js/mypage.js"></script>
|
<script src="/kngil/js/mypage.js"></script>
|
||||||
<script src="/kngil/js/join.js"></script>
|
<script src="/kngil/js/join.js"></script>
|
||||||
<script type="module" src="/kngil/js/login.js"></script>
|
|
||||||
<script src="/kngil/js/login_sms.js"></script>
|
<script src="/kngil/js/login_sms.js"></script>
|
||||||
|
|
||||||
<!-- CKEditor 표시용 초기화 (submit 관여 X) -->
|
<!-- CKEditor 표시용 초기화 (submit 관여 X) -->
|
||||||
|
|||||||
22
kngil/vendor/autoload.php
vendored
22
kngil/vendor/autoload.php
vendored
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload.php @generated by Composer
|
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50600) {
|
|
||||||
if (!headers_sent()) {
|
|
||||||
header('HTTP/1.1 500 Internal Server Error');
|
|
||||||
}
|
|
||||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
|
||||||
if (!ini_get('display_errors')) {
|
|
||||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
|
||||||
fwrite(STDERR, $err);
|
|
||||||
} elseif (!headers_sent()) {
|
|
||||||
echo $err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new RuntimeException($err);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
|
||||||
|
|
||||||
return ComposerAutoloaderInit7af56487bc504c75f0291ee804b479b9::getLoader();
|
|
||||||
579
kngil/vendor/composer/ClassLoader.php
vendored
579
kngil/vendor/composer/ClassLoader.php
vendored
@@ -1,579 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Composer.
|
|
||||||
*
|
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
|
||||||
* Jordi Boggiano <j.boggiano@seld.be>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Composer\Autoload;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
|
||||||
*
|
|
||||||
* $loader = new \Composer\Autoload\ClassLoader();
|
|
||||||
*
|
|
||||||
* // register classes with namespaces
|
|
||||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
|
||||||
* $loader->add('Symfony', __DIR__.'/framework');
|
|
||||||
*
|
|
||||||
* // activate the autoloader
|
|
||||||
* $loader->register();
|
|
||||||
*
|
|
||||||
* // to enable searching the include path (eg. for PEAR packages)
|
|
||||||
* $loader->setUseIncludePath(true);
|
|
||||||
*
|
|
||||||
* In this example, if you try to use a class in the Symfony\Component
|
|
||||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
|
||||||
* the autoloader will first look for the class under the component/
|
|
||||||
* directory, and it will then fallback to the framework/ directory if not
|
|
||||||
* found before giving up.
|
|
||||||
*
|
|
||||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
|
||||||
*
|
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
|
||||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
|
||||||
* @see https://www.php-fig.org/psr/psr-0/
|
|
||||||
* @see https://www.php-fig.org/psr/psr-4/
|
|
||||||
*/
|
|
||||||
class ClassLoader
|
|
||||||
{
|
|
||||||
/** @var \Closure(string):void */
|
|
||||||
private static $includeFile;
|
|
||||||
|
|
||||||
/** @var string|null */
|
|
||||||
private $vendorDir;
|
|
||||||
|
|
||||||
// PSR-4
|
|
||||||
/**
|
|
||||||
* @var array<string, array<string, int>>
|
|
||||||
*/
|
|
||||||
private $prefixLengthsPsr4 = array();
|
|
||||||
/**
|
|
||||||
* @var array<string, list<string>>
|
|
||||||
*/
|
|
||||||
private $prefixDirsPsr4 = array();
|
|
||||||
/**
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
private $fallbackDirsPsr4 = array();
|
|
||||||
|
|
||||||
// PSR-0
|
|
||||||
/**
|
|
||||||
* List of PSR-0 prefixes
|
|
||||||
*
|
|
||||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
|
||||||
*
|
|
||||||
* @var array<string, array<string, list<string>>>
|
|
||||||
*/
|
|
||||||
private $prefixesPsr0 = array();
|
|
||||||
/**
|
|
||||||
* @var list<string>
|
|
||||||
*/
|
|
||||||
private $fallbackDirsPsr0 = array();
|
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $useIncludePath = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, string>
|
|
||||||
*/
|
|
||||||
private $classMap = array();
|
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
private $classMapAuthoritative = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, bool>
|
|
||||||
*/
|
|
||||||
private $missingClasses = array();
|
|
||||||
|
|
||||||
/** @var string|null */
|
|
||||||
private $apcuPrefix;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array<string, self>
|
|
||||||
*/
|
|
||||||
private static $registeredLoaders = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string|null $vendorDir
|
|
||||||
*/
|
|
||||||
public function __construct($vendorDir = null)
|
|
||||||
{
|
|
||||||
$this->vendorDir = $vendorDir;
|
|
||||||
self::initializeIncludeClosure();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, list<string>>
|
|
||||||
*/
|
|
||||||
public function getPrefixes()
|
|
||||||
{
|
|
||||||
if (!empty($this->prefixesPsr0)) {
|
|
||||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
|
||||||
}
|
|
||||||
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, list<string>>
|
|
||||||
*/
|
|
||||||
public function getPrefixesPsr4()
|
|
||||||
{
|
|
||||||
return $this->prefixDirsPsr4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return list<string>
|
|
||||||
*/
|
|
||||||
public function getFallbackDirs()
|
|
||||||
{
|
|
||||||
return $this->fallbackDirsPsr0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return list<string>
|
|
||||||
*/
|
|
||||||
public function getFallbackDirsPsr4()
|
|
||||||
{
|
|
||||||
return $this->fallbackDirsPsr4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, string> Array of classname => path
|
|
||||||
*/
|
|
||||||
public function getClassMap()
|
|
||||||
{
|
|
||||||
return $this->classMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array<string, string> $classMap Class to filename map
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function addClassMap(array $classMap)
|
|
||||||
{
|
|
||||||
if ($this->classMap) {
|
|
||||||
$this->classMap = array_merge($this->classMap, $classMap);
|
|
||||||
} else {
|
|
||||||
$this->classMap = $classMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a set of PSR-0 directories for a given prefix, either
|
|
||||||
* appending or prepending to the ones previously set for this prefix.
|
|
||||||
*
|
|
||||||
* @param string $prefix The prefix
|
|
||||||
* @param list<string>|string $paths The PSR-0 root directories
|
|
||||||
* @param bool $prepend Whether to prepend the directories
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function add($prefix, $paths, $prepend = false)
|
|
||||||
{
|
|
||||||
$paths = (array) $paths;
|
|
||||||
if (!$prefix) {
|
|
||||||
if ($prepend) {
|
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
|
||||||
$paths,
|
|
||||||
$this->fallbackDirsPsr0
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
|
||||||
$this->fallbackDirsPsr0,
|
|
||||||
$paths
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$first = $prefix[0];
|
|
||||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
|
||||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($prepend) {
|
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
|
||||||
$paths,
|
|
||||||
$this->prefixesPsr0[$first][$prefix]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
|
||||||
$this->prefixesPsr0[$first][$prefix],
|
|
||||||
$paths
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a set of PSR-4 directories for a given namespace, either
|
|
||||||
* appending or prepending to the ones previously set for this namespace.
|
|
||||||
*
|
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
|
||||||
* @param list<string>|string $paths The PSR-4 base directories
|
|
||||||
* @param bool $prepend Whether to prepend the directories
|
|
||||||
*
|
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function addPsr4($prefix, $paths, $prepend = false)
|
|
||||||
{
|
|
||||||
$paths = (array) $paths;
|
|
||||||
if (!$prefix) {
|
|
||||||
// Register directories for the root namespace.
|
|
||||||
if ($prepend) {
|
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
|
||||||
$paths,
|
|
||||||
$this->fallbackDirsPsr4
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
|
||||||
$this->fallbackDirsPsr4,
|
|
||||||
$paths
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
|
||||||
// Register directories for a new namespace.
|
|
||||||
$length = strlen($prefix);
|
|
||||||
if ('\\' !== $prefix[$length - 1]) {
|
|
||||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
|
||||||
}
|
|
||||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
|
||||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
|
||||||
} elseif ($prepend) {
|
|
||||||
// Prepend directories for an already registered namespace.
|
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
|
||||||
$paths,
|
|
||||||
$this->prefixDirsPsr4[$prefix]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// Append directories for an already registered namespace.
|
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
|
||||||
$this->prefixDirsPsr4[$prefix],
|
|
||||||
$paths
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a set of PSR-0 directories for a given prefix,
|
|
||||||
* replacing any others previously set for this prefix.
|
|
||||||
*
|
|
||||||
* @param string $prefix The prefix
|
|
||||||
* @param list<string>|string $paths The PSR-0 base directories
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function set($prefix, $paths)
|
|
||||||
{
|
|
||||||
if (!$prefix) {
|
|
||||||
$this->fallbackDirsPsr0 = (array) $paths;
|
|
||||||
} else {
|
|
||||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers a set of PSR-4 directories for a given namespace,
|
|
||||||
* replacing any others previously set for this namespace.
|
|
||||||
*
|
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
|
||||||
* @param list<string>|string $paths The PSR-4 base directories
|
|
||||||
*
|
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setPsr4($prefix, $paths)
|
|
||||||
{
|
|
||||||
if (!$prefix) {
|
|
||||||
$this->fallbackDirsPsr4 = (array) $paths;
|
|
||||||
} else {
|
|
||||||
$length = strlen($prefix);
|
|
||||||
if ('\\' !== $prefix[$length - 1]) {
|
|
||||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
|
||||||
}
|
|
||||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
|
||||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Turns on searching the include path for class files.
|
|
||||||
*
|
|
||||||
* @param bool $useIncludePath
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setUseIncludePath($useIncludePath)
|
|
||||||
{
|
|
||||||
$this->useIncludePath = $useIncludePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can be used to check if the autoloader uses the include path to check
|
|
||||||
* for classes.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function getUseIncludePath()
|
|
||||||
{
|
|
||||||
return $this->useIncludePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Turns off searching the prefix and fallback directories for classes
|
|
||||||
* that have not been registered with the class map.
|
|
||||||
*
|
|
||||||
* @param bool $classMapAuthoritative
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
|
||||||
{
|
|
||||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Should class lookup fail if not found in the current class map?
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isClassMapAuthoritative()
|
|
||||||
{
|
|
||||||
return $this->classMapAuthoritative;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
|
||||||
*
|
|
||||||
* @param string|null $apcuPrefix
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setApcuPrefix($apcuPrefix)
|
|
||||||
{
|
|
||||||
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
|
||||||
*
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public function getApcuPrefix()
|
|
||||||
{
|
|
||||||
return $this->apcuPrefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers this instance as an autoloader.
|
|
||||||
*
|
|
||||||
* @param bool $prepend Whether to prepend the autoloader or not
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function register($prepend = false)
|
|
||||||
{
|
|
||||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
|
||||||
|
|
||||||
if (null === $this->vendorDir) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($prepend) {
|
|
||||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
|
||||||
} else {
|
|
||||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
|
||||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unregisters this instance as an autoloader.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function unregister()
|
|
||||||
{
|
|
||||||
spl_autoload_unregister(array($this, 'loadClass'));
|
|
||||||
|
|
||||||
if (null !== $this->vendorDir) {
|
|
||||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the given class or interface.
|
|
||||||
*
|
|
||||||
* @param string $class The name of the class
|
|
||||||
* @return true|null True if loaded, null otherwise
|
|
||||||
*/
|
|
||||||
public function loadClass($class)
|
|
||||||
{
|
|
||||||
if ($file = $this->findFile($class)) {
|
|
||||||
$includeFile = self::$includeFile;
|
|
||||||
$includeFile($file);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finds the path to the file where the class is defined.
|
|
||||||
*
|
|
||||||
* @param string $class The name of the class
|
|
||||||
*
|
|
||||||
* @return string|false The path if found, false otherwise
|
|
||||||
*/
|
|
||||||
public function findFile($class)
|
|
||||||
{
|
|
||||||
// class map lookup
|
|
||||||
if (isset($this->classMap[$class])) {
|
|
||||||
return $this->classMap[$class];
|
|
||||||
}
|
|
||||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (null !== $this->apcuPrefix) {
|
|
||||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
|
||||||
if ($hit) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = $this->findFileWithExtension($class, '.php');
|
|
||||||
|
|
||||||
// Search for Hack files if we are running on HHVM
|
|
||||||
if (false === $file && defined('HHVM_VERSION')) {
|
|
||||||
$file = $this->findFileWithExtension($class, '.hh');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null !== $this->apcuPrefix) {
|
|
||||||
apcu_add($this->apcuPrefix.$class, $file);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (false === $file) {
|
|
||||||
// Remember that this class does not exist.
|
|
||||||
$this->missingClasses[$class] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
|
||||||
*
|
|
||||||
* @return array<string, self>
|
|
||||||
*/
|
|
||||||
public static function getRegisteredLoaders()
|
|
||||||
{
|
|
||||||
return self::$registeredLoaders;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $class
|
|
||||||
* @param string $ext
|
|
||||||
* @return string|false
|
|
||||||
*/
|
|
||||||
private function findFileWithExtension($class, $ext)
|
|
||||||
{
|
|
||||||
// PSR-4 lookup
|
|
||||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
|
||||||
|
|
||||||
$first = $class[0];
|
|
||||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
|
||||||
$subPath = $class;
|
|
||||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
|
||||||
$subPath = substr($subPath, 0, $lastPos);
|
|
||||||
$search = $subPath . '\\';
|
|
||||||
if (isset($this->prefixDirsPsr4[$search])) {
|
|
||||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
|
||||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
|
||||||
if (file_exists($file = $dir . $pathEnd)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PSR-4 fallback dirs
|
|
||||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
|
||||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PSR-0 lookup
|
|
||||||
if (false !== $pos = strrpos($class, '\\')) {
|
|
||||||
// namespaced class name
|
|
||||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
|
||||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
|
||||||
} else {
|
|
||||||
// PEAR-like class name
|
|
||||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->prefixesPsr0[$first])) {
|
|
||||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
|
||||||
if (0 === strpos($class, $prefix)) {
|
|
||||||
foreach ($dirs as $dir) {
|
|
||||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PSR-0 fallback dirs
|
|
||||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
|
||||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PSR-0 include paths.
|
|
||||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
private static function initializeIncludeClosure()
|
|
||||||
{
|
|
||||||
if (self::$includeFile !== null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scope isolated include.
|
|
||||||
*
|
|
||||||
* Prevents access to $this/self from included files.
|
|
||||||
*
|
|
||||||
* @param string $file
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
self::$includeFile = \Closure::bind(static function($file) {
|
|
||||||
include $file;
|
|
||||||
}, null, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
396
kngil/vendor/composer/InstalledVersions.php
vendored
396
kngil/vendor/composer/InstalledVersions.php
vendored
@@ -1,396 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Composer.
|
|
||||||
*
|
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
|
||||||
* Jordi Boggiano <j.boggiano@seld.be>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Composer;
|
|
||||||
|
|
||||||
use Composer\Autoload\ClassLoader;
|
|
||||||
use Composer\Semver\VersionParser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class is copied in every Composer installed project and available to all
|
|
||||||
*
|
|
||||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
|
||||||
*
|
|
||||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
|
||||||
*
|
|
||||||
* @final
|
|
||||||
*/
|
|
||||||
class InstalledVersions
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
private static $selfDir = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var mixed[]|null
|
|
||||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
|
||||||
*/
|
|
||||||
private static $installed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private static $installedIsLocalDir;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool|null
|
|
||||||
*/
|
|
||||||
private static $canGetVendors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array[]
|
|
||||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
private static $installedByVendor = array();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
|
||||||
*
|
|
||||||
* @return string[]
|
|
||||||
* @psalm-return list<string>
|
|
||||||
*/
|
|
||||||
public static function getInstalledPackages()
|
|
||||||
{
|
|
||||||
$packages = array();
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
$packages[] = array_keys($installed['versions']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (1 === \count($packages)) {
|
|
||||||
return $packages[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a list of all package names with a specific type e.g. 'library'
|
|
||||||
*
|
|
||||||
* @param string $type
|
|
||||||
* @return string[]
|
|
||||||
* @psalm-return list<string>
|
|
||||||
*/
|
|
||||||
public static function getInstalledPackagesByType($type)
|
|
||||||
{
|
|
||||||
$packagesByType = array();
|
|
||||||
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
foreach ($installed['versions'] as $name => $package) {
|
|
||||||
if (isset($package['type']) && $package['type'] === $type) {
|
|
||||||
$packagesByType[] = $name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $packagesByType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether the given package is installed
|
|
||||||
*
|
|
||||||
* This also returns true if the package name is provided or replaced by another package
|
|
||||||
*
|
|
||||||
* @param string $packageName
|
|
||||||
* @param bool $includeDevRequirements
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (isset($installed['versions'][$packageName])) {
|
|
||||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether the given package satisfies a version constraint
|
|
||||||
*
|
|
||||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
|
||||||
*
|
|
||||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
|
||||||
*
|
|
||||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
|
||||||
* @param string $packageName
|
|
||||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
|
||||||
{
|
|
||||||
$constraint = $parser->parseConstraints((string) $constraint);
|
|
||||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
|
||||||
|
|
||||||
return $provided->matches($constraint);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
|
||||||
*
|
|
||||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
|
||||||
* whether a given version of a package is installed, and not just whether it exists
|
|
||||||
*
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string Version constraint usable with composer/semver
|
|
||||||
*/
|
|
||||||
public static function getVersionRanges($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ranges = array();
|
|
||||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
|
||||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
|
||||||
}
|
|
||||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
|
||||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
|
||||||
}
|
|
||||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
|
||||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
|
||||||
}
|
|
||||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
|
||||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return implode(' || ', $ranges);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
|
||||||
*/
|
|
||||||
public static function getVersion($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed['versions'][$packageName]['version'];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
|
||||||
*/
|
|
||||||
public static function getPrettyVersion($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed['versions'][$packageName]['pretty_version'];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
|
||||||
*/
|
|
||||||
public static function getReference($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed['versions'][$packageName]['reference'];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $packageName
|
|
||||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
|
||||||
*/
|
|
||||||
public static function getInstallPath($packageName)
|
|
||||||
{
|
|
||||||
foreach (self::getInstalled() as $installed) {
|
|
||||||
if (!isset($installed['versions'][$packageName])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
|
||||||
*/
|
|
||||||
public static function getRootPackage()
|
|
||||||
{
|
|
||||||
$installed = self::getInstalled();
|
|
||||||
|
|
||||||
return $installed[0]['root'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the raw installed.php data for custom implementations
|
|
||||||
*
|
|
||||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
|
||||||
* @return array[]
|
|
||||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
|
||||||
*/
|
|
||||||
public static function getRawData()
|
|
||||||
{
|
|
||||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
if (null === self::$installed) {
|
|
||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
|
||||||
self::$installed = include __DIR__ . '/installed.php';
|
|
||||||
} else {
|
|
||||||
self::$installed = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$installed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
|
||||||
*
|
|
||||||
* @return array[]
|
|
||||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
public static function getAllRawData()
|
|
||||||
{
|
|
||||||
return self::getInstalled();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets you reload the static array from another file
|
|
||||||
*
|
|
||||||
* This is only useful for complex integrations in which a project needs to use
|
|
||||||
* this class but then also needs to execute another project's autoloader in process,
|
|
||||||
* and wants to ensure both projects have access to their version of installed.php.
|
|
||||||
*
|
|
||||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
|
||||||
* the data it needs from this class, then call reload() with
|
|
||||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
|
||||||
* the project in which it runs can then also use this class safely, without
|
|
||||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
|
||||||
*
|
|
||||||
* @param array[] $data A vendor/composer/installed.php data set
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
|
||||||
*/
|
|
||||||
public static function reload($data)
|
|
||||||
{
|
|
||||||
self::$installed = $data;
|
|
||||||
self::$installedByVendor = array();
|
|
||||||
|
|
||||||
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
|
|
||||||
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
|
|
||||||
// so we have to assume it does not, and that may result in duplicate data being returned when listing
|
|
||||||
// all installed packages for example
|
|
||||||
self::$installedIsLocalDir = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private static function getSelfDir()
|
|
||||||
{
|
|
||||||
if (self::$selfDir === null) {
|
|
||||||
self::$selfDir = strtr(__DIR__, '\\', '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$selfDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array[]
|
|
||||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
|
||||||
*/
|
|
||||||
private static function getInstalled()
|
|
||||||
{
|
|
||||||
if (null === self::$canGetVendors) {
|
|
||||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
|
||||||
}
|
|
||||||
|
|
||||||
$installed = array();
|
|
||||||
$copiedLocalDir = false;
|
|
||||||
|
|
||||||
if (self::$canGetVendors) {
|
|
||||||
$selfDir = self::getSelfDir();
|
|
||||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
|
||||||
$vendorDir = strtr($vendorDir, '\\', '/');
|
|
||||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
|
||||||
$installed[] = self::$installedByVendor[$vendorDir];
|
|
||||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
|
||||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
|
||||||
$required = require $vendorDir.'/composer/installed.php';
|
|
||||||
self::$installedByVendor[$vendorDir] = $required;
|
|
||||||
$installed[] = $required;
|
|
||||||
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
|
|
||||||
self::$installed = $required;
|
|
||||||
self::$installedIsLocalDir = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
|
|
||||||
$copiedLocalDir = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === self::$installed) {
|
|
||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
|
||||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
|
||||||
$required = require __DIR__ . '/installed.php';
|
|
||||||
self::$installed = $required;
|
|
||||||
} else {
|
|
||||||
self::$installed = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self::$installed !== array() && !$copiedLocalDir) {
|
|
||||||
$installed[] = self::$installed;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $installed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
21
kngil/vendor/composer/LICENSE
vendored
21
kngil/vendor/composer/LICENSE
vendored
@@ -1,21 +0,0 @@
|
|||||||
|
|
||||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
|
||||||
to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
12
kngil/vendor/composer/autoload_classmap.php
vendored
12
kngil/vendor/composer/autoload_classmap.php
vendored
@@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload_classmap.php @generated by Composer
|
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
|
||||||
$baseDir = dirname($vendorDir);
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
|
||||||
'Jumbojett\\OpenIDConnectClient' => $vendorDir . '/jumbojett/openid-connect-php/src/OpenIDConnectClient.php',
|
|
||||||
'Jumbojett\\OpenIDConnectClientException' => $vendorDir . '/jumbojett/openid-connect-php/src/OpenIDConnectClient.php',
|
|
||||||
);
|
|
||||||
10
kngil/vendor/composer/autoload_files.php
vendored
10
kngil/vendor/composer/autoload_files.php
vendored
@@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload_files.php @generated by Composer
|
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
|
||||||
$baseDir = dirname($vendorDir);
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
|
||||||
);
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload_namespaces.php @generated by Composer
|
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
|
||||||
$baseDir = dirname($vendorDir);
|
|
||||||
|
|
||||||
return array(
|
|
||||||
);
|
|
||||||
11
kngil/vendor/composer/autoload_psr4.php
vendored
11
kngil/vendor/composer/autoload_psr4.php
vendored
@@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload_psr4.php @generated by Composer
|
|
||||||
|
|
||||||
$vendorDir = dirname(__DIR__);
|
|
||||||
$baseDir = dirname($vendorDir);
|
|
||||||
|
|
||||||
return array(
|
|
||||||
'phpseclib3\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
|
|
||||||
'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'),
|
|
||||||
);
|
|
||||||
50
kngil/vendor/composer/autoload_real.php
vendored
50
kngil/vendor/composer/autoload_real.php
vendored
@@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
|
||||||
|
|
||||||
class ComposerAutoloaderInit7af56487bc504c75f0291ee804b479b9
|
|
||||||
{
|
|
||||||
private static $loader;
|
|
||||||
|
|
||||||
public static function loadClassLoader($class)
|
|
||||||
{
|
|
||||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
|
||||||
require __DIR__ . '/ClassLoader.php';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \Composer\Autoload\ClassLoader
|
|
||||||
*/
|
|
||||||
public static function getLoader()
|
|
||||||
{
|
|
||||||
if (null !== self::$loader) {
|
|
||||||
return self::$loader;
|
|
||||||
}
|
|
||||||
|
|
||||||
require __DIR__ . '/platform_check.php';
|
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInit7af56487bc504c75f0291ee804b479b9', 'loadClassLoader'), true, true);
|
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInit7af56487bc504c75f0291ee804b479b9', 'loadClassLoader'));
|
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInit7af56487bc504c75f0291ee804b479b9::getInitializer($loader));
|
|
||||||
|
|
||||||
$loader->register(true);
|
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit7af56487bc504c75f0291ee804b479b9::$files;
|
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
|
||||||
|
|
||||||
require $file;
|
|
||||||
}
|
|
||||||
}, null, null);
|
|
||||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
|
||||||
$requireFile($fileIdentifier, $file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $loader;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
50
kngil/vendor/composer/autoload_static.php
vendored
50
kngil/vendor/composer/autoload_static.php
vendored
@@ -1,50 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// autoload_static.php @generated by Composer
|
|
||||||
|
|
||||||
namespace Composer\Autoload;
|
|
||||||
|
|
||||||
class ComposerStaticInit7af56487bc504c75f0291ee804b479b9
|
|
||||||
{
|
|
||||||
public static $files = array (
|
|
||||||
'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php',
|
|
||||||
);
|
|
||||||
|
|
||||||
public static $prefixLengthsPsr4 = array (
|
|
||||||
'p' =>
|
|
||||||
array (
|
|
||||||
'phpseclib3\\' => 11,
|
|
||||||
),
|
|
||||||
'P' =>
|
|
||||||
array (
|
|
||||||
'ParagonIE\\ConstantTime\\' => 23,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
public static $prefixDirsPsr4 = array (
|
|
||||||
'phpseclib3\\' =>
|
|
||||||
array (
|
|
||||||
0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib',
|
|
||||||
),
|
|
||||||
'ParagonIE\\ConstantTime\\' =>
|
|
||||||
array (
|
|
||||||
0 => __DIR__ . '/..' . '/paragonie/constant_time_encoding/src',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
public static $classMap = array (
|
|
||||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
||||||
'Jumbojett\\OpenIDConnectClient' => __DIR__ . '/..' . '/jumbojett/openid-connect-php/src/OpenIDConnectClient.php',
|
|
||||||
'Jumbojett\\OpenIDConnectClientException' => __DIR__ . '/..' . '/jumbojett/openid-connect-php/src/OpenIDConnectClient.php',
|
|
||||||
);
|
|
||||||
|
|
||||||
public static function getInitializer(ClassLoader $loader)
|
|
||||||
{
|
|
||||||
return \Closure::bind(function () use ($loader) {
|
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7af56487bc504c75f0291ee804b479b9::$prefixLengthsPsr4;
|
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInit7af56487bc504c75f0291ee804b479b9::$prefixDirsPsr4;
|
|
||||||
$loader->classMap = ComposerStaticInit7af56487bc504c75f0291ee804b479b9::$classMap;
|
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
289
kngil/vendor/composer/installed.json
vendored
289
kngil/vendor/composer/installed.json
vendored
@@ -1,289 +0,0 @@
|
|||||||
{
|
|
||||||
"packages": [
|
|
||||||
{
|
|
||||||
"name": "jumbojett/openid-connect-php",
|
|
||||||
"version": "v1.0.2",
|
|
||||||
"version_normalized": "1.0.2.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/jumbojett/OpenID-Connect-PHP.git",
|
|
||||||
"reference": "f327e7eb0626d55ddb6abc7b7c9e6ad3af4e5d51"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/jumbojett/OpenID-Connect-PHP/zipball/f327e7eb0626d55ddb6abc7b7c9e6ad3af4e5d51",
|
|
||||||
"reference": "f327e7eb0626d55ddb6abc7b7c9e6ad3af4e5d51",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"ext-curl": "*",
|
|
||||||
"ext-json": "*",
|
|
||||||
"php": ">=7.0",
|
|
||||||
"phpseclib/phpseclib": "^3.0.7"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "<10",
|
|
||||||
"roave/security-advisories": "dev-latest",
|
|
||||||
"yoast/phpunit-polyfills": "^2.0"
|
|
||||||
},
|
|
||||||
"time": "2024-09-13T07:08:11+00:00",
|
|
||||||
"type": "library",
|
|
||||||
"installation-source": "source",
|
|
||||||
"autoload": {
|
|
||||||
"classmap": [
|
|
||||||
"src/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"Apache-2.0"
|
|
||||||
],
|
|
||||||
"description": "Bare-bones OpenID Connect client",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/jumbojett/OpenID-Connect-PHP/issues",
|
|
||||||
"source": "https://github.com/jumbojett/OpenID-Connect-PHP/tree/v1.0.2"
|
|
||||||
},
|
|
||||||
"install-path": "../jumbojett/openid-connect-php"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "paragonie/constant_time_encoding",
|
|
||||||
"version": "v3.1.3",
|
|
||||||
"version_normalized": "3.1.3.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/paragonie/constant_time_encoding.git",
|
|
||||||
"reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77",
|
|
||||||
"reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^8"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"infection/infection": "^0",
|
|
||||||
"nikic/php-fuzzer": "^0",
|
|
||||||
"phpunit/phpunit": "^9|^10|^11",
|
|
||||||
"vimeo/psalm": "^4|^5|^6"
|
|
||||||
},
|
|
||||||
"time": "2025-09-24T15:06:41+00:00",
|
|
||||||
"type": "library",
|
|
||||||
"installation-source": "source",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"ParagonIE\\ConstantTime\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Paragon Initiative Enterprises",
|
|
||||||
"email": "security@paragonie.com",
|
|
||||||
"homepage": "https://paragonie.com",
|
|
||||||
"role": "Maintainer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Steve 'Sc00bz' Thomas",
|
|
||||||
"email": "steve@tobtu.com",
|
|
||||||
"homepage": "https://www.tobtu.com",
|
|
||||||
"role": "Original Developer"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
|
|
||||||
"keywords": [
|
|
||||||
"base16",
|
|
||||||
"base32",
|
|
||||||
"base32_decode",
|
|
||||||
"base32_encode",
|
|
||||||
"base64",
|
|
||||||
"base64_decode",
|
|
||||||
"base64_encode",
|
|
||||||
"bin2hex",
|
|
||||||
"encoding",
|
|
||||||
"hex",
|
|
||||||
"hex2bin",
|
|
||||||
"rfc4648"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"email": "info@paragonie.com",
|
|
||||||
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
|
|
||||||
"source": "https://github.com/paragonie/constant_time_encoding"
|
|
||||||
},
|
|
||||||
"install-path": "../paragonie/constant_time_encoding"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "paragonie/random_compat",
|
|
||||||
"version": "v9.99.100",
|
|
||||||
"version_normalized": "9.99.100.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/paragonie/random_compat.git",
|
|
||||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
|
||||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">= 7"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "4.*|5.*",
|
|
||||||
"vimeo/psalm": "^1"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
|
||||||
},
|
|
||||||
"time": "2020-10-15T08:29:30+00:00",
|
|
||||||
"type": "library",
|
|
||||||
"installation-source": "source",
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Paragon Initiative Enterprises",
|
|
||||||
"email": "security@paragonie.com",
|
|
||||||
"homepage": "https://paragonie.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
|
||||||
"keywords": [
|
|
||||||
"csprng",
|
|
||||||
"polyfill",
|
|
||||||
"pseudorandom",
|
|
||||||
"random"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"email": "info@paragonie.com",
|
|
||||||
"issues": "https://github.com/paragonie/random_compat/issues",
|
|
||||||
"source": "https://github.com/paragonie/random_compat"
|
|
||||||
},
|
|
||||||
"install-path": "../paragonie/random_compat"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "phpseclib/phpseclib",
|
|
||||||
"version": "3.0.49",
|
|
||||||
"version_normalized": "3.0.49.0",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
|
||||||
"reference": "6233a1e12584754e6b5daa69fe1289b47775c1b9"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/6233a1e12584754e6b5daa69fe1289b47775c1b9",
|
|
||||||
"reference": "6233a1e12584754e6b5daa69fe1289b47775c1b9",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"paragonie/constant_time_encoding": "^1|^2|^3",
|
|
||||||
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
|
|
||||||
"php": ">=5.6.1"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "*"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"ext-dom": "Install the DOM extension to load XML formatted public keys.",
|
|
||||||
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
|
|
||||||
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
|
|
||||||
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
|
|
||||||
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
|
|
||||||
},
|
|
||||||
"time": "2026-01-27T09:17:28+00:00",
|
|
||||||
"type": "library",
|
|
||||||
"installation-source": "source",
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"phpseclib/bootstrap.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
|
||||||
"phpseclib3\\": "phpseclib/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Jim Wigginton",
|
|
||||||
"email": "terrafrost@php.net",
|
|
||||||
"role": "Lead Developer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Patrick Monnerat",
|
|
||||||
"email": "pm@datasphere.ch",
|
|
||||||
"role": "Developer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Andreas Fischer",
|
|
||||||
"email": "bantu@phpbb.com",
|
|
||||||
"role": "Developer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Hans-Jürgen Petrich",
|
|
||||||
"email": "petrich@tronic-media.com",
|
|
||||||
"role": "Developer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Graham Campbell",
|
|
||||||
"email": "graham@alt-three.com",
|
|
||||||
"role": "Developer"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
|
|
||||||
"homepage": "http://phpseclib.sourceforge.net",
|
|
||||||
"keywords": [
|
|
||||||
"BigInteger",
|
|
||||||
"aes",
|
|
||||||
"asn.1",
|
|
||||||
"asn1",
|
|
||||||
"blowfish",
|
|
||||||
"crypto",
|
|
||||||
"cryptography",
|
|
||||||
"encryption",
|
|
||||||
"rsa",
|
|
||||||
"security",
|
|
||||||
"sftp",
|
|
||||||
"signature",
|
|
||||||
"signing",
|
|
||||||
"ssh",
|
|
||||||
"twofish",
|
|
||||||
"x.509",
|
|
||||||
"x509"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/phpseclib/phpseclib/issues",
|
|
||||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.49"
|
|
||||||
},
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://github.com/terrafrost",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://www.patreon.com/phpseclib",
|
|
||||||
"type": "patreon"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"install-path": "../phpseclib/phpseclib"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dev": true,
|
|
||||||
"dev-package-names": []
|
|
||||||
}
|
|
||||||
59
kngil/vendor/composer/installed.php
vendored
59
kngil/vendor/composer/installed.php
vendored
@@ -1,59 +0,0 @@
|
|||||||
<?php return array(
|
|
||||||
'root' => array(
|
|
||||||
'name' => 'kngil/oidc',
|
|
||||||
'pretty_version' => 'dev-main',
|
|
||||||
'version' => 'dev-main',
|
|
||||||
'reference' => '21b6332c9c3d52f223e0e57d2b5c7ff633469256',
|
|
||||||
'type' => 'project',
|
|
||||||
'install_path' => __DIR__ . '/../../',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev' => true,
|
|
||||||
),
|
|
||||||
'versions' => array(
|
|
||||||
'jumbojett/openid-connect-php' => array(
|
|
||||||
'pretty_version' => 'v1.0.2',
|
|
||||||
'version' => '1.0.2.0',
|
|
||||||
'reference' => 'f327e7eb0626d55ddb6abc7b7c9e6ad3af4e5d51',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../jumbojett/openid-connect-php',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'kngil/oidc' => array(
|
|
||||||
'pretty_version' => 'dev-main',
|
|
||||||
'version' => 'dev-main',
|
|
||||||
'reference' => '21b6332c9c3d52f223e0e57d2b5c7ff633469256',
|
|
||||||
'type' => 'project',
|
|
||||||
'install_path' => __DIR__ . '/../../',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'paragonie/constant_time_encoding' => array(
|
|
||||||
'pretty_version' => 'v3.1.3',
|
|
||||||
'version' => '3.1.3.0',
|
|
||||||
'reference' => 'd5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../paragonie/constant_time_encoding',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'paragonie/random_compat' => array(
|
|
||||||
'pretty_version' => 'v9.99.100',
|
|
||||||
'version' => '9.99.100.0',
|
|
||||||
'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../paragonie/random_compat',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'phpseclib/phpseclib' => array(
|
|
||||||
'pretty_version' => '3.0.49',
|
|
||||||
'version' => '3.0.49.0',
|
|
||||||
'reference' => '6233a1e12584754e6b5daa69fe1289b47775c1b9',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../phpseclib/phpseclib',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
25
kngil/vendor/composer/platform_check.php
vendored
25
kngil/vendor/composer/platform_check.php
vendored
@@ -1,25 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// platform_check.php @generated by Composer
|
|
||||||
|
|
||||||
$issues = array();
|
|
||||||
|
|
||||||
if (!(PHP_VERSION_ID >= 80000)) {
|
|
||||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($issues) {
|
|
||||||
if (!headers_sent()) {
|
|
||||||
header('HTTP/1.1 500 Internal Server Error');
|
|
||||||
}
|
|
||||||
if (!ini_get('display_errors')) {
|
|
||||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
|
||||||
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
|
||||||
} elseif (!headers_sent()) {
|
|
||||||
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new \RuntimeException(
|
|
||||||
'Composer detected issues in your platform: ' . implode(' ', $issues)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
1
kngil/vendor/jumbojett/openid-connect-php
vendored
1
kngil/vendor/jumbojett/openid-connect-php
vendored
Submodule kngil/vendor/jumbojett/openid-connect-php deleted from f327e7eb06
Submodule kngil/vendor/paragonie/constant_time_encoding deleted from d5b01a39b3
1
kngil/vendor/paragonie/random_compat
vendored
1
kngil/vendor/paragonie/random_compat
vendored
Submodule kngil/vendor/paragonie/random_compat deleted from 996434e549
1
kngil/vendor/phpseclib/phpseclib
vendored
1
kngil/vendor/phpseclib/phpseclib
vendored
Submodule kngil/vendor/phpseclib/phpseclib deleted from 6233a1e125
2366
kngil_plain.sql
Normal file
2366
kngil_plain.sql
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user