Bläddra i källkod

exit() after headers

pecesama 15 år sedan
förälder
incheckning
0d1341a930
2 ändrade filer med 5 tillägg och 6 borttagningar
  1. 1 3
      admin/index.php
  2. 4 3
      login.php

+ 1 - 3
admin/index.php Visa fil

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

+ 4 - 3
login.php Visa fil

@@ -21,11 +21,12 @@ if ($user->isAuthenticated()) {
21 21
 	header("Location: ".$conf->urlGelato."/admin/index.php");
22 22
 } else {
23 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 25
 			header("Location: ".$conf->urlGelato."/admin/index.php");
27
-		} else {
26
+			exit();
27
+		} else {			
28 28
 			header("Location: ".$conf->urlGelato."/login.php?error=1");
29
+			exit();
29 30
 		}
30 31
 	} else {
31 32
 ?>