Add primary domain in setup.php

This commit is contained in:
2024-06-06 16:38:45 +02:00
parent f197f10228
commit bef733240f
7 changed files with 15 additions and 6 deletions

View File

@ -49,7 +49,7 @@ if ( $_SERVER[ 'REQUEST_METHOD' ] === 'POST' ) {
if ( $ok ) {
$db = get_db_instance();
$user = $match[ 1 ];
$domain = $match[ 3 ] ?? PRIMARY_DOMAIN;
$domain = $match[ 3 ] ?? CLEARNET_SERVER;
$stmt = $db->prepare( 'SELECT target_domain FROM alias_domain WHERE alias_domain = ? AND active=1;' );
$stmt->execute( [ $domain ] );
if ( $tmp = $stmt->fetch( PDO::FETCH_ASSOC ) ) {

View File

@ -31,7 +31,7 @@ if ( isset( $_POST[ 'user' ] ) ) {
$msg .= '<div class="red" role="alert">'.htmlspecialchars(_('Invalid username. It may not contain a +, \', " or /.')).'</div>';
}
$user = mb_strtolower( $match[ 1 ] ?? '' );
$domain = $match[ 3 ] ?? PRIMARY_DOMAIN;
$domain = $match[ 3 ] ?? CLEARNET_SERVER;
if ( $ok && ( empty( $_POST[ 'pwd' ] ) || empty( $_POST[ 'pwd2' ] ) || $_POST[ 'pwd' ] !== $_POST[ 'pwd2' ] ) ) {
$ok = false;
$msg .= '<div class="red" role="alert">'.htmlspecialchars(_('Passwords empty or don\'t match')).'</div>';