From: Robin Appelman Date: Thu, 21 Jul 2011 22:47:20 +0000 (+0200) Subject: fix warning if no username is set in the cookie X-Git-Tag: v3.0~267^2~385 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9d1c5c855bb1e5708d46960b3ad08acd805a6186;p=nextcloud-server.git fix warning if no username is set in the cookie --- diff --git a/index.php b/index.php index 2e2d495fda6..dfd75492709 100644 --- a/index.php +++ b/index.php @@ -69,14 +69,22 @@ elseif(isset($_POST["user"])) { exit(); } else { - OC_TEMPLATE::printGuestPage("", "login", array("error" => true, "username" => $_COOKIE["username"])); + if(isset($_COOKIE["username"])){ + OC_TEMPLATE::printGuestPage("", "login", array("error" => true, "username" => $_COOKIE["username"])); + }else{ + OC_TEMPLATE::printGuestPage("", "login", array("error" => true)); + } } } // For all others cases, we display the guest page : else { OC_APP::loadApps(); - OC_TEMPLATE::printGuestPage("", "login", array("error" => false, "username" => $_COOKIE["username"])); + if(isset($_COOKIE["username"])){ + OC_TEMPLATE::printGuestPage("", "login", array("error" => false, "username" => $_COOKIE["username"])); + }else{ + OC_TEMPLATE::printGuestPage("", "login", array("error" => false)); + } } ?> \ No newline at end of file