Subject: [PATCH] wp-admin/install.php
The fork's change to this file, regenerated by tools/refresh-patches.sh.
It is a record, not the mechanism: core is vendored under wordpress/ and
this diff is what distinguishes it from pristine upstream.
Applies to: WordPress 7.1.1
--- a/wp-admin/install.php
+++ b/wp-admin/install.php
@@ -101,6 +101,8 @@ function display_setup_form( $error = null ) {
$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
$user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
$admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
+ // Sirius Press: the identity field on this form is a wallet address.
+ $admin_wallet = isset( $_POST['admin_wallet'] ) ? trim( wp_unslash( $_POST['admin_wallet'] ) ) : '';
if ( ! is_null( $error ) ) {
?>
@@ -175,9 +177,9 @@ function display_setup_form( $error = null ) {
-
-
-
+
+
+
@@ -411,10 +413,20 @@ switch ( $step ) {
$user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
$admin_password = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : '';
$admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : '';
- $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
+ $admin_wallet = isset( $_POST['admin_wallet'] ) ? trim( wp_unslash( $_POST['admin_wallet'] ) ) : '';
$public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;
- // Check email address.
+ /*
+ * Sirius Press: there is no email step. The account identity is a
+ * CashAddress, and it is optional here because the installer has nothing
+ * to verify a signature against yet — the site does not exist. An address
+ * typed now is attached below; an administrator who leaves it blank
+ * attaches one from their profile afterwards, where they can prove it.
+ */
+ $admin_wallet = sirius_press_install_address( $admin_wallet );
+ $admin_email = sirius_press_install_stub_email( $admin_wallet );
+
+ // Check the username and password.
$error = false;
if ( empty( $user_name ) ) {
// TODO: Poka-yoke.
@@ -427,19 +439,20 @@ switch ( $step ) {
// TODO: Poka-yoke.
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
$error = true;
- } elseif ( empty( $admin_email ) ) {
- // TODO: Poka-yoke.
- display_setup_form( __( 'You must provide an email address.' ) );
- $error = true;
- } elseif ( ! is_email( $admin_email ) ) {
- // TODO: Poka-yoke.
- display_setup_form( __( 'Sorry, that is not a valid email address. Email addresses look like username@example.com.' ) );
+ } elseif ( false === $admin_wallet ) {
+ display_setup_form( __( 'Sorry, that is not a valid Bitcoin Cash address. Leave the field blank if you would rather attach a wallet after installing.' ) );
$error = true;
}
if ( false === $error ) {
$wpdb->show_errors();
$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
+
+ // Sirius Press: record the administrator's wallet so they can sign in
+ // with it immediately.
+ if ( '' !== $admin_wallet && ! empty( $result['user_id'] ) ) {
+ update_user_meta( (int) $result['user_id'], 'sirius_wallet_address', $admin_wallet );
+ }
?>