- fix some oddities (doubled spaces for example)

- changed the way make_forum_select() is returning the forum list - now including skipped forums but being disabled. This should make identifying the correct forum much more easier.
- Changed some permission namings based on suggestions by the community
- Tried to comply to the permission field ordering within the language files while displaying permission sets. Hopefully it's worth the additional processing time.
- Disable submit buttons after clicking for installation and conversions.


git-svn-id: file:///svn/phpbb/trunk@6930 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-01-26 16:09:51 +00:00
parent 920fc0156d
commit ddddda47fb
59 changed files with 163 additions and 144 deletions

View file

@ -879,6 +879,11 @@ a.button2, a.button2:link, a.button2:visited, a.button2:active {
padding: 4px 8px; padding: 4px 8px;
} }
input.disabled {
font-weight: normal;
color: #666;
}
/* Action Highlighting /* Action Highlighting
---------------------------------------- */ ---------------------------------------- */
.success { .success {

View file

@ -115,7 +115,7 @@
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<!-- IF L_MESSAGE --><p>{L_MESSAGE}</p><!-- ENDIF --> <!-- IF L_MESSAGE --><p>{L_MESSAGE}</p><!-- ENDIF -->
{S_HIDDEN} {S_HIDDEN}
<!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> <!-- IF L_SUBMIT --><input class="button1<!-- IF S_REFRESH --> disabled<!-- ENDIF -->" type="submit" id="submit" <!-- IF S_REFRESH -->disabled="disabled" <!-- ELSE --> onclick="this.className = 'button1 disabled';" onsubmit="this.disabled = 'disabled';" <!-- ENDIF -->name="submit" value="{L_SUBMIT}" /><!-- ENDIF -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -68,7 +68,7 @@
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
{S_HIDDEN} {S_HIDDEN}
<!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> <!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" onclick="this.className = 'button1 disabled';" onsubmit="this.disabled = 'disabled';" name="submit" value="{L_SUBMIT}" /><!-- ENDIF -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -325,6 +325,7 @@ class acp_language
if ($result === false) if ($result === false)
{ {
// If failed, try to rename again and print error out... // If failed, try to rename again and print error out...
$transfer->delete_file($lang_path . $file);
$transfer->rename($lang_path . $file . '.bak', $lang_path . $file); $transfer->rename($lang_path . $file . '.bak', $lang_path . $file);
trigger_error($user->lang['UPLOAD_FAILED'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); trigger_error($user->lang['UPLOAD_FAILED'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);

View file

@ -305,7 +305,7 @@ class acp_permissions
$s_forum_options = ''; $s_forum_options = '';
foreach ($forum_list as $f_id => $f_row) foreach ($forum_list as $f_id => $f_row)
{ {
$s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>'; $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
} }
// Build subforum options // Build subforum options
@ -488,6 +488,11 @@ class acp_permissions
foreach ($forum_list as $key => $row) foreach ($forum_list as $key => $row)
{ {
if ($row['disabled'])
{
continue;
}
$s_options .= '<option value="' . $row['forum_id'] . '"' . (($row['selected']) ? ' selected="selected"' : '') . '>' . $row['padding'] . $row['forum_name']; $s_options .= '<option value="' . $row['forum_id'] . '"' . (($row['selected']) ? ' selected="selected"' : '') . '>' . $row['padding'] . $row['forum_name'];
// We check if a branch is there... // We check if a branch is there...

View file

@ -1917,14 +1917,7 @@ class acp_users
} }
$s_forum_options = '<option value="0"' . ((!$forum_id) ? ' selected="selected"' : '') . '>' . $user->lang['VIEW_GLOBAL_PERMS'] . '</option>'; $s_forum_options = '<option value="0"' . ((!$forum_id) ? ' selected="selected"' : '') . '>' . $user->lang['VIEW_GLOBAL_PERMS'] . '</option>';
$s_forum_options .= make_forum_select($forum_id, false, true, false, false, false);
$forum_list = make_forum_select($forum_id, false, true, false, false, false, true);
// Build forum options
foreach ($forum_list as $f_id => $f_row)
{
$s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
}
$template->assign_vars(array( $template->assign_vars(array(
'S_PERMISSIONS' => true, 'S_PERMISSIONS' => true,

View file

@ -323,6 +323,16 @@ class auth_admin extends auth
if ($local) if ($local)
{ {
$forum_names_ary = make_forum_select(false, false, true, false, false, false, true); $forum_names_ary = make_forum_select(false, false, true, false, false, false, true);
// Remove the disabled ones, since we do not create an option field here...
foreach ($forum_names_ary as $key => $value)
{
if (!$value['disabled'])
{
continue;
}
unset($forum_names_ary[$key]);
}
} }
else else
{ {
@ -1070,6 +1080,19 @@ class auth_admin extends auth
'CAT_NAME' => $user->lang['permission_cat'][$cat]) 'CAT_NAME' => $user->lang['permission_cat'][$cat])
); );
// Sort array
$key_array = array_intersect(array_keys($user->lang), array_map(create_function('$a', 'return "acl_" . $a;'), array_keys($cat_array['permissions'])));
$values_array = $cat_array['permissions'];
$cat_array['permissions'] = array();
foreach ($key_array as $key)
{
$key = str_replace('acl_', '', $key);
$cat_array['permissions'][$key] = $values_array[$key];
}
unset($key_array, $values_array);
@reset($cat_array['permissions']); @reset($cat_array['permissions']);
while (list($permission, $allowed) = each($cat_array['permissions'])) while (list($permission, $allowed) = each($cat_array['permissions']))
{ {

View file

@ -114,7 +114,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
ORDER BY left_id ASC'; ORDER BY left_id ASC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$right = $iteration = 0; $right = 0;
$padding_store = array('0' => ''); $padding_store = array('0' => '');
$padding = ''; $padding = '';
$forum_list = ($return_array) ? array() : ''; $forum_list = ($return_array) ? array() : '';
@ -136,41 +136,44 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
} }
$right = $row['right_id']; $right = $row['right_id'];
$disabled = false;
if ($acl && !$auth->acl_gets($acl, $row['forum_id'])) if ($acl && !$auth->acl_gets($acl, $row['forum_id']))
{ {
continue; // List permission?
if ($auth->acl_get('f_list', $row['forum_id']))
{
$disabled = true;
} }
else
if ((is_array($ignore_id) && in_array($row['forum_id'], $ignore_id)) || $row['forum_id'] == $ignore_id)
{ {
continue; continue;
} }
}
if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat) if (
{ ((is_array($ignore_id) && in_array($row['forum_id'], $ignore_id)) || $row['forum_id'] == $ignore_id)
||
// Non-postable forum with no subforums, don't display // Non-postable forum with no subforums, don't display
continue; ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']) && $ignore_emptycat)
} ||
($row['forum_type'] != FORUM_POST && $ignore_nonpost)
if ($row['forum_type'] != FORUM_POST && $ignore_nonpost) )
{ {
continue; $disabled = true;
} }
if ($return_array) if ($return_array)
{ {
// Include some more information... // Include some more information...
$selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false); $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false);
$forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => $selected), $row); $forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => ($selected && !$disabled), 'disabled' => $disabled), $row);
} }
else else
{ {
$selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? ' selected="selected"' : '') : (($row['forum_id'] == $select_id) ? ' selected="selected"' : ''); $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? ' selected="selected"' : '') : (($row['forum_id'] == $select_id) ? ' selected="selected"' : '');
$forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $padding . $row['forum_name'] . '</option>'; $forum_list .= '<option value="' . $row['forum_id'] . '"' . (($disabled) ? ' disabled="disabled"' : $selected) . '>' . $padding . $row['forum_name'] . '</option>';
} }
$iteration++;
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
unset($padding_store); unset($padding_store);

