Commit f9a8dbd4 authored by Pablo Rauzy's avatar Pablo Rauzy
Browse files

default to main domain in account.php too

parent e9c04299
......@@ -6,6 +6,9 @@ $config = require 'config.php';
if (isset($_GET['email'])) {
$db = new SQLite3($config['users']);
$name = $db->escapeString($_POST['email_login']);
if ($config['multidomain'] && !strpos($name, '.')) {
$name .= '.'.$config['domains'][0];
}
$passwd = sha1(sha1($_POST['email_password']).'cigala');
$email = filter_var($_POST['email_email'], FILTER_VALIDATE_EMAIL);
if ($email === false && strlen($_POST['email_email']) > 0) {
......@@ -24,6 +27,9 @@ if (isset($_GET['email'])) {
elseif (isset($_GET['forgot'])) {
$db = new SQLite3($config['users']);
$name = $db->escapeString($_POST['token_login']);
if ($config['multidomain'] && !strpos($name, '.')) {
$name .= '.'.$config['domains'][0];
}
$email = $db->querySingle("select email from users where name='$name'");
if (!$email) {
$_SESSION['error'] = 'Email unknown.';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment