diff options
author | Bartek Przybylski <bart.p.pl@gmail.com> | 2011-07-20 17:04:14 +0400 |
---|---|---|
committer | Bartek Przybylski <bart.p.pl@gmail.com> | 2011-07-20 17:04:14 +0400 |
commit | c5776fdae4c6ae1fbad1831946d2e6ba4fa0ffac (patch) | |
tree | bb9e9bcdea3899f0a0a7d19cb765d2692b55c54d /index.php | |
parent | 6230001a3c80c081001c46197cc95403cc73622f (diff) |
remember login added
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/index.php b/index.php index d1726676c66..2e2d495fda6 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,6 @@ OC_UTIL::addScript('setup'); $not_installed = !OC_CONFIG::getValue('installed', false); $install_called = (isset($_POST['install']) AND $_POST['install']=='true'); - // First step : check if the server is correctly configured for ownCloud : $errors = OC_UTIL::checkServer(); if(count($errors) > 0) { @@ -61,17 +60,23 @@ elseif(isset($_POST["user"])) { OC_APP::loadApps(); if(OC_USER::login($_POST["user"], $_POST["password"])) { header("Location: ".$WEBROOT.'/'.OC_APPCONFIG::getValue("core", "defaultpage", "files/index.php")); + if(!empty($_POST["remember_login"])){ + OC_USER::setUsernameInCookie($_POST["user"]); + } + else { + OC_USER::unsetUsernameInCookie(); + } exit(); } else { - OC_TEMPLATE::printGuestPage("", "login", array("error" => true)); + OC_TEMPLATE::printGuestPage("", "login", array("error" => true, "username" => $_COOKIE["username"])); } } // For all others cases, we display the guest page : else { OC_APP::loadApps(); - OC_TEMPLATE::printGuestPage("", "login", array("error" => false)); + OC_TEMPLATE::printGuestPage("", "login", array("error" => false, "username" => $_COOKIE["username"])); } ?>
\ No newline at end of file |