- 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
This commit is contained in:
Meik Sievertsen 2006-04-17 13:09:50 +00:00
parent 8c2f02ca00
commit a0f8e1323a
49 changed files with 664 additions and 411 deletions

View file

@ -61,6 +61,7 @@
</tbody>
</table>
<!-- IF S_ACTION_OPTIONS -->
<form id="stats" method="post" action="{U_ACTION}">
<fieldset class="quick">
<select name="action">{S_ACTION_OPTIONS}</select>
@ -68,7 +69,9 @@
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- IF .log -->
<h2>{L_ADMIN_LOG}</h2>
<p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p>
@ -94,6 +97,7 @@
<!-- END log -->
</tbody>
</table>
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
<h2>{L_INACTIVE_USERS}</h2>

View file

@ -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>

View file

@ -50,6 +50,11 @@ function dE(n, s, type)
function marklist(id, name, state)
{
var parent = document.getElementById(id);
if (!parent)
{
eval('parent = document.' + id);
}
if (!parent)
{
return;

View file

@ -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 : '',
)
);

View file

@ -735,6 +735,8 @@ class acp_users
'U_SHOW_IP' => $this->u_action . "&amp;u=$user_id&amp;ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&amp;action=whois&amp;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&amp;mode=switch_perm&amp;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'],

View file

@ -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;
}
}
?>

View file

@ -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);

View file

@ -147,23 +147,6 @@ function unique_id($extra = 0, $prefix = false)
return uniqid(($prefix === false) ? mt_rand() : $prefix, true);
}
/**
* 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
*/
@ -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', '&lt;\1&gt;');
$replace = array('\1', '\1', '\1', '\1', '\1', '', '&lt;\1&gt;');
$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&amp;search_id=active_topics",
'U_DELETE_COOKIES' => "{$phpbb_root_path}ucp.$phpEx$SID&amp;mode=delete_cookies",
'U_TEAM' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=leaders",
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;mode=restore_perm" : '',
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_REGISTERED_USER' => $user->data['is_registered'],

View file

@ -584,7 +584,7 @@ function gen_forum_auth_level($mode, $forum_id, $forum_status)
($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)
$block_array += array(
'S_DENIED' => true,
'DENIED_MESSAGE' => sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])
);
}
else
{
$return_tpl[] = $tpl;
}
}
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,22 +765,25 @@ 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;
$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&amp;id=" . $attachment['attach_id'] : $filename;
$download_link = (!$force_physical && $attachment['attach_id']) ? $phpbb_root_path . "download.$phpEx$SID&amp;id=" . $attachment['attach_id'] : $filename;
$additional_array['VAR'][] = '{THUMB_IMG}';
$additional_array['VAL'][] = $thumb_source;
$block_array += array(
'S_THUMBNAIL' => true,
'THUMB_IMAGE' => $thumbnail_filename,
);
break;
// Windows Media Streams
@ -823,6 +791,10 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$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;
@ -832,25 +804,27 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$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(
$block_array += array(
'S_SWF_FILE' => true,
'WIDTH' => $width,
'HEIGHT' => $height
'HEIGHT' => $height,
);
// Viewed/Heared File ... update the download count (download.php is not called here)
@ -859,26 +833,26 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
*/
default:
$l_downloaded_viewed = $user->lang['DOWNLOADED'];
$download_link = (!$force_physical) ? $phpbb_root_path . "download.$phpEx$SID&amp;id=" . $attachment['attach_id'] : $filename;
$download_link = (!$force_physical && $attachment['attach_id']) ? $phpbb_root_path . "download.$phpEx$SID&amp;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}')
$block_array += array(
'U_DOWNLOAD_LINK' => $download_link,
'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed,
'L_DOWNLOAD_COUNT' => $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)
);
$template->assign_block_vars('_file', $block_array);
$tpl = str_replace($template_array['VAR'], $template_array['VAL'], $attachment_tpl[$current_block]);
// 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)
{
@ -891,11 +865,8 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$return_tpl[] = $tpl;
}
}
}
return $return_tpl;
// $mtime = explode(' ', microtime());
// $totaltime = $mtime[0] + $mtime[1] - $starttime;
}
/**

View file

@ -40,6 +40,10 @@ class template_compile
{
var $template;
// Various storage arrays
var $block_names = array();
var $block_else_level = array();
/**
* constuctor
*/
@ -120,18 +124,18 @@ 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;
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;
case 'END':
array_pop($this->template->block_names);
$compile_blocks[] = '<?php ' . ((array_pop($this->template->block_else_level)) ? '}' : '}}') . ' ?>';
array_pop($this->block_names);
$compile_blocks[] = '<?php ' . ((array_pop($this->block_else_level)) ? '}' : '}}') . ' ?>';
break;
case 'IF':
@ -159,8 +163,7 @@ class template_compile
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;
@ -168,9 +171,7 @@ class template_compile
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

View file

