소스 검색

exit() after headers

pecesama 17 년 전
부모
커밋
0d1341a930
2개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 3
      admin/index.php
  2. 4 3
      login.php

+ 1 - 3
admin/index.php 파일 보기

12
   =========================== */
12
   =========================== */
13
 ?>
13
 ?>
14
 <?php
14
 <?php
15
-
16
-
17
 require('../entry.php');
15
 require('../entry.php');
18
 global $user, $conf, $tumble;
16
 global $user, $conf, $tumble;
19
 $template = new plantillas("admin");
17
 $template = new plantillas("admin");
21
 $isEdition = (isset($_GET["edit"])) ? true : false;
19
 $isEdition = (isset($_GET["edit"])) ? true : false;
22
 $postId = ($isEdition) ? $_GET["edit"] : NULL;
20
 $postId = ($isEdition) ? $_GET["edit"] : NULL;
23
 
21
 
24
-if ($user->isAdmin()) {
22
+if ($user->isAuthenticated()) {
25
 
23
 
26
 	if (isset($_GET["delete"])) {
24
 	if (isset($_GET["delete"])) {
27
 		$tumble->deletePost($_GET['delete']);
25
 		$tumble->deletePost($_GET['delete']);

+ 4 - 3
login.php 파일 보기

21
 	header("Location: ".$conf->urlGelato."/admin/index.php");
21
 	header("Location: ".$conf->urlGelato."/admin/index.php");
22
 } else {
22
 } else {
23
 	if (isset($_POST["pass"]) && isset($_POST["login"])) {		
23
 	if (isset($_POST["pass"]) && isset($_POST["login"])) {		
24
-		//print "<pre>"; print_r($_SESSION); print "</pre>";die();
25
-		if ($user->validateUser($_POST['login'], md5($_POST['pass']))) {
24
+		if ($user->validateUser($_POST['login'], md5($_POST['pass']))) {			
26
 			header("Location: ".$conf->urlGelato."/admin/index.php");
25
 			header("Location: ".$conf->urlGelato."/admin/index.php");
27
-		} else {
26
+			exit();
27
+		} else {			
28
 			header("Location: ".$conf->urlGelato."/login.php?error=1");
28
 			header("Location: ".$conf->urlGelato."/login.php?error=1");
29
+			exit();
29
 		}
30
 		}
30
 	} else {
31
 	} else {
31
 ?>
32
 ?>