<?php ? require('./wp-config.php');require_once( ABSPATH . WPINC . '/registration-functions.php');$action = $_REQUEST['action']; if ( !get_settings('users_can_register') ) $action = 'disabled'; header( 'Content-Type: ' . get_bloginfo('html_type') . '; charset=' . get_bloginfo('charset') ); switch( $action ) { case 'register': $user_login = sanitize_user( $_POST['user_login'] ); $user_email = $_POST['user_email']; $errors = array(); if ( $user_login == '' ) $errors['user_login'] = __('
ERROR: Per favore,scegli un nickname.');if ($user_email == '') { $errors['user_email'] = __('
ERROR: Please type your e-mail address.'); } else if (!is_email($user_email)) {$errors['user_email'] = __('
ERROR: The email address isn’t correct.'); $user_email = ''; } if ( ! validate_username($user_login) ) { $errors['user_login'] = __('
ERROR: Questo nickname non è valido.Per favore inserisci un nickname valido.'); $user_login = ''; } if ( username_exists( $user_login ) )$errors['user_login'] = __('
ERROR: Spiacente,ma il nickname inserito è già utilizzato.');$email_exists = $wpdb->get_row("SELECT user_email FROM $wpdb->users WHERE user_email = '$user_email'"); if ( $email_exists) die (__('
ERROR: Questo indirizzo email è gia in uso,per favore inserisci un'altra email.')); if ( 0 == count($errors) ) {$password = substr( md5( uniqid( microtime() ) ), 0, 7);$user_id = wp_create_user( $user_login, $password, $user_email );if( !$user_id )$errors['user_id'] = sprintf(__('
ERROR: Hai problemi con la registrazione?Contatta l'
amministratore. !'), get_settings('admin_email')); else wp_new_user_notification($user_id, $password); } if ( 0 == count($errors) ) { ?><meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> .submit { font-size: 1.7em;}<div id="login"><h2><?php _e('Registrazione Completata.') ?></h2>
<?php printf(__('Username: %s'), "
" . wp_specialchars($user_login) . "") ?>
<?php printf(__('Password: %s'), '
' . __('emailed to you') . '') ?>
<?php printf(__('E-mail: %s'), "
" . wp_specialchars($user_email) . "") ?></p> <p class="submit">
<?php _e('Login'); ?> »</p> </div><?php break;}default:<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> #user_email, #user_login, #submit { font-size: 1.7em; }<div id="login"><h2><?php _e('Register for this blog') ?></h2> <?php if ( isset($errors) ) : ?> <div class="error"> <ul> <?php foreach($errors as $error) echo "[*]$error"; ?>[/list]</div><?php endif; ?> <form method="post" action="wp-register.php" id="registerform">
<input type="hidden" name="action" value="register" /><label for="user_login"><?php _e('Username:') ?></label>