Implement Google FBL

This commit is contained in:
danwin1210 committed 2026-10-13 14:31:03 +02:00
1 parent 1ff7d4131d
commit 938bfab606
8 files changed
+113 -9

No files matched your search

+2 -3
View File
@@ -69,8 +69,8 @@ if ( isset( $_POST[ 'user' ] ) ) {
$hash = password_hash( $_POST[ 'pwd' ], PASSWORD_ARGON2ID );
$stmt = $db->prepare( 'INSERT INTO alias (address, goto, domain, created, modified) VALUES (?, ?, ?, NOW(), NOW());' );
$stmt->execute( [ "$user@$domain", "$user@$domain", $domain ] );
$stmt = $db->prepare( 'INSERT INTO mailbox (username, password, quota, local_part, domain, created, modified, password_hash_type, openpgpkey_wkd) VALUES(?, ?, ?, ?, ?, NOW(), NOW(), ?, ?);' );
$stmt->execute( [ "$user@$domain", $hash, DEFAULT_QUOTA, $user, $domain, '{ARGON2ID}', z_base32_encode( hash( 'sha1', mb_strtolower( $user ), true ) ) ] );
$stmt = $db->prepare( 'INSERT INTO mailbox (username, password, quota, local_part, domain, created, modified, password_hash_type, openpgpkey_wkd, feedback_id) VALUES(?, ?, ?, ?, ?, NOW(), NOW(), ?, ?, ?);' );
$stmt->execute( [ "$user@$domain", $hash, DEFAULT_QUOTA, $user, $domain, '{ARGON2ID}', z_base32_encode( hash( 'sha1', mb_strtolower( $user ), true ) ), generate_feedback_id( $db ) ] );
$msg .= '<div class="green" role="alert">'.htmlspecialchars(_('Successfully created new mailbox!')).'</div>';
}
}
@@ -135,4 +135,3 @@ if( ! REGISTRATION_ENABLED ) {
</main>
</body>
</html>