login($_POST['login'], $_POST['password'])) { $url = null; if (!empty($_POST['nc']) && $_POST['nc'] == 'redirect') { $url = $users->appSessionCreateAndGetRedirectURL(); } elseif (!empty($_POST['nc'])) { $users->appSessionCreate($_POST['nc']); $error = -1; } else { $url = './'; } if ($url) { header('Location: ' . $url); exit; } } else { $error = 1; } } html_head('Login'); if ($error == -1) { echo '
You are logged in, you can close this window or tab and go back to the app.
'; exit; } if ($error) { echo 'Invalid login or password
'; } if ($install_password) { printf('Your default user is:
demo / %1$s
(this is only visible by you and will disappear when you close your browser)