@ -164,6 +164,39 @@ class filespec
return array_pop($filename);
}
/**
* 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
*

View file

@ -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'];

View file

@ -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'])
{
if ($type == 's')
{
$this->attachment_data[$pos][$var] = trim(htmlspecialchars(str_replace(array("\r\n", "\r", '\xFF'), array("\n", "\n", ' '), stripslashes($this->attachment_data[$pos][$var]))));
$attach_ids[(int) $this->attachment_data[$pos]['attach_id']] = $pos;
}
else
{
$this->attachment_data[$pos][$var] = (int) $this->attachment_data[$pos][$var];
$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)
{
$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)
{
set_var($this->attachment_data[$pos]['mimetype'], $_POST['attachment_data'][$pos]['mimetype'], 'string');
}
else
{
$this->attachment_data[$pos]['mimetype'] = filespec::get_mimetype($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename);
}
}
}

View file

@ -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);
@ -357,6 +338,36 @@ class template
return true;
}
/**
* 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)
*

View file

@ -73,8 +73,8 @@ function compose_pm($id, $mode, $action)
{
trigger_error('NO_AUTH_SEND_MESSAGE');
}
break;
case 'reply':
case 'quote':
case 'forward':
@ -176,24 +176,27 @@ 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'];
$message_text = (isset($post['message_text'])) ? $post['message_text'] : '';
if (!$post['author_id'] && $msg_id)
{
trigger_error('NO_AUTHOR');
}
if ($action != 'delete')
{
$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_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'));
@ -213,6 +216,7 @@ function compose_pm($id, $mode, $action)
$check_value = (($post['enable_bbcode']+1) << 8) + (($post['enable_smilies']+1) << 4) + (($enable_urls+1) << 2) + (($post['enable_sig']+1) << 1);
}
}
}
else
{
$message_attachment = 0;
@ -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);

View file

@ -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

View file

@ -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,

View file

@ -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],

View file

@ -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,

View file

@ -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 '',

View file

@ -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,

View file

@ -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');

View file

@ -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 '',

View file

@ -345,6 +345,8 @@ $lang = array_merge($lang, array(
'LOG_ACL_DEL_MOD_LOCAL_M_' => '<b>Removed Moderators</b> from %s<br />&#187; %s',
'LOG_ACL_DEL_FORUM_LOCAL_F_' => '<b>Removed User/Group Forum Permissions</b> from %s<br />&#187; %s',
'LOG_ACL_TRANSFER_PERMISSIONS' => '<b>Permissions transfered from</b><br />&#187; %s',
'LOG_ACL_RESTORE_PERMISSIONS' => '<b>Own permissions restored after using permissions from</b><br />&#187; %s',
'LOG_ATTACH_EXT_ADD' => '<b>Added or edited attachment extension</b><br />&#187; %s',
'LOG_ATTACH_EXT_DEL' => '<b>Removed attachment extension</b><br />&#187; %s',

View file

@ -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'),

View file

@ -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',

View file

@ -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',

View file

@ -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',

View file

@ -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}&amp;i=users&amp;mode=overview&amp;u={$user_id}" : '',
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;mode=switch_perm&amp;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&amp;i=zebra&amp;add=" . urlencode($member['username']),
'U_ADD_FOE' => "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=zebra&amp;mode=foes&amp;add=" . urlencode($member['username']))

View file

@ -1,11 +1,35 @@
<!-- BEGIN DENIED -->
<span class="postbody">[{L_DENIED}]</span><br /><br />
<!-- END DENIED -->
<!-- BEGIN WM_STREAM -->
<span class="postbody">{COMMENT}</span><br />
<!-- BEGIN _file -->
<!-- IF _file.S_DENIED -->
<span class="genmed">[{_file.DENIED_MESSAGE}]</span><br />
<!-- ELSE -->
<!-- IF _file.COMMENT -->
<span class="gensmall"><b>{L_FILE_COMMENT}:</b> {_file.COMMENT}</span><br />
<!-- ENDIF -->
<!-- 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 -->
<!-- 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 -->
<!-- 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 -->
<!-- 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="{U_DOWNLOAD_LINK}">
<param name="FileName" value="{_file.U_DOWNLOAD_LINK}">
<param name="ShowControls" value="1">
<param name="ShowDisplay" value="0">
<param name="ShowStatusBar" value="1">
@ -14,60 +38,47 @@
<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 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>
<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 />
<object id=ctrls_{ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36">
<span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span>
<!-- ENDIF -->
<!-- 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="{U_DOWNLOAD_LINK}">
<embed name=ctrls_{ATTACH_ID} type="audio/x-pn-realaudio-plugin" width="0" height="36" controls="ControlPanel" console="video"></embed>
<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_{ATTACH_ID}.GetClipWidth())
while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth())
{
}
var width = document.rmstream_{ATTACH_ID}.GetClipWidth();
var height = document.rmstream_{ATTACH_ID}.GetClipHeight();
var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth();
var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight();
document.rmstream_{ATTACH_ID}.width = width;
document.rmstream_{ATTACH_ID}.height = height;
document.ctrls_{ATTACH_ID}.width = width;
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">{DOWNLOAD_NAME} - {L_DOWNLOADED_VIEWED} {L_DOWNLOAD_COUNT}</span><br /><br />
<!-- END RM_STREAM -->
<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 -->
<!-- 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 -->
<!-- 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 -->
<br />
<!-- ENDIF -->
<!-- END _file -->

View file

@ -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}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE -->&nbsp;&nbsp;<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>&nbsp;&nbsp;<!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE -->&nbsp;&nbsp;<a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td>
</tr>
</table>

View file

@ -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>

View file

@ -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>

View file

@ -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>&nbsp;<!-- IF S_USER_LOGGED_IN --><!-- IF S_DISPLAY_PM --> &nbsp;<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 --> &nbsp;<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>&nbsp;
<!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<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 --> &nbsp;<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 --> &nbsp;<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 -->&nbsp; &nbsp;<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 -->&nbsp; &nbsp;<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 -->&nbsp; &nbsp;<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>

View file

@ -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 -->

View file

@ -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>

View file

@ -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 -->

View file

@ -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 -->

View file

@ -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 -->

View file

@ -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 -->

View file

@ -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">

View file

@ -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>

View file

@ -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>

View file

@ -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