From 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 7 Jan 2020 13:06:14 +0100 Subject: Added wordpress --- srcs/wordpress/wp-signup.php | 1014 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1014 insertions(+) create mode 100644 srcs/wordpress/wp-signup.php (limited to 'srcs/wordpress/wp-signup.php') diff --git a/srcs/wordpress/wp-signup.php b/srcs/wordpress/wp-signup.php new file mode 100644 index 0000000..8457c70 --- /dev/null +++ b/srcs/wordpress/wp-signup.php @@ -0,0 +1,1014 @@ +is_404 = false; + +/** + * Fires before the Site Signup page is loaded. + * + * @since 4.4.0 + */ +do_action( 'before_signup_header' ); + +/** + * Prints styles for front-end Multisite signup pages + * + * @since MU (3.0.0) + */ +function wpmu_signup_stylesheet() { + ?> + + +
+'; +} + +$newblogname = isset( $_GET['new'] ) ? strtolower( preg_replace( '/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'] ) ) : null; + +$current_user = wp_get_current_user(); +if ( 'none' === $active_signup ) { + _e( 'Registration has been disabled.' ); +} elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) { + $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); + /* translators: %s: Login URL. */ + printf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); +} else { + $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; + switch ( $stage ) { + case 'validate-user-signup': + if ( 'all' === $active_signup + || ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup ) + || ( 'user' === $_POST['signup_for'] && 'user' === $active_signup ) + ) { + validate_user_signup(); + } else { + _e( 'User registration has been disabled.' ); + } + break; + case 'validate-blog-signup': + if ( 'all' === $active_signup || 'blog' === $active_signup ) { + validate_blog_signup(); + } else { + _e( 'Site registration has been disabled.' ); + } + break; + case 'gimmeanotherblog': + validate_another_blog_signup(); + break; + case 'default': + default: + $user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : ''; + /** + * Fires when the site sign-up form is sent. + * + * @since 3.0.0 + */ + do_action( 'preprocess_signup_form' ); + if ( is_user_logged_in() && ( 'all' === $active_signup || 'blog' === $active_signup ) ) { + signup_another_blog( $newblogname ); + } elseif ( ! is_user_logged_in() && ( 'all' === $active_signup || 'user' === $active_signup ) ) { + signup_user( $newblogname, $user_email ); + } elseif ( ! is_user_logged_in() && ( 'blog' === $active_signup ) ) { + _e( 'Sorry, new registrations are not allowed at this time.' ); + } else { + _e( 'You are logged in already. No need to register again!' ); + } + + if ( $newblogname ) { + $newblog = get_blogaddress_by_name( $newblogname ); + + if ( 'blog' === $active_signup || 'all' === $active_signup ) { + printf( + /* translators: %s: Site address. */ + '

' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '

', + '' . $newblog . '' + ); + } else { + printf( + /* translators: %s: Site address. */ + '

' . __( 'The site you were looking for, %s, does not exist.' ) . '

', + '' . $newblog . '' + ); + } + } + break; + } +} +?> +
+ + + +