More new_users_can_blog fixes, including to the registration form and resolution to http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000280

git-svn-id: https://develop.svn.wordpress.org/trunk@1667 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-09-16 10:26:39 +00:00
parent c69ee23851
commit b47e9a5139
2 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ window.onload = focusit;
<fieldset id="poststatusdiv">
<legend><a href="http://wordpress.org/docs/reference/post/#post_status" title="<?php _e('Help on post status') ?>"><?php _e('Post Status') ?></a></legend>
<div>
<?php if ( 2 == get_option('new_users_can_blog') && 1 != $user_level ) : ?>
<?php if ( 1 < $user_level || (1 == $user_level && 2 == get_option('new_users_can_blog')) ) : ?>
<label for="post_status_publish" class="selectit"><input id="post_status_publish" name="post_status" type="radio" value="publish" <?php checked($post_status, 'publish'); ?> /> <?php _e('Publish') ?></label>
<?php endif; ?>
<label for="post_status_draft" class="selectit"><input id="post_status_draft" name="post_status" type="radio" value="draft" <?php checked($post_status, 'draft'); ?> /> <?php _e('Draft') ?></label>
@ -124,7 +124,7 @@ edCanvas = document.getElementById('content');
<?php
if ('publish' != $post_status || 0 == $post_ID) {
?>
<?php if ( 2 == get_option('new_users_can_blog') && 1 != $user_level ) : ?>
<?php if ( 1 < $user_level || (1 == $user_level && 2 == get_option('new_users_can_blog')) ) : ?>
<input name="publish" type="submit" id="publish" tabindex="10" value="<?php _e('Publish') ?>" />
<?php endif; ?>
<?php

View File

@ -85,12 +85,12 @@ case 'register':
$user_nickname = $wpdb->escape($user_nickname);
$user_nicename = sanitize_title($user_nickname);
$now = gmdate('Y-m-d H:i:s');
$new_users_can_blog = get_settings('new_users_can_blog');
if (get_settings('new_users_can_blog') >= 1) $user_level = 1;
$result = $wpdb->query("INSERT INTO $wpdb->users
(user_login, user_pass, user_nickname, user_email, user_ip, user_browser, dateYMDhour, user_level, user_idmode, user_nicename)
VALUES
('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_browser', '$now', '$new_users_can_blog', 'nickname', '$user_nicename')");
('$user_login', MD5('$pass1'), '$user_nickname', '$user_email', '$user_ip', '$user_browser', '$now', '$user_level', 'nickname', '$user_nicename')");
if ($result == false) {
die (sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_settings('admin_email')));