Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
Fixed annoying undefined variable notices
Browse files Browse the repository at this point in the history
  • Loading branch information
smajda committed Jul 21, 2009
1 parent bc7eeb4 commit ab64bba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions includes/access.php
Expand Up @@ -60,7 +60,7 @@ class="wide" type='text' name='input_user' /><br />


session_start(); session_start();


if(!$_SESSION['authenticated']) { if(!isset($_SESSION['authenticated'])) {


if (isset($_COOKIE['todotxt-user']) && isset($_COOKIE['todotxt-pass'])) { if (isset($_COOKIE['todotxt-user']) && isset($_COOKIE['todotxt-pass'])) {


Expand All @@ -71,7 +71,7 @@ class="wide" type='text' name='input_user' /><br />
displayform(1); displayform(1);
} }


} elseif($_POST['loginbutton']) { } elseif(isset($_POST['loginbutton'])) {


if (($_POST['input_user'] == $user) && ($_POST['input_password'] == $password)) { if (($_POST['input_user'] == $user) && ($_POST['input_password'] == $password)) {


Expand All @@ -82,7 +82,7 @@ class="wide" type='text' name='input_user' /><br />
setcookie('todotxt-pass', md5($_POST['input_password']), $expire); setcookie('todotxt-pass', md5($_POST['input_password']), $expire);
} }
$_SESSION['authenticated'] = 1; $_SESSION['authenticated'] = 1;
header("Location:".$todoURL); header("Location:".$todoUrl);


} else { } else {
displayform(1); displayform(1);
Expand Down
5 changes: 3 additions & 2 deletions includes/todo.php
Expand Up @@ -2,11 +2,12 @@


// process $_POST // process $_POST
function get_cmd($_POST, $id='cmd') { function get_cmd($_POST, $id='cmd') {
if($cmd=$_POST[$id]) { if(isset($_POST[$id]) && $cmd=$_POST[$id]) {
$cmd=rawurldecode($cmd); $cmd=rawurldecode($cmd);
$cmd=stripslashes($cmd); $cmd=stripslashes($cmd);
} }
return $cmd; if(isset($cmd))
return $cmd;
} }


// checks if a command is an ls command or not // checks if a command is an ls command or not
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -2,7 +2,7 @@
require_once('includes/config.php'); require_once('includes/config.php');
require_once('includes/access.php'); require_once('includes/access.php');
require_once('includes/todo.php'); require_once('includes/todo.php');
if($_GET['logout'] == 'true') {logout();} if(isset($_GET['logout'])) { $_GET['logout'] == 'true' ? logout() : '';}
$cmd = get_cmd($_POST); $cmd = get_cmd($_POST);
$cmd2 = get_cmd($_POST, 'cmd2'); $cmd2 = get_cmd($_POST, 'cmd2');
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"> ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
Expand Down

0 comments on commit ab64bba

Please sign in to comment.