diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-04-17 13:09:50 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-04-17 13:09:50 +0000 |
commit | a0f8e1323a0fb50e6a4b7449f93b493377eddd2c (patch) | |
tree | ad60ba619c483e390bf767c70ff7c160e087daf5 /phpBB | |
parent | 8c2f02ca00b41d7aa3282aaacfbf2674a5347a14 (diff) | |
download | forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar.gz forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar.bz2 forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar.xz forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.zip |
- clean up marklist calls (global function)
- added new feature: test out others permissions (admin permissions will not be copied)
- changed attachment processing by directly using the template engine
- fixed some attachment related bugs
- additional tiny fixes
git-svn-id: file:///svn/phpbb/trunk@5790 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
49 files changed, 663 insertions, 410 deletions
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index 1b521e1ec9..f293c31147 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -61,39 +61,43 @@ </tbody> </table> -<form id="stats" method="post" action="{U_ACTION}"> -<fieldset class="quick"> - <select name="action">{S_ACTION_OPTIONS}</select> +<!-- IF S_ACTION_OPTIONS --> + <form id="stats" method="post" action="{U_ACTION}"> + <fieldset class="quick"> + <select name="action">{S_ACTION_OPTIONS}</select> - <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> -</fieldset> -</form> + <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> + </fieldset> + </form> +<!-- ENDIF --> -<h2>{L_ADMIN_LOG}</h2> +<!-- IF .log --> + <h2>{L_ADMIN_LOG}</h2> -<p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p> + <p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p> -<table cellspacing="1"> -<thead> -<tr> - <th>{L_USERNAME}</th> - <th>{L_IP}</th> - <th>{L_TIME}</th> - <th>{L_ACTION}</th> -</tr> -</thead> -<tbody> -<!-- BEGIN log --> - <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - - <td>{log.USERNAME}</td> - <td style="text-align: center;">{log.IP}</td> - <td style="text-align: center;">{log.DATE}</td> - <td>{log.ACTION}</td> + <table cellspacing="1"> + <thead> + <tr> + <th>{L_USERNAME}</th> + <th>{L_IP}</th> + <th>{L_TIME}</th> + <th>{L_ACTION}</th> </tr> -<!-- END log --> -</tbody> -</table> + </thead> + <tbody> + <!-- BEGIN log --> + <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + + <td>{log.USERNAME}</td> + <td style="text-align: center;">{log.IP}</td> + <td style="text-align: center;">{log.DATE}</td> + <td>{log.ACTION}</td> + </tr> + <!-- END log --> + </tbody> + </table> +<!-- ENDIF --> <!-- IF S_INACTIVE_USERS --> <h2>{L_INACTIVE_USERS}</h2> diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 0df5e86b97..a7a66f5d5e 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -84,6 +84,7 @@ <dl> <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt> <dd><input type="text" id="user" name="user" value="{USER}" /></dd> + <!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF --> </dl> <dl> <dt><label>{L_REGISTERED}:</label></dt> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 9345ae0682..f719ec8074 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -52,6 +52,11 @@ function marklist(id, name, state) var parent = document.getElementById(id); if (!parent) { + eval('parent = document.' + id); + } + + if (!parent) + { return; } diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 8a7bf5ff75..acc1c50112 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -154,7 +154,7 @@ class acp_main switch ($action) { case 'online': - if (!$auth->acl_get('a_defaults')) + if (!$auth->acl_get('a_board')) { trigger_error($user->lang['NO_ADMIN']); } @@ -165,7 +165,7 @@ class acp_main break; case 'stats': - if (!$auth->acl_get('a_defaults')) + if (!$auth->acl_get('a_board')) { trigger_error($user->lang['NO_ADMIN']); } @@ -215,7 +215,7 @@ class acp_main break; case 'user': - if (!$auth->acl_get('a_defaults')) + if (!$auth->acl_get('a_board')) { trigger_error($user->lang['NO_ADMIN']); } @@ -256,7 +256,7 @@ class acp_main break; case 'date': - if (!$auth->acl_get('a_defaults')) + if (!$auth->acl_get('a_board')) { trigger_error($user->lang['NO_ADMIN']); } @@ -347,7 +347,7 @@ class acp_main 'U_ACTION' => "{$phpbb_admin_path}index.$phpEx$SID", - 'S_ACTION_OPTIONS' => $s_action_options, + 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '', ) ); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 29572b7147..62a9a38d98 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -734,7 +734,9 @@ class acp_users 'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'), 'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}", - + + 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=switch_perm&u={$user_row['user_id']}" : '', + 'USER' => $user_row['username'], 'USER_REGISTERED' => $user->format_date($user_row['user_regdate']), 'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'], diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 2307d413fa..e8c2c12079 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -1101,6 +1101,59 @@ class auth_admin extends auth } } } + + /** + * Use permissions from another user. This transferes a permission set from one user to another. + * The other user is always able to revert back to his permission set. + * This function does not check for lower/higher permissions, it is possible for the user to gain + * "more" permissions by this. + * + */ + function ghost_permissions($from_user_id, $to_user_id) + { + global $db; + + if ($to_user_id == ANONYMOUS) + { + return false; + } + + $hold_ary = $this->acl_raw_data($from_user_id, false, false); + + if (isset($hold_ary[$from_user_id])) + { + $hold_ary = $hold_ary[$from_user_id]; + } + + // Key 0 in $hold_ary are global options, all others are forum_ids + + // We disallow copying admin permissions + foreach ($this->acl_options['global'] as $opt => $id) + { + if (strpos($opt, 'a_') === 0) + { + $hold_ary[0][$opt] = ACL_NO; + } + } + + // Force a_switchperm to be allowed + $hold_ary[0]['a_switchperm'] = ACL_YES; + + $user_permissions = $this->build_bitstring($hold_ary); + + if (!$user_permissions) + { + return false; + } + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = '" . $db->sql_escape($user_permissions) . "', + user_perm_from = $from_user_id + WHERE user_id = " . $to_user_id; + $db->sql_query($sql); + + return true; + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index c4dc4cb84a..fb1d2126a7 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -325,12 +325,34 @@ class auth { if (strpos($opt, 'a_') === 0) { - $hold_ary[0][$opt] = 1; + $hold_ary[0][$opt] = ACL_YES; } } } + $hold_str = $this->build_bitstring($hold_ary); + + if ($hold_str) + { + $userdata['user_permissions'] = $hold_str; + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "', + user_perm_from = 0 + WHERE user_id = " . $userdata['user_id']; + $db->sql_query($sql); + } + + return; + } + + /** + * Build bitstring from permission set + */ + function build_bitstring(&$hold_ary) + { $hold_str = ''; + if (sizeof($hold_ary)) { ksort($hold_ary); @@ -379,16 +401,10 @@ class auth } unset($bitstring); - $userdata['user_permissions'] = rtrim($hold_str); - - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "' - WHERE user_id = " . $userdata['user_id']; - $db->sql_query($sql); + $hold_str = rtrim($hold_str); } - unset($hold_ary); - return; + return $hold_str; } /** @@ -401,7 +417,8 @@ class auth $where_sql = ($user_id !== false) ? ' WHERE user_id ' . ((is_array($user_id)) ? ' IN (' . implode(', ', array_map('intval', $user_id)) . ')' : " = $user_id") : ''; $sql = 'UPDATE ' . USERS_TABLE . " - SET user_permissions = '' + SET user_permissions = '', + user_perm_from = 0 $where_sql"; $db->sql_query($sql); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 38e9448ecb..5ca15e493d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -148,23 +148,6 @@ function unique_id($extra = 0, $prefix = false) } /** -* Get userdata -* @param mixed $user user id or username -*/ -function get_userdata($user) -{ - global $db; - - $sql = 'SELECT * - FROM ' . USERS_TABLE . ' - WHERE '; - $sql .= ((is_integer($user)) ? "user_id = $user" : "username = '" . $db->sql_escape($user) . "'") . " AND user_id <> " . ANONYMOUS; - $result = $db->sql_query($sql); - - return ($row = $db->sql_fetchrow($result)) ? $row : false; -} - -/** * Generate sort selection fields */ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param) @@ -1654,10 +1637,11 @@ function decode_message(&$message, $bbcode_uid = '') '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', + '#<!\-\- .*? \-\->#s', '#<.*?>#s' ); - $replace = array('\1', '\1', '\1', '\1', '\1', '<\1>'); + $replace = array('\1', '\1', '\1', '\1', '\1', '', '<\1>'); $message = preg_replace($match, $replace, $message); @@ -1863,7 +1847,7 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_ { global $config, $user; - $attachments = display_attachments($forum_id, NULL, $attachments, $update_count, $preview, true); + $attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true); $tpl_size = sizeof($attachments); $unset_tpl = array(); @@ -2013,7 +1997,7 @@ function add_log() $forum_id = ($mode == 'mod') ? intval(array_shift($args)) : ''; $topic_id = ($mode == 'mod') ? intval(array_shift($args)) : ''; $action = array_shift($args); - $data = (!sizeof($args)) ? '' : $db->sql_escape(serialize($args)); + $data = (!sizeof($args)) ? '' : serialize($args); $sql_ary = array( 'user_id' => $user->data['user_id'], @@ -2533,6 +2517,7 @@ function page_header($page_title = '') 'U_SEARCH_ACTIVE_TOPICS'=> "{$phpbb_root_path}search.$phpEx$SID&search_id=active_topics", 'U_DELETE_COOKIES' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=delete_cookies", 'U_TEAM' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=leaders", + 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=restore_perm" : '', 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_REGISTERED_USER' => $user->data['is_registered'], diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 7384217c31..b64e2b2ad0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -578,13 +578,13 @@ function gen_forum_auth_level($mode, $forum_id, $forum_status) global $SID, $template, $auth, $user; $locked = ($forum_status == ITEM_LOCKED && !$auth->acl_get('m_edit', $forum_id)) ? true : false; - + $rules = array( ($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'], ($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'], ($auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'], ($auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'], - ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach', $forum_id) && !$locked) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT'] + ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && !$locked) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT'] ); foreach ($rules as $rule) @@ -670,41 +670,13 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold function display_attachments($forum_id, $blockname, &$attachment_data, &$update_count, $force_physical = false, $return = false) { global $template, $cache, $user; - global $attachment_tpl, $extensions, $config, $phpbb_root_path, $phpEx, $SID; + global $extensions, $config, $phpbb_root_path, $phpEx, $SID; -// $starttime = explode(' ', microtime()); -// $starttime = $starttime[1] + $starttime[0]; $return_tpl = array(); - $blocks = array(ATTACHMENT_CATEGORY_WM => 'WM_STREAM', ATTACHMENT_CATEGORY_RM => 'RM_STREAM', ATTACHMENT_CATEGORY_THUMB => 'THUMBNAIL', ATTACHMENT_CATEGORY_IMAGE => 'IMAGE'); - - if (!isset($attachment_tpl)) - { - if (!($attachment_tpl = $cache->get('attachment_tpl'))) - { - $attachment_tpl = array(); - - $template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/attachment.html'; - if (($attachment_template = file_get_contents($template_filename)) === false) - { - trigger_error('Could not load template file "' . $template_filename . '"'); - } - - // replace \ with \\ and then ' with \'. - $attachment_template = str_replace('\\', '\\\\', $attachment_template); - $attachment_template = str_replace("'", "\'", $attachment_template); - - preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#s', $attachment_template, $tpl); - - foreach ($tpl[1] as $num => $block_name) - { - $attachment_tpl[$block_name] = $tpl[2][$num]; - } - unset($tpl); - - $cache->put('attachment_tpl', $attachment_tpl); - } - } + $template->set_filenames(array( + 'attachment_tpl' => 'attachment.html') + ); if (empty($extensions) || !is_array($extensions)) { @@ -714,62 +686,55 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ foreach ($attachment_data as $attachment) { + // We need to reset/empty the _file block var, because this function might be called more than once + $template->reset_block_vars('_file'); + + $block_array = array(); + // Some basics... $attachment['extension'] = strtolower(trim($attachment['extension'])); $filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']); $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']); - $upload_image = ''; - + $upload_icon = ''; if ($user->img('icon_attach', '') && !$extensions[$attachment['extension']]['upload_icon']) { - $upload_image = $user->img('icon_attach', ''); + $upload_icon = $user->img('icon_attach', ''); } else if ($extensions[$attachment['extension']]['upload_icon']) { - $upload_image = '<img src="' . $phpbb_root_path . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" border="0" />'; + $upload_icon = '<img src="' . $phpbb_root_path . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />'; } $filesize = $attachment['filesize']; $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); - $display_name = basename($attachment['real_filename']); $comment = str_replace("\n", '<br />', censor_text($attachment['comment'])); + $block_array += array( + 'UPLOAD_ICON' => $upload_icon, + 'FILESIZE' => $filesize, + 'SIZE_LANG' => $size_lang, + 'DOWNLOAD_NAME' => basename($attachment['real_filename']), + 'COMMENT' => $comment, + ); + $denied = false; if (!extension_allowed($forum_id, $attachment['extension'], $extensions)) { $denied = true; - $template_array['VAR'] = array('{L_DENIED}'); - $template_array['VAL'] = array(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); - - $tpl = str_replace($template_array['VAR'], $template_array['VAL'], $attachment_tpl['DENIED']); - - // Replace {L_*} lang strings - $tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl); - - if (!$return) - { - $template->assign_block_vars($blockname, array( - 'DISPLAY_ATTACHMENT' => $tpl) - ); - } - else - { - $return_tpl[] = $tpl; - } + $block_array += array( + 'S_DENIED' => true, + 'DENIED_MESSAGE' => sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']) + ); } if (!$denied) { - $l_downloaded_viewed = ''; - $download_link = ''; - $additional_array['VAR'] = $additional_array['VAL'] = array(); - + $l_downloaded_viewed = $download_link = ''; $display_cat = $extensions[$attachment['extension']]['display_cat']; if ($display_cat == ATTACHMENT_CATEGORY_IMAGE) @@ -800,102 +765,108 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ { // Images case ATTACHMENT_CATEGORY_IMAGE: - $img_source = $filename; - $update_count[] = $attachment['attach_id']; - $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $img_source; - break; + $download_link = $filename; + + $block_array += array( + 'S_IMAGE' => true, + ); + + $update_count[] = $attachment['attach_id']; + break; // Images, but display Thumbnail case ATTACHMENT_CATEGORY_THUMB: - $thumb_source = $thumbnail_filename; - $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = (!$force_physical) ? $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'] : $filename; + $download_link = (!$force_physical && $attachment['attach_id']) ? $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'] : $filename; - $additional_array['VAR'][] = '{THUMB_IMG}'; - $additional_array['VAL'][] = $thumb_source; - break; + $block_array += array( + 'S_THUMBNAIL' => true, + 'THUMB_IMAGE' => $thumbnail_filename, + ); + break; // Windows Media Streams case ATTACHMENT_CATEGORY_WM: $l_downloaded_viewed = $user->lang['VIEWED']; $download_link = $filename; + $block_array += array( + 'S_WM_FILE' => true, + ); + // Viewed/Heared File ... update the download count (download.php is not called here) $update_count[] = $attachment['attach_id']; - break; + break; // Real Media Streams case ATTACHMENT_CATEGORY_RM: $l_downloaded_viewed = $user->lang['VIEWED']; $download_link = $filename; - $additional_array['VAR'][] = '{U_FORUM}'; - $additional_array['VAL'][] = generate_board_url(); - $additional_array['VAR'][] = '{ATTACH_ID}'; - $additional_array['VAL'][] = $attachment['attach_id']; + $block_array += array( + 'S_RM_FILE' => true, + 'U_FORUM' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'], + ); // Viewed/Heared File ... update the download count (download.php is not called here) $update_count[] = $attachment['attach_id']; break; -/* - // Macromedia Flash Files + +/* // Macromedia Flash Files case SWF_CAT: list($width, $height) = swf_getdimension($filename); $l_downloaded_viewed = $user->lang['VIEWED']; $download_link = $filename; - $additional_array = array( - 'WIDTH' => $width, - 'HEIGHT' => $height + $block_array += array( + 'S_SWF_FILE' => true, + 'WIDTH' => $width, + 'HEIGHT' => $height, ); // Viewed/Heared File ... update the download count (download.php is not called here) $update_count[] = $attachment['attach_id']; - break; + break; */ default: $l_downloaded_viewed = $user->lang['DOWNLOADED']; - $download_link = (!$force_physical) ? $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'] : $filename; - break; + $download_link = (!$force_physical && $attachment['attach_id']) ? $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'] : $filename; + + $block_array += array( + 'S_FILE' => true, + ); + break; } $l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang['DOWNLOAD_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang['DOWNLOAD_COUNT'], $attachment['download_count']) : sprintf($user->lang['DOWNLOAD_COUNTS'], $attachment['download_count'])); - $current_block = ($display_cat) ? $blocks[$display_cat] : 'FILE'; - - $template_array['VAR'] = array_merge($additional_array['VAR'], array( - '{DOWNLOAD_NAME}', '{FILESIZE}', '{SIZE_VAR}', '{COMMENT}', '{U_DOWNLOAD_LINK}', '{UPLOAD_IMG}', '{L_DOWNLOADED_VIEWED}', '{L_DOWNLOAD_COUNT}') - ); - - $template_array['VAL'] = array_merge($additional_array['VAL'], array( - $display_name, $filesize, $size_lang, $comment, $download_link, $upload_image, $l_downloaded_viewed, $l_download_count) + $block_array += array( + 'U_DOWNLOAD_LINK' => $download_link, + 'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed, + 'L_DOWNLOAD_COUNT' => $l_download_count ); + } - $tpl = str_replace($template_array['VAR'], $template_array['VAL'], $attachment_tpl[$current_block]); + $template->assign_block_vars('_file', $block_array); - // Replace {L_*} lang strings - $tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl); + $tpl = $template->assign_display('attachment_tpl'); - if (!$return) - { - $template->assign_block_vars($blockname, array( - 'DISPLAY_ATTACHMENT' => $tpl) - ); - } - else - { - $return_tpl[] = $tpl; - } + if (!$return) + { + $template->assign_block_vars($blockname, array( + 'DISPLAY_ATTACHMENT' => $tpl) + ); + } + else + { + $return_tpl[] = $tpl; } } return $return_tpl; -// $mtime = explode(' ', microtime()); -// $totaltime = $mtime[0] + $mtime[1] - $starttime; } /** diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index bf70f174d3..ec573d229e 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -40,6 +40,10 @@ class template_compile { var $template; + // Various storage arrays + var $block_names = array(); + var $block_else_level = array(); + /** * constuctor */ @@ -120,57 +124,54 @@ class template_compile switch ($blocks[1][$curr_tb]) { case 'BEGIN': - $this->template->block_else_level[] = false; + $this->block_else_level[] = false; $compile_blocks[] = '<?php ' . $this->compile_tag_block($blocks[2][$curr_tb]) . ' ?>'; - break; + break; case 'BEGINELSE': - $this->template->block_else_level[sizeof($this->template->block_else_level) - 1] = true; + $this->block_else_level[sizeof($this->block_else_level) - 1] = true; $compile_blocks[] = '<?php }} else { ?>'; - break; + break; case 'END': - array_pop($this->template->block_names); - $compile_blocks[] = '<?php ' . ((array_pop($this->template->block_else_level)) ? '}' : '}}') . ' ?>'; - break; + array_pop($this->block_names); + $compile_blocks[] = '<?php ' . ((array_pop($this->block_else_level)) ? '}' : '}}') . ' ?>'; + break; case 'IF': $compile_blocks[] = '<?php ' . $this->compile_tag_if($blocks[2][$curr_tb], false) . ' ?>'; - break; + break; case 'ELSE': $compile_blocks[] = '<?php } else { ?>'; - break; + break; case 'ELSEIF': $compile_blocks[] = '<?php ' . $this->compile_tag_if($blocks[2][$curr_tb], true) . ' ?>'; - break; + break; case 'ENDIF': $compile_blocks[] = '<?php } ?>'; - break; + break; case 'DEFINE': $compile_blocks[] = '<?php ' . $this->compile_tag_define($blocks[2][$curr_tb], true) . ' ?>'; - break; + break; case 'UNDEFINE': $compile_blocks[] = '<?php ' . $this->compile_tag_define($blocks[2][$curr_tb], false) . ' ?>'; - break; + break; case 'INCLUDE': - $temp = ''; - list(, $temp) = each($include_blocks); + $temp = array_shift($include_blocks); $compile_blocks[] = '<?php ' . $this->compile_tag_include($temp) . ' ?>'; $this->template->_tpl_include($temp, false); - break; + break; case 'INCLUDEPHP': if ($config['tpl_php']) { - $temp = ''; - list(, $temp) = each($includephp_blocks); - $compile_blocks[] = '<?php ' . $this->compile_tag_include_php($temp) . ' ?>'; + $compile_blocks[] = '<?php ' . $this->compile_tag_include_php(array_shift($includephp_blocks)) . ' ?>'; } else { @@ -181,9 +182,7 @@ class template_compile case 'PHP': if ($config['tpl_php']) { - $temp = ''; - list(, $temp) = each($php_blocks); - $compile_blocks[] = '<?php ' . $temp . ' ?>'; + $compile_blocks[] = '<?php ' . array_shift($php_blocks) . ' ?>'; } else { @@ -306,9 +305,9 @@ class template_compile } $tag_template_php = ''; - array_push($this->template->block_names, $tag_args); + array_push($this->block_names, $tag_args); - if (sizeof($this->template->block_names) < 2) + if (sizeof($this->block_names) < 2) { // Block is not nested. $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;"; @@ -321,11 +320,11 @@ class template_compile if ($no_nesting !== false) { // We need to implode $no_nesting times from the end... - $namespace = implode('.', array_slice($this->template->block_names, -$no_nesting)); + $namespace = implode('.', array_slice($this->block_names, -$no_nesting)); } else { - $namespace = implode('.', $this->template->block_names); + $namespace = implode('.', $this->block_names); } // Get a reference to the data array for this block that depends on the diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index a9e08ec1e9..46449ff722 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -165,6 +165,39 @@ class filespec } /** + * Get mimetype + */ + function get_mimetype($filename) + { + if (function_exists('mime_content_type')) + { + $mimetype = mime_content_type($filename); + } + else + { + $mimetype = 'application/octetstream'; + } + + // Opera adds the name to the mime type + $mimetype = (strpos($mimetype, '; name') !== false) ? str_replace(strstr($mimetype, '; name'), '', $mimetype) : $mimetype; + + if (!$mimetype) + { + $mimetype = 'application/octetstream'; + } + + return $mimetype; + } + + /** + * Get filesize + */ + function get_filesize($filename) + { + return @filesize($filename); + } + + /** * Move file to destination folder * * The phpbb_root_path variable will be applied to the destination path diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index fd75a86d21..cc52baabf6 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -306,7 +306,12 @@ function mcp_warn_user_view($id, $mode, $action) $sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'"; - $userrow = get_userdata($user_id); + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . $sql_where; + $result = $db->sql_query($sql); + $userrow = $db->sql_fetchrow($result); + $db->sql_freeresult($result); $user_id = $userrow['user_id']; diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 9e86678580..2c4f89bcec 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -977,9 +977,9 @@ class parse_message extends bbcode_firstpass $this->filename_data['filecomment'] = request_var('filecomment', '', true); $upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false; - $add_file = (isset($_POST['add_file'])); - $delete_file = (isset($_POST['delete_file'])); - $edit_comment = (isset($_POST['edit_comment'])); + $add_file = (isset($_POST['add_file'])) ? true : false; + $delete_file = (isset($_POST['delete_file'])) ? true : false; + $edit_comment = (isset($_POST['edit_comment'])) ? true : false; $cfg = array(); $cfg['max_attachments'] = ($is_message) ? $config['max_attachments_pm'] : $config['max_attachments']; @@ -1063,6 +1063,9 @@ class parse_message extends bbcode_firstpass if ($edit_comment) { $actual_comment_list = request_var('comment_list', array(''), true); + + $edit_comment = key(request_var('edit_comment', array(0 => ''))); + $this->attachment_data[$edit_comment]['comment'] = $actual_comment_list[$edit_comment]; } if (($add_file || $preview) && $upload_file) @@ -1105,26 +1108,102 @@ class parse_message extends bbcode_firstpass } } - // Get Attachment Data + /** + * Get Attachment Data + */ function get_submitted_attachment_data() { + global $user, $db, $phpbb_root_path, $phpEx, $config; + $this->filename_data['filecomment'] = request_var('filecomment', '', true); $this->attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array(); - // - $data_prepare = array('physical_filename' => 's', 'real_filename' => 's', 'comment' => 's', 'extension' => 's', 'mimetype' => 's', - 'filesize' => 'i', 'filetime' => 'i', 'attach_id' => 'i', 'thumbnail' => 'i'); + // Regenerate data array... + $attach_ids = $filenames = array(); + foreach ($this->attachment_data as $pos => $var_ary) { - foreach ($data_prepare as $var => $type) + if ($var_ary['attach_id']) + { + $attach_ids[(int) $this->attachment_data[$pos]['attach_id']] = $pos; + } + else + { + $filenames[$pos] = ''; + set_var($filenames[$pos], $this->attachment_data[$pos]['physical_filename'], 'string'); + $filenames[$pos] = basename($filenames[$pos]); + } + } + + $this->attachment_data = array(); + + // Regenerate already posted attachments... + if (sizeof($attach_ids)) + { + // Get the data from the attachments + $sql = 'SELECT attach_id, physical_filename, real_filename, extension, mimetype, filesize, filetime, thumbnail + FROM ' . ATTACHMENTS_TABLE . ' + WHERE attach_id IN (' . implode(', ', array_keys($attach_ids)) . ') + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (isset($attach_ids[$row['attach_id']])) + { + $pos = $attach_ids[$row['attach_id']]; + $this->attachment_data[$pos] = $row; + set_var($this->attachment_data[$pos]['comment'], $_POST['attachment_data'][$pos]['comment'], 'string', true); + + unset($attach_ids[$row['attach_id']]); + } + } + $db->sql_freeresult($result); + + if (sizeof($attach_ids)) + { + trigger_error('NO_ACCESS_ATTACHMENT'); + } + } + + // Regenerate newly uploaded attachments + if (sizeof($filenames)) + { + include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); + + $sql = 'SELECT attach_id + FROM ' . ATTACHMENTS_TABLE . " + WHERE LOWER(physical_filename) IN ('" . implode("', '", array_map('strtolower', $filenames)) . "')"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + trigger_error('NO_ACCESS_ATTACHMENT'); + } + + foreach ($filenames as $pos => $physical_filename) { - if ($type == 's') + $this->attachment_data[$pos] = array( + 'physical_filename' => $physical_filename, + 'extension' => strtolower(filespec::get_extension($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename)), + 'filesize' => filespec::get_filesize($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename), + 'attach_id' => 0, + 'thumbnail' => (file_exists($phpbb_root_path . $config['upload_path'] . '/thumb_' . $physical_filename)) ? 1 : 0, + ); + + set_var($this->attachment_data[$pos]['comment'], $_POST['attachment_data'][$pos]['comment'], 'string', true); + set_var($this->attachment_data[$pos]['real_filename'], $_POST['attachment_data'][$pos]['real_filename'], 'string', true); + set_var($this->attachment_data[$pos]['filetime'], $_POST['attachment_data'][$pos]['filetime'], 'int'); + + if (strpos($_POST['attachment_data'][$pos]['mimetype'], 'image/') !== false) { - $this->attachment_data[$pos][$var] = trim(htmlspecialchars(str_replace(array("\r\n", "\r", '\xFF'), array("\n", "\n", ' '), stripslashes($this->attachment_data[$pos][$var])))); + set_var($this->attachment_data[$pos]['mimetype'], $_POST['attachment_data'][$pos]['mimetype'], 'string'); } else { - $this->attachment_data[$pos][$var] = (int) $this->attachment_data[$pos][$var]; + $this->attachment_data[$pos]['mimetype'] = filespec::get_mimetype($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename); } } } diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 82cddda071..022ef4f68c 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -18,21 +18,7 @@ if (!defined('IN_PHPBB')) /** * @package phpBB3 * -* Template class. -* -* psoTFX - Completion of file caching, decompilation routines and implementation of -* conditionals/keywords and associated changes -* -* The interface was inspired by PHPLib templates, and the template file (formats are -* quite similar) -* -* The keyword/conditional implementation is currently based on sections of code from -* the Smarty templating engine (c) 2001 ispi of Lincoln, Inc. which is released -* (on its own and in whole) under the LGPL. Section 3 of the LGPL states that any code -* derived from an LGPL application may be relicenced under the GPL, this applies -* to this source -* -* DEFINE directive inspired by a request by Cyberalien +* Base Template class. */ class template { @@ -52,11 +38,6 @@ class template // this will hash handle names to the compiled/uncompiled code for that handle. var $compiled_code = array(); - // Various counters and storage arrays - var $block_names = array(); - var $block_else_level = array(); - var $block_nesting_level = 0; - var $static_lang; /** @@ -153,7 +134,7 @@ class template * Display the handle and assign the output to a template variable * @public */ - function assign_display($handle, $template_var, $return_content = false, $include_once = true) + function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) { ob_start(); $this->display($handle, $include_once); @@ -358,6 +339,36 @@ class template } /** + * Reset/empty complete block + * @public + */ + function reset_block_vars($blockname) + { + if (strpos($blockname, '.') !== false) + { + // Nested block. + $blocks = explode('.', $blockname); + $blockcount = sizeof($blocks) - 1; + + $str = &$this->_tpldata; + for ($i = 0; $i < $blockcount; $i++) + { + $str = &$str[$blocks[$i]]; + $str = &$str[sizeof($str) - 1]; + } + + unset($str[$blocks[$blockcount]]); + } + else + { + // Top-level block. + unset($this->_tpldata[$blockname]); + } + + return true; + } + + /** * Change already assigned key variable pair (one-dimensional - single loop entry) * * Some Examples: diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 30e4c06f77..ffe668d056 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -73,8 +73,8 @@ function compose_pm($id, $mode, $action) { trigger_error('NO_AUTH_SEND_MESSAGE'); } + break; - break; case 'reply': case 'quote': case 'forward': @@ -112,7 +112,7 @@ function compose_pm($id, $mode, $action) AND t.msg_id = p.msg_id AND p.msg_id = $msg_id"; } - break; + break; case 'edit': if (!$msg_id) @@ -127,7 +127,7 @@ function compose_pm($id, $mode, $action) AND t.folder_id = ' . PRIVMSGS_OUTBOX . " AND t.msg_id = $msg_id AND t.msg_id = p.msg_id"; - break; + break; case 'delete': if (!$auth->acl_get('u_pm_delete')) @@ -144,11 +144,11 @@ function compose_pm($id, $mode, $action) FROM ' . PRIVMSGS_TO_TABLE . ' WHERE user_id = ' . $user->data['user_id'] . " AND msg_id = $msg_id"; - break; + break; case 'smilies': generate_smilies('window', 0); - break; + break; default: trigger_error('NO_ACTION_MODE'); @@ -175,42 +175,46 @@ function compose_pm($id, $mode, $action) $db->sql_freeresult($result); - $msg_id = (int) $post['msg_id']; - $enable_urls = $post['enable_magic_url']; - $enable_sig = (isset($post['enable_sig'])) ? $post['enable_sig'] : 0; - - $message_attachment = (isset($post['message_attachement'])) ? $post['message_attachement'] : 0; - $message_text = $post['message_text']; - $message_subject = $post['message_subject']; - $quote_username = (isset($post['quote_username'])) ? $post['quote_username'] : ''; - - $message_time = $post['message_time']; - $icon_id = (isset($post['icon_id'])) ? $post['icon_id'] : 0; - $folder_id = (isset($post['folder_id'])) ? $post['folder_id'] : 0; - $bbcode_uid = $post['bbcode_uid']; + $msg_id = (int) $post['msg_id']; + $folder_id = (isset($post['folder_id'])) ? $post['folder_id'] : 0; + $message_text = (isset($post['message_text'])) ? $post['message_text'] : ''; if (!$post['author_id'] && $msg_id) { trigger_error('NO_AUTHOR'); } - if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview) + if ($action != 'delete') { - $address_list = array('u' => array($post['author_id'] => 'to')); - } - else if ($action == 'edit' && !sizeof($address_list) && !$refresh && !$submit && !$preview) - { - // Rebuild TO and BCC Header - $address_list = rebuild_header(array('to' => $post['to_address'], 'bcc' => $post['bcc_address'])); - } + $enable_urls = $post['enable_magic_url']; + $enable_sig = (isset($post['enable_sig'])) ? $post['enable_sig'] : 0; - if ($action == 'quotepost') - { - $check_value = 0; - } - else - { - $check_value = (($post['enable_bbcode']+1) << 8) + (($post['enable_smilies']+1) << 4) + (($enable_urls+1) << 2) + (($post['enable_sig']+1) << 1); + $message_attachment = (isset($post['message_attachement'])) ? $post['message_attachement'] : 0; + $message_subject = $post['message_subject']; + $message_time = $post['message_time']; + $bbcode_uid = $post['bbcode_uid']; + + $quote_username = (isset($post['quote_username'])) ? $post['quote_username'] : ''; + $icon_id = (isset($post['icon_id'])) ? $post['icon_id'] : 0; + + if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview) + { + $address_list = array('u' => array($post['author_id'] => 'to')); + } + else if ($action == 'edit' && !sizeof($address_list) && !$refresh && !$submit && !$preview) + { + // Rebuild TO and BCC Header + $address_list = rebuild_header(array('to' => $post['to_address'], 'bcc' => $post['bcc_address'])); + } + + if ($action == 'quotepost') + { + $check_value = 0; + } + else + { + $check_value = (($post['enable_bbcode']+1) << 8) + (($post['enable_smilies']+1) << 4) + (($enable_urls+1) << 2) + (($post['enable_sig']+1) << 1); + } } } else @@ -247,8 +251,6 @@ function compose_pm($id, $mode, $action) $icon_id = 0; } - - $message_parser = new parse_message(); $message_parser->message = ($action == 'reply') ? '' : $message_text; @@ -547,7 +549,7 @@ function compose_pm($id, $mode, $action) $extensions = $update_count = array(); $template->assign_var('S_HAS_ATTACHMENTS', true); - display_attachments(0, 'attachment', $message_parser->attachment_data, $update_count, true); + display_attachments(0, 'attachment', $message_parser->attachment_data, $update_count); } $preview_subject = censor_text($subject); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index d8bfcc3ec7..f09bd2d39c 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -381,7 +381,12 @@ function get_user_informations($user_id, $user_row) if (empty($user_row)) { - $user_row = get_userdata((int) $user_id); + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $user_id; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); } // Grab ranks diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index d395704a62..7d604447bf 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -1318,6 +1318,7 @@ CREATE TABLE phpbb_users ( user_type INTEGER DEFAULT 0 NOT NULL, group_id INTEGER DEFAULT 3 NOT NULL, user_permissions BLOB SUB_TYPE TEXT, + user_perm_from INTEGER DEFAULT 0 NOT NULL, user_ip VARCHAR(40) NOT NULL, user_regdate INTEGER DEFAULT 0 NOT NULL, username VARCHAR(255) NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 4bad827c8e..bce22a6f89 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1976,6 +1976,7 @@ CREATE TABLE [phpbb_users] ( [user_type] [int] NOT NULL , [group_id] [int] NOT NULL , [user_permissions] [text] , + [user_perm_from] [int] NOT NULL , [user_ip] [varchar] (40) NOT NULL , [user_regdate] [int] NOT NULL , [username] [varchar] (255) NOT NULL , @@ -2052,6 +2053,7 @@ GO ALTER TABLE [phpbb_users] WITH NOCHECK ADD CONSTRAINT [DF_users__user_type] DEFAULT (0) FOR [user_type], CONSTRAINT [DF_users__group_id] DEFAULT (3) FOR [group_id], + CONSTRAINT [DF_users__user_perm_from] DEFAULT (0) FOR [user_perm_from], CONSTRAINT [DF_users__user_regdate] DEFAULT (0) FOR [user_regdate], CONSTRAINT [DF_users__user_passchg] DEFAULT (0) FOR [user_passchg], CONSTRAINT [DF_users__user_email_hash] DEFAULT (0) FOR [user_email_hash], diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index db15d91645..562d5de95d 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -873,6 +873,7 @@ CREATE TABLE phpbb_users ( user_type tinyint(1) DEFAULT '0' NOT NULL, group_id mediumint(8) DEFAULT '3' NOT NULL, user_permissions text, + user_perm_from mediumint(8) DEFAULT '0' NOT NULL, user_ip varchar(40) DEFAULT '' NOT NULL, user_regdate int(11) DEFAULT '0' NOT NULL, username varchar(255) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index bf4fedf512..9d5a743dab 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1713,6 +1713,7 @@ CREATE TABLE phpbb_users ( user_type number(1) DEFAULT '0' NOT NULL, group_id number(8) DEFAULT '3' NOT NULL, user_permissions clob, + user_perm_from number(8) DEFAULT '0' NOT NULL, user_ip varchar2(40) DEFAULT '', user_regdate number(11) DEFAULT '0' NOT NULL, username varchar2(255) DEFAULT '', diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 0fdab06b7e..313c2864cf 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -1216,6 +1216,7 @@ CREATE TABLE phpbb_users ( user_type INT2 DEFAULT '0' NOT NULL, group_id INT4 DEFAULT '3' NOT NULL, user_permissions TEXT, + user_perm_from INT4 DEFAULT '0' NOT NULL, user_ip varchar(40) DEFAULT '' NOT NULL, user_regdate INT4 DEFAULT '0' NOT NULL, username varchar(255) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index d4b1cec306..4174c287f3 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -294,6 +294,7 @@ INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_roles', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_search', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_server', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_styles', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_switchperm', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_uauth', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_user', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_userdel', 1); @@ -515,15 +516,15 @@ INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (77, 1, 'attachments', 'acp', 1, 56, 351, 352, 'ACP_EXTENSION_GROUPS', 'ext_groups', 'acl_a_attach'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (78, 1, 'attachments', 'acp', 1, 56, 353, 354, 'ACP_MANAGE_EXTENSIONS', 'extensions', 'acl_a_attach'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (80, 1, 'attachments', 'acp', 1, 56, 355, 356, 'ACP_ORPHAN_ATTACHMENTS', 'orphan', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (81, 1, 'board', 'acp', 1, 42, 285, 286, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (81, 1, 'board', 'acp', 1, 42, 285, 286, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_board'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (82, 1, 'board', 'acp', 1, 43, 297, 298, 'ACP_AUTH_SETTINGS', 'auth', 'acl_a_server'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (83, 1, 'board', 'acp', 1, 43, 299, 300, 'ACP_EMAIL_SETTINGS', 'email', 'acl_a_server'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (84, 1, 'jabber', 'acp', 1, 43, 301, 302, 'ACP_JABBER_SETTINGS', 'settings', 'acl_a_jabber'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (85, 1, 'board', 'acp', 1, 44, 305, 306, 'ACP_COOKIE_SETTINGS', 'cookie', 'acl_a_cookies'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (85, 1, 'board', 'acp', 1, 44, 305, 306, 'ACP_COOKIE_SETTINGS', 'cookie', 'acl_a_server'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (86, 1, 'board', 'acp', 1, 44, 307, 308, 'ACP_SERVER_SETTINGS', 'server', 'acl_a_server'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (87, 1, 'board', 'acp', 1, 44, 311, 312, 'ACP_LOAD_SETTINGS', 'load', 'acl_a_server'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (92, 1, 'modules', 'acp', 1, 67, 511, 512, 'MCP', 'mcp', 'acl_a_modules'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (93, 1, 'board', 'acp', 1, 75, 337, 338, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (93, 1, 'board', 'acp', 1, 75, 337, 338, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_board'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (94, 1, 'bbcodes', 'acp', 1, 75, 339, 340, 'ACP_BBCODES', 'bbcodes', 'acl_a_bbcode'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (95, 1, 'icons', 'acp', 1, 75, 341, 342, 'ACP_ICONS', 'icons', 'acl_a_icons'); INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (96, 1, 'icons', 'acp', 1, 75, 343, 344, 'ACP_SMILIES', 'smilies', 'acl_a_icons'); @@ -657,7 +658,7 @@ INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) S # ADMINISTRATOR group - admin and forum rights INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%'; -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%'; +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%' AND auth_option NOT IN ('a_switchperm'); INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach'); INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 7, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_poll', 'f_announce', 'f_sticky', 'f_attach'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 0df2b54a35..482299e0ae 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -935,6 +935,7 @@ CREATE TABLE phpbb_users ( user_type tinyint(1) NOT NULL DEFAULT '0', group_id mediumint(8) NOT NULL DEFAULT '3', user_permissions text(65535), + user_perm_from mediumint(8) NOT NULL DEFAULT '0', user_ip varchar(40) NOT NULL DEFAULT '', user_regdate int(11) NOT NULL DEFAULT '0', username varchar(255) NOT NULL DEFAULT '', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index d92d78c4d6..16139b60ac 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -345,6 +345,8 @@ $lang = array_merge($lang, array( 'LOG_ACL_DEL_MOD_LOCAL_M_' => '<b>Removed Moderators</b> from %s<br />» %s', 'LOG_ACL_DEL_FORUM_LOCAL_F_' => '<b>Removed User/Group Forum Permissions</b> from %s<br />» %s', + 'LOG_ACL_TRANSFER_PERMISSIONS' => '<b>Permissions transfered from</b><br />» %s', + 'LOG_ACL_RESTORE_PERMISSIONS' => '<b>Own permissions restored after using permissions from</b><br />» %s', 'LOG_ATTACH_EXT_ADD' => '<b>Added or edited attachment extension</b><br />» %s', 'LOG_ATTACH_EXT_DEL' => '<b>Removed attachment extension</b><br />» %s', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index ff2f916355..25744bc0d5 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -204,6 +204,7 @@ $lang = array_merge($lang, array( 'acl_a_authgroups' => array('lang' => 'Can alter permissions for groups', 'cat' => 'permissions'), 'acl_a_authusers' => array('lang' => 'Can alter permissions for users', '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_styles' => array('lang' => 'Can manage styles', 'cat' => 'misc'), 'acl_a_viewlogs' => array('lang' => 'Can view logs', 'cat' => 'misc'), diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 72907c97cb..e2a2722a9f 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -286,6 +286,7 @@ $lang = array_merge($lang, array( 'NOT_AUTHORIZED' => 'You are not authorized to access this area.', 'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.', 'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.', + 'NO_ACCESS_ATTACHMENT' => 'You are not allowed to access this file.', 'NO_AUTH_ADMIN' => 'You do not have admin permissions and therefore not allowed to access the administration control panel.', 'NO_AUTH_ADMIN_USER_DIFFER' => 'You are not able to re-authenticate as a different user.', 'NO_AUTH_OPERATION' => 'You do not have the neccessary permissions to complete this operation.', @@ -482,6 +483,7 @@ $lang = array_merge($lang, array( 'USER_POST' => '%d Post', 'USER_POSTS' => '%d Posts', 'USERS' => 'Users', + 'USE_PERMISSIONS' => 'Test out users permissions', 'VIEWED' => 'Viewed', 'VIEWING_FAQ' => 'Viewing FAQ', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index 13eb24ff38..204fb91adf 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -112,6 +112,7 @@ $lang = array_merge($lang, array( 'SORT_POST_COUNT' => 'Post count', 'USERNAME_BEGINS_WITH' => 'Username begins with', + 'USER_ADMIN' => 'Administrate User', 'USER_FORUM' => 'User statistics', 'USER_ONLINE' => 'Online', 'USER_PRESENCE' => 'Forum presence', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index eb1ad6d45b..2c6e335f4a 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -279,6 +279,8 @@ $lang = array_merge($lang, array( 'PASSWORD_ACTIVATED' => 'Your new password has been activated', 'PASSWORD_UPDATED' => 'Your password has been sent successfully to your original email address.', + 'PERMISSIONS_RESTORED' => 'Successfully restored original permissions.', + 'PERMISSIONS_TRANSFERED' => 'Successfully transfered permissions from <b>%s</b>, you are now able to browse the forum with the users permissions.<br />Please note that admin permissions were not transfered. You are able to revert to your permission set at any time.', 'PM_DISABLED' => 'Private messaging has been disabled on this board', 'PM_FROM' => 'From', 'PM_ICON' => 'PM Icon', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b1d4b91d66..50ea8d789a 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -396,6 +396,9 @@ switch ($mode) 'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false, 'S_SHOW_ACTIVITY' => ($config['load_user_activity']) ? true : false, + 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? "{$phpbb_root_path}adm/index.$phpEx?sid={$user->session_id}&i=users&mode=overview&u={$user_id}" : '', + 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=switch_perm&u={$user_id}" : '', + 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered']) ? true : false, 'U_ADD_FRIEND' => "{$phpbb_root_path}ucp.$phpEx$SID&i=zebra&add=" . urlencode($member['username']), 'U_ADD_FOE' => "{$phpbb_root_path}ucp.$phpEx$SID&i=zebra&mode=foes&add=" . urlencode($member['username'])) diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index 9727602bbc..65d32a5932 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -1,73 +1,84 @@ -<!-- BEGIN DENIED --> - <span class="postbody">[{L_DENIED}]</span><br /><br /> -<!-- END DENIED --> -<!-- BEGIN WM_STREAM --> - <span class="postbody">{COMMENT}</span><br /> - <object id="wmp" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> - <param name="FileName" value="{U_DOWNLOAD_LINK}"> - <param name="ShowControls" value="1"> - <param name="ShowDisplay" value="0"> - <param name="ShowStatusBar" value="1"> - <param name="AutoSize" value="1"> - <param name="AutoStart" value="0"> - <param name="Visible" value="1"> - <param name="AnimationStart" value="0"> - <param name="Loop" value="0"> - <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="{U_DOWNLOAD_LINK}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=0 visible=1 animationatstart=0 loop=0></embed> - </object> - <br /><span class="gensmall">{DOWNLOAD_NAME} - {L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT}</span><br /><br /> -<!-- END WM_STREAM --> +<!-- BEGIN _file --> -<!-- BEGIN RM_STREAM --> - <span class="postbody">{COMMENT}</span><br /> - <object id=rmstream_{ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="0"> - <param name="src" value="{U_FORUM}/{U_DOWNLOAD_LINK}"> - <param name="autostart" value="false"> - <param name="controls" value="ImageWindow"> - <param name="console" value="{U_DOWNLOAD_LINK}"> - <param name="prefetch" value="true"> - <embed name=rmstream_{ATTACH_ID} type="audio/x-pn-realaudio-plugin" src="{U_FORUM}/{U_DOWNLOAD_LINK}" width="0" height="0" autostart="false" controls="ImageWindow" console="video" prefetch="true"></embed> - </object> - <br /> - <object id=ctrls_{ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36"> - <param name="controls" value="ControlPanel"> - <param name="console" value="{U_DOWNLOAD_LINK}"> - <embed name=ctrls_{ATTACH_ID} type="audio/x-pn-realaudio-plugin" width="0" height="36" controls="ControlPanel" console="video"></embed> - </object> + <!-- IF _file.S_DENIED --> + <span class="genmed">[{_file.DENIED_MESSAGE}]</span><br /> + <!-- ELSE --> - <script language="Javascript"> - <!-- - while (!document.rmstream_{ATTACH_ID}.GetClipWidth()) - { - } + <!-- IF _file.COMMENT --> + <span class="gensmall"><b>{L_FILE_COMMENT}:</b> {_file.COMMENT}</span><br /> + <!-- ENDIF --> - var width = document.rmstream_{ATTACH_ID}.GetClipWidth(); - var height = document.rmstream_{ATTACH_ID}.GetClipHeight(); + <!-- IF _file.S_THUMBNAIL --> + <a href="{_file.U_DOWNLOAD_LINK}" target="_blank"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" /></a><br /> + <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span> + <!-- ENDIF --> - document.rmstream_{ATTACH_ID}.width = width; - document.rmstream_{ATTACH_ID}.height = height; - document.ctrls_{ATTACH_ID}.width = width; - //--> - </script> - <br /><span class="gensmall">{DOWNLOAD_NAME} - {L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT}</span><br /><br /> -<!-- END RM_STREAM --> + <!-- IF _file.S_IMAGE --> + <img src="{_file.U_DOWNLOAD_LINK}" alt="{_file.DOWNLOAD_NAME}" /><br /> + <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span> + <!-- ENDIF --> -<!-- BEGIN IMAGE --> - <span class="postbody">{COMMENT}<br /> - <img src="{U_DOWNLOAD_LINK}" alt="{DOWNLOAD_NAME}" /></span> - <br /><span class="gensmall">{DOWNLOAD_NAME} - {L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT}</span><br /><br /> -<!-- END IMAGE --> + <!-- IF _file.S_FILE --> + <span class="genmed"> + <!-- IF _file.UPLOAD_IMAGE -->{_file.UPLOAD_IMAGE} <!-- ENDIF --> + <a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [{_file.FILESIZE} {_file.SIZE_LANG}] + </span><br /> + <span class="gensmall">{_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT}</span> + <!-- ENDIF --> -<!-- BEGIN THUMBNAIL --> - <span class="gensmall"><b>{L_FILE_COMMENT}:</b> {COMMENT}</span><hr /> - <a href="{U_DOWNLOAD_LINK}" target="_blank"><img src="{THUMB_IMG}" alt="{DOWNLOAD_NAME}" border="0" /></a><br clear="all" /> - <span class="gensmall">{DOWNLOAD_NAME} - {L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT}</span> -<!-- END THUMBNAIL --> + <!-- IF _file.S_WM_FILE --> + <object id="wmp" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> + <param name="FileName" value="{_file.U_DOWNLOAD_LINK}"> + <param name="ShowControls" value="1"> + <param name="ShowDisplay" value="0"> + <param name="ShowStatusBar" value="1"> + <param name="AutoSize" value="1"> + <param name="AutoStart" value="0"> + <param name="Visible" value="1"> + <param name="AnimationStart" value="0"> + <param name="Loop" value="0"> + <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="{_file.U_DOWNLOAD_LINK}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=0 visible=1 animationatstart=0 loop=0></embed> + </object> + <br /> + <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span> + <!-- ENDIF --> -<!-- BEGIN FILE --> - <span class="gensmall"><b>{L_FILE_COMMENT}:</b> {COMMENT}</span><hr /> - <span class="postbody">{UPLOAD_IMG} <a href="{U_DOWNLOAD_LINK}" target="_blank">{DOWNLOAD_NAME}</a> - {FILESIZE} {SIZE_VAR}</span><br clear="all" /> - <span class="gensmall">{L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT}</span> -<!-- END FILE --> - + <!-- IF _file.S_RM_FILE --> + <object id=rmstream_{_file.ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="0"> + <param name="src" value="{_file.U_FORUM}/{_file.U_DOWNLOAD_LINK}"> + <param name="autostart" value="false"> + <param name="controls" value="ImageWindow"> + <param name="console" value="{_file.U_DOWNLOAD_LINK}"> + <param name="prefetch" value="true"> + <embed name=rmstream_{_file.ATTACH_ID} type="audio/x-pn-realaudio-plugin" src="{_file.U_FORUM}/{_file.U_DOWNLOAD_LINK}" width="0" height="0" autostart="false" controls="ImageWindow" console="video" prefetch="true"></embed> + </object> + <br /> + <object id=ctrls_{_file.ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36"> + <param name="controls" value="ControlPanel"> + <param name="console" value="{_file.U_DOWNLOAD_LINK}"> + <embed name=ctrls_{_file.ATTACH_ID} type="audio/x-pn-realaudio-plugin" width="0" height="36" controls="ControlPanel" console="video"></embed> + </object> + + <script language="Javascript"> + <!-- + while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth()) + { + } + + var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth(); + var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight(); + + document.rmstream_{_file.ATTACH_ID}.width = width; + document.rmstream_{_file.ATTACH_ID}.height = height; + document.ctrls_{_file.ATTACH_ID}.width = width; + //--> + </script> + <br /> + <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span> + <!-- ENDIF --> + + <br /> + <!-- ENDIF --> + +<!-- END _file --> diff --git a/phpBB/styles/subSilver/template/mcp_forum.html b/phpBB/styles/subSilver/template/mcp_forum.html index a618df4ce7..9d15fc04d1 100644 --- a/phpBB/styles/subSilver/template/mcp_forum.html +++ b/phpBB/styles/subSilver/template/mcp_forum.html @@ -2,7 +2,7 @@ <!-- IF U_VIEW_FORUM_LOGS --><a href="{U_VIEW_FORUM_LOGS}">{L_VIEW_FORUM_LOGS}</a><!-- ENDIF --> -<form method="post" name="mcp" action="{S_MCP_ACTION}"><table class="tablebg" width="100%" cellspacing="1"> +<form method="post" id="mcp" action="{S_MCP_ACTION}"><table class="tablebg" width="100%" cellspacing="1"> <tr> <td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></span></td> </tr> @@ -57,7 +57,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', 'topic_id_list', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', 'topic_id_list', false);">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_header.html b/phpBB/styles/subSilver/template/mcp_header.html index d371b94872..0e26ebe0b9 100644 --- a/phpBB/styles/subSilver/template/mcp_header.html +++ b/phpBB/styles/subSilver/template/mcp_header.html @@ -1,17 +1,5 @@ <!-- INCLUDE overall_header.html --> -<script language="javascript" type="text/javascript" defer="defer"> -<!-- -function marklist(form_name, status) -{ - for (i = 0; i < document.forms[form_name].length; i++) - { - document.forms[form_name].elements[i].checked = status; - } -} -//--> -</script> - <!-- IF TOPIC_TITLE or FORUM_NAME --> <div id="pageheader"> <h2><!-- IF TOPIC_TITLE --><a class="titles" href="{U_VIEWTOPIC}">{TOPIC_TITLE}</a><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- ENDIF --></h2> diff --git a/phpBB/styles/subSilver/template/mcp_queue.html b/phpBB/styles/subSilver/template/mcp_queue.html index 5052d9ad98..b981256c94 100644 --- a/phpBB/styles/subSilver/template/mcp_queue.html +++ b/phpBB/styles/subSilver/template/mcp_queue.html @@ -1,6 +1,6 @@ <!-- INCLUDE mcp_header.html --> -<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0"><form name="mcp" method="post" action="{S_MCP_ACTION}"> +<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0"><form name="mcp" id="mcp" method="post" action="{S_MCP_ACTION}"> <tr> <th colspan="6" height="28" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th> </tr> @@ -34,7 +34,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', '', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', '', false);">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_reports.html b/phpBB/styles/subSilver/template/mcp_reports.html index 00a10ac8f6..3df64274d9 100644 --- a/phpBB/styles/subSilver/template/mcp_reports.html +++ b/phpBB/styles/subSilver/template/mcp_reports.html @@ -1,6 +1,6 @@ <!-- INCLUDE mcp_header.html --> -<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0"><form name="mcp" method="post" action="{S_MCP_ACTION}"> +<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0"><form name="mcp" id="mcp" method="post" action="{S_MCP_ACTION}"> <tr> <th colspan="5" height="28" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th> </tr> @@ -44,7 +44,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', '', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', '', false);">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_topic.html b/phpBB/styles/subSilver/template/mcp_topic.html index 181dbb3d6d..736337d9ea 100644 --- a/phpBB/styles/subSilver/template/mcp_topic.html +++ b/phpBB/styles/subSilver/template/mcp_topic.html @@ -1,6 +1,6 @@ <!-- INCLUDE mcp_header.html --> -<form name="mcp" method="post" action="{S_MCP_ACTION}"><table class="tablebg" width="100%" cellspacing="1"> +<form name="mcp" id="mcp" method="post" action="{S_MCP_ACTION}"><table class="tablebg" width="100%" cellspacing="1"> <!-- IF S_CAN_SPLIT --> <tr> <th colspan="3" nowrap="nowrap">{L_SPLIT_TOPIC}</th> @@ -133,7 +133,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', '', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', '', false);">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index 119790b4e4..ea4e4019d3 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -85,7 +85,7 @@ <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pagination">{PAGE_NUMBER} [ {TOTAL_USERS} ]</td> - <td align="right"><!-- IF S_SEARCH_USER --><b class="nav"><a href="javascript:marklist(true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist(false);">{L_UNMARK_ALL}</a></b><br /><!-- ENDIF --><span class="pagination"><!-- IF PAGINATION --><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td> + <td align="right"><!-- IF S_SEARCH_USER --><b class="nav"><a href="javascript:marklist('results', 'user', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('results', 'user', false);">{L_UNMARK_ALL}</a></b><br /><!-- ENDIF --><span class="pagination"><!-- IF PAGINATION --><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/memberlist_search.html b/phpBB/styles/subSilver/template/memberlist_search.html index 6bb38f3202..042909fa8d 100644 --- a/phpBB/styles/subSilver/template/memberlist_search.html +++ b/phpBB/styles/subSilver/template/memberlist_search.html @@ -28,13 +28,6 @@ function insert_marked(users) self.close(); } -function marklist(status) -{ - for (i = 0; i < document.results.length; i++) - { - document.results.elements[i].checked = status; - } -} //--> </script> diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index ceebfb21c1..4839b42c2a 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -13,7 +13,7 @@ <tr> <td class="row1" align="center"><table cellspacing="1" cellpadding="2" border="0"> <tr> - <td class="gen" align="center"><!-- IF USER_COLOR --><b style="color: #{USER_COLOR}"><!-- ELSE --><b><!-- ENDIF -->{USERNAME}</b></td> + <td align="center"><!-- IF USER_COLOR --><b class="gen" style="color: #{USER_COLOR}"><!-- ELSE --><b class="gen"><!-- ENDIF -->{USERNAME}</b><!-- IF U_USER_ADMIN --><span class="genmed"> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]</span><!-- ENDIF --></td> </tr> <!-- IF RANK --> <tr> @@ -33,6 +33,11 @@ <tr> <td align="center">{ONLINE_IMG}</td> </tr> + <!-- IF U_SWITCH_PERMISSIONS --> + <tr> + <td class="genmed" align="center">[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</td> + </tr> + <!-- ENDIF --> <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> <tr> <td class="genmed" align="center">[ <a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a> ]</td> diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index fb75b9ca8b..7f73005671 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -49,6 +49,32 @@ function jumpto() } } +// Mark/unmark checkboxes +// id = ID of parent container, name = name prefix, state = state [true/false] +function marklist(id, name, state) +{ + var parent = document.getElementById(id); + if (!parent) + { + eval('parent = document.' + id); + } + + if (!parent) + { + return; + } + + var rb = parent.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) + { + if (rb[r].name.substr(0, name.length) == name) + { + rb[r].checked = state; + } + } +} + //--> </script> </head> @@ -67,7 +93,14 @@ function jumpto() <div id="menubar"><table width="100%" cellspacing="0"> <tr> - <td class="genmed"><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a> <!-- IF S_USER_LOGGED_IN --><!-- IF S_DISPLAY_PM --> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{L_PRIVATE_MESSAGES}" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF --><!-- ELSE --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" /> {L_REGISTER}</a><!-- ENDIF --></td> + <td class="genmed"> + <a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a> + <!-- IF U_RESTORE_PERMISSIONS --> <a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> Restore Permissions</a><!-- ENDIF --> + <!-- IF S_USER_LOGGED_IN --> + <!-- IF S_DISPLAY_PM --> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{L_PRIVATE_MESSAGES}" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF --> + <!-- ELSE --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" /> {L_REGISTER}</a> + <!-- ENDIF --> + </td> <td class="genmed" align="right"><a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" /> {L_FAQ}</a><!-- IF S_DISPLAY_SEARCH --> <a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" /> {L_SEARCH}</a><!-- ENDIF --><!-- IF S_DISPLAY_MEMBERLIST --> <a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" /> {L_MEMBERLIST}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> <a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" /> {L_PROFILE}</a><!-- ENDIF --></td> </tr> </table></div> diff --git a/phpBB/styles/subSilver/template/ucp_attachments.html b/phpBB/styles/subSilver/template/ucp_attachments.html index 144b3664f7..fba878b6b0 100644 --- a/phpBB/styles/subSilver/template/ucp_attachments.html +++ b/phpBB/styles/subSilver/template/ucp_attachments.html @@ -41,7 +41,7 @@ </tr> </table> -<div style="float:right"><b class="gensmall"><a href="javascript:marklist('ucp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', false);">{L_UNMARK_ALL}</a></b></div> +<div style="float:right"><b class="gensmall"><a href="javascript:marklist('ucp', 'attachment', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 'attachment', false);">{L_UNMARK_ALL}</a></b></div> <!-- ELSE --> diff --git a/phpBB/styles/subSilver/template/ucp_groups_manage.html b/phpBB/styles/subSilver/template/ucp_groups_manage.html index e067db83ed..125ebad9df 100644 --- a/phpBB/styles/subSilver/template/ucp_groups_manage.html +++ b/phpBB/styles/subSilver/template/ucp_groups_manage.html @@ -135,19 +135,6 @@ <!-- ELSEIF S_LIST --> - <script type="text/javascript"> - <!-- - function marklist(match, status) - { - doc = document.forms[match]; - for (i = 0; i < doc.length; i++) - { - doc.elements[i].checked = status; - } - } - //--> - </script> - <h1>{L_GROUP_MEMBERS}</h1> <p>{L_GROUP_MEMBERS_EXPLAIN}</p> @@ -196,7 +183,7 @@ </tr> <!-- END member --> <tr> - <td class="cat" colspan="5" align="center"><div style="float: right;"><span class="small"><a href="javascript:marklist('ucp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', false);">{L_UNMARK_ALL}</a></span></div><div style="float: left"><select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select> <input class="button2" type="submit" name="update" value="{L_SUBMIT}" /></div></td> + <td class="cat" colspan="5" align="center"><div style="float: right;"><span class="small"><a href="javascript:marklist('ucp', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 'mark', false);">{L_UNMARK_ALL}</a></span></div><div style="float: left"><select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select> <input class="button2" type="submit" name="update" value="{L_SUBMIT}" /></div></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/ucp_header.html b/phpBB/styles/subSilver/template/ucp_header.html index 6ff1b3206f..b84aab9107 100644 --- a/phpBB/styles/subSilver/template/ucp_header.html +++ b/phpBB/styles/subSilver/template/ucp_header.html @@ -156,4 +156,4 @@ </td> <td><img src="images/spacer.gif" width="4" alt="" /></td> - <td width="80%" valign="top"><!-- IF not S_PRIVMSGS --><form name="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}><!-- ENDIF --> + <td width="80%" valign="top"><!-- IF not S_PRIVMSGS --><form name="ucp" id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}><!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/ucp_main_bookmarks.html b/phpBB/styles/subSilver/template/ucp_main_bookmarks.html index 46185e1775..984c313f1f 100644 --- a/phpBB/styles/subSilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/subSilver/template/ucp_main_bookmarks.html @@ -53,6 +53,6 @@ <!-- ENDIF --> </table> -<!-- IF not S_NO_DISPLAY_BOOKMARKS --><div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', false);">{L_UNMARK_ALL}</a></b></div><!-- ENDIF --> +<!-- IF not S_NO_DISPLAY_BOOKMARKS --><div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', 't', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 't', false);">{L_UNMARK_ALL}</a></b></div><!-- ENDIF --> <!-- INCLUDE ucp_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/ucp_main_subscribed.html b/phpBB/styles/subSilver/template/ucp_main_subscribed.html index 033df21c16..17d58bd132 100644 --- a/phpBB/styles/subSilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/subSilver/template/ucp_main_subscribed.html @@ -81,6 +81,6 @@ </tr> </table> -<div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', false);">{L_UNMARK_ALL}</a></b></div> +<div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', 't', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 't', false);">{L_UNMARK_ALL}</a></b></div> <!-- INCLUDE ucp_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_footer.html b/phpBB/styles/subSilver/template/ucp_pm_message_footer.html index d20c099894..777b93935e 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_message_footer.html +++ b/phpBB/styles/subSilver/template/ucp_pm_message_footer.html @@ -37,5 +37,5 @@ </table> <!-- IF not S_VIEW_MESSAGE --> - <div style="float:right"><b class="gensmall"><a href="javascript:marklist('viewfolder', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('viewfolder', false);">{L_UNMARK_ALL}</a></b></div> + <div style="float:right"><b class="gensmall"><a href="javascript:marklist('viewfolder', 'marked_msg_id', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('viewfolder', 'marked_msg_id', false);">{L_UNMARK_ALL}</a></b></div> <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_header.html b/phpBB/styles/subSilver/template/ucp_pm_message_header.html index ece2389952..f499b82fd5 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/subSilver/template/ucp_pm_message_header.html @@ -1,16 +1,4 @@ -<script language="javascript" type="text/javascript"> -<!-- -function marklist(form_name, status) -{ - for (i = 0; i < document.forms[form_name].length; i++) - { - document.forms[form_name].elements[i].checked = status; - } -} -//--> -</script> - <table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> <tr> <td class="row1"> diff --git a/phpBB/styles/subSilver/template/ucp_profile_signature.html b/phpBB/styles/subSilver/template/ucp_profile_signature.html index 8d28984840..316fb89266 100644 --- a/phpBB/styles/subSilver/template/ucp_profile_signature.html +++ b/phpBB/styles/subSilver/template/ucp_profile_signature.html @@ -26,14 +26,6 @@ s_help = "{L_BBCODE_S_HELP}"; f_help = "{L_BBCODE_F_HELP}"; e_help = "{L_BBCODE_E_HELP}"; -function marklist(form_name, status) -{ - for (i = 0; i < document.forms[form_name].length; i++) - { - document.forms[form_name].elements[i].checked = status; - } -} - //--> </script> <script language="javascript" type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script> diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index e31392590c..14be0cf2c5 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -206,7 +206,7 @@ </tr> <!-- BEGIN attachment --> <tr> - <!-- IF postrow.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{postrow.attachment.DISPLAY_ATTACHMENT}</td> + <!-- IF postrow.attachment.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{postrow.attachment.DISPLAY_ATTACHMENT}</td> </tr> <!-- END attachment --> </table> diff --git a/phpBB/ucp.php b/phpBB/ucp.php index d9dfc9d1ba..9775e5fd81 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -39,8 +39,8 @@ switch ($mode) case 'activate': $module->load('ucp', 'activate'); $module->display($user->lang['UCP_ACTIVATE']); - redirect("index.$phpEx$SID"); + redirect("index.$phpEx$SID"); break; case 'resend_act': @@ -64,7 +64,6 @@ switch ($mode) break; case 'confirm': - $module->load('ucp', 'confirm'); exit; break; @@ -161,6 +160,72 @@ switch ($mode) redirect("index.$phpEx$SID"); break; + + case 'switch_perm': + + $user_id = request_var('u', 0); + + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $user_id; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id']) + { + redirect("index.$phpEx$SID"); + } + + include($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $auth_admin = new auth_admin(); + if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id'])) + { + redirect("index.$phpEx$SID"); + } + + $sql = 'SELECT username + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $username = $db->sql_fetchfield('username'); + $db->sql_freeresult($result); + + add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $username); + + $message = sprintf($user->lang['PERMISSIONS_TRANSFERED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"{$phpbb_root_path}index.$phpEx$SID\">", '</a>'); + trigger_error($message); + + break; + + case 'restore_perm': + + if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm')) + { + redirect("index.$phpEx$SID"); + } + + $auth->acl_cache($user->data); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_perm_from = 0 + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + $sql = 'SELECT username + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user->data['user_perm_from']; + $result = $db->sql_query($sql); + $username = $db->sql_fetchfield('username'); + $db->sql_freeresult($result); + + add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username); + + $message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"{$phpbb_root_path}index.$phpEx$SID\">", '</a>'); + trigger_error($message); + + break; } // Only registered users can go beyond this point |