]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix warning if no username is set in the cookie
authorRobin Appelman <icewind1991@gmail.com>
Thu, 21 Jul 2011 22:47:20 +0000 (00:47 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Thu, 21 Jul 2011 22:47:20 +0000 (00:47 +0200)
index.php

index 2e2d495fda619a81463ce4dfaf52bda6ae97cc21..dfd75492709323cceebf72593d67f80c95f35ae5 100644 (file)
--- 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