Auto login after installation
This commit is contained in:
parent
8a17fa9709
commit
967c66b40a
@ -44,9 +44,13 @@ class Session extends Module {
|
|||||||
# Path to Lychee for the server-import dialog
|
# Path to Lychee for the server-import dialog
|
||||||
$return['config']['location'] = LYCHEE;
|
$return['config']['location'] = LYCHEE;
|
||||||
|
|
||||||
# No login
|
# Check if login credentials exist and login if they don't
|
||||||
if ($this->settings['username']===''&&$this->settings['password']==='') $return['config']['login'] = false;
|
if ($this->noLogin()===true) {
|
||||||
else $return['config']['login'] = true;
|
$public = false;
|
||||||
|
$return['config']['login'] = false;
|
||||||
|
} else {
|
||||||
|
$return['config']['login'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($public===false) {
|
if ($public===false) {
|
||||||
|
|
||||||
@ -109,6 +113,21 @@ class Session extends Module {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function noLogin() {
|
||||||
|
|
||||||
|
# Check dependencies
|
||||||
|
self::dependencies(isset($this->settings));
|
||||||
|
|
||||||
|
# Check if login credentials exist and login if they don't
|
||||||
|
if ($this->settings['username']===''&&$this->settings['password']==='') {
|
||||||
|
$_SESSION['login'] = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function logout() {
|
public function logout() {
|
||||||
|
|
||||||
# Call plugins
|
# Call plugins
|
||||||
|
Loading…
Reference in New Issue
Block a user