From c2c05916cdf24690c2611f228af5ab8d9bc81dac Mon Sep 17 00:00:00 2001 From: nanosimbiot Date: Wed, 10 Apr 2013 18:12:05 +0000 Subject: [PATCH] r498 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit правка багов git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@498 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/admin/admin_attach_cp.php | 16 ++++++---------- upload/includes/ucp/usercp_register.php | 7 +++++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/upload/admin/admin_attach_cp.php b/upload/admin/admin_attach_cp.php index 36e0e33d9..d7c54dac8 100644 --- a/upload/admin/admin_attach_cp.php +++ b/upload/admin/admin_attach_cp.php @@ -440,16 +440,7 @@ if ($view == 'attachments') WHERE a.attach_id IN (" . implode(', ', $attach_id) . ") " . $order_by; - } - else if ($search_based) - { - // we are called from search - $attachments = search_attachments($order_by, $total_rows); - } - - if (!$search_based) - { - if ( !($result = DB()->sql_query($sql)) ) + if ( !($result = DB()->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Couldn\'t query attachments', '', __LINE__, __FILE__, $sql); } @@ -458,6 +449,11 @@ if ($view == 'attachments') $num_attach = DB()->num_rows($result); DB()->sql_freeresult($result); } + else + { + // we are called from search + $attachments = search_attachments($order_by, $total_rows); + } if (sizeof($attachments) > 0) { diff --git a/upload/includes/ucp/usercp_register.php b/upload/includes/ucp/usercp_register.php index 1be0074ec..32fcbb452 100644 --- a/upload/includes/ucp/usercp_register.php +++ b/upload/includes/ucp/usercp_register.php @@ -311,8 +311,11 @@ foreach ($profile_fields as $field => $can_edit) { $errors[] = $err; } - $pr_data['user_active'] = 0; - $db_data['user_active'] = 0; + if ($bb_cfg['require_activation'] == USER_ACTIVATION_SELF || $bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN) + { + $pr_data['user_active'] = 0; + $db_data['user_active'] = 0; + } $db_data['user_email'] = $email; } }