From ac9a60e8fe0b3db256319f68879be8893ed2b472 Mon Sep 17 00:00:00 2001 From: hskwon Date: Thu, 11 Dec 2025 10:22:22 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=84=B8=EC=85=98=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=20=ED=98=B8=EC=B6=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20=EB=B0=8F=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - session.php: isset($_SESSION) → session_status() 방식으로 변경 - notice/list.php: BOM 문자 제거 - login/login_result.php: 코드 포맷팅 정리 --- login/login_result.php | 144 ++++++++++++++++++++--------------------- notice/list.php | 2 +- session.php | 5 +- 3 files changed, 76 insertions(+), 75 deletions(-) diff --git a/login/login_result.php b/login/login_result.php index adc15634..979f1666 100644 --- a/login/login_result.php +++ b/login/login_result.php @@ -1,98 +1,98 @@ prepare($sql); - $stmh->bindValue(1,$id,PDO::PARAM_STR); - $stmh->execute(); - $count=$stmh->rowCount(); - } catch (PDOException $Exception) { - print "오류: ".$Exception->getMessage(); +try { + $sql = "select * from $DB.member where id=?"; + $stmh = $pdo->prepare($sql); + $stmh->bindValue(1, $id, PDO::PARAM_STR); + $stmh->execute(); + $count = $stmh->rowCount(); +} catch (PDOException $Exception) { + print "오류: " . $Exception->getMessage(); } -$row=$stmh->fetch(PDO::FETCH_ASSOC); +$row = $stmh->fetch(PDO::FETCH_ASSOC); -if($count<1) { +if ($count < 1) { ?> - + - - - + alert("비밀번호가 틀립니다.!"); + history.back(); + + - - + + beginTransaction(); - $sql = "insert into chandj.logdata(data) values(?) " ; - $stmh = $pdo->prepare($sql); - $stmh->bindValue(1, $data, PDO::PARAM_STR); - $stmh->execute(); - $pdo->commit(); + $_SESSION["userid"] = $row["id"] ?? ''; + $_SESSION["name"] = $row["name"] ?? ''; + $_SESSION["nick"] = $row["nick"] ?? ''; + $_SESSION["level"] = $row["lv"] ?? ''; + $_SESSION["authority"] = $row["authority"] ?? ''; + + $_SESSION["ecountID"] = $row["ecountID"] ?? ''; + $_SESSION["division"] = $row["division"] ?? ''; + $_SESSION["mycompany"] = $row["division"] ?? ''; + $_SESSION["mypart"] = $row["part"] ?? ''; + $_SESSION["eworks_level"] = $row["eworks_lv"] ?? ''; + $_SESSION["eworks_lv"] = $row["eworks_lv"] ?? ''; + $_SESSION["position"] = $row["position"] ?? ''; + $_SESSION["hp"] = $row["hp"] ?? ''; + $_SESSION["authority"] = $row["authority"] ?? ''; + + $_SESSION["first_approval_id"] = $row["first_approval_id"] ?? ''; + $_SESSION["first_approval_name"] = $row["first_approval_name"] ?? ''; + + // log 기록 + $data = date("Y-m-d H:i:s") . " - " . $_SESSION["userid"] . " - " . $_SESSION["name"]; + $pdo->beginTransaction(); + $sql = "insert into chandj.logdata(data) values(?) "; + $stmh = $pdo->prepare($sql); + $stmh->bindValue(1, $data, PDO::PARAM_STR); + $stmh->execute(); + $pdo->commit(); // 로그인 성공 시 쿠키 설정 -setcookie("showTodoView", "show", time() + 86400, "/"); // 1일 동안 유효 -setcookie("showBoardView", "show", time() + 86400, "/"); // 1일 동안 유효 + setcookie("showTodoView", "show", time() + 86400, "/"); // 1일 동안 유효 + setcookie("showBoardView", "show", time() + 86400, "/"); // 1일 동안 유효 // 세무사열림 아이디는 별도처리 (회계부분 메뉴만 보이게) // 회계사무실 수정 // if($_SESSION["userid"] == '0266771300') { -if($_SESSION["userid"] == '0266771300') { - header ("Location:/index_accountant.php"); - exit; -} + if ($_SESSION["userid"] == '0266771300') { + header("Location:/index_accountant.php"); + exit; + } - if($_SESSION["division"] == '경동') - header ("Location:/index.php"); - else - header ("Location:/index1.php"); + if ($_SESSION["division"] == '경동') + header("Location:/index.php"); + else + header("Location:/index1.php"); exit; } ?> \ No newline at end of file diff --git a/notice/list.php b/notice/list.php index 21fa4bb5..1da025e1 100644 --- a/notice/list.php +++ b/notice/list.php @@ -1,4 +1,4 @@ -