diff options
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 14 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 47 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_inactive.php | 34 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_jabber.php | 16 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_profile.php | 8 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 |
6 files changed, 70 insertions, 51 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 2ff597ee98..bde59ec870 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -75,13 +75,6 @@ class acp_forums trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } - case 'copy_perm': - - if (!(($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) - { - trigger_error($user->lang['NO_PERMISSION_COPY'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); - } - break; } @@ -125,7 +118,6 @@ class acp_forums 'type_action' => request_var('type_action', ''), 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), 'forum_parents' => '', - 'forum_options' => 0, 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), 'forum_link' => request_var('forum_link', ''), 'forum_link_track' => request_var('forum_link_track', false), @@ -159,6 +151,12 @@ class acp_forums 'forum_password_unset' => request_var('forum_password_unset', false), ); + // On add, add empty forum_options... else do not consider it (not updating it) + if ($action == 'add') + { + $forum_data['forum_options'] = 0; + } + // Use link_display_on_index setting if forum type is link if ($forum_data['forum_type'] == FORUM_LINK) { diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 8213c55ccb..e1deb7e533 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -89,16 +89,19 @@ class acp_icons continue; } - // adjust the width and height to be lower than 128px while perserving the aspect ratio - if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) + // adjust the width and height to be lower than 128px while perserving the aspect ratio (for icons) + if ($mode == 'icons') { - $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0])); - $img_size[0] = 127; - } - else if ($img_size[1] > 127) - { - $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1])); - $img_size[1] = 127; + if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) + { + $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0])); + $img_size[0] = 127; + } + else if ($img_size[1] > 127) + { + $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1])); + $img_size[1] = 127; + } } $_images[$path . $img]['file'] = $path . $img; @@ -363,7 +366,7 @@ class acp_icons if ($mode == 'smilies' && $action == 'create') { $smiley_count = $this->item_count($table); - + $addable_smileys_count = sizeof($images); foreach ($images as $image) { @@ -372,7 +375,7 @@ class acp_icons --$addable_smileys_count; } } - + if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT) { trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING); @@ -400,15 +403,19 @@ class acp_icons $image_height[$image] = $img_size[1]; } - if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image]) + // Adjust image width/height for icons + if ($mode == 'icons') { - $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image])); - $image_width[$image] = 127; - } - else if ($image_height[$image] > 127) - { - $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image])); - $image_height[$image] = 127; + if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image]) + { + $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image])); + $image_width[$image] = 127; + } + else if ($image_height[$image] > 127) + { + $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image])); + $image_height[$image] = 127; + } } $img_sql = array( @@ -923,7 +930,7 @@ class acp_icons generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true) ); } - + /** * Returns the count of smilies or icons in the database * diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 3d0c0a2780..1a12c4967c 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -90,22 +90,19 @@ class acp_inactive if ($action == 'activate') { - if ($config['require_activation'] == USER_ACTIVATION_ADMIN) + // Get those 'being activated'... + $sql = 'SELECT user_id, username' . (($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ', user_email, user_lang' : '') . ' + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $mark) . ' + AND user_type = ' . USER_INACTIVE; + $result = $db->sql_query($sql); + + $inactive_users = array(); + while ($row = $db->sql_fetchrow($result)) { - // Get those 'being activated'... - $sql = 'SELECT user_id, username, user_email, user_lang - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $mark) . ' - AND user_type = ' . USER_INACTIVE; - $result = $db->sql_query($sql); - - $inactive_users = array(); - while ($row = $db->sql_fetchrow($result)) - { - $inactive_users[] = $row; - } - $db->sql_freeresult($result); + $inactive_users[] = $row; } + $db->sql_freeresult($result); user_active_flip('activate', $mark); @@ -136,6 +133,15 @@ class acp_inactive $messenger->save_queue(); } + if (!empty($inactive_users)) + { + foreach ($inactive_users as $row) + { + add_log('admin', 'LOG_USER_ACTIVE', $row['username']); + add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER'); + } + } + // For activate we really need to redirect, else a refresh can result in users being deactivated again $u_action = $this->u_action . "&$u_sort_param&start=$start"; $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index 3ab6eb64ed..9925527b34 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -44,13 +44,13 @@ class acp_jabber $this->tpl_name = 'acp_jabber'; $this->page_title = 'ACP_JABBER_SETTINGS'; - $jab_enable = request_var('jab_enable', $config['jab_enable']); - $jab_host = request_var('jab_host', $config['jab_host']); - $jab_port = request_var('jab_port', $config['jab_port']); - $jab_username = request_var('jab_username', $config['jab_username']); - $jab_password = request_var('jab_password', $config['jab_password']); - $jab_package_size = request_var('jab_package_size', $config['jab_package_size']); - $jab_use_ssl = request_var('jab_use_ssl', $config['jab_use_ssl']); + $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']); + $jab_host = request_var('jab_host', (string) $config['jab_host']); + $jab_port = request_var('jab_port', (int) $config['jab_port']); + $jab_username = request_var('jab_username', (string) $config['jab_username']); + $jab_password = request_var('jab_password', (string) $config['jab_password']); + $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']); + $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']); $form_name = 'acp_jabber'; add_form_key($form_name); @@ -117,7 +117,7 @@ class acp_jabber 'JAB_ENABLE' => $jab_enable, 'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/">', '</a>'), 'JAB_HOST' => $jab_host, - 'JAB_PORT' => $jab_port, + 'JAB_PORT' => ($jab_port) ? $jab_port : '', 'JAB_USERNAME' => $jab_username, 'JAB_PASSWORD' => $jab_password, 'JAB_PACKAGE_SIZE' => $jab_package_size, diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 1b0ec4b5d5..fc08c7e8e8 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -509,6 +509,14 @@ class acp_profile // Get the number of options if this key is 'field_maxlen' $var = request_var('field_default_value', 0); }*/ + else if ($field_type == FIELD_INT && $key == 'field_default_value') + { + // Permit an empty string + if (request_var('field_default_value', '') === '') + { + $var = ''; + } + } $cp->vars[$key] = $var; } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index afca056eb2..4905840e02 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1416,7 +1416,7 @@ class acp_users $now = getdate(); $s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>'; - for ($i = $now['year'] - 100; $i < $now['year']; $i++) + for ($i = $now['year'] - 100; $i <= $now['year']; $i++) { $selected = ($i == $data['bday_year']) ? ' selected="selected"' : ''; $s_birthday_year_options .= "<option value=\"$i\"$selected>$i</option>"; |