View file

@ -43,7 +43,7 @@ function still_on_time()
$max_execution_time = min(max(10, ($max_execution_time - 15)), 250); $max_execution_time = min(max(10, ($max_execution_time - 15)), 250);
// For debugging purposes // For debugging purposes
// $max_execution_time = 30; $max_execution_time = 10;
global $starttime; global $starttime;
$start_time = (empty($starttime)) ? $current_time : $starttime; $start_time = (empty($starttime)) ? $current_time : $starttime;

View file

@ -1293,15 +1293,19 @@ function validate_password($password)
/** /**
* Check to see if email address is banned or already present in the DB * Check to see if email address is banned or already present in the DB
* *
* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) * @param string $email The email to check
* @param string $allowed_email An allowed email, default being $user->data['user_email']
*
* @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/ */
function validate_email($email) function validate_email($email, $allowed_email = false)
{ {
global $config, $db, $user; global $config, $db, $user;
$email = strtolower($email); $email = strtolower($email);
$allowed_email = ($allowed_email === false) ? strtolower($user->data['user_email']) : strtolower($allowed_email);
if (strtolower($user->data['user_email']) == $email) if ($allowed_email == $email)
{ {
return false; return false;
} }
@ -1468,13 +1472,14 @@ function avatar_upload($data, &$error)
$destination = $config['avatar_path']; $destination = $config['avatar_path'];
if ($destination[sizeof($destination) - 1] == '/' || $destination[sizeof($destination) - 1] == '\\') // Adjust destination path (no trailing slash)
if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
{ {
$destination = substr($destination, 0, -1); $destination = substr($destination, 0, -1);
} }
$destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
if ($destination && ($destination[0] == '/' || $destination[0] == '\\')) if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
{ {
$destination = ''; $destination = '';
} }

View file

@ -52,7 +52,7 @@ class ucp_profile
'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'email' => array( 'email' => array(
array('string', false, 6, 60), array('string', false, 6, 60),
array('email', $data['email'])), array('email')),
'email_confirm' => array('string', true, 6, 60), 'email_confirm' => array('string', true, 6, 60),
); );

