Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2011-07-20 17:04:14 +0400
committerBartek Przybylski <bart.p.pl@gmail.com>2011-07-20 17:04:14 +0400
commitc5776fdae4c6ae1fbad1831946d2e6ba4fa0ffac (patch)
treebb9e9bcdea3899f0a0a7d19cb765d2692b55c54d /index.php
parent6230001a3c80c081001c46197cc95403cc73622f (diff)
remember login added
Diffstat (limited to 'index.php')
-rw-r--r--index.php11
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