View file

@ -1704,10 +1704,11 @@ class install_convert extends module
*/ */
function meta_refresh($url) function meta_refresh($url)
{ {
global $convert; global $convert, $template;
if ($convert->options['refresh']) if ($convert->options['refresh'])
{ {
$template->assign_var('S_REFRESH', true);
meta_refresh(5, $url); meta_refresh(5, $url);
} }
} }

View file

@ -128,11 +128,11 @@ $lang = array_merge($lang, array(
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'post'), 'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'post'),
'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'post'), 'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'post'),
'acl_f_post' => array('lang' => 'Can post in forum', 'cat' => 'post'), 'acl_f_post' => array('lang' => 'Can start new topics', 'cat' => 'post'),
'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'),
'acl_f_icons' => array('lang' => 'Can use post icons', 'cat' => 'post'),
'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'), 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'),
'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'), 'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'),
'acl_f_reply' => array('lang' => 'Can reply to posts', 'cat' => 'post'),
'acl_f_icons' => array('lang' => 'Can use post icons', 'cat' => 'post'),
'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'), 'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'),
'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'), 'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'),
@ -207,12 +207,12 @@ $lang = array_merge($lang, array(
'acl_a_ban' => array('lang' => 'Can manage bans', 'cat' => 'user_group'), 'acl_a_ban' => array('lang' => 'Can manage bans', 'cat' => 'user_group'),
'acl_a_viewauth' => array('lang' => 'Can view permission masks', 'cat' => 'permissions'), 'acl_a_viewauth' => array('lang' => 'Can view permission masks', 'cat' => 'permissions'),
'acl_a_fauth' => array('lang' => 'Can alter forum permissions', 'cat' => 'permissions'), 'acl_a_authgroups' => array('lang' => 'Can alter permissions for individual groups', 'cat' => 'permissions'),
'acl_a_mauth' => array('lang' => 'Can alter moderator permissions', 'cat' => 'permissions'), 'acl_a_authusers' => array('lang' => 'Can alter permissions for individual users', 'cat' => 'permissions'),
'acl_a_aauth' => array('lang' => 'Can alter admin permissions', 'cat' => 'permissions'), 'acl_a_fauth' => array('lang' => 'Can alter forum permission class', 'cat' => 'permissions'),
'acl_a_uauth' => array('lang' => 'Can alter user permissions', 'cat' => 'permissions'), 'acl_a_mauth' => array('lang' => 'Can alter moderator permission class', 'cat' => 'permissions'),
'acl_a_authgroups' => array('lang' => 'Can alter permissions for groups', 'cat' => 'permissions'), 'acl_a_aauth' => array('lang' => 'Can alter admin permission class', 'cat' => 'permissions'),
'acl_a_authusers' => array('lang' => 'Can alter permissions for users', 'cat' => 'permissions'), 'acl_a_uauth' => array('lang' => 'Can alter user permission class', 'cat' => 'permissions'),
'acl_a_roles' => array('lang' => 'Can manage roles', 'cat' => 'permissions'), 'acl_a_roles' => array('lang' => 'Can manage roles', 'cat' => 'permissions'),
'acl_a_switchperm' => array('lang' => 'Can use others permissions', 'cat' => 'permissions'), 'acl_a_switchperm' => array('lang' => 'Can use others permissions', 'cat' => 'permissions'),

View file

@ -320,7 +320,7 @@ $help = array(
), ),
array( array(
0 => 'Who wrote this bulletin board?', 0 => 'Who wrote this bulletin board?',
1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="http://www.phpbb.com/" target="_blank">phpBB Group</a>. It is made available under the GNU General Public Licence and may be freely distributed, see link for more details' 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="http://www.phpbb.com/">phpBB Group</a>. It is made available under the GNU General Public Licence and may be freely distributed, see link for more details'
), ),
array( array(
0 => 'Why isnt X feature available?', 0 => 'Why isnt X feature available?',

View file

@ -51,23 +51,6 @@ $lang = array_merge($lang, array(
', ',
)); ));
$lang = array_merge($lang, array(
'CAPTCHA' =>array(
'cells' => array(
'Enter the code on',
' the right, in ',
' the order shown ',
' on the left ',
),
'shape' => array(
'Enter the code on',
' the right which ',
'matches the image',
' on the left ',
)
)
));
// Common language entries // Common language entries
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering', 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering',