Merge commit 'release-3.0-B3'

This commit is contained in:
Nils Adermann 2010-03-02 01:05:34 +01:00
commit 07633a66e8
325 changed files with 19159 additions and 13245 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

View file

@ -136,21 +136,27 @@ function adm_page_header($page_title)
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'S_USER_LANG' => $user->lang['USER_LANG'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'])
);
if (!empty($config['send_encoding']))
if ($config['send_encoding'])
{
header('Content-type: text/html; charset: ' . $user->lang['ENCODING']);
header('Content-type: text/html; charset=UTF-8');
}
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
@ -371,4 +377,102 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
return $tpl;
}
/**
* Going through a config array and validate values, writing errors to $error.
*/
function validate_config_vars($config_vars, &$cfg_array, &$error)
{
global $phpbb_root_path, $user;
foreach ($config_vars as $config_name => $config_definition)
{
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
{
continue;
}
if (!isset($config_definition['validate']))
{
continue;
}
// Validate a bit. ;) String is already checked through request_var(), therefore we do not check this again
switch ($config_definition['validate'])
{
case 'bool':
$cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0;
break;
case 'int':
$cfg_array[$config_name] = (int) $cfg_array[$config_name];
break;
// Relative path (appended $phpbb_root_path)
case 'rpath':
case 'rwpath':
if (!$cfg_array[$config_name])
{
break;
}
$destination = $cfg_array[$config_name];
// Adjust destination path (no trailing slash)
if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\')
{
$destination = substr($destination, 0, sizeof($destination)-2);
}
$destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
{
$destination = '';
}
$cfg_array[$config_name] = trim($destination);
// Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
case 'path':
case 'wpath':
if (!$cfg_array[$config_name])
{
break;
}
$cfg_array[$config_name] = trim($cfg_array[$config_name]);
// Make sure no NUL byte is present...
if (strpos($cfg_array[$config_name], '\0') !== false || strpos($cfg_array[$config_name], '%00') !== false)
{
$cfg_array[$config_name] = '';
break;
}
if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
}
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
}
// Check if the path is writeable
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
{
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_writeable($phpbb_root_path . $cfg_array[$config_name]))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $cfg_array[$config_name]);
}
}
break;
}
}
return;
}
?>

View file

@ -295,10 +295,9 @@
</tr>
<!-- ENDIF -->
<tr>
<input type="hidden" name="extension_change_list[]" value="{extensions.EXTENSION_ID}" />
<td><b>{extensions.EXTENSION}</b></td>
<td>{extensions.GROUP_OPTIONS}</td>
<td><input type="checkbox" class="radio" name="extension_id_list[]" value="{extensions.EXTENSION_ID}" /></td>
<td><input type="checkbox" class="radio" name="extension_id_list[]" value="{extensions.EXTENSION_ID}" /><input type="hidden" name="extension_change_list[]" value="{extensions.EXTENSION_ID}" /></td>
</tr>
<!-- END extensions -->
</tbody>
@ -319,6 +318,7 @@
<thead>
<tr>
<th>{L_FILENAME}</th>
<th>{L_FILEDATE}</th>
<th>{L_FILESIZE}</th>
<th>{L_ATTACH_POST_ID}</th>
<th>{L_ATTACH_TO_POST}</th>
@ -328,21 +328,24 @@
<tbody>
<!-- BEGIN orphan -->
<!-- IF orphan.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{orphan.U_FILE}" rel="file">{orphan.FILE}</a></td>
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
<td>{orphan.FILETIME}</td>
<td>{orphan.FILESIZE}</td>
<td><b>ID: </b><input type="text" name="post_id[{orphan.FILE}]" size="7" maxlength="10" value="{orphan.POST_IDS}" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.FILE}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.FILE}]" /></td>
<td><b>ID: </b><input type="text" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
</tr>
<!-- END orphan -->
<tr>
<td colspan="3">&nbsp;</td>
<td class="small"><a href="javascript:marklist('orphan', 'add', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'add', false);">{L_UNMARK_ALL}</a></td>
<td class="small"><a href="javascript:marklist('orphan', 'delete', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'delete', false);">{L_UNMARK_ALL}</a></td>
<tr class="row4">
<td colspan="4">&nbsp;</td>
<td class="small"><a href="#" onclick="marklist('orphan', 'add', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'add', false); return false;">{L_UNMARK_ALL}</a></td>
<td class="small"><a href="#" onclick="marklist('orphan', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'delete', false); return false;">{L_UNMARK_ALL}</a></td>
</tr>
</tbody>
</table>
<br />
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />

View file

@ -12,19 +12,19 @@
<!--
var ban_length = new Array();
ban_length[-1] = "";
ban_length[-1] = '';
<!-- BEGIN ban_length -->
ban_length['{ban_length.BAN_ID}'] = "{ban_length.A_LENGTH}";
<!-- END ban_length -->
var ban_reason = new Array();
ban_reason[-1] = "";
ban_reason[-1] = '';
<!-- BEGIN ban_reason -->
ban_reason['{ban_reason.BAN_ID}'] = "{ban_reason.A_REASON}";
<!-- END ban_reason -->
var ban_give_reason = new Array();
ban_give_reason[-1] = "";
ban_give_reason[-1] = '';
<!-- BEGIN ban_give_reason -->
ban_give_reason['{ban_give_reason.BAN_ID}'] = "{ban_give_reason.A_REASON}";
<!-- END ban_give_reason -->

View file

@ -96,7 +96,7 @@
<!-- BEGIN bbcodes -->
<!-- IF bbcodes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="text-align: center;">{bbcodes.BBCODE_TAG}</td>
<td style="text-align: center;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td>
<td style="text-align: right; width: 40px;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td>
</tr>
<!-- END bbcodes -->
</tbody>

View file

@ -6,6 +6,13 @@
<p>{L_TITLE_EXPLAIN}</p>
<!-- IF S_ERROR -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<form id="acp_board" method="post" action="{U_ACTION}">
<!-- BEGIN options -->

View file

@ -89,7 +89,7 @@
<input class="button2" name="add" type="submit" value="{L_BOT_ADD}" />
</fieldset>
<fieldset class="quick">
<fieldset class="quick" style="float: right;">
<select name="action">{S_BOT_OPTIONS}</select>
<input class="button2" name="submit" type="submit" value="{L_SUBMIT}" />
</fieldset>

View file

@ -18,100 +18,18 @@
<dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ENABLED}&nbsp; &nbsp;<input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_DISABLED}</dd>
</dl>
</fieldset>
<!-- IF GD -->
<fieldset>
<legend>{L_CAPTCHA_OVERLAP}</legend>
<!-- IF TTF -->
<dl>
<dt><label for="policy_overlap">{L_CAPTCHA_OVERLAP}:</label><br /><span>{U_POLICY_OVERLAP}</span></dt>
<dd><input id="policy_overlap" name="policy_overlap" value="1" class="radio" type="radio"<!-- IF OVERLAP_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_overlap" value="0" class="radio" type="radio"<!-- IF not OVERLAP_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
<dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt>
<dd><input id="captcha_gd" name="captcha_gd" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="captcha_gd" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
<dl>
<dt><label for="policy_overlap_noise_pixel">{L_OVERLAP_NOISE_PIXEL}:</label></dt>
<select id="policy_overlap_noise_pixel" name="policy_overlap_noise_pixel"><option value="0"<!-- IF OVERLAP_NOISE_PIXEL eq '0' --> selected="selected"<!-- ENDIF -->>{L_NO_NOISE}</option><option value="1"<!-- IF OVERLAP_NOISE_PIXEL eq '1' --> selected="selected"<!-- ENDIF -->>{L_LIGHT}</option><option value="2"<!-- IF OVERLAP_NOISE_PIXEL eq '2' --> selected="selected"<!-- ENDIF -->>{L_MEDIUM}</option><option value="3"<!-- IF OVERLAP_NOISE_PIXEL eq '3' --> selected="selected"<!-- ENDIF -->>{L_HEAVY}</option></select></dd>
<dt><label for="captcha_gd_noise">{L_CAPTCHA_GD_NOISE}:</label><br /><span>{L_CAPTCHA_GD_NOISE_EXPLAIN}</span></dt>
<dd><input id="captcha_gd_noise" name="captcha_gd_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="captcha_gd_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
<dl>
<dt><label for="policy_overlap_noise_line">{L_OVERLAP_NOISE_LINE}:</label></dt>
<dd><input id="policy_overlap_noise_line" name="policy_overlap_noise_line" value="1" class="radio" type="radio"<!-- IF OVERLAP_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_overlap_noise_line" value="0" class="radio" type="radio"<!-- IF not OVERLAP_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<!-- ENDIF -->
<fieldset>
<legend>{L_CAPTCHA_ENTROPY}</legend>
<dl>
<dt><label for="policy_entropy">{L_CAPTCHA_ENTROPY}:</label><br /><span>{U_POLICY_ENTROPY}</span></dt>
<dd><input id="policy_entropy" name="policy_entropy" value="1" class="radio" type="radio"<!-- IF ENTROPY_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_entropy" value="0" class="radio" type="radio"<!-- IF not ENTROPY_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
<dl>
<dt><label for="policy_entropy_noise_pixel">{L_ENTROPY_NOISE_PIXEL}:</label></dt>
<select id="policy_entropy_noise_pixel" name="policy_entropy_noise_pixel"><option value="0"<!-- IF ENTROPY_NOISE_PIXEL eq '0' --> selected="selected"<!-- ENDIF -->>{L_NO_NOISE}</option><option value="1"<!-- IF ENTROPY_NOISE_PIXEL eq '1' --> selected="selected"<!-- ENDIF -->>{L_LIGHT}</option><option value="2"<!-- IF ENTROPY_NOISE_PIXEL eq '2' --> selected="selected"<!-- ENDIF -->>{L_MEDIUM}</option><option value="3"<!-- IF ENTROPY_NOISE_PIXEL eq '3' --> selected="selected"<!-- ENDIF -->>{L_HEAVY}</option></select></dd>
</dl>
<dl>
<dt><label for="policy_entropy_noise_line">{L_ENTROPY_NOISE_LINE}:</label></dt>
<dd><input id="policy_entropy_noise_line" name="policy_entropy_noise_line" value="1" class="radio" type="radio"<!-- IF ENTROPY_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_entropy_noise_line" value="0" class="radio" type="radio"<!-- IF not ENTROPY_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<!-- IF TTF -->
<fieldset>
<legend>{L_CAPTCHA_SHAPE}</legend>
<dl>
<dt><label for="policy_shape">{L_CAPTCHA_SHAPE}:</label><br /><span>{U_POLICY_SHAPE}</span></dt>
<dd><input id="policy_shape" name="policy_shape" value="1" class="radio" type="radio"<!-- IF SHAPE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_shape" value="0" class="radio" type="radio"<!-- IF not SHAPE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
<dl>
<dt><label for="policy_shape_noise_pixel">{L_SHAPE_NOISE_PIXEL}:</label></dt>
<select id="policy_shape_noise_pixel" name="policy_shape_noise_pixel"><option value="0"<!-- IF SHAPE_NOISE_PIXEL eq '0' --> selected="selected"<!-- ENDIF -->>{L_NO_NOISE}</option><option value="1"<!-- IF SHAPE_NOISE_PIXEL eq '1' --> selected="selected"<!-- ENDIF -->>{L_LIGHT}</option><option value="2"<!-- IF SHAPE_NOISE_PIXEL eq '2' --> selected="selected"<!-- ENDIF -->>{L_MEDIUM}</option><option value="3"<!-- IF SHAPE_NOISE_PIXEL eq '3' --> selected="selected"<!-- ENDIF -->>{L_HEAVY}</option></select></dd>
</dl>
<dl>
<dt><label for="policy_shape_noise_line">{L_SHAPE_NOISE_LINE}:</label></dt>
<dd><input id="policy_shape_noise_line" name="policy_shape_noise_line" value="1" class="radio" type="radio"<!-- IF SHAPE_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_shape_noise_line" value="0" class="radio" type="radio"<!-- IF not SHAPE_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<!-- ENDIF -->
<fieldset>
<legend>{L_CAPTCHA_3DBITMAP}</legend>
<dl>
<dt><label for="policy_3dbitmap">{L_CAPTCHA_3DBITMAP}:</label><br /><span>{U_POLICY_3DBITMAP}</span></dt>
<dd><input id="policy_3dbitmap" name="policy_3dbitmap" value="1" class="radio" type="radio"<!-- IF THREEDBITMAP_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_3dbitmap" value="0" class="radio" type="radio"<!-- IF not THREEDBITMAP_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<!-- IF TTF -->
<fieldset>
<legend>{L_CAPTCHA_CELLS}</legend>
<dl>
<dt><label for="policy_cells">{L_CAPTCHA_CELLS}:</label><br /><span>{U_POLICY_CELLS}</span></dt>
<dd><input id="policy_cells" name="policy_cells" value="1" class="radio" type="radio"<!-- IF CELLS_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_cells" value="0" class="radio" type="radio"<!-- IF not CELLS_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_CAPTCHA_STENCIL}</legend>
<dl>
<dt><label for="policy_stencil">{L_CAPTCHA_STENCIL}:</label><br /><span>{U_POLICY_STENCIL}</span></dt>
<dd><input id="policy_stencil" name="policy_stencil" value="1" class="radio" type="radio"<!-- IF STENCIL_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_stencil" value="0" class="radio" type="radio"<!-- IF not STENCIL_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_CAPTCHA_COMPOSITE}</legend>
<dl>
<dt><label for="policy_composite">{L_CAPTCHA_COMPOSITE}:</label><br /><span>{U_POLICY_COMPOSITE}</span></dt>
<dd><input id="policy_composite" name="policy_composite" value="1" class="radio" type="radio"<!-- IF COMPOSITE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="policy_composite" value="0" class="radio" type="radio"<!-- IF not COMPOSITE_ENABLE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl>
</fieldset>
<!-- ENDIF -->
<!-- ENDIF -->
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />

View file

@ -24,7 +24,7 @@
<dl>
<dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt>
<dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
</dl>
<dl>
<dt><label for="subject">{L_SUBJECT}:</label></dt>

View file

@ -96,6 +96,14 @@
<dd><img src="{FORUM_IMAGE_SRC}" alt="{L_FORUM_IMAGE}" /></dd>
<!-- ENDIF -->
</dl>
<dl>
<dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password" name="forum_password" value="{FORUM_PASSWORD}" /></dd>
</dl>
<dl>
<dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="{FORUM_PASSWORD_CONFIRM}" /></dd>
</dl>
<dl>
<dt><label for="forum_style">{L_FORUM_STYLE}:</label></dt>
<dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd>
@ -149,14 +157,6 @@
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
<dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" /></dd>
</dl>
<dl>
<dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password" name="forum_password" value="{FORUM_PASSWORD}" /></dd>
</dl>
<dl>
<dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt>
<dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="{FORUM_PASSWORD_CONFIRM}" /></dd>
</dl>
</fieldset>
<fieldset>
@ -283,8 +283,40 @@
</form>
<!-- ELSEIF S_CONTINUE_SYNC -->
<script type="text/javascript">
<!--
var close_waitscreen = 0;
window.open('{UA_PROGRESS_BAR}', '_sync', 'height=240, resizable=yes, scrollbars=no, width=400');
//-->
</script>
<h1>{L_FORUM_ADMIN}</h1>
<p>{L_FORUM_ADMIN_EXPLAIN}</p>
<p>{L_PROGRESS_EXPLAIN}</p>
<!-- ELSE -->
<script type="text/javascript">
<!--
/**
* Popup search progress bar
*/
function popup_progress_bar()
{
var close_waitscreen = 0;
window.open('{UA_PROGRESS_BAR}', '_sync', 'height=240, resizable=yes, scrollbars=no, width=400');
}
//-->
</script>
<h1>{L_FORUM_ADMIN}</h1>
<p>{L_FORUM_ADMIN_EXPLAIN}</p>
@ -297,12 +329,18 @@
<!-- ENDIF -->
<!-- IF S_RESYNCED -->
<script language="javascript" type="text/javascript">
<!--
var close_waitscreen = 1;
//-->
</script>
<div class="successbox">
<h3>{L_NOTIFY}</h3>
<p>{L_FORUM_RESYNCED}</p>
</div>
<!-- ENDIF -->
<p><strong>{NAVIGATION}<!-- IF S_NO_FORUMS --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a><!-- IF not S_LINK --> | <a href="{U_SYNC}">{L_RESYNC}</a><!-- ENDIF --->]<!-- ENDIF --></strong></p>
<!-- IF .forums -->
@ -313,15 +351,31 @@
<tr>
<td style="width: 5%;">{forums.FOLDER_IMAGE}</td>
<td>
<strong><!-- IF forums.S_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
<!-- IF forums.FORUM_IMAGE --><div style="float: left;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
<strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
<!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF -->
<!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <b>{forums.FORUM_TOPICS}</b> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF -->
</td>
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not forums.S_FIRST_ROW --><a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not forums.S_LAST_ROW --><a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
<!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW-->
<a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW -->
<a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{forums.U_EDIT}">{ICON_EDIT}</a>
<!-- IF not forums.S_LINK --><a href="{forums.U_SYNC}">{ICON_SYNC}</a> <!-- ENDIF -->
<!-- IF not forums.S_FORUM_LINK -->
<a href="{forums.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a>
<!-- ELSE -->
{ICON_SYNC_DISABLED}
<!-- ENDIF -->
<a href="{forums.U_DELETE}">{ICON_DELETE}</a>
</td>
</tr>
@ -353,4 +407,4 @@
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
<!-- INCLUDE overall_footer.html -->

View file

@ -217,14 +217,14 @@
<div class="pagination" style="float: left;">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
<fieldset class="quick">
<span class="small"><a href="javascript:marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></span><br />
<span class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></span><br />
<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}" />
@ -247,7 +247,7 @@
<dl>
<dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
<dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd>
<dd>[ <a href="{U_FIND_USERNAME}" target="usersearch">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
</dl>
</fieldset>

View file

@ -139,14 +139,22 @@
</tr>
<!-- ENDIF -->
<!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td>
<td style="width: 85%; text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td>
<!-- IF S_SMILIES -->
<td style="text-align: center;">{items.CODE}</td>
<td style="text-align: center;">{items.EMOTION}</td>
<!-- ENDIF -->
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not items.S_FIRST_ROW --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not items.S_LAST_ROW --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF items.S_FIRST_ROW && not items.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not items.S_FIRST_ROW && not items.S_LAST_ROW-->
<a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF items.S_LAST_ROW && not items.S_FIRST_ROW -->
<a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{items.U_EDIT}">{ICON_EDIT}</a>
<a href="{items.U_DELETE}">{ICON_DELETE}</a>
</td>

View file

@ -0,0 +1,75 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a>
<h2>{L_INACTIVE_USERS}</h2>
<p>{L_INACTIVE_USERS_EXPLAIN}</p>
<form id="inactive" method="post" action="{U_ACTION}">
<div class="clearfix"></div>
<div class="pagination">
<!-- IF PAGINATION -->
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_JOINED}</th>
<th>{L_INACTIVE_DATE}</th>
<th>{L_INACTIVE_REASON}</th>
<th>{L_LAST_VISIT}</th>
<th>{L_MARK}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN inactive -->
<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
<td>{inactive.JOINED}</td>
<td>{inactive.INACTIVE_DATE}</td>
<td>{inactive.REASON}</td>
<td>{inactive.LAST_VISIT}</td>
<td>&nbsp;<input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" />&nbsp;</td>
</tr>
<!-- BEGINELSE -->
<tr>
<td colspan="6" style="text-align: center;">{L_NO_INACTIVE_USERS}</td>
</tr>
<!-- END inactive -->
</tbody>
</table>
<!-- IF .inactive -->
<fieldset class="quick" style="float: left;">
{L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
<input class="button2" type="submit" value="{L_GO}" name="sort" />
</fieldset>
<fieldset class="quick">
<p><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
<select name="action">{S_INACTIVE_OPTIONS}</select>
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
<!-- ENDIF -->
<div class="pagination">
<!-- IF PAGINATION -->
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
</div>
</form>
<!-- INCLUDE overall_footer.html -->

View file

@ -44,7 +44,7 @@
</dl>
<dl>
<dt><label>{L_LANG_ISO_CODE}:</label></dt>
<dd><b>{LANG_ISO}</b></dd>
<dd><strong>{LANG_ISO}</strong></dd>
</dl>
<dl>
<dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt>
@ -85,7 +85,7 @@
<tbody>
<!-- BEGIN missing -->
<tr class="row4">
<td><b>{missing.FILE}</b></td>
<td><strong>{missing.FILE}</strong></td>
<td style="text-align: right;"><input type="submit" name="missing_file[{missing.KEY}]" value="{L_SELECT}" class="button2" /></td>
</tr>
{missing.TPL}
@ -131,8 +131,12 @@
</tr>
<!-- ENDIF -->
<tr>
<td class="row3"><b>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></b></td>
<td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /><!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method">&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
<td rowspan="2" class="row3"><strong>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></strong></td>
<td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
</tr>
<tr>
<td class="row3" style="text-align: right;">
<!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" />&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
</tr>
</thead>
<tbody>
@ -144,7 +148,10 @@
{TPL}
<!-- ENDIF -->
<tr>
<td class="row3" colspan="3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /><!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio" value="{buttons.VALUE}" name="method">&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
<td class="row3" colspan="3" style="text-align: right;"><!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}:&nbsp;<!-- BEGIN buttons--><input type="radio" class="radio" value="{buttons.VALUE}" name="method" />&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
</tr>
<tr>
<td class="row3" colspan="3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
</tr>
</tbody>
</table>
@ -173,12 +180,12 @@
<legend>{L_UPLOAD_SETTINGS}</legend>
<dl>
<dt><label>{L_UPLOAD_METHOD}:</label></dt>
<dd><b>{NAME}</b></dd>
<dd><strong>{NAME}</strong></dd>
</dl>
<!-- BEGIN data -->
<dl>
<dt><label for="store">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" checked="checked" /></dd>
<dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
</dl>
<!-- END data -->
</fieldset>
@ -209,27 +216,27 @@
</thead>
<tbody>
<tr>
<td class="row3" colspan="5"><b>{L_INSTALLED_LANGUAGE_PACKS}</b></td>
<td class="row3" colspan="5"><strong>{L_INSTALLED_LANGUAGE_PACKS}</strong></td>
</tr>
<!-- BEGIN lang -->
<!-- IF lang.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{lang.U_DETAILS}">{lang.ENGLISH_NAME}</a> {lang.TAG}</td>
<td>{lang.LOCAL_NAME}</td>
<td style="text-align: center;"><b>{lang.ISO}</b></td>
<td style="text-align: center;"><strong>{lang.ISO}</strong></td>
<td style="text-align: center;">{lang.USED_BY}</td>
<td style="text-align: center;">&nbsp;<a href="{lang.U_DOWNLOAD}">{L_DOWNLOAD}</a>&nbsp;|&nbsp;<a href="{lang.U_DELETE}">{L_DELETE}</a></td>
</tr>
<!-- END lang -->
<!-- IF .notinst -->
<tr>
<td class="row3" colspan="5"><b>{L_UNINSTALLED_LANGUAGE_PACKS}</b></td>
<td class="row3" colspan="5"><strong>{L_UNINSTALLED_LANGUAGE_PACKS}</strong></td>
</tr>
<!-- ENDIF -->
<!-- BEGIN notinst -->
<!-- IF notinst.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td>{notinst.NAME}</td>
<td>{notinst.LOCAL_NAME}</td>
<td style="text-align: center;"><b>{notinst.ISO}</b></td>
<td style="text-align: center;"><strong>{notinst.ISO}</strong></td>
<td colspan="2" style="text-align: center;"><a href="{notinst.U_INSTALL}">{L_INSTALL}</a></td>
</tr>
<!-- END notinst -->

View file

@ -17,7 +17,7 @@
<div class="pagination">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
@ -70,7 +70,7 @@
<!-- IF S_CLEARLOGS -->
<fieldset class="quick">
<b class="small"><a href="javascript: marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></b><br />
<b class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></b><br />
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />&nbsp;
<input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" />&nbsp;
</fieldset>
@ -78,7 +78,7 @@
<div class="pagination">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->

View file

@ -1,165 +1,171 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a><h1>{L_WELCOME_PHPBB}</h1>
<a name="maincontent"></a>
<p>{L_ADMIN_INTRO}</p>
<!-- IF S_RESTORE_PERMISSIONS -->
<!-- IF S_DEBUG_EXTRA -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_DEBUG_EXTRA_WARNING}</p>
</div>
<!-- ENDIF -->
<h1>{L_PERMISSIONS_TRANSFERED}</h1>
<!-- IF S_REMOVE_INSTALL -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_REMOVE_INSTALL}</p>
</div>
<!-- ENDIF -->
<p>{L_PERMISSIONS_TRANSFERED_EXPLAIN}</p>
<table cellspacing="1">
<caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
<tr>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{L_NUMBER_POSTS}: </td>
<td><b>{TOTAL_POSTS}</b></td>
<td>{L_POSTS_PER_DAY}: </td>
<td><b>{POSTS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_TOPICS}: </td>
<td><b>{TOTAL_TOPICS}</b></td>
<td>{L_TOPICS_PER_DAY}: </td>
<td><b>{TOPICS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_USERS}: </td>
<td><b>{TOTAL_USERS}</b></td>
<td>{L_USERS_PER_DAY}: </td>
<td><b>{USERS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_FILES}: </td>
<td><b>{TOTAL_FILES}</b></td>
<td>{L_FILES_PER_DAY}: </td>
<td><b>{FILES_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_BOARD_STARTED}: </td>
<td><b>{START_DATE}</b></td>
<td>{L_AVATAR_DIR_SIZE}: </td>
<td><b>{AVATAR_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SIZE}: </td>
<td><b>{DBSIZE}</b></td>
<td>{L_UPLOAD_DIR_SIZE}: </td>
<td><b>{UPLOAD_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SERVER_INFO}: </td>
<td><b>{DATABASE_INFO}</b></td>
<td>{L_GZIP_COMPRESSION}: </td>
<td><b>{GZIP_COMPRESSION}</b></td>
</tr>
</tbody>
</table>
<!-- ELSE -->
<!-- IF S_ACTION_OPTIONS -->
<form id="stats" method="post" action="{U_ACTION}">
<fieldset class="quick">
<select name="action">{S_ACTION_OPTIONS}</select>
<h1>{L_WELCOME_PHPBB}</h1>
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<p>{L_ADMIN_INTRO}</p>
<!-- IF .log -->
<h2>{L_ADMIN_LOG}</h2>
<p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p>
<!-- IF S_REMOVE_INSTALL -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_REMOVE_INSTALL}</p>
</div>
<!-- ENDIF -->
<table cellspacing="1">
<caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_IP}</th>
<th>{L_TIME}</th>
<th>{L_ACTION}</th>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</th>
<th>{L_STATISTIC}</th>
<th>{L_VALUE}</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>
</tr>
<!-- END log -->
</tbody>
</table>
<br />
<div style="text-align: right;"><a href="{U_ADMIN_LOG}">&raquo; {L_VIEW_ADMIN_LOG}</a></div>
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
<h2>{L_INACTIVE_USERS}</h2>
<p>{L_INACTIVE_USERS_EXPLAIN}</p>
<form id="inactive" method="post" action="{U_ACTION}">
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_JOINED}</th>
<th>{L_LAST_VISIT}</th>
<th>{L_MARK}</th>
<td>{L_NUMBER_POSTS}: </td>
<td><b>{TOTAL_POSTS}</b></td>
<td>{L_POSTS_PER_DAY}: </td>
<td><b>{POSTS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_TOPICS}: </td>
<td><b>{TOTAL_TOPICS}</b></td>
<td>{L_TOPICS_PER_DAY}: </td>
<td><b>{TOPICS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_USERS}: </td>
<td><b>{TOTAL_USERS}</b></td>
<td>{L_USERS_PER_DAY}: </td>
<td><b>{USERS_PER_DAY}</b></td>
</tr>
<tr>
<td>{L_NUMBER_FILES}: </td>
<td><b>{TOTAL_FILES}</b></td>
<td>{L_FILES_PER_DAY}: </td>
<td><b>{FILES_PER_DAY}</b></td>
</tr>
</thead>
<tbody>
<!-- BEGIN inactive -->
<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
<td>{inactive.DATE}</td>
<td>{inactive.LAST_VISIT}</td>
<td>&nbsp;<input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" />&nbsp;</td>
</tr>
<!-- BEGINELSE -->
<tr>
<td colspan="3" style="text-align: center;">{L_NO_INACTIVE_USERS}</td>
</tr>
<!-- END inactive -->
<tr>
<td>{L_BOARD_STARTED}: </td>
<td><b>{START_DATE}</b></td>
<td>{L_AVATAR_DIR_SIZE}: </td>
<td><b>{AVATAR_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SIZE}: </td>
<td><b>{DBSIZE}</b></td>
<td>{L_UPLOAD_DIR_SIZE}: </td>
<td><b>{UPLOAD_DIR_SIZE}</b></td>
</tr>
<tr>
<td>{L_DATABASE_SERVER_INFO}: </td>
<td><b>{DATABASE_INFO}</b></td>
<td>{L_GZIP_COMPRESSION}: </td>
<td><b>{GZIP_COMPRESSION}</b></td>
</tr>
<!-- IF S_TOTAL_ORPHAN -->
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>{L_NUMBER_ORPHAN}: </td>
<td><b>{TOTAL_ORPHAN}</b></td>
</tr>
<!-- ENDIF -->
</tbody>
</table>
<!-- IF .inactive -->
<!-- IF S_ACTION_OPTIONS -->
<form id="stats" method="post" action="{U_ACTION}">
<fieldset class="quick">
<p><a href="javascript:marklist('inactive', 'mark', true);">{L_MARK_ALL}</a> &bull; <a href="javascript:marklist('inactive', 'mark', false);">{L_UNMARK_ALL}</a></p>
<select name="action">{S_INACTIVE_OPTIONS}</select>
<select name="action">{S_ACTION_OPTIONS}</select>
<input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
</form>
<!-- IF .log -->
<h2>{L_ADMIN_LOG}</h2>
<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>
</tr>
<!-- END log -->
</tbody>
</table>
<br />
<div style="text-align: right;"><a href="{U_ADMIN_LOG}">&raquo; {L_VIEW_ADMIN_LOG}</a></div>
<!-- ENDIF -->
<!-- IF S_INACTIVE_USERS -->
<h2>{L_INACTIVE_USERS}</h2>
<p>{L_INACTIVE_USERS_EXPLAIN_INDEX}</p>
<div style="text-align: right;"><a href="{U_INACTIVE_USERS}">&raquo; {L_VIEW_INACTIVE_USERS}</a></div>
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_JOINED}</th>
<th>{L_INACTIVE_DATE}</th>
<th>{L_INACTIVE_REASON}</th>
<th>{L_LAST_VISIT}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN inactive -->
<!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
<td>{inactive.JOINED}</td>
<td>{inactive.INACTIVE_DATE}</td>
<td>{inactive.REASON}</td>
<td>{inactive.LAST_VISIT}</td>
</tr>
<!-- BEGINELSE -->
<tr>
<td colspan="5" style="text-align: center;">{L_NO_INACTIVE_USERS}</td>
</tr>
<!-- END inactive -->
</tbody>
</table>
<!-- ENDIF -->
<!-- ENDIF -->

View file

@ -21,16 +21,20 @@
function display_modes(value)
{
// Remove select fields
// Find the old select tag
var item = document.getElementById('module_mode');
var j = 0;
// empty existing items
for (var i = 0; i <= item.options.length; i++)
{
item.options[i] = null;
}
// Create the new select tag
var new_node = document.createElement('select');
new_node.setAttribute('id', 'module_mode');
// Substitute it for the old one
item.parentNode.replaceChild(new_node, item);
// Reset the variable
item = document.getElementById('module_mode');
var j = 0;
<!-- BEGIN m_names -->
if (value == '{m_names.NAME}')
@ -143,11 +147,22 @@
<!-- BEGIN modules -->
<tr>
<td style="width: 5%;">{modules.MODULE_IMAGE}</td>
<td style="width: 50%;"><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td>
<td><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td>
<td style="width: 15%; white-space: nowrap; text-align: center; vertical-align: middle;">&nbsp;<!-- IF modules.MODULE_ENABLED --><a href="{modules.U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{modules.U_ENABLE}">{L_ENABLE}</a><!-- ENDIF -->&nbsp;</td>
<td style="width: 20%; white-space: nowrap; text-align: center; vertical-align: middle;">
<!-- IF not modules.S_FIRST_ROW --><a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not modules.S_LAST_ROW --><a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width:90px; white-space: nowrap; text-align: right; vertical-align: middle;">
<!-- IF modules.S_FIRST_ROW && not modules.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not modules.S_FIRST_ROW && not modules.S_LAST_ROW-->
<a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF modules.S_LAST_ROW && not modules.S_FIRST_ROW -->
<a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{modules.U_EDIT}">{ICON_EDIT}</a>
<a href="{modules.U_DELETE}">{ICON_DELETE}</a>
</td>

View file

@ -96,7 +96,7 @@
<h1>{L_ACL_TYPE}</h1>
<fieldset class="quick">
<a href="javascript: mark_options('a_options', 'y');">{L_ALL_YES}</a> &bull; <a href="javascript: mark_options('a_options', 'n');">{L_ALL_NEVER}</a> &bull; <a href="javascript: mark_options('a_options', 'u');">{L_ALL_NO}</a>
<a href="#" onclick="mark_options('a_options', 'y'); return false;">{L_ALL_YES}</a> &bull; <a href="#" onclick="mark_options('a_options', 'n'); return false;">{L_ALL_NEVER}</a> &bull; <a href="#" onclick="mark_options('a_options', 'u'); return false;">{L_ALL_NO}</a>
</fieldset>
<fieldset class="permissions">
@ -121,7 +121,7 @@
<!-- ELSE -->
<td class="preset preset_custom">
<!-- ENDIF -->
<a href="javascript:swap_options('options{auth.S_ROW_COUNT}');"><span></span></a></td>
<a href="#" onclick="swap_options('options{auth.S_ROW_COUNT}'); return false;"><span></span></a></td>
<!-- END auth -->
</tr>
<tr class="row3">
@ -131,9 +131,9 @@
<thead>
<tr>
<th scope="col" style="text-align: left; padding-left: 0;"><strong>{L_ACL_SETTING} [{auth.CAT_NAME}]</strong></th>
<th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'y');">{L_ACL_YES}</a></th>
<th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'u');">{L_ACL_NO}</a></th>
<th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'n');">{L_ACL_NEVER}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'y'); return false;">{L_ACL_YES}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'u'); return false;">{L_ACL_NO}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'n'); return false;">{L_ACL_NEVER}</a></th>
</tr>
</thead>
<tbody>
@ -173,10 +173,10 @@
<form id="acp_roles" method="post" action="{U_ACTION}">
<table cellspacing="1">
<col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" />
<col class="col2" /><col class="col2" /><col class="col1" /><col class="col2" /><col class="col2" />
<thead>
<tr>
<th style="width: 50%">{L_ROLE_NAME}</th>
<th>{L_ROLE_NAME}</th>
<th colspan="2">{L_OPTIONS}</th>
</tr>
</thead>
@ -186,10 +186,21 @@
<td style="vertical-align: top;"><b>{roles.ROLE_NAME}</b>
<!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF -->
</td>
<td style="vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
<td style="vertical-align: top; white-space: nowrap;">
<!-- IF not roles.S_FIRST_ROW --><a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not roles.S_LAST_ROW --><a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width: 30%; text-align: center; vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td>
<td style="width: 80px; text-align: right; vertical-align: top; white-space: nowrap;">
<!-- IF roles.S_FIRST_ROW && not roles.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not roles.S_FIRST_ROW && not roles.S_LAST_ROW-->
<a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF roles.S_LAST_ROW && not roles.S_FIRST_ROW -->
<a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ELSE -->
{ICON_MOVE_UP_DISABLED}
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a>
<a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}">{ICON_DELETE}</a>
</td>

View file

@ -89,7 +89,7 @@
<dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input class="medium" type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@ -134,7 +134,7 @@
<legend>{L_MANAGE_USERS}</legend>
<dl>
<dd class="full"><select style="width: 100%;" name="user_id[]" multiple="multiple" size="5">{S_DEFINED_USER_OPTIONS}</select></dd>
<dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_users" value="1" />&nbsp; {L_ALL_USERS}</dd>
<!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_users" value="1" />&nbsp; {L_ALL_USERS}</dd><!-- ENDIF -->
</dl>
</fieldset>
@ -152,7 +152,7 @@
<p>{L_USERNAMES_EXPLAIN}</p>
<dl>
<dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd>
<dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
<dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@ -179,7 +179,7 @@
<legend>{L_MANAGE_GROUPS}</legend>
<dl>
<dd class="full"><select style="width: 100%;" name="group_id[]" multiple="multiple" size="5">{S_DEFINED_GROUP_OPTIONS}</select></dd>
<dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_groups" value="1" />&nbsp; {L_ALL_GROUPS}</dd>
<!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_groups" value="1" />&nbsp; {L_ALL_GROUPS}</dd><!-- ENDIF -->
</dl>
</fieldset>
@ -239,7 +239,7 @@
<dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@ -356,7 +356,7 @@
<fieldset class="quick" style="float: left; text-align: left;">
{L_PERMISSION_APPLIED_TO_ALL}<br />
<a href="javascript:marklist('set_permissions', 'inherit', true);">{L_MARK_ALL}</a> &bull; <a href="javascript:marklist('set_permissions', 'inherit', false);">{L_UNMARK_ALL}</a>
<a href="#" onclick="marklist('set_permissions', 'inherit', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('set_permissions', 'inherit', false); return false;">{L_UNMARK_ALL}</a>
</fieldset>
<fieldset class="quick" style="float: right;">

View file

@ -27,10 +27,17 @@
<dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt>
<dd><b>{FIELD_TYPE}</b></dd>
</dl>
<!-- IF S_EDIT_MODE -->
<dl>
<dt><label>{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
<dd><input type="hidden" name="field_ident" value="{FIELD_IDENT}" /><strong>{FIELD_IDENT}</strong></dd>
</dl>
<!-- ELSE -->
<dl>
<dt><label for="field_ident">{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt>
<dd><input class="medium" type="text" id="field_ident" name="field_ident" value="{FIELD_IDENT}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}:</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
@ -154,14 +161,20 @@
<!-- ELSE -->
<h1>{L_ACP_CUSTOM_PROFILE_FIELDS}</h1>
<!-- IF S_NEED_EDIT -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_CUSTOM_FIELDS_NOT_TRANSLATED}</p>
</div>
<!-- ENDIF -->
<table cellspacing="1">
<thead>
<tr>
<th>{L_FIELD_IDENT}</th>
<th>{L_FIELD_TYPE}</th>
<th>&nbsp;</th>
<th>{L_OPTIONS}</th>
<th colspan="2">{L_OPTIONS}</th>
</tr>
</thead>
<tbody>
@ -170,12 +183,24 @@
<td>{fields.FIELD_IDENT}</td>
<td>{fields.FIELD_TYPE}</td>
<td><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_EDIT}"><span style="color:red;">{L_EDIT}</span><!-- ENDIF --></td>
<td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td>
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not fields.S_FIRST_ROW --><a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not fields.S_LAST_ROW --><a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<!-- IF not fields.S_NEED_EDIT --><a href="{fields.U_EDIT}">{ICON_EDIT}</a> <!-- ENDIF -->
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF fields.S_FIRST_ROW && not fields.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not fields.S_FIRST_ROW && not fields.S_LAST_ROW-->
<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW -->
<a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<!-- IF not fields.S_NEED_EDIT -->
<a href="{fields.U_EDIT}">{ICON_EDIT}</a>
<!-- ELSE -->
{ICON_EDIT_DISABLED}
<!-- ENDIF -->
<a href="{fields.U_DELETE}">{ICON_DELETE}</a>
</td>

View file

@ -25,7 +25,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
<td class="row3" style="text-align: center;">{L_NO_PRUNE}</td>
<td colspan="3" class="row3" style="text-align: center;">{L_NO_PRUNE}</td>
</tr>
<!-- END pruned -->
</tbody>

View file

@ -17,19 +17,37 @@
</div>
<!-- ENDIF -->
<!-- IF not S_TRANSLATED -->
<h3>{L_AVAILABLE_TITLES}</h3>
<p>{S_AVAILABLE_TITLES}</p>
<!-- ENDIF -->
<form id="acp_reasons" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_TITLE}</legend>
<p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- ENDIF --></p>
<p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED_EXPLAIN}<!-- ELSE -->{L_IS_NOT_TRANSLATED_EXPLAIN}<!-- ENDIF --></p>
<dl>
<dt><label for="reason_title">{L_REASON_TITLE}:</label></dt>
<dd><input name="reason_title" type="text" id="reason_title" value="{REASON_TITLE}" /></dd>
</dl>
<!-- IF S_TRANSLATED -->
<dl>
<dt>{L_REASON_TITLE_TRANSLATED}</dt>
<dd>{TRANSLATED_TITLE}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="reason_description">{L_REASON_DESCRIPTION}:</label></dt>
<dd><textarea name="reason_description" id="reason_description" rows="8">{REASON_DESCRIPTION}</textarea></dd>
</dl>
<!-- IF S_TRANSLATED -->
<dl>
<dt>{L_REASON_DESC_TRANSLATED}</dt>
<dd>{TRANSLATED_DESCRIPTION}</dd>
</dl>
<!-- ENDIF -->
</fieldset>
<fieldset class="submit-buttons">
@ -64,11 +82,23 @@
<br /><span>{reasons.REASON_DESCRIPTION}</span>
</td>
<td style="width: 100px;">{reasons.REASON_COUNT}</td>
<td style="width: 15%; text-align: right; white-space: nowrap;">
<!-- IF not reasons.S_FIRST_ROW --><a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF -->
<!-- IF not reasons.S_LAST_ROW --><a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF -->
<td style="width: 80px; text-align: right; white-space: nowrap;">
<!-- IF reasons.S_FIRST_ROW && not reasons.S_LAST_ROW -->
{ICON_MOVE_UP_DISABLED}
<a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF not reasons.S_FIRST_ROW && not reasons.S_LAST_ROW-->
<a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
<a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
<!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW -->
<a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a>
{ICON_MOVE_DOWN_DISABLED}
<!-- ENDIF -->
<a href="{reasons.U_EDIT}">{ICON_EDIT}</a>
<!-- IF reasons.U_DELETE --><a href="{reasons.U_DELETE}">{ICON_DELETE}</a><!-- ENDIF -->
<!-- IF reasons.U_DELETE -->
<a href="{reasons.U_DELETE}">{ICON_DELETE}</a>
<!-- ELSE -->
{ICON_DELETE_DISABLED}
<!-- ENDIF -->
</td>
</tr>
<!-- END reasons -->

View file

@ -55,8 +55,8 @@
<!-- END backend -->
<fieldset class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="Submit" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="Reset" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset>
</form>
@ -82,7 +82,7 @@
<p>{L_ACP_SEARCH_INDEX_EXPLAIN}</p>
<!-- IF S_CONTINUE_INDEXING -->
<a href="{U_CONTINUE_INDEXING}" onclick="javascript:popup_progress_bar('{S_CONTINUE_INDEXING}');">{L_CONTINUE}</a>
<a href="{U_CONTINUE_INDEXING}" onclick="popup_progress_bar('{S_CONTINUE_INDEXING}');">{L_CONTINUE}</a>
<p>{L_CONTINUE_EXPLAIN}</p>
<!-- ELSE -->
@ -121,9 +121,9 @@
<fieldset class="quick">
<!-- IF backend.S_INDEXED -->
<input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="javascript:popup_progress_bar('delete')" />
<input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" />
<!-- ELSE -->
<input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="javascript:popup_progress_bar('create')" />
<input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" />
<!-- ENDIF -->
</fieldset>

View file

@ -330,7 +330,7 @@
</dl>
<dl>
<dt><label for="font_size">{L_FONT_SIZE}:</label></dt>
<dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="3" maxlength="3" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd>
<dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="5" maxlength="5" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd>
</dl>
<dl>
<dt><label for="font_weight">{L_BOLD}:</label></dt>
@ -440,7 +440,7 @@
</table>
<fieldset class="quick">
<span class="small"><a href="javascript:marklist('acp_styles', 'delete', true);">Mark all</a> :: <a href="javascript:marklist('acp_styles', 'delete', false);">Unmark all</a></span><br />
<span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br />
<input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" />
</fieldset>
@ -537,7 +537,7 @@
<!-- ENDIF -->
{installed.S_ACTIONS}
<!-- IF S_STYLE -->
| <a href="{installed.U_PREVIEW}" onclick="this.target='_preview';">{L_PREVIEW}</a>
| <a href="{installed.U_PREVIEW}">{L_PREVIEW}</a>
<!-- ENDIF -->
</td>
<!-- END installed -->

View file

@ -0,0 +1,40 @@
<!-- INCLUDE overall_header.html -->
<a name="maincontent"></a>
<!-- IF S_VERSION_CHECK -->
<h1>{L_VERSION_CHECK}</h1>
<p>{L_VERSION_CHECK_EXPLAIN}</p>
<!-- IF S_UP_TO_DATE -->
<div class="successbox">
<p>{L_VERSION_UP_TO_DATE_ACP}</p>
</div>
<!-- ELSE -->
<div class="errorbox">
<p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p>
</div>
<!-- ENDIF -->
<fieldset>
<legend></legend>
<dl>
<dt><label>{L_CURRENT_VERSION}</label></dt>
<dd><b>{CURRENT_VERSION}</b></dd>
</dl>
<dl>
<dt><label>{L_LATEST_VERSION}</label></dt>
<dd><b>{LATEST_VERSION}</b></dd>
</dl>
</fieldset>
<!-- IF not S_UP_TO_DATE -->
{UPDATE_INSTRUCTIONS}
<br /><br />
<!-- ENDIF -->
<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->

View file

@ -15,7 +15,7 @@
<dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input class="medium" type="text" id="username" name="username" /></dd>
<dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl>
</fieldset>
@ -68,7 +68,7 @@
<form id="mode_select" method="post" action="{U_MODE_SELECT}">
<fieldset class="quick">
{L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select>
{L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" />
</fieldset>
</form>
@ -83,7 +83,7 @@
<legend>{L_ACP_USER_OVERVIEW}</legend>
<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>
<dd><input type="text" id="user" name="user" value="{USER}" /><!-- IF S_USER_INACTIVE --> [{L_USER_IS_INACTIVE}]<!-- ENDIF --></dd>
<!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF -->
</dl>
<dl>
@ -168,7 +168,7 @@
<!-- IF PAGINATION -->
<div class="pagination">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->
@ -546,22 +546,26 @@
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
imageTag = false;
// Helpline messages
b_help = "{LA_BBCODE_B_HELP}";
i_help = "{LA_BBCODE_I_HELP}";
u_help = "{LA_BBCODE_U_HELP}";
q_help = "{LA_BBCODE_Q_HELP}";
c_help = "{LA_BBCODE_C_HELP}";
l_help = "{LA_BBCODE_L_HELP}";
o_help = "{LA_BBCODE_O_HELP}";
p_help = "{LA_BBCODE_P_HELP}";
w_help = "{LA_BBCODE_W_HELP}";
a_help = "{LA_BBCODE_A_HELP}";
s_help = "{LA_BBCODE_S_HELP}";
f_help = "{LA_BBCODE_F_HELP}";
e_help = "{LA_BBCODE_E_HELP}";
d_help = "{LA_BBCODE_D_HELP}";
<!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags -->
// Helpline messages
var help_line = {
b: '{LA_BBCODE_B_HELP}',
i: '{LA_BBCODE_I_HELP}',
u: '{LA_BBCODE_U_HELP}',
q: '{LA_BBCODE_Q_HELP}',
c: '{LA_BBCODE_C_HELP}',
l: '{LA_BBCODE_L_HELP}',
o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}',
a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
d: '{LA_BBCODE_D_HELP}'
<!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}'
<!-- END custom_tags -->
}
//-->
</script>
@ -587,9 +591,15 @@
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
<!-- IF S_BBCODE_IMG --><input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseover="helpline('d')" />
<!-- IF S_BBCODE_FLASH --><input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /><!-- ENDIF -->
<!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" />
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseover="helpline('d')" />
<!-- ENDIF -->
<!-- IF S_BBCODE_FLASH -->
<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" />
<!-- ENDIF -->
{L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')">
<option value="7">{L_FONT_TINY}</option>
@ -598,7 +608,7 @@
<option value="18">{L_FONT_LARGE}</option>
<option value="24">{L_FONT_HUGE}</option>
</select>
<a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a>
<a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a>
<!-- IF .custom_tags -->
<br /><br />
<!-- BEGIN custom_tags -->
@ -615,10 +625,16 @@
</dt>
<dd style="text-align: left; margin-left: 95px;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd>
<dd style="text-align: left; margin-left: 95px;">
<!-- IF S_BBCODE_ALLOWED --><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp;<!-- ENDIF -->
<!-- IF S_SMILIES_ALLOWED --><input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} />&nbsp; {L_DISABLE_SMILIES} &nbsp;<!-- ENDIF -->
<input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp;
<br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {SMILIES_STATUS}
<!-- IF S_BBCODE_ALLOWED -->
<input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp;
<!-- ENDIF -->
<!-- IF S_SMILIES_ALLOWED -->
<input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} />&nbsp; {L_DISABLE_SMILIES} &nbsp;
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
<input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp;
<!-- ENDIF -->
<br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
</dd>
</dl>
</fieldset>
@ -669,7 +685,7 @@
<div class="pagination" style="float: right;">
<!-- IF PAGINATION -->
<a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
<!-- ELSE -->
{S_ON_PAGE}
<!-- ENDIF -->

View file

@ -18,6 +18,7 @@ html {
font-size: 100%;
height: 100%;
margin-bottom: 1px;
background-color: #E4EDF0;
}
body {
@ -257,7 +258,7 @@ span.corners-top span, span.corners-bottom span {
border-top: 1px solid #FFFFFF;
}
#menu li a:hover span, #menu li#activemenu span {
#menu li a:hover span, #menu li#activemenu span, #menu li a:hover {
text-decoration: none;
background-color: #FFA34F;
color: #FFFFFF;
@ -919,7 +920,8 @@ table.pmask td.name {
}
.errorbox {
background-color: #ECECEC;
background-color: #ECD7DA;
color: #990000;
}
.successbox h3, .errorbox h3 {

View file

@ -1,7 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<title>{L_COLOUR_SWATCH}</title>
@ -57,7 +59,7 @@
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td style="background-color: #' + color + ';" onmouseover="this.className=\'over\'" onmouseout="this.className=\'out\'">');
document.write('<a href="javascript:cell(\'' + color + '\');"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>');
document.write('<a href="#" onclick="cell(\'' + color + '\'); return false;"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>');
document.writeln('<\/td>');
}
}

View file

@ -33,7 +33,7 @@ function getarraysize(thearray)
{
for (i = 0; i < thearray.length; i++)
{
if (thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null)
if (typeof thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null)
{
return i;
}
@ -208,7 +208,7 @@ function addquote(post_id, username)
theSelection = document.selection.createRange().text;
}
if (theSelection == '')
if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
{
if (document.all)
{
@ -485,7 +485,7 @@ function colorPalette(dir, width, height)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td style="line-height: ' + height + 'px; background-color:#' + color + '; width: ' + width + 'px; height: ' + height + 'px;">');
document.write('<a href="javascript:bbfontstyle(\'[color=#' + color + ']\', \'[/color]\');" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>');
}

View file

@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>

View file

@ -2,8 +2,8 @@
<form id="install_install" method="post" action="{U_ACTION}">
<h2>{TITLE}</h2>
<p>{BODY}</p>
<!-- IF TITLE --><h2>{TITLE}</h2><!-- ENDIF -->
<!-- IF BODY --><p>{BODY}</p><!-- ENDIF -->
<!-- IF .checks -->
<fieldset>

View file

@ -0,0 +1,278 @@
<!-- INCLUDE install_header.html -->
<!-- IF S_ERROR -->
<h1>{L_NOTICE}</h1>
<p style="color: red;">{ERROR_MSG}</p>
<!-- ENDIF -->
<!-- IF S_INTRO -->
<form id="install_update" method="post" action="{U_ACTION}">
<h1>{L_UPDATE_INSTALLATION}</h1>
<p>{L_UPDATE_INSTALLATION_EXPLAIN}</p>
<fieldset class="submit-buttons">
<input class="button1" type="submit" name="submit" value="{L_NEXT}" />
</fieldset>
</form>
<!-- ELSEIF S_UPLOAD_SUCCESS -->
<form id="install_update" method="post" action="{U_ACTION}">
<h1>{L_UPDATE_SUCCESS}</h1>
<p>{L_UPDATE_SUCCESS_EXPLAIN}</p>
<fieldset class="submit-buttons">
<input class="button1" type="submit" name="submit" value="{L_CHECK_FILES_AGAIN}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- IF S_VERSION_CHECK -->
<h1>{L_VERSION_CHECK}</h1>
<p>{L_VERSION_CHECK_EXPLAIN}</p>
<!-- IF S_UP_TO_DATE -->
<div class="successbox">
<p>{L_VERSION_UP_TO_DATE}</p>
</div>
<!-- ELSE -->
<div class="errorbox">
<p>{L_VERSION_NOT_UP_TO_DATE}</p>
</div>
<!-- ENDIF -->
<fieldset>
<legend></legend>
<dl>
<dt><label>{L_CURRENT_VERSION}</label></dt>
<dd><b>{CURRENT_VERSION}</b></dd>
</dl>
<dl>
<dt><label>{L_LATEST_VERSION}</label></dt>
<dd><b>{LATEST_VERSION}</b></dd>
</dl>
</fieldset>
<!-- IF not S_UP_TO_DATE -->
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset class="submit-buttons">
<p>{L_CHECK_FILES_EXPLAIN}</p>
<input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
</fieldset>
</form>
<!-- ELSE -->
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset class="submit-buttons">
<p>{L_CHECK_FILES_UP_TO_DATE}</p>
<input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- ELSEIF S_FILE_CHECK -->
<h1>{L_COLLECTED_INFORMATIONS}</h1>
<p>{L_COLLECTED_INFORMATIONS_EXPLAIN}</p>
<!-- IF S_NO_UPDATE_FILES -->
<div class="errorbox">
<h3>{L_NO_UPDATE_FILES}</h3>
<p>{L_NO_UPDATE_FILES_EXPLAIN}</p><br />
<strong>{NO_UPDATE_FILES}</strong>
</div>
<!-- ENDIF -->
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
<!-- IF .files -->
<!-- BEGIN files -->
<!-- IF files.S_STATUS -->
<!-- IF not files.S_FIRST_ROW -->
</fieldset>
<!-- ENDIF -->
<h2>{files.TITLE}</h2>
<p>{files.EXPLAIN}</p>
<!--table cellspacing="1">
<col class="row1" /><col class="row2" /><col class="row2" />
<tbody -->
<fieldset>
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
<!-- ELSE -->
<dl>
<!-- IF files.STATUS eq 'up_to_date' -->
<dd class="full" style="text-align: left;"><strong>{files.FILENAME}</strong></dd>
<!-- ELSE -->
<dt>
<strong>{files.FILENAME}</strong>
<!-- IF files.S_CUSTOM -->
<br /><span><em>{L_FILE_USED}: </em>{files.CUSTOM_ORIGINAL}</span>
<!-- ENDIF -->
<!-- IF files.NUM_CONFLICTS -->
<br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span>
<!-- ENDIF -->
</dt>
<dd>[ <a href="{files.U_SHOW_DIFF}" onclick="popup({files.UA_SHOW_DIFF}, 700, 500);">{files.L_SHOW_DIFF}</a> ]</dd>
<!-- IF files.S_CUSTOM -->
<dd><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" />&nbsp; {L_DO_NOT_UPDATE}</dd>
<!-- ENDIF -->
<!-- IF files.STATUS eq 'conflict' -->
<dd><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="1" checked="checked" />&nbsp; {L_MERGE_NEW_FILE_OPTION}<br /><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="2" />&nbsp; {L_MERGE_MOD_FILE_OPTION}</dd>
<!-- ENDIF -->
<!-- ENDIF -->
</dl>
<!-- ENDIF -->
<!-- END files -->
</fieldset>
<!-- ENDIF -->
<br />
<fieldset class="quick">
<input class="button1" type="submit" name="check_again" value="{L_CHECK_FILES_AGAIN}" />
</fieldset>
<br />
<!-- IF S_ALL_UP_TO_DATE -->
</form>
<!-- IF S_VERSION_UP_TO_DATE -->
<p>{L_NO_DATABASE_UPDATE_NEEDED}</p>
<!-- ELSE -->
<form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}">
<fieldset class="submit-buttons">
<p>{L_ALL_FILES_UP_TO_DATE}</p>
<input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" />
</fieldset>
<!-- ENDIF -->
<!-- ELSE -->
<h1>{L_UPDATE_METHOD}</h1>
<p>{L_UPDATE_METHOD_EXPLAIN}</p>
<fieldset class="submit-buttons">
<input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" />&nbsp; &nbsp;<input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD}" />
</fieldset>
<!-- ENDIF -->
</form>
<!-- ELSEIF S_DOWNLOAD_FILES -->
<h1>{L_SELECT_DOWNLOAD_FORMAT}</h1>
<p>{L_DOWNLOAD_UPDATE_METHOD_EXPLAIN}</p>
<p>{L_MAPPING_FILE_STRUCTURE}</p>
<table cellspacing="1">
<col class="row1" /><col class="row2" /><col class="row1" />
<thead>
<tr>
<th style="width: 49%">{L_ARCHIVE_FILE}</th>
<th style="width: 2%">&nbsp;</th>
<th style="width: 49%">{L_DESTINATION}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN location -->
<tr>
<td>{location.SOURCE}</td>
<td><strong>&raquo;</strong></td>
<td>{location.DESTINATION}</td>
</tr>
<!-- END location -->
</tbody>
</table>
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_DOWNLOAD_AS}</legend>
<dl>
<dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
<dd>{RADIO_BUTTONS}</dd>
</dl>
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input type="submit" class="button2" value="{L_CHECK_FILES_AGAIN}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
</fieldset>
</form>
<!-- ELSEIF S_FTP_UPLOAD -->
<h1>{L_SELECT_FTP_SETTINGS}</h1>
<form id="install_update" method="post" action="{U_ACTION}">
<!-- IF S_CONNECTION_SUCCESS -->
<div class="successbox">
<p>{L_CONNECTION_SUCCESS}</p>
</div>
<!-- ELSEIF S_CONNECTION_FAILED -->
<div class="errorbox">
<p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<fieldset>
<legend>{L_FTP_SETTINGS}</legend>
<dl>
<dt><label>{L_UPLOAD_METHOD}:</label></dt>
<dd><b>{UPLOAD_METHOD}</b></dd>
</dl>
<!-- BEGIN data -->
<dl>
<dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt>
<dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
</dl>
<!-- END data -->
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input class="button2" type="submit" name="check_again" value="{L_BACK}" />
<input class="button1" type="submit" name="test_connection" value="{L_TEST_CONNECTION}" />
<input class="button1" type="submit" name="submit" value="{L_UPDATE_FILES}" />
</fieldset>
</form>
<!-- ELSEIF S_DB_UPDATE -->
<h1>{L_PERFORM_DATABASE_UPDATE}</h1>
<p>
{L_PERFORM_DATABASE_UPDATE_EXPLAIN}<br />
<br />
<a href="{U_DB_UPDATE}"><strong>&raquo; {L_RUN_DATABASE_SCRIPT} &laquo;</strong></a>
</p>
<!-- ENDIF -->
<!-- INCLUDE install_footer.html -->

View file

@ -0,0 +1,181 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
#main {
font-size: 1.25em;
line-height: 0.7em;
margin: 0;
padding: 0;
width: 99%;
}
<!-- IF not S_DIFF_NEW_FILE -->
/**
* Unified Diff
*/
.file {
border: 1px solid #eee;
line-height: .7em;
}
.diff {
margin: 0;
}
.added {
background-color: #dfd;
}
.removed {
background-color: #fdd;
}
.info {
color: #888;
}
.context {
background-color: #eee;
}
/**
* Inline Diff
*/
.ins {
background-color: #dfd;
text-decoration: underline;
}
.del {
background-color: #fdd;
text-decoration: line-through;
}
/**
* Column Diff
*/
table.hrdiff {
width: 99%;
margin: 0 0 8px 5px;
}
table.hrdiff th {
text-align: left;
width: 50%;
color: #333;
font-family: Verdana,Helvetica,sans-serif;
font-size: 11px;
border-bottom: 1px solid #999;
background: transparent;
}
table.hrdiff thead th {
font-weight: bold;
font-size: 110%;
padding: 2px;
}
table.hrdiff tbody th {
padding: 2em 1px 1px 1px;
font-size: 80%;
}
table.hrdiff .unmodified {
background: #fff;
}
table.hrdiff .added {
background: #9f9;
}
table.hrdiff .added_empty {
background: #cfc;
}
table.hrdiff .modified {
background: #fd9;
}
table.hrdiff .removed {
background: #f99;
}
table.hrdiff .removed_empty {
background: #fcc;
}
table.hrdiff caption {
caption-side: top;
text-align: left;
margin: 0 0 8px 5px;
font-size: 90%;
font-weight: bold;
padding: 5px;
}
table.hrdiff caption span {
height: 10px;
width: 10px;
line-height: 10px;
letter-spacing: 10px;
border: 1px solid #000;
margin-left: 0.5em;
vertical-align: baseline;
}
<!-- ENDIF -->
//-->
</style>
</head>
<body>
<div id="wrap">
<div id="page-header">
<!-- IF S_DIFF_NEW_FILE -->
<h1>{L_VIEWING_FILE_CONTENTS}</h1>
<!-- ELSE -->
<h1>{L_VIEWING_FILE_DIFF}</h1>
<!-- ENDIF -->
<!-- IF not S_DIFF_NEW_FILE -->
<br />
<form method="post">
<label for="diff_mode">{L_SELECT_DIFF_MODE}:</label>
<select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select>
<input class="button1" type="submit" id="submit" name="submit" value="{L_CHANGE}" />
</form>
<!-- ENDIF -->
</div>
<div id="page-body">
<div class="panel">
<span class="corners-top"><span></span></span>
<div id="content">
<div id="main">
<!-- IF S_DIFF_CONFLICT_FILE -->
<div style="float: right;"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
<!-- ENDIF -->
{DIFF_CONTENT}
</div>
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
<!-- INCLUDE simple_footer.html -->

View file

@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
<div class="successbox">
<div <!-- IF S_USER_NOTICE -->class="successbox"<!-- ELSE -->class="errorbox"<!-- ENDIF -->>
<h3>{MESSAGE_TITLE}</h3>
<p>{MESSAGE_TEXT}</p>
</div>

View file

@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>

View file

@ -160,7 +160,7 @@
<!-- IF not p_mask.S_VIEW --><input type="checkbox" class="radio" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="1" /><!-- ELSE -->&nbsp;<!-- ENDIF -->
</span>
</td>
<td>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0');">{p_mask.f_mask.NAME}</a></span></td>
<td><span>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0'); return false;">{p_mask.f_mask.NAME}</a></span></td>
<td style="text-align: right;">
<!-- IF p_mask.S_VIEW -->
&nbsp;
@ -186,7 +186,7 @@
<!-- ELSE -->
<td class="preset preset_custom">
<!-- ENDIF -->
<a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}');"><span></span></a></td>
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}'); return false;"><span></span></a></td>
<!-- END category -->
</tr>
<tr class="row3">
@ -199,9 +199,9 @@
</div>
<div style="float: right; text-align: right; width: 35%;">
<p class="small">
[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_YES}</a>]<br />
[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_NEVER}</a>]<br />
[<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_NO}</a>]
[<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_YES}</a>]<br />
[<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_NEVER}</a>]<br />
[<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_NO}</a>]
</p>
</div>
<!-- ELSE -->
@ -220,16 +220,16 @@
<th scope="col">{L_ACL_YES}</th>
<th scope="col">{L_ACL_NEVER}</th>
<!-- ELSE -->
<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_YES}</a></th>
<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_NO}</a></th>
<th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_NEVER}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_YES}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_NO}</a></th>
<th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_NEVER}</a></th>
<!-- ENDIF -->
</tr>
</thead>
<tbody>
<!-- BEGIN mask -->
<!-- IF p_mask.f_mask.category.mask.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF -->
<th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="javascript:trace('{p_mask.f_mask.category.mask.U_TRACE}')" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th>
<th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="trace('{p_mask.f_mask.category.mask.U_TRACE}'); return false;" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th>
<!-- IF p_mask.S_VIEW -->
<td<!-- IF p_mask.f_mask.category.mask.S_YES --> class="yes"<!-- ELSE --> class="no"<!-- ENDIF -->>&nbsp;</td>
<td<!-- IF p_mask.f_mask.category.mask.S_NEVER --> class="never"<!-- ELSE --> class="no"<!-- ENDIF -->>&nbsp;</td>

View file

@ -1,4 +1,4 @@
<div style="text-align: right;"><a href="#" onclick="javascript: self.close();">{L_CLOSE_WINDOW}</a></div>
<div style="text-align: right;"><a href="#" onclick="self.close(); return false;">{L_CLOSE_WINDOW}</a></div>
<br /><br />
</div>

View file

@ -1,9 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>

View file

@ -99,7 +99,15 @@ else
if (defined('IN_CRON'))
{
chdir($phpbb_root_path);
$phpbb_root_path = getcwd() . '/';
if (@function_exists('getcwd'))
{
$phpbb_root_path = getcwd() . '/';
}
else
{
// This is a best guess
$phpbb_root_path = pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_DIRNAME) . '/';
}
}
if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
@ -170,6 +178,7 @@ require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler('msg_handler');
@ -189,7 +198,6 @@ unset($dbpasswd);
// Grab global variables, re-cache if necessary
$config = $cache->obtain_config();
$dss_seeded = false;
// Disable board if the install/ directory is still present
if (file_exists($phpbb_root_path . 'install') && !defined('ADMIN_START'))

View file

@ -23,6 +23,15 @@ $auth->acl($user->data);
$cron_type = request_var('cron_type', '');
$use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false;
// Output transparent gif
header('Cache-Control: no-cache');
header('Content-type: image/gif');
header('Content-length: 43');
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
flush();
/**
* Run cron-like action
* Real cron-based layer will be introduced in 3.2
@ -217,14 +226,6 @@ else
garbage_collection();
}
// Output transparent gif
header('Cache-Control: no-cache');
header('Content-type: image/gif');
header('Content-length: 43');
echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
flush();
exit;
?>

View file

@ -371,7 +371,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
switch ($sql_type)
{
case 'insert':
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':

View file

@ -0,0 +1,174 @@
<?php
/**
* Only adjust bitfields, do not rewrite text...
* All new parsings have the img, flash and quote modes set to true
*
* You should make a backup from your users, posts and privmsgs table in case something goes wrong
* Forum descriptions and rules need to be re-submitted manually.
*/
die("Please read the first lines of this script for instructions on how to enable it");
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$echos = 0;
// Adjust user signatures
$message_parser = new parse_message();
$message_parser->mode = 'sig';
$message_parser->bbcode_init();
$sql = 'SELECT user_id, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// Convert bbcodes back to their normal form
if ($row['user_sig_bbcode_uid'] && $row['user_sig'])
{
decode_message($row['user_sig'], $row['user_sig_bbcode_uid']);
$message_parser->message = $row['user_sig'];
$message_parser->prepare_bbcodes();
$message_parser->parse_bbcode();
$bitfield = $message_parser->bbcode_bitfield;
$sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = '" . $db->sql_escape($bitfield) . "'
WHERE user_id = " . $row['user_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
else
{
$sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = ''
WHERE user_id = " . $row['user_id'];
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
// Now adjust posts
$message_parser = new parse_message();
$message_parser->mode = 'post';
$message_parser->bbcode_init();
// Update posts
$sql = 'SELECT post_id, post_text, bbcode_uid, enable_bbcode, enable_smilies, enable_sig
FROM ' . POSTS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// Convert bbcodes back to their normal form
if ($row['enable_bbcode'])
{
decode_message($row['post_text'], $row['bbcode_uid']);
$message_parser->message = $row['post_text'];
$message_parser->prepare_bbcodes();
$message_parser->parse_bbcode();
$bitfield = $message_parser->bbcode_bitfield;
$sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "'
WHERE post_id = " . $row['post_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
else
{
$sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = ''
WHERE post_id = " . $row['post_id'];
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
// Now to the private messages
$message_parser = new parse_message();
$message_parser->mode = 'post';
$message_parser->bbcode_init();
// Update pms
$sql = 'SELECT msg_id, message_text, bbcode_uid, enable_bbcode
FROM ' . PRIVMSGS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// Convert bbcodes back to their normal form
if ($row['enable_bbcode'])
{
decode_message($row['message_text'], $row['bbcode_uid']);
$message_parser->message = $row['message_text'];
$message_parser->prepare_bbcodes();
$message_parser->parse_bbcode();
$bitfield = $message_parser->bbcode_bitfield;
$sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "'
WHERE msg_id = " . $row['msg_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
else
{
$sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = ''
WHERE msg_id = " . $row['msg_id'];
$db->sql_query($sql);
}
}
$db->sql_freeresult($result);
// Done
$db->sql_close();
?>

View file

@ -0,0 +1,52 @@
<?php
/**
* Adjust username_clean column.
*
* You should make a backup from your users table in case something goes wrong
*/
die("Please read the first lines of this script for instructions on how to enable it");
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$echos = 0;
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET username_clean = '" . $db->sql_escape(utf8_clean_string($row['username'])) . "'
WHERE user_id = " . $row['user_id'];
$db->sql_query($sql);
if ($echos > 200)
{
echo '<br />' . "\n";
$echos = 0;
}
echo '.';
$echos++;
flush();
}
$db->sql_freeresult($result);
echo 'FINISHED';
// Done
$db->sql_close();
?>

View file

@ -313,7 +313,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
else
{
// Rollback
if(SQL_LAYER == "mysql")
if($db->sql_layer == "mysql")
{
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $new_post_id";

View file

@ -25,7 +25,7 @@ if (!is_writeable($schema_path))
$schema_data = get_schema_struct();
$dbms_type_map = array(
'mysql' => array(
'mysql_41' => array(
'INT:' => 'int(%d)',
'BINT' => 'bigint(20)',
'UINT' => 'mediumint(8) UNSIGNED',
@ -37,13 +37,45 @@ $dbms_type_map = array(
'VCHAR:' => 'varchar(%d)',
'CHAR:' => 'char(%d)',
'XSTEXT' => 'text',
'XSTEXT_UNI'=> 'varchar(100)',
'STEXT' => 'text',
'STEXT_UNI' => 'varchar(255)',
'TEXT' => 'text',
'TEXT_UNI' => 'text',
'MTEXT' => 'mediumtext',
'MTEXT_UNI' => 'mediumtext',
'TIMESTAMP' => 'int(11) UNSIGNED',
'DECIMAL' => 'decimal(5,2)',
'VCHAR_BIN' => 'varchar(252) /*!40101 CHARACTER SET utf8 */ BINARY',
'VCHAR_CI' => 'varchar(252)',
'VCHAR_UNI' => 'varchar(255)',
'VCHAR_UNI:'=> 'varchar(%d)',
'VCHAR_CI' => 'varchar(255)',
'VARBINARY' => 'varbinary(255)',
),
'mysql_40' => array(
'INT:' => 'int(%d)',
'BINT' => 'bigint(20)',
'UINT' => 'mediumint(8) UNSIGNED',
'UINT:' => 'int(%d) UNSIGNED',
'TINT:' => 'tinyint(%d)',
'USINT' => 'smallint(4) UNSIGNED',
'BOOL' => 'tinyint(1) UNSIGNED',
'VCHAR' => 'varchar(255)',
'VCHAR:' => 'varchar(%d)',
'CHAR:' => 'char(%d)',
'XSTEXT' => 'text',
'XSTEXT_UNI'=> 'text',
'STEXT' => 'text',
'STEXT_UNI' => 'text',
'TEXT' => 'text',
'TEXT_UNI' => 'text',
'MTEXT' => 'mediumtext',
'MTEXT_UNI' => 'mediumtext',
'TIMESTAMP' => 'int(11) UNSIGNED',
'DECIMAL' => 'decimal(5,2)',
'VCHAR_UNI' => 'text',
'VCHAR_UNI:'=> array('varchar(%d)', 'limit' => array('mult', 3, 255, 'text')),
'VCHAR_CI' => 'text',
'VARBINARY' => 'varbinary(255)',
),
@ -55,18 +87,23 @@ $dbms_type_map = array(
'TINT:' => 'INTEGER',
'USINT' => 'INTEGER',
'BOOL' => 'INTEGER',
'VCHAR' => 'VARCHAR(255)',
'VCHAR:' => 'VARCHAR(%d)',
'CHAR:' => 'CHAR(%d)',
'XSTEXT' => 'BLOB SUB_TYPE TEXT',
'STEXT' => 'BLOB SUB_TYPE TEXT',
'TEXT' => 'BLOB SUB_TYPE TEXT',
'MTEXT' => 'BLOB SUB_TYPE TEXT',
'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
'TIMESTAMP' => 'INTEGER',
'DECIMAL' => 'DOUBLE PRECISION',
'VCHAR_BIN' => 'VARCHAR(84) CHARACTER SET UNICODE_FSS',
'VCHAR_CI' => 'VARCHAR(252)',
'VARBINARY' => 'CHAR(255)',
'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
),
'mssql' => array(
@ -84,11 +121,16 @@ $dbms_type_map = array(
'STEXT' => '[varchar] (3000)',
'TEXT' => '[varchar] (8000)',
'MTEXT' => '[text]',
'XSTEXT_UNI'=> '[varchar] (100)',
'STEXT_UNI' => '[varchar] (255)',
'TEXT_UNI' => '[varchar] (4000)',
'MTEXT_UNI' => '[text]',
'TIMESTAMP' => '[int]',
'DECIMAL' => '[float]',
'VCHAR_BIN' => '[nvarchar] (252)',
'VCHAR_CI' => '[varchar] (252)',
'VARBINARY' => '[varbinary] (255)',
'VCHAR_UNI' => '[varchar] (255)',
'VCHAR_UNI:'=> '[varchar] (%d)',
'VCHAR_CI' => '[varchar] (255)',
'VARBINARY' => '[varchar] (255)',
),
'oracle' => array(
@ -106,10 +148,15 @@ $dbms_type_map = array(
'STEXT' => 'varchar2(3000)',
'TEXT' => 'clob',
'MTEXT' => 'clob',
'XSTEXT_UNI'=> 'varchar2(300)',
'STEXT_UNI' => 'varchar2(765)',
'TEXT_UNI' => 'clob',
'MTEXT_UNI' => 'clob',
'TIMESTAMP' => 'number(11)',
'DECIMAL' => 'number(5, 2)',
'VCHAR_BIN' => 'nvarchar2(252)',
'VCHAR_CI' => 'varchar2(252)',
'VCHAR_UNI' => 'varchar2(765)',
'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
'VCHAR_CI' => 'varchar2(255)',
'VARBINARY' => 'raw(255)',
),
@ -128,10 +175,15 @@ $dbms_type_map = array(
'STEXT' => 'text(65535)',
'TEXT' => 'text(65535)',
'MTEXT' => 'mediumtext(16777215)',
'XSTEXT_UNI'=> 'text(65535)',
'STEXT_UNI' => 'text(65535)',
'TEXT_UNI' => 'text(65535)',
'MTEXT_UNI' => 'mediumtext(16777215)',
'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
'DECIMAL' => 'decimal(5,2)',
'VCHAR_BIN' => 'nvarchar(252)',
'VCHAR_CI' => 'varchar(252)',
'VCHAR_UNI' => 'varchar(255)',
'VCHAR_UNI:'=> 'varchar(%d)',
'VCHAR_CI' => 'varchar(255)',
'VARBINARY' => 'blob',
),
@ -150,9 +202,14 @@ $dbms_type_map = array(
'STEXT' => 'varchar(3000)',
'TEXT' => 'varchar(8000)',
'MTEXT' => 'TEXT',
'XSTEXT_UNI'=> 'varchar(100)',
'STEXT_UNI' => 'varchar(255)',
'TEXT_UNI' => 'varchar(4000)',
'MTEXT_UNI' => 'TEXT',
'TIMESTAMP' => 'INT4', // unsigned
'DECIMAL' => 'decimal(5,2)',
'VCHAR_BIN' => 'varchar(252)',
'VCHAR_UNI' => 'varchar(255)',
'VCHAR_UNI:'=> 'varchar(%d)',
'VCHAR_CI' => 'varchar_ci',
'VARBINARY' => 'bytea',
),
@ -160,7 +217,7 @@ $dbms_type_map = array(
// A list of types being unsigned for better reference in some db's
$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
$supported_dbms = array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite');
$supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
foreach ($supported_dbms as $dbms)
{
@ -171,7 +228,8 @@ foreach ($supported_dbms as $dbms)
// Write Header
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
case 'mysql_41':
$line = "#\n# MySQL Schema for phpBB 3.x - (c) phpBB Group, 2005\n#\n# \$I" . "d: $\n#\n\n";
break;
@ -209,7 +267,8 @@ foreach ($supported_dbms as $dbms)
// Write comment about table
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
case 'mysql_41':
case 'firebird':
case 'sqlite':
fwrite($fp, "# Table: '{$table_name}'\n");
@ -228,7 +287,8 @@ foreach ($supported_dbms as $dbms)
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
case 'mysql_41':
case 'firebird':
case 'oracle':
case 'sqlite':
@ -241,6 +301,9 @@ foreach ($supported_dbms as $dbms)
break;
}
// Table specific so we don't get overlap
$modded_array = array();
// Write columns one by one...
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
{
@ -248,14 +311,53 @@ foreach ($supported_dbms as $dbms)
if (strpos($column_data[0], ':') !== false)
{
list($orig_column_type, $column_length) = explode(':', $column_data[0]);
if (!is_array($dbms_type_map[$dbms][$orig_column_type . ':']))
{
$column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length);
}
else
{
if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['rule']))
{
switch ($dbms_type_map[$dbms][$orig_column_type . ':']['rule'][0])
{
case 'div':
$column_length /= $dbms_type_map[$dbms][$orig_column_type . ':']['rule'][1];
$column_length = ceil($column_length);
$column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length);
break;
}
}
$column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length);
if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['limit']))
{
switch ($dbms_type_map[$dbms][$orig_column_type . ':']['limit'][0])
{
case 'mult':
$column_length *= $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][1];
if ($column_length > $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][2])
{
$column_type = $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][3];
$modded_array[$column_name] = $column_type;
}
else
{
$column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length);
}
break;
}
}
}
$orig_column_type .= ':';
}
else
{
$orig_column_type = $column_data[0];
$column_type = $dbms_type_map[$dbms][$column_data[0]];
if ($column_type == 'text')
{
$modded_array[$column_name] = $column_type;
}
}
// Adjust default value if db-dependant specified
@ -266,11 +368,12 @@ foreach ($supported_dbms as $dbms)
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
case 'mysql_41':
$line .= "\t{$column_name} {$column_type} ";
// For hexadecimal values do not use single quotes
if (!is_null($column_data[1]))
if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text')
{
$line .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' ";
}
@ -308,7 +411,15 @@ foreach ($supported_dbms as $dbms)
$line .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
}
$line .= "NOT NULL,\n";
$line .= 'NOT NULL';
// This is a UNICODE column and thus should be given it's fair share
if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0]))
{
$line .= ' COLLATE UNICODE';
}
$line .= ",\n";
if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
{
@ -412,7 +523,8 @@ foreach ($supported_dbms as $dbms)
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
case 'mysql_41':
case 'postgres':
$line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n";
break;
@ -493,9 +605,22 @@ foreach ($supported_dbms as $dbms)
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
case 'mysql_41':
$line .= ($key_data[0] == 'INDEX') ? "\tKEY" : '';
$line .= ($key_data[0] == 'UNIQUE') ? "\tUNIQUE" : '';
foreach ($key_data[1] as $key => $col_name)
{
if (isset($modded_array[$col_name]))
{
switch ($modded_array[$col_name])
{
case 'text':
$key_data[1][$key] = $col_name . '(255)';
break;
}
}
}
$line .= ' ' . $key_name . ' (' . implode(', ', $key_data[1]) . "),\n";
break;
@ -544,12 +669,18 @@ foreach ($supported_dbms as $dbms)
switch ($dbms)
{
case 'mysql':
case 'mysql_40':
// Remove last line delimiter...
$line = substr($line, 0, -2);
$line .= "\n);\n\n";
break;
case 'mysql_41':
// Remove last line delimiter...
$line = substr($line, 0, -2);
$line .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;\n\n";
break;
// Create Generator
case 'firebird':
if ($generator !== false)
@ -632,7 +763,7 @@ foreach ($supported_dbms as $dbms)
* VCHAR:x => varchar(x)
* TIMESTAMP => int(11) UNSIGNED
* DECIMAL => decimal number (5,2)
* VCHAR_BIN => varchar(252) BINARY
* VCHAR_UNI => varchar(255) BINARY
* VCHAR_CI => varchar_ci for postgresql, others VCHAR
*/
function get_schema_struct()
@ -646,10 +777,11 @@ function get_schema_struct()
'topic_id' => array('UINT', 0),
'in_message' => array('BOOL', 0),
'poster_id' => array('UINT', 0),
'is_orphan' => array('BOOL', 1),
'physical_filename' => array('VCHAR', ''),
'real_filename' => array('VCHAR', ''),
'download_count' => array('UINT', 0),
'attach_comment' => array('TEXT', ''),
'attach_comment' => array('TEXT_UNI', ''),
'extension' => array('VCHAR:100', ''),
'mimetype' => array('VCHAR:100', ''),
'filesize' => array('UINT:20', 0),
@ -662,7 +794,7 @@ function get_schema_struct()
'post_msg_id' => array('INDEX', 'post_msg_id'),
'topic_id' => array('INDEX', 'topic_id'),
'poster_id' => array('INDEX', 'poster_id'),
'filesize' => array('INDEX', 'filesize'),
'is_orphan' => array('INDEX', 'is_orphan'),
),
);
@ -697,8 +829,8 @@ function get_schema_struct()
$schema_data['phpbb_acl_roles'] = array(
'COLUMNS' => array(
'role_id' => array('UINT', NULL, 'auto_increment'),
'role_name' => array('VCHAR', ''),
'role_description' => array('TEXT', ''),
'role_name' => array('VCHAR_UNI', ''),
'role_description' => array('TEXT_UNI', ''),
'role_type' => array('VCHAR:10', ''),
'role_order' => array('USINT', 0),
),
@ -737,7 +869,7 @@ function get_schema_struct()
'ban_id' => array('UINT', NULL, 'auto_increment'),
'ban_userid' => array('UINT', 0),
'ban_ip' => array('VCHAR:40', ''),
'ban_email' => array('VCHAR:100', ''),
'ban_email' => array('VCHAR_UNI:100', ''),
'ban_start' => array('TIMESTAMP', 0),
'ban_end' => array('TIMESTAMP', 0),
'ban_exclude' => array('BOOL', 0),
@ -759,12 +891,12 @@ function get_schema_struct()
'bbcode_tag' => array('VCHAR:16', ''),
'bbcode_helpline' => array('VCHAR', ''),
'display_on_posting' => array('BOOL', 0),
'bbcode_match' => array('TEXT', ''),
'bbcode_tpl' => array('MTEXT', ''),
'first_pass_match' => array('MTEXT', ''),
'first_pass_replace' => array('MTEXT', ''),
'second_pass_match' => array('MTEXT', ''),
'second_pass_replace' => array('MTEXT', ''),
'bbcode_match' => array('TEXT_UNI', ''),
'bbcode_tpl' => array('MTEXT_UNI', ''),
'first_pass_match' => array('MTEXT_UNI', ''),
'first_pass_replace' => array('MTEXT_UNI', ''),
'second_pass_match' => array('MTEXT_UNI', ''),
'second_pass_replace' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'bbcode_id',
'KEYS' => array(
@ -788,7 +920,7 @@ function get_schema_struct()
'COLUMNS' => array(
'bot_id' => array('UINT', NULL, 'auto_increment'),
'bot_active' => array('BOOL', 1),
'bot_name' => array('STEXT', ''),
'bot_name' => array('STEXT_UNI', ''),
'user_id' => array('UINT', 0),
'bot_agent' => array('VCHAR', ''),
'bot_ip' => array('VCHAR', ''),
@ -801,7 +933,7 @@ function get_schema_struct()
$schema_data['phpbb_config'] = array(
'COLUMNS' => array(
'config_name' => array('VCHAR:252', ''),
'config_name' => array('VCHAR:255', ''),
'config_value' => array('VCHAR', ''),
'is_dynamic' => array('BOOL', 0),
),
@ -827,7 +959,7 @@ function get_schema_struct()
$schema_data['phpbb_disallow'] = array(
'COLUMNS' => array(
'disallow_id' => array('UINT', NULL, 'auto_increment'),
'disallow_username' => array('VCHAR:252', ''),
'disallow_username' => array('VCHAR_UNI:255', ''),
),
'PRIMARY_KEY' => 'disallow_id',
);
@ -839,8 +971,8 @@ function get_schema_struct()
'topic_id' => array('UINT', 0),
'forum_id' => array('UINT', 0),
'save_time' => array('TIMESTAMP', 0),
'draft_subject' => array('XSTEXT', ''),
'draft_message' => array('MTEXT', ''),
'draft_subject' => array('XSTEXT_UNI', ''),
'draft_message' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'draft_id',
'KEYS' => array(
@ -860,7 +992,7 @@ function get_schema_struct()
$schema_data['phpbb_extension_groups'] = array(
'COLUMNS' => array(
'group_id' => array('UINT', NULL, 'auto_increment'),
'group_name' => array('VCHAR', ''),
'group_name' => array('VCHAR_UNI', ''),
'cat_id' => array('TINT:2', 0),
'allow_group' => array('BOOL', 0),
'download_mode' => array('BOOL', 1),
@ -879,19 +1011,19 @@ function get_schema_struct()
'left_id' => array('UINT', 0),
'right_id' => array('UINT', 0),
'forum_parents' => array('MTEXT', ''),
'forum_name' => array('STEXT', ''),
'forum_desc' => array('TEXT', ''),
'forum_desc_bitfield' => array('VCHAR:252', ''),
'forum_desc_options' => array('UINT:11', 0),
'forum_name' => array('STEXT_UNI', ''),
'forum_desc' => array('TEXT_UNI', ''),
'forum_desc_bitfield' => array('VCHAR:255', ''),
'forum_desc_options' => array('UINT:11', 7),
'forum_desc_uid' => array('VCHAR:5', ''),
'forum_link' => array('VCHAR', ''),
'forum_password' => array('VCHAR:40', ''),
'forum_link' => array('VCHAR_UNI', ''),
'forum_password' => array('VCHAR_UNI:40', ''),
'forum_style' => array('TINT:4', 0),
'forum_image' => array('VCHAR', ''),
'forum_rules' => array('TEXT', ''),
'forum_rules_link' => array('VCHAR', ''),
'forum_rules_bitfield' => array('VCHAR:252', ''),
'forum_rules_options' => array('UINT:11', 0),
'forum_rules' => array('TEXT_UNI', ''),
'forum_rules_link' => array('VCHAR_UNI', ''),
'forum_rules_bitfield' => array('VCHAR:255', ''),
'forum_rules_options' => array('UINT:11', 7),
'forum_rules_uid' => array('VCHAR:5', ''),
'forum_topics_per_page' => array('TINT:4', 0),
'forum_type' => array('TINT:4', 0),
@ -901,8 +1033,10 @@ function get_schema_struct()
'forum_topics_real' => array('UINT', 0),
'forum_last_post_id' => array('UINT', 0),
'forum_last_poster_id' => array('UINT', 0),
'forum_last_post_subject' => array('XSTEXT_UNI', ''),
'forum_last_post_time' => array('TIMESTAMP', 0),
'forum_last_poster_name'=> array('VCHAR', ''),
'forum_last_poster_name'=> array('VCHAR_UNI', ''),
'forum_last_poster_colour'=> array('VCHAR:6', ''),
'forum_flags' => array('TINT:4', 32),
'display_on_index' => array('BOOL', 1),
'enable_indexing' => array('BOOL', 1),
@ -956,9 +1090,9 @@ function get_schema_struct()
'group_id' => array('UINT', NULL, 'auto_increment'),
'group_type' => array('TINT:4', 1),
'group_name' => array('VCHAR_CI', ''),
'group_desc' => array('TEXT', ''),
'group_desc_bitfield' => array('VCHAR:252', ''),
'group_desc_options' => array('UINT:11', 0),
'group_desc' => array('TEXT_UNI', ''),
'group_desc_bitfield' => array('VCHAR:255', ''),
'group_desc_options' => array('UINT:11', 7),
'group_desc_uid' => array('VCHAR:5', ''),
'group_display' => array('BOOL', 0),
'group_avatar' => array('VCHAR', ''),
@ -998,9 +1132,9 @@ function get_schema_struct()
'lang_id' => array('TINT:4', NULL, 'auto_increment'),
'lang_iso' => array('VCHAR:30', ''),
'lang_dir' => array('VCHAR:30', ''),
'lang_english_name' => array('VCHAR:100', ''),
'lang_local_name' => array('VCHAR:255', ''),
'lang_author' => array('VCHAR:255', ''),
'lang_english_name' => array('VCHAR_UNI:100', ''),
'lang_local_name' => array('VCHAR_UNI:255', ''),
'lang_author' => array('VCHAR_UNI:255', ''),
),
'PRIMARY_KEY' => 'lang_id',
'KEYS' => array(
@ -1018,8 +1152,8 @@ function get_schema_struct()
'reportee_id' => array('UINT', 0),
'log_ip' => array('VCHAR:40', ''),
'log_time' => array('TIMESTAMP', 0),
'log_operation' => array('TEXT', ''),
'log_data' => array('MTEXT', ''),
'log_operation' => array('TEXT_UNI', ''),
'log_data' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'log_id',
'KEYS' => array(
@ -1035,9 +1169,9 @@ function get_schema_struct()
'COLUMNS' => array(
'forum_id' => array('UINT', 0),
'user_id' => array('UINT', 0),
'username' => array('VCHAR:252', ''),
'username' => array('VCHAR_UNI:255', ''),
'group_id' => array('UINT', 0),
'group_name' => array('VCHAR', ''),
'group_name' => array('VCHAR_UNI', ''),
'display_on_index' => array('BOOL', 1),
),
'KEYS' => array(
@ -1072,7 +1206,7 @@ function get_schema_struct()
'COLUMNS' => array(
'poll_option_id' => array('TINT:4', 0),
'topic_id' => array('UINT', 0),
'poll_option_text' => array('TEXT', ''),
'poll_option_text' => array('TEXT_UNI', ''),
'poll_option_total' => array('UINT', 0),
),
'KEYS' => array(
@ -1110,17 +1244,16 @@ function get_schema_struct()
'enable_smilies' => array('BOOL', 1),
'enable_magic_url' => array('BOOL', 1),
'enable_sig' => array('BOOL', 1),
'post_username' => array('VCHAR:252', ''),
'post_subject' => array('XSTEXT', ''),
'post_text' => array('MTEXT', ''),
'post_username' => array('VCHAR_UNI:255', ''),
'post_subject' => array('XSTEXT_UNI', ''),
'post_text' => array('MTEXT_UNI', ''),
'post_checksum' => array('VCHAR:32', ''),
'post_encoding' => array('VCHAR:20', 'iso-8859-1'),
'post_attachment' => array('BOOL', 0),
'bbcode_bitfield' => array('VCHAR:252', ''),
'bbcode_bitfield' => array('VCHAR:255', ''),
'bbcode_uid' => array('VCHAR:5', ''),
'post_postcount' => array('BOOL', 1),
'post_edit_time' => array('TIMESTAMP', 0),
'post_edit_reason' => array('STEXT', ''),
'post_edit_reason' => array('STEXT_UNI', ''),
'post_edit_user' => array('UINT', 0),
'post_edit_count' => array('USINT', 0),
'post_edit_locked' => array('BOOL', 0),
@ -1132,8 +1265,7 @@ function get_schema_struct()
'poster_ip' => array('INDEX', 'poster_ip'),
'poster_id' => array('INDEX', 'poster_id'),
'post_approved' => array('INDEX', 'post_approved'),
'post_postcount' => array('INDEX', 'post_postcount'),
'post_time' => array('INDEX', 'post_time'),
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
),
);
@ -1149,18 +1281,17 @@ function get_schema_struct()
'enable_smilies' => array('BOOL', 1),
'enable_magic_url' => array('BOOL', 1),
'enable_sig' => array('BOOL', 1),
'message_subject' => array('XSTEXT', ''),
'message_text' => array('MTEXT', ''),
'message_edit_reason' => array('STEXT', ''),
'message_subject' => array('XSTEXT_UNI', ''),
'message_text' => array('MTEXT_UNI', ''),
'message_edit_reason' => array('STEXT_UNI', ''),
'message_edit_user' => array('UINT', 0),
'message_encoding' => array('VCHAR:20', 'iso-8859-1'),
'message_attachment' => array('BOOL', 0),
'bbcode_bitfield' => array('VCHAR:252', ''),
'bbcode_bitfield' => array('VCHAR:255', ''),
'bbcode_uid' => array('VCHAR:5', ''),
'message_edit_time' => array('TIMESTAMP', 0),
'message_edit_count' => array('USINT', 0),
'to_address' => array('TEXT', ''),
'bcc_address' => array('TEXT', ''),
'to_address' => array('TEXT_UNI', ''),
'bcc_address' => array('TEXT_UNI', ''),
),
'PRIMARY_KEY' => 'msg_id',
'KEYS' => array(
@ -1175,7 +1306,7 @@ function get_schema_struct()
'COLUMNS' => array(
'folder_id' => array('UINT', NULL, 'auto_increment'),
'user_id' => array('UINT', 0),
'folder_name' => array('VCHAR', ''),
'folder_name' => array('VCHAR_UNI', ''),
'pm_count' => array('UINT', 0),
),
'PRIMARY_KEY' => 'folder_id',
@ -1190,7 +1321,7 @@ function get_schema_struct()
'user_id' => array('UINT', 0),
'rule_check' => array('UINT', 0),
'rule_connection' => array('UINT', 0),
'rule_string' => array('VCHAR', ''),
'rule_string' => array('VCHAR_UNI', ''),
'rule_user_id' => array('UINT', 0),
'rule_group_id' => array('UINT', 0),
'rule_action' => array('UINT', 0),
@ -1225,15 +1356,15 @@ function get_schema_struct()
$schema_data['phpbb_profile_fields'] = array(
'COLUMNS' => array(
'field_id' => array('UINT', NULL, 'auto_increment'),
'field_name' => array('VCHAR', ''),
'field_name' => array('VCHAR_UNI', ''),
'field_type' => array('TINT:4', 0),
'field_ident' => array('VCHAR:20', ''),
'field_length' => array('VCHAR:20', ''),
'field_minlen' => array('VCHAR', ''),
'field_maxlen' => array('VCHAR', ''),
'field_novalue' => array('VCHAR', ''),
'field_default_value' => array('VCHAR', ''),
'field_validation' => array('VCHAR:20', ''),
'field_novalue' => array('VCHAR_UNI', ''),
'field_default_value' => array('VCHAR_UNI', ''),
'field_validation' => array('VCHAR_UNI:20', ''),
'field_required' => array('BOOL', 0),
'field_show_on_reg' => array('BOOL', 0),
'field_hide' => array('BOOL', 0),
@ -1261,7 +1392,7 @@ function get_schema_struct()
'lang_id' => array('UINT', 0),
'option_id' => array('UINT', 0),
'field_type' => array('TINT:4', 0),
'lang_value' => array('VCHAR', ''),
'lang_value' => array('VCHAR_UNI', ''),
),
'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'),
);
@ -1270,9 +1401,9 @@ function get_schema_struct()
'COLUMNS' => array(
'field_id' => array('UINT', 0),
'lang_id' => array('UINT', 0),
'lang_name' => array('VCHAR', ''),
'lang_explain' => array('TEXT', ''),
'lang_default_value' => array('VCHAR', ''),
'lang_name' => array('VCHAR_UNI', ''),
'lang_explain' => array('TEXT_UNI', ''),
'lang_default_value' => array('VCHAR_UNI', ''),
),
'PRIMARY_KEY' => array('field_id', 'lang_id'),
);
@ -1280,7 +1411,7 @@ function get_schema_struct()
$schema_data['phpbb_ranks'] = array(
'COLUMNS' => array(
'rank_id' => array('UINT', NULL, 'auto_increment'),
'rank_title' => array('VCHAR', ''),
'rank_title' => array('VCHAR_UNI', ''),
'rank_min' => array('UINT', 0),
'rank_special' => array('BOOL', 0),
'rank_image' => array('VCHAR', ''),
@ -1297,7 +1428,7 @@ function get_schema_struct()
'user_notify' => array('BOOL', 0),
'report_closed' => array('BOOL', 0),
'report_time' => array('TIMESTAMP', 0),
'report_text' => array('MTEXT', ''),
'report_text' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'report_id',
);
@ -1305,8 +1436,8 @@ function get_schema_struct()
$schema_data['phpbb_reports_reasons'] = array(
'COLUMNS' => array(
'reason_id' => array('USINT', NULL, 'auto_increment'),
'reason_title' => array('VCHAR', ''),
'reason_description' => array('MTEXT', ''),
'reason_title' => array('VCHAR_UNI', ''),
'reason_description' => array('MTEXT_UNI', ''),
'reason_order' => array('USINT', 0),
),
'PRIMARY_KEY' => 'reason_id',
@ -1316,7 +1447,7 @@ function get_schema_struct()
'COLUMNS' => array(
'search_key' => array('VCHAR:32', ''),
'search_time' => array('TIMESTAMP', 0),
'search_keywords' => array('MTEXT', ''),
'search_keywords' => array('MTEXT_UNI', ''),
'search_authors' => array('MTEXT', ''),
),
'PRIMARY_KEY' => 'search_key',
@ -1325,7 +1456,7 @@ function get_schema_struct()
$schema_data['phpbb_search_wordlist'] = array(
'COLUMNS' => array(
'word_id' => array('UINT', NULL, 'auto_increment'),
'word_text' => array('VCHAR_BIN', ''),
'word_text' => array('VCHAR_UNI', ''),
'word_common' => array('BOOL', 0),
),
'PRIMARY_KEY' => 'word_id',
@ -1355,7 +1486,7 @@ function get_schema_struct()
'session_time' => array('TIMESTAMP', 0),
'session_ip' => array('VCHAR:40', ''),
'session_browser' => array('VCHAR:150', ''),
'session_page' => array('VCHAR', ''),
'session_page' => array('VCHAR_UNI', ''),
'session_viewonline' => array('BOOL', 1),
'session_autologin' => array('BOOL', 0),
'session_admin' => array('BOOL', 0),
@ -1393,11 +1524,11 @@ function get_schema_struct()
$schema_data['phpbb_smilies'] = array(
'COLUMNS' => array(
'smiley_id' => array('UINT', NULL, 'auto_increment'),
'code' => array('VCHAR:50', ''),
'emotion' => array('VCHAR:50', ''),
'code' => array('VCHAR_UNI:50', ''),
'emotion' => array('VCHAR_UNI:50', ''),
'smiley_url' => array('VCHAR:50', ''),
'smiley_width' => array('TINT:4', 0),
'smiley_height' => array('TINT:4', 0),
'smiley_width' => array('USINT', 0),
'smiley_height' => array('USINT', 0),
'smiley_order' => array('UINT', 0),
'display_on_posting'=> array('BOOL', 1),
),
@ -1410,8 +1541,8 @@ function get_schema_struct()
$schema_data['phpbb_styles'] = array(
'COLUMNS' => array(
'style_id' => array('TINT:4', NULL, 'auto_increment'),
'style_name' => array('VCHAR:252', ''),
'style_copyright' => array('VCHAR', ''),
'style_name' => array('VCHAR_UNI:255', ''),
'style_copyright' => array('VCHAR_UNI', ''),
'style_active' => array('BOOL', 1),
'template_id' => array('TINT:4', 0),
'theme_id' => array('TINT:4', 0),
@ -1429,10 +1560,10 @@ function get_schema_struct()
$schema_data['phpbb_styles_template'] = array(
'COLUMNS' => array(
'template_id' => array('TINT:4', NULL, 'auto_increment'),
'template_name' => array('VCHAR:252', ''),
'template_copyright' => array('VCHAR', ''),
'template_name' => array('VCHAR_UNI:255', ''),
'template_copyright' => array('VCHAR_UNI', ''),
'template_path' => array('VCHAR:100', ''),
'bbcode_bitfield' => array('VCHAR:252', 'kNg='),
'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
'template_storedb' => array('BOOL', 0),
),
'PRIMARY_KEY' => 'template_id',
@ -1447,7 +1578,7 @@ function get_schema_struct()
'template_filename' => array('VCHAR:100', ''),
'template_included' => array('TEXT', ''),
'template_mtime' => array('TIMESTAMP', 0),
'template_data' => array('MTEXT', ''),
'template_data' => array('MTEXT_UNI', ''),
),
'KEYS' => array(
'tid' => array('INDEX', 'template_id'),
@ -1458,12 +1589,12 @@ function get_schema_struct()
$schema_data['phpbb_styles_theme'] = array(
'COLUMNS' => array(
'theme_id' => array('TINT:4', NULL, 'auto_increment'),
'theme_name' => array('VCHAR:252', ''),
'theme_copyright' => array('VCHAR', ''),
'theme_name' => array('VCHAR_UNI:255', ''),
'theme_copyright' => array('VCHAR_UNI', ''),
'theme_path' => array('VCHAR:100', ''),
'theme_storedb' => array('BOOL', 0),
'theme_mtime' => array('TIMESTAMP', 0),
'theme_data' => array('MTEXT', ''),
'theme_data' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'theme_id',
'KEYS' => array(
@ -1474,8 +1605,8 @@ function get_schema_struct()
$schema_data['phpbb_styles_imageset'] = array(
'COLUMNS' => array(
'imageset_id' => array('TINT:4', NULL, 'auto_increment'),
'imageset_name' => array('VCHAR:252', ''),
'imageset_copyright' => array('VCHAR', ''),
'imageset_name' => array('VCHAR_UNI:255', ''),
'imageset_copyright' => array('VCHAR_UNI', ''),
'imageset_path' => array('VCHAR:100', ''),
'site_logo' => array('VCHAR:200', ''),
@ -1601,7 +1732,7 @@ function get_schema_struct()
'topic_attachment' => array('BOOL', 0),
'topic_approved' => array('BOOL', 1),
'topic_reported' => array('BOOL', 0),
'topic_title' => array('XSTEXT', ''),
'topic_title' => array('XSTEXT_UNI', ''),
'topic_poster' => array('UINT', 0),
'topic_time' => array('TIMESTAMP', 0),
'topic_time_limit' => array('TIMESTAMP', 0),
@ -1611,16 +1742,19 @@ function get_schema_struct()
'topic_status' => array('TINT:3', 0),
'topic_type' => array('TINT:3', 0),
'topic_first_post_id' => array('UINT', 0),
'topic_first_poster_name' => array('VCHAR', ''),
'topic_first_poster_name' => array('VCHAR_UNI', ''),
'topic_first_poster_colour' => array('VCHAR:6', ''),
'topic_last_post_id' => array('UINT', 0),
'topic_last_poster_id' => array('UINT', 0),
'topic_last_poster_name' => array('VCHAR', ''),
'topic_last_poster_name' => array('VCHAR_UNI', ''),
'topic_last_poster_colour' => array('VCHAR:6', ''),
'topic_last_post_subject' => array('XSTEXT_UNI', ''),
'topic_last_post_time' => array('TIMESTAMP', 0),
'topic_last_view_time' => array('TIMESTAMP', 0),
'topic_moved_id' => array('UINT', 0),
'topic_bumped' => array('BOOL', 0),
'topic_bumper' => array('UINT', 0),
'poll_title' => array('XSTEXT', ''),
'poll_title' => array('XSTEXT_UNI', ''),
'poll_start' => array('TIMESTAMP', 0),
'poll_length' => array('TIMESTAMP', 0),
'poll_max_options' => array('TINT:4', 1),
@ -1632,6 +1766,7 @@ function get_schema_struct()
'forum_id' => array('INDEX', 'forum_id'),
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
'last_post_time' => array('INDEX', 'topic_last_post_time'),
'topic_approved' => array('INDEX', 'topic_approved'),
'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
),
);
@ -1695,25 +1830,28 @@ function get_schema_struct()
'user_ip' => array('VCHAR:40', ''),
'user_regdate' => array('TIMESTAMP', 0),
'username' => array('VCHAR_CI', ''),
'user_password' => array('VCHAR:40', ''),
'username_clean' => array('VCHAR_CI', ''),
'user_password' => array('VCHAR_UNI:40', ''),
'user_passchg' => array('TIMESTAMP', 0),
'user_email' => array('VCHAR:100', ''),
'user_email' => array('VCHAR_UNI:100', ''),
'user_email_hash' => array('BINT', 0),
'user_birthday' => array('VCHAR:10', ''),
'user_lastvisit' => array('TIMESTAMP', 0),
'user_lastmark' => array('TIMESTAMP', 0),
'user_lastpost_time' => array('TIMESTAMP', 0),
'user_lastpage' => array('VCHAR:200', ''),
'user_lastpage' => array('VCHAR_UNI:200', ''),
'user_last_confirm_key' => array('VCHAR:10', ''),
'user_last_search' => array('TIMESTAMP', 0),
'user_warnings' => array('TINT:4', 0),
'user_last_warning' => array('TIMESTAMP', 0),
'user_login_attempts' => array('TINT:4', 0),
'user_inactive_reason' => array('TINT:2', 0),
'user_inactive_time' => array('TIMESTAMP', 0),
'user_posts' => array('UINT', 0),
'user_lang' => array('VCHAR:30', ''),
'user_timezone' => array('DECIMAL', 0),
'user_dst' => array('BOOL', 0),
'user_dateformat' => array('VCHAR:30', 'd M Y H:i'),
'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
'user_style' => array('TINT:4', 0),
'user_rank' => array('UINT', 0),
'user_colour' => array('VCHAR:6', ''),
@ -1733,36 +1871,35 @@ function get_schema_struct()
'user_notify_pm' => array('BOOL', 1),
'user_notify_type' => array('TINT:4', 0),
'user_allow_pm' => array('BOOL', 1),
'user_allow_email' => array('BOOL', 1),
'user_allow_viewonline' => array('BOOL', 1),
'user_allow_viewemail' => array('BOOL', 1),
'user_allow_massemail' => array('BOOL', 1),
'user_options' => array('UINT:11', 893),
'user_avatar' => array('VCHAR', ''),
'user_avatar_type' => array('TINT:2', 0),
'user_avatar_width' => array('TINT:4', 0),
'user_avatar_height' => array('TINT:4', 0),
'user_sig' => array('MTEXT', ''),
'user_avatar_width' => array('USINT', 0),
'user_avatar_height' => array('USINT', 0),
'user_sig' => array('MTEXT_UNI', ''),
'user_sig_bbcode_uid' => array('VCHAR:5', ''),
'user_sig_bbcode_bitfield' => array('VCHAR:252', ''),
'user_from' => array('VCHAR:100', ''),
'user_sig_bbcode_bitfield' => array('VCHAR:255', ''),
'user_from' => array('VCHAR_UNI:100', ''),
'user_icq' => array('VCHAR:15', ''),
'user_aim' => array('VCHAR', ''),
'user_yim' => array('VCHAR', ''),
'user_msnm' => array('VCHAR', ''),
'user_jabber' => array('VCHAR', ''),
'user_website' => array('VCHAR:200', ''),
'user_occ' => array('VCHAR', ''),
'user_interests' => array('TEXT', ''),
'user_aim' => array('VCHAR_UNI', ''),
'user_yim' => array('VCHAR_UNI', ''),
'user_msnm' => array('VCHAR_UNI', ''),
'user_jabber' => array('VCHAR_UNI', ''),
'user_website' => array('VCHAR_UNI:200', ''),
'user_occ' => array('VCHAR_UNI', ''),
'user_interests' => array('TEXT_UNI', ''),
'user_actkey' => array('VCHAR:32', ''),
'user_newpasswd' => array('VCHAR:32', ''),
'user_newpasswd' => array('VCHAR_UNI:32', ''),
),
'PRIMARY_KEY' => 'user_id',
'KEYS' => array(
'user_birthday' => array('INDEX', 'user_birthday'),
'user_email_hash' => array('INDEX', 'user_email_hash'),
'user_type' => array('INDEX', 'user_type'),
'username' => array('INDEX', 'username'),
'username_clean' => array('INDEX', 'username_clean'),
),
);
@ -1780,8 +1917,8 @@ function get_schema_struct()
$schema_data['phpbb_words'] = array(
'COLUMNS' => array(
'word_id' => array('UINT', NULL, 'auto_increment'),
'word' => array('VCHAR', ''),
'replacement' => array('VCHAR', ''),
'word' => array('VCHAR_UNI', ''),
'replacement' => array('VCHAR_UNI', ''),
),
'PRIMARY_KEY' => 'word_id',
);
@ -1858,7 +1995,7 @@ EOF;
/*
Domain definition
*/
CREATE DOMAIN varchar_ci AS varchar(252) NOT NULL DEFAULT ''::character varying;
CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying;
/*
Operation Functions
@ -1930,27 +2067,6 @@ CREATE OPERATOR =(
MERGES,
SORT1= <);
EOF;
break;
case 'firebird':
return <<<EOF
# Emulation of STRLEN, might need to be checked out for FB 2.0
DECLARE EXTERNAL FUNCTION STRLEN CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';;
# Emulation of LOWER, might need to be checked out for FB 2.0
DECLARE EXTERNAL FUNCTION LOWER CSTRING(80)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';;
# Only used for insertion of binary strings as defaults
DECLARE EXTERNAL FUNCTION ASCII_CHAR INTEGER
RETURNS CSTRING(1) FREE_IT
ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf';;
EOF;
break;
}

View file

@ -12,7 +12,7 @@
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpbb_root_path = './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
@ -22,13 +22,13 @@ header('Expires: 0');
ignore_user_abort(true);
// number of topics to create
$num_topics = 5000000;
$num_topics = 10000;
// number of topics to be generated per call
$batch_size = 100000;
$batch_size = 2000;
// max number of posts per topic
$posts_per_topic = 500000;
$posts_per_topic = 500;
// general vars
@ -40,7 +40,7 @@ switch ($mode)
case 'generate':
$user_ids = $forum_ids = $topic_rows = array();
$sql = 'SELECT user_id FROM ' . USERS_TABLE;
$sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') OR user_id = ' . ANONYMOUS;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
@ -60,7 +60,7 @@ switch ($mode)
{
$db->sql_query('TRUNCATE TABLE ' . POSTS_TABLE);
$db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE);
$db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch');
// $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch');
}
$db->sql_query('LOCK TABLES ' . POSTS_TABLE . ' WRITE, ' . TOPICS_TABLE . ' WRITE');
@ -86,7 +86,7 @@ switch ($mode)
$rows = array();
$post_time = mt_rand(0, time());
$num_posts = mt_rand(1, $posts_per_topic);
$num_posts = $posts_per_topic; //mt_rand(1, $posts_per_topic);
for ($i = 0; $i < $num_posts; ++$i)
{
$poster_id = $user_ids[array_rand($user_ids)];
@ -108,18 +108,20 @@ switch ($mode)
if ($topic_id >= $num_topics)
{
echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . '?mode=sync&amp;' . time() . '">And now for something completely different...';
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?mode=sync&amp;' . time() . '">And now for something completely different...';
$db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE);
flush();
}
else
{
echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . '?start=' . $topic_id . '&amp;' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?start=' . $topic_id . '&amp;' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')';
flush();
}
break;
case 'sync':
error_reporting(E_ALL);
/* error_reporting(E_ALL);
$sync_all = TRUE;
if ($sync_all)
@ -158,8 +160,11 @@ switch ($mode)
{
trigger_error('Done');
}
*/
}
$db->sql_close();
function rndm_username()
{
static $usernames;

View file

@ -0,0 +1,147 @@
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (php_sapi_name() != 'cli')
{
die("This program must be run from the command line.\n");
}
set_time_limit(0);
define('IN_PHPBB', true);
$phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
echo "Checking for required files\n";
download('http://unicode.org/Public/UNIDATA/CaseFolding.txt');
echo "\n";
/**
* Load the CaseFolding table
*/
echo "Loading CaseFolding\n";
$unidata = file_get_contents('CaseFolding.txt');
function utf8_chr($cp)
{
if ($cp > 0xFFFF)
{
return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
else if ($cp > 0x7FF)
{
return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
}
else if ($cp > 0x7F)
{
return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
}
else
{
return chr($cp);
}
}
preg_match_all('/^([0-9A-F]+); ([CFS]); ([0-9A-F]+(?: [0-9A-F]+)*);/im', $unidata, $array, PREG_SET_ORDER);
$uniarray = array();
foreach ($array as $value)
{
$uniarray[$value[2]][utf8_chr(hexdec((string)$value[1]))] = implode(array_map('utf8_chr', array_map('hexdec', explode(' ', $value[3]))));
}
foreach ($uniarray as $idx => $contents)
{
echo "Writing to case_fold_$idx.$phpEx\n";
$fp = fopen($phpbb_root_path . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . $phpEx, 'wb');
fwrite($fp, '<?php return ' . my_var_export($contents) . ';');
fclose($fp);
}
/**
* Return a parsable string representation of a variable
*
* This is function is limited to array/strings/integers
*
* @param mixed $var Variable
* @return string PHP code representing the variable
*/
function my_var_export($var)
{
if (is_array($var))
{
$lines = array();
foreach ($var as $k => $v)
{
$lines[] = my_var_export($k) . '=>' . my_var_export($v);
}
return 'array(' . implode(',', $lines) . ')';
}
elseif (is_string($var))
{
return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'";
}
else
{
return $var;
}
}
/**
* Download a file to the develop/ dir
*
* @param string $url URL of the file to download
* @return void
*/
function download($url)
{
global $phpbb_root_path;
if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
{
return;
}
echo 'Downloading from ', $url, ' ';
if (!$fpr = fopen($url, 'rb'))
{
die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
}
if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
{
die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
}
$i = 0;
$chunk = 32768;
$done = '';
while (!feof($fpr))
{
$i += fwrite($fpw, fread($fpr, $chunk));
echo str_repeat("\x08", strlen($done));
$done = ($i >> 10) . ' KiB';
echo $done;
}
fclose($fpr);
fclose($fpw);
echo "\n";
}
?>

View file

@ -48,7 +48,7 @@ $sql = "CREATE TABLE {$table_prefix}attachments
AND a.post_id = p.post_id";
$db->sql_query($sql);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':

View file

@ -54,7 +54,7 @@ $sql = "CREATE TABLE {$table_prefix}posts
WHERE pt.post_id = p.post_id";
$db->sql_query($sql);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':
@ -150,7 +150,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'oracle':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id

View file

@ -23,18 +23,21 @@ phpBB Developers : Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - ]
BartVB (Bart van Bragt) - [11/2000 - 03/2006]
Original subSilver by subBlue Design, Tom Beddard, © 2001 phpBB Group
Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
phpBB3 contains code from the following applications:
LGPL licenced:
Smarty © 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
GPL licenced:
phpMyAdmin © 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
Jabber class © 2003 Carlo Zottmann, http://phpjabber.g-blog.net
phpMyAdmin (c) 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
Jabber Class (c) 2004 Nathan Fritz, http://cjphp.netflint.net
Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/
Horde Project (c) 2000-2006, The Horde Project. http://horde.org/
PHP License, version 3.0:
Pear © 2001-2004 PHP Group, http://pear.php.net
Pear (c) 2001-2004 PHP Group, http://pear.php.net
Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff

View file

@ -12,7 +12,6 @@
<meta name="author" content="phpBB Group" />
<meta name="copyright" content="phpBB Group" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<link rel="shortcut icon" href="" />
<style type="text/css">
<!--
@ -151,6 +150,10 @@ p a {
.menu li a {
font-size: 100%;
}
.comment {
color: green;
}
//-->
</style>
@ -179,7 +182,7 @@ body {
<a name="top"></a><div id="main">
<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible. This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p>
<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible.<br />This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p>
<h1>Coding Guidelines</h1>
@ -214,12 +217,12 @@ body {
<div class="paragraph">
<h3>Tabs vs Spaces:</h3>
<p>In order to make this as simple as possible, we will be using tabs, not spaces. Feel free to set how many spaces your editor uses when it <b>displays</b> tabs, but make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p>
<p>Additionally please check your editor for the indent size. If tabs are set to 4 spaces for example, the indent size needs to be 4 too:</p>
<p>In order to make this as simple as possible, we will be using tabs, not spaces. We enforce 4 (four) spaces for one tab - therefore you need to set your tab width within your editor to 4 spaces. Make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p>
<p>Tabs in front of lines are no problem, but having them within the text can be a problem if you do not set it to the amount of spaces every one of us uses. Here is a short example of how it should look like:</p>
<blockquote><pre>
$mode{TAB}{TAB}= request_var('mode', '');
$search_id{TAB}= request_var('search_id', '');
{TAB}$mode{TAB}{TAB}= request_var('mode', '');
{TAB}$search_id{TAB}= request_var('search_id', '');
</pre></blockquote>
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
@ -280,9 +283,7 @@ $search_id{TAB}= request_var('search_id', '');
<blockquote><pre>
/**
*
* {HEADER}
*
*/
/**
@ -304,31 +305,26 @@ class ...
<br /><br />
<div class="paragraph">
<p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file.</p>
<p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file. Some files in <code>/includes</code> are holding functions responsible for special sections, for example uploading files, displaying &quot;things&quot;, user related functions and so forth.</p>
<p>The following packages are defined, and related new features/functions should be placed within the mentioned files/locations, as well as specifying the correct package name. The package names are bold within this list:</p>
<ul class="menu">
<li><b>phpBB3</b><br />Core files and all files not assigned to a seperate package</li>
<li><b>acm</b><br /><code>/includes/acm</code><br />Cache System, seperated because of equal class names
<ul>
<li><b>acm_main</b><br /><code>/includes/acm/acm_main.php</code><br />Base caching class. All functions obtaining cached data should be placed into this file</li>
<li><b>acm_db</b><br /><code>/includes/acm/acm_db.php</code><br />Database based caching</li>
<li><b>acm_file</b><br /><code>/includes/acm/acm_file.php</code><br />File based caching</li>
</ul>
</li>
<li><b>acm</b><br /><code>/includes/acm</code>, <code>/includes/cache.php</code><br />Cache System</li>
<li><b>acp</b><br /><code>/adm</code>, <code>/includes/acp</code>, <code>/includes/functions_admin.php</code><br />Administration Control Panel</li>
<li><b>dbal</b><br /><code>/includes/db</code><br />Database Abstraction Layer.<br />Base class is <code>dbal</code>
<ul>
<li><b>dbal_firebird</b><br /><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer<br />Minimum Requirement is Firebird 1.5+/Interbase 7.1+</li>
<li><b>dbal_mssql</b><br /><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer<br />Minimum Requirement is MSSQL 2000+</li>
<li><b>dbal_mssql_odbc</b><br /><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL<br />Minimum Requirement is Version 2000+</li>
<li><b>dbal_mysql</b><br /><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer<br />Minimum Requirement is 3.23+/4.0+/4.1+</li>
<li><b>dbal_mysql4</b><br /><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer<br />Minimum Requirement is 4.0+/4.1+/5.0+</li>
<li><b>dbal_mysqli</b><br /><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer<br />Minimum Requirement is MySQLi extension with MySQL 4.1+/5.0+</li>
<li><b>dbal_oracle</b><br /><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
<li><b>dbal_postgres</b><br /><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer<br />Minimum Requirement is Version 7.3+</li>
<li><b>dbal_sqlite</b><br /><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li>
<li><code>/includes/db/dbal.php</code><br />Base DBAL class, defining the overall framework as well as common detominators</li>
<li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li>
<li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
<li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x</li>
<li><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer for MySQL 4.1.x/5.x</li>
<li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
<li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
<li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li>
<li><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li>
</ul>
</li>
<li><b>docs</b><br /><code>/docs</code><br />phpBB Documentation</li>
@ -336,6 +332,7 @@ class ...
<li><b>install</b><br /><code>/install</code><br />Installation System</li>
<li><b>language</b><br /><code>/language</code><br />All language files</li>
<li><b>login</b><br /><code>/includes/auth</code><br />Login Authentication Plugins</li>
<li><b>VC</b><br /><code>/includes/captcha</code><br />CAPTCHA</li>
<li><b>mcp</b><br /><code>mcp.php</code>, <code>/includes/mcp</code>, <code>report.php</code><br />Moderator Control Panel</li>
<li><b>ucp</b><br /><code>ucp.php</code>, <code>/includes/ucp</code><br />User Control Panel</li>
<li><b>search</b><br /><code>/includes/search</code>, <code>search.php</code><br />Search System</li>
@ -350,7 +347,7 @@ class ...
<a name="code"></a><h1>2. Code Layout/Guidelines</h1>
<p>Please note that these Guidelines also applies to javascript code.</p>
<p>Please note that these Guidelines applies to all php, html, javascript and css files.</p>
<a name="namingvars"></a><b>2.i. Variable/Function Naming</b>
<br /><br />
@ -369,6 +366,7 @@ class ...
<h3>Loop Indices:</h3>
<p>The <em>only</em> situation where a one-character variable name is allowed is when it's the index for some looping construct. In this case, the index of the outer loop should always be $i. If there's a loop inside that loop, its index should be $j, followed by $k, and so on. If the loop is being indexed by some already-existing variable with a meaningful name, this guideline does not apply, example:</p>
<blockquote><pre>
for ($i = 0; $i &lt; $outer_size; $i++)
{
@ -404,6 +402,7 @@ for ($i = 0; $i &lt; $outer_size; $i++)
<p>This is another case of being too lazy to type 2 extra characters causing problems with code clarity. Even if the body of some construct is only one line long, do <em>not</em> drop the braces. Just don't, examples:</p>
<p class="bad">// These are all wrong. </p>
<blockquote><pre>
if (condition) do_stuff();
@ -471,6 +470,7 @@ function do_stuff()
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
<p>// Each pair shows the wrong way followed by the right way. </p>
<blockquote><pre>
$i=0;
$i = 0;
@ -481,8 +481,8 @@ if ($i &lt; 7) ...
if ( ($i &lt; 7)&amp;&amp;($j &gt; 8) ) ...
if ($i &lt; 7 &amp;&amp; $j &gt; 8) ...
do_stuff( $i, "foo", $b );
do_stuff($i, "foo", $b);
do_stuff( $i, 'foo', $b );
do_stuff($i, 'foo', $b);
for($i=0; $i&lt;$size; $i++) ...
for ($i = 0; $i &lt; $size; $i++) ...
@ -552,8 +552,18 @@ $foo = $assoc_array[blah];
$foo = $assoc_array['blah'];
</pre></blockquote>
<p class="bad">// wrong</p>
<blockquote><pre>
$foo = $assoc_array["$var"];
</pre></blockquote>
<p class="good">// right </p>
<blockquote><pre>
$foo = $assoc_array[$var];
</pre></blockquote>
<h3>Comments:</h3>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time. Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
<h3>Magic numbers:</h3>
<p>Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants <code>true</code> and <code>false</code> should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not have a very close eye to it).</p>
@ -590,7 +600,7 @@ $min = ($i &lt; $j) ? $i : $j;
</pre></blockquote>
<h3>Don't use uninitialized variables.</h3>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set, examples:</p>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p>
<p class="bad">// Wrong </p>
<blockquote><pre>
@ -607,6 +617,8 @@ if (isset($forum)) ...
if (isset($forum) &amp;&amp; $forum == 5)
</pre></blockquote>
<p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) &amp;&amp; sizeof($array) > 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
<h3>Switch statements:</h3>
<p>Switch/case code blocks can get a bit long sometimes. To have some level of notice and being in-line with the opening/closing brace requirement (where they are on the same line for better readability), this also applies to switch/case code blocks and the breaks. An example:</p>
@ -704,7 +716,7 @@ switch ($mode)
<div class="paragraph">
<h3>Common SQL Guidelines: </h3>
<p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible, otherwise DB2)).</p>
<p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p>
<p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p>
<h3>SQL code layout:</h3>
@ -731,7 +743,7 @@ $sql = 'SELECT *
</pre></blockquote>
<h3>SQL Quotes: </h3>
<p>Double quotes where applicable ... examples: </p>
<p>Double quotes where applicable (The variables in these examples are typecasted to integers before) ... examples: </p>
<p class="bad">// These are wrong.</p>
<blockquote><pre>
@ -752,6 +764,8 @@ $sql = 'SELECT *
<h3>Common DBAL methods: </h3>
<h3>sql_escape():</h3>
<p>Always use <code>$db-&gt;sql_escape()</code> if you need to check for a string within an SQL statement (even if you are sure the variable can not contain single quotes - never trust your input), for example:</p>
<blockquote><pre>
@ -760,7 +774,9 @@ $sql = 'SELECT *
WHERE username = '" . $db-&gt;sql_escape($username) . "'";
</pre></blockquote>
<p>If you need to UPDATE or INSERT data, make use of the <code>$db-&gt;sql_build_array()</code> function. This function already escapes strings and checkes other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p>
<h3>sql_build_array():</h3>
<p>If you need to UPDATE or INSERT data, make use of the <code>$db-&gt;sql_build_array()</code> function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p>
<blockquote><pre>
$sql_ary = array(
@ -782,13 +798,127 @@ $sql_ary = array(
);
$sql = 'UPDATE ' . SOME_TABLE . '
SET ' . $db-&gt;sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = $user_id";
SET ' . $db-&gt;sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user_id;
$db-&gt;sql_query($sql);
</pre></blockquote>
<p>The <code>$db-&gt;sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>MULTI_INSERT</code> (for returning extended inserts), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
<h3>sql_in_set():</h3>
<p>The <code>$db-&gt;sql_in_set()</code> function should be used for building <code>IN ()</code> and <code>NOT IN ()</code> constructs. Since (specifically) MySQL tend to be faster if for one value to be compared the <code>=</code> and <code>&lt;&gt;</code> operator is used, we let the DBAL decide what to do. A typical example of doing a positive match against a number of values would be:</p>
<blockquote><pre>
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids);
$db-&gt;sql_query($sql);
</pre></blockquote>
<p>Based on the number of values in $forum_ids, the query can look differently.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)
</pre></blockquote>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id = 1
</pre></blockquote>
<p>Of course the same is possible for doing a negative match against a number of values:</p>
<blockquote><pre>
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids, <strong>true</strong>);
$db-&gt;sql_query($sql);
</pre></blockquote>
<p>Based on the number of values in $forum_ids, the query can look differently here too.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)
</pre></blockquote>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<blockquote><pre>
SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1
</pre></blockquote>
<p>If the given array is empty, an error will be produced.</p>
<h3>sql_build_query():</h3>
<p>The <code>$db-&gt;sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p>
<blockquote><pre>
$sql_array = array(
'SELECT' => 'f.*, ft.mark_time',
'FROM' => array(
FORUMS_WATCH_TABLE => 'fw',
FORUMS_TABLE => 'f'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'
)
);
'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . '
AND f.forum_id = fw.forum_id',
'ORDER_BY' => 'left_id'
);
$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
</pre></blockquote>
<p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p>
<blockquote><pre>
$sql_array = array(
'SELECT' => 'f.*',
'FROM' => array(
FORUMS_WATCH_TABLE => 'fw',
FORUMS_TABLE => 'f'
),
'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . '
AND f.forum_id = fw.forum_id',
'ORDER_BY' => 'left_id'
);
if ($config['load_db_lastread'])
{
$sql_array['LEFT_JOIN'] = array(
array(
'FROM' => array(FORUMS_TRACK_TABLE => 'ft'),
'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id'
)
);
$sql_array['SELECT'] .= ', ft.mark_time ';
}
else
{
// Here we read the cookie data
}
$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
</pre></blockquote>
</div>
<a href="#top">Top</a>
<br /><br />
@ -818,7 +948,7 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
</pre></blockquote>
<h3>Use of in_array(): </h3>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds.</p>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
</div>
<a href="#top">Top</a>
@ -830,9 +960,11 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
<div class="paragraph">
<h3>General things:</h3>
<p>Never trust user input.</p>
<p>The auth class should be used for all authorisation checking</p>
<p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to)</p>
<p>Never trust user input (this also applies to server variables as well as cookies).</p>
<p>Try to sanitize values returned from a function.</p>
<p>Try to sanitize given function variables within your function.</p>
<p>The auth class should be used for all authorisation checking.</p>
<p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).</p>
<h3>Variables: </h3>
<p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params. </p>
@ -868,7 +1000,7 @@ $action_ary = request_var('action', array('' => 0));
<h3>Login checks/redirection: </h3>
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
<p>The <code>login_box()</code> function could have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
<p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
<h3>Sensitive Operations: </h3>
<p>For sensitive operations always let the user confirm the action. For the confirmation screens, make use of the <code>confirm_box()</code> function.</p>
@ -882,22 +1014,36 @@ $auth->acl($user->data);
$user->setup();
</pre></blockquote>
<p>The <code>$user->setup()</code> call can be used to pass on additional language definitions and a custom style (used in viewforum).</p>
<p>The <code>$user->setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p>
<h3>Errors and messages: </h3>
<p>All messages/errors should be output by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<p>All messages/errors should be outputed by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<blockquote><pre>
trigger_error('NO_FORUM');
</pre></blockquote>
<blockquote><pre>
trigger_error($user-&gt;lang['NO_FORUM']);
</pre></blockquote>
<blockquote><pre>
trigger_error('NO_APPROPIATE_MODE', E_USER_ERROR);
</pre></blockquote>
<h3>Url formatting</h3>
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended.</p>
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p>
<p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
<blockquote><pre>
append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])
</pre></blockquote>
<h3>General function usage: </h3>
<p>Some of these functions are only chosen over others because of a personal preference and are having no other benefit than to be consistant over the code.</p>
<p>Some of these functions are only chosen over others because of personal preference and having no other benefit than to be consistant over the code.</p>
<ul>
<li>
@ -909,6 +1055,12 @@ trigger_error('NO_FORUM');
<li>
<p>Use <code>else if</code> instead of <code>elseif</code></p>
</li>
<li>
<p>Use <code>false</code> (lowercase) instead of <code>FALSE</code></p>
</li>
<li>
<p>Use <code>true</code> (lowercase) instead of <code>TRUE</code></p>
</li>
</ul>
</div>
@ -921,7 +1073,7 @@ trigger_error('NO_FORUM');
<div class="paragraph">
<h3>General things</h3>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms).</p>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p>
<p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p>
<p>When writing <code>&lt;table&gt;</code> the order <code>&lt;table class="" cellspacing="" cellpadding="" border="" align=""&gt;</code> creates consistency and allows everyone to easily see which table produces which "look". The same applies to most other tags for which additional parameters can be set, consistency is the major aim here.</p>
@ -945,33 +1097,33 @@ trigger_error('NO_FORUM');
<p>Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.</p>
<p>Use div container for styling and table for data representation</p>
<p><strong>Use div container/css for styling and table for data representation.</strong></p>
<p>The seperate catXXXX and thXXX classes are gone. When defining a header cell just use <code>&lt;th&gt;</code> rather than <code>&lt;th class="thHead"&gt;</code> etc. Similarly for cat, don't use <code>&lt;td class="catLeft"&gt;</code> use <code>&lt;td class="cat"&gt;</code> etc.</p>
<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}&lt;br /&gt;&lt;span class="gensmall"&gt;{L_POST_USERNAME_EXPLAIN}&lt;/span&gt;</code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule</p>
<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}&lt;br /&gt;&lt;span class="gensmall"&gt;{L_POST_USERNAME_EXPLAIN}&lt;/span&gt;</code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p>
<p>Try to keep template conditional and other statements tabbed in line with the block to which they refer.</p>
<p class="bad">this is incorrect</p>
<p class="good">this is correct</p>
<blockquote><pre>
&lt;!-- BEGIN test --&gt;
<span class="comment">&lt;!-- BEGIN test --&gt;</span>
&lt;tr&gt;
&lt;td&gt;&#123;test.TEXT&#125;&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- END test --&gt;
<span class="comment">&lt;!-- END test --&gt;</span>
</pre></blockquote>
<p class="good">this is correct:</p>
<p class="good">this is also correct:</p>
<blockquote><pre>
&lt;!-- BEGIN test --&gt;
<span class="comment">&lt;!-- BEGIN test --&gt;</span>
&lt;tr&gt;
&lt;td&gt;&#123;test.TEXT&#125;&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- END test --&gt;
<span class="comment">&lt;!-- END test --&gt;</span>
</pre></blockquote>
<p>it gives immediate feedback on exactly what is looping.</p>
<p>it gives immediate feedback on exactly what is looping - decide which way to use based on the readability.</p>
</div>
<a href="#top">Top</a>
@ -986,50 +1138,26 @@ trigger_error('NO_FORUM');
<p>Firstly templates now take the suffix &quot;.html&quot; rather than &quot;.tpl&quot;. This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p>
<h3>Variables</h3>
<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, all other variables should be presented 'as is'.</p>
<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, javascript urls with UA_, language to be put in javascript statements with LA_, all other variables should be presented 'as is'.</p>
<p>Note that unlike 2.0.x most language strings are not assigned from the source. When a language variable is found {L_YYYYYY} phpBB first looks if an assigned variable exists with that name. If it does, it uses that. If not it looks if an exsting string defined in the language file exists. This should reduce the need to assign loads of new lang vars in Mods.</p>
<p>L_* template variables are automatically tried to be mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically. For example <code>{L_USERNAME}</code> maps to <code>$user-&gt;lang['USERNAME']</code>. The LA_* template variables are handled within the same way, but properly escaped to be put in javascript code. This should reduce the need to assign loads of new lang vars in Mods.
</p>
<h3>Blocks</h3>
<h3>Blocks/Loops</h3>
<p>The basic block level loop remains and takes the form:</p>
<blockquote><pre>
&lt;!-- BEGIN loopname --&gt;
markup, {loopname&#46;X_YYYYY}, etc&#46;
&lt;!-- END loopname --&gt;
<span class="comment">&lt;!-- BEGIN loopname --&gt;</span>
markup, {loopname&#46;X_YYYYY}, etc&#46;
<span class="comment">&lt;!-- END loopname --&gt;</span>
</pre></blockquote>
<p>However this has now been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p>
<blockquote><pre>
&lt;!-- BEGIN loopname(2) --&gt;
markup
&lt;!-- END loopname --&gt;
</pre></blockquote>
<p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are:
<br /><br />
<code>loopname(2,4)</code>: Starts loop on third values, ends on fourth<br />
<code>loopname(-4)</code>: Starts loop fourth from last value<br />
<code>loopname(2, -4)</code>: Starts loop on third value, ends four from end<br />
<br />Note that the indexing method may change since it's not really consistent at this time :)</p>
<p>A further extension to begin is BEGINELSE:</p>
<blockquote><pre>
&lt;!-- BEGIN loop --&gt;
markup
&lt;!-- BEGINELSE --&gt;
markup
&lt;!-- END loop --&gt;
</pre></blockquote>
<p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces &quot;bits of&quot; the existing &quot;switch_&quot; type control (the rest being replaced by conditionals, see below).</p>
<p>A bit later loops will be explained further. To not irretate you we will explain conditionals as well as other statements first.</p>
<h3>Including files</h3>
<p>Something that existed in 2.0.x which no longer exists in 3.0.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:</p>
<blockquote><pre>
&lt;!-- INCLUDE filename --&gt;
<span class="comment">&lt;!-- INCLUDE filename --&gt;</span>
</pre></blockquote>
<p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
@ -1038,15 +1166,15 @@ markup
<p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p>
<blockquote><pre>
&lt;!-- PHP --&gt;
echo &quot;hello!&quot;;
&lt;!-- ENDPHP --&gt;
<span class="comment">&lt;!-- PHP --&gt;</span>
echo &quot;hello!&quot;;
<span class="comment">&lt;!-- ENDPHP --&gt;</span>
</pre></blockquote>
<p>You may also include PHP from an external file using:</p>
<blockquote><pre>
&lt;!-- INCLUDEPHP somefile&#46;php --&gt;
<span class="comment">&lt;!-- INCLUDEPHP somefile&#46;php --&gt;</span>
</pre></blockquote>
<p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="http://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p>
@ -1055,18 +1183,20 @@ echo &quot;hello!&quot;;
<p>The most significant addition to 3.0.x are conditions or control structures, &quot;if something then do this else do that&quot;. The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p>
<blockquote><pre>
&lt;!-- IF expr --&gt;<br />markup<br />&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF expr --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>expr can take many forms, for example:</p>
<blockquote><pre>
&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;
markup
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including:</p>
<p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including (<code>not, or, and, eq, neq, is</code> should be used if possible for better readability):</p>
<blockquote><pre>
== [eq]
@ -1086,6 +1216,7 @@ markup
-
*
/
,
&lt;&lt; (bitwise shift left)
&gt;&gt; (bitwise shift right)
| (bitwise or)
@ -1106,29 +1237,29 @@ div
<p>Beyond the simple use of IF you can also do a sequence of comparisons using the following:</p>
<blockquote><pre>
&lt;!-- IF expr1 --&gt;
markup
&lt;!-- ELSEIF expr2 --&gt;
markup
&#46;
&#46;
&#46;
&lt;!-- ELSEIF exprN --&gt;
markup
&lt;!-- ELSE --&gt;
markup
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF expr1 --&gt;</span>
markup
<span class="comment">&lt;!-- ELSEIF expr2 --&gt;</span>
markup
&#46;
&#46;
&#46;
<span class="comment">&lt;!-- ELSEIF exprN --&gt;</span>
markup
<span class="comment">&lt;!-- ELSE --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match &quot;everything else&quot;.<br /><br />So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.0.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:</p>
<blockquote><pre>
&lt;table&gt;
&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;
&lt;tr class=&quot;row1&quot;&gt;
&lt;!-- ELSE --&gt;
&lt;tr class=&quot;row2&quot;&gt;
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF loop&#46;S_ROW_COUNT is even --&gt;</span>
&lt;tr class=&quot;row1&quot;&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;tr class=&quot;row2&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;td&gt;HELLO!&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
@ -1138,15 +1269,15 @@ markup
<blockquote><pre>
&lt;table&gt;
&lt;!-- IF loop&#46;S_ROW_COUNT &gt; 10 --&gt;
&lt;tr bgcolor=&quot;#FF0000&quot;&gt;
&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 5 --&gt;
&lt;tr bgcolor=&quot;#00FF00&quot;&gt;
&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 2 --&gt;
&lt;tr bgcolor=&quot;#0000FF&quot;&gt;
&lt;!-- ELSE --&gt;
&lt;tr bgcolor=&quot;#FF00FF&quot;&gt;
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF loop&#46;S_ROW_COUNT &gt; 10 --&gt;</span>
&lt;tr bgcolor=&quot;#FF0000&quot;&gt;
<span class="comment">&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 5 --&gt;</span>
&lt;tr bgcolor=&quot;#00FF00&quot;&gt;
<span class="comment">&lt;!-- ELSEIF loop&#46;S_ROW_COUNT &gt; 2 --&gt;</span>
&lt;tr bgcolor=&quot;#0000FF&quot;&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;tr bgcolor=&quot;#FF00FF&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;td&gt;hello!&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
@ -1155,13 +1286,229 @@ markup
<p>This will output the row cell in purple for the first two rows, blue for rows 2 to 5, green for rows 5 to 10 and red for remainder. So, you could produce a &quot;nice&quot; gradient effect, for example.<br /><br />What else can you do? Well, you could use IF to do common checks on for example the login state of a user:</p>
<blockquote><pre>
&lt;!-- IF S_USER_LOGGED_IN --&gt;
markup
&lt;!-- ENDIF --&gt;
<span class="comment">&lt;!-- IF S_USER_LOGGED_IN --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>This replaces the existing (fudged) method in 2.0.x using a zero length array and BEGIN/END.</p>
<h3>Extended syntax for Blocks/Loops</h3>
<p>Back to our loops - they had been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN loopname(2) --&gt;</span>
markup
<span class="comment">&lt;!-- END loopname --&gt;</span>
</pre></blockquote>
<p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are:
<br /><br />
<code>loopname(2)</code>: Will start the loop on the 3rd entry<br />
<code>loopname(-2)</code>: Will start the loop two entries from the end<br />
<code>loopname(3,4)</code>: Will start the loop on the fourth entry and end it on the fifth<br />
<code>loopname(3,-4)</code>: Will start the loop on the fourth entry and end it four from last<br />
</p>
<p>A further extension to begin is BEGINELSE:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN loop --&gt;</span>
markup
<span class="comment">&lt;!-- BEGINELSE --&gt;</span>
markup
<span class="comment">&lt;!-- END loop --&gt;</span>
</pre></blockquote>
<p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces &quot;bits of&quot; the existing &quot;switch_&quot; type control (the rest being replaced by conditionals).</p>
<p>Another way of checking if a loop contains values is by prefixing the loops name with a dot:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF .loop --&gt;</span>
<span class="comment">&lt;!-- BEGIN loop --&gt;</span>
markup
<span class="comment">&lt;!-- END loop --&gt;</span>
<span class="comment">&lt;!-- ELSE --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>You are even able to check the number of items within a loop by comparing it with values within the IF condition:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF .loop > 2 --&gt;</span>
<span class="comment">&lt;!-- BEGIN loop --&gt;</span>
markup
<span class="comment">&lt;!-- END loop --&gt;</span>
<span class="comment">&lt;!-- ELSE --&gt;</span>
markup
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>Nesting loops cause the conditionals needing prefixed with all loops from the outer one to the inner most. An illustration of this:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN firstloop --&gt;</span>
{firstloop.MY_VARIABLE_FROM_FIRSTLOOP}
<span class="comment">&lt;!-- BEGIN secondloop --&gt;</span>
{firstloop.secondloop.MY_VARIABLE_FROM_SECONDLOOP}
<span class="comment">&lt;!-- END secondloop --&gt;</span>
<span class="comment">&lt;!-- END firstloop --&gt;</span>
</pre></blockquote>
<p>Sometimes it is necessary to break out of nested loops to be able to call another loop within the current iteration. This sounds a little bit confusing and it is not used very often. The following (rather complex) example shows this quite good - it also shows how you test for the first and last row in a loop (i will explain the example in detail further down):</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
<span class="comment">&lt;!-- IF l_block1.S_SELECTED --&gt;</span>
&lt;strong&gt;{l_block1.L_TITLE}&lt;/strong&gt;
<span class="comment">&lt;!-- IF S_PRIVMSGS --&gt;</span>
<span class="comment">&lt;!-- the ! at the beginning of the loop name forces the loop to be not a nested one of l_block1 --&gt;</span>
<span class="comment">&lt;!-- BEGIN !folder --&gt;</span>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- IF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END !folder --&gt;</span>
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- BEGIN l_block2 --&gt;</span>
&lt;li&gt;
<span class="comment">&lt;!-- IF l_block1.l_block2.S_SELECTED --&gt;</span>
&lt;strong&gt;{l_block1.l_block2.L_TITLE}&lt;/strong&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a href=&quot;{l_block1.l_block2.U_TITLE}&quot;&gt;{l_block1.l_block2.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;/li&gt;
<span class="comment">&lt;!-- END l_block2 --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a class=&quot;nav&quot; href=&quot;{l_block1.U_TITLE}&quot;&gt;{l_block1.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>Let us first concentrate on this part of the example:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
<span class="comment">&lt;!-- IF l_block1.S_SELECTED --&gt;</span>
markup
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a class=&quot;nav&quot; href=&quot;{l_block1.U_TITLE}&quot;&gt;{l_block1.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>Here we open the loop l_block1 and doing some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see <code>{l_block1.L_TITLE}</code> referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.</p>
<p>Let's have a closer look to the markup:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
.
.
<span class="comment">&lt;!-- IF S_PRIVMSGS --&gt;</span>
<span class="comment">&lt;!-- BEGIN !folder --&gt;</span>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- IF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
<span class="comment">&lt;!-- END !folder --&gt;</span>
<span class="comment">&lt;!-- ENDIF --&gt;</span>
.
.
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>The <code>&lt;!-- IF S_PRIVMSGS --&gt;</code> statement clearly checks a global variable and not one within the loop, since the loop is not given here. So, if S_PRIVMSGS is true we execute the shown markup. Now, you see the <code>&lt;!-- BEGIN !folder --&gt;</code> statement. The exclamation mark is responsible for instructing the template engine to iterate through the main loop folder. So, we are now within the loop folder - with <code>&lt;!-- BEGIN folder --&gt;</code> we would have been within the loop <code>l_block1.folder</code> automatically as is the case with l_block2:</p>
<blockquote><pre>
<span class="comment">&lt;!-- BEGIN l_block1 --&gt;</span>
.
.
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- BEGIN l_block2 --&gt;</span>
&lt;li&gt;
<span class="comment">&lt;!-- IF l_block1.l_block2.S_SELECTED --&gt;</span>
&lt;strong&gt;{l_block1.l_block2.L_TITLE}&lt;/strong&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;a href=&quot;{l_block1.l_block2.U_TITLE}&quot;&gt;{l_block1.l_block2.L_TITLE}&lt;/a&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;/li&gt;
<span class="comment">&lt;!-- END l_block2 --&gt;</span>
&lt;/ul&gt;
.
.
<span class="comment">&lt;!-- END l_block1 --&gt;</span>
</pre></blockquote>
<p>You see the difference? The loop l_block2 is a member of the loop l_block1 but the loop folder is a main loop.</p>
<p>Now back to our folder loop:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- IF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>You may have wondered what the comparison to S_FIRST_ROW and S_LAST_ROW is about. If you haven't guessed already - it is checking for the first iteration of the loop with <code>S_FIRST_ROW</code> and the last iteration with <code>S_LAST_ROW</code>. This can come in handy quite often if you want to open or close design elements, like the above list. Let us imagine a folder loop build with three iterations, it would go this way:</p>
<blockquote><pre>
&lt;ul class=&quot;nav&quot;&gt; <span class="comment">&lt;!-- written on first iteration --&gt;</span>
&lt;li&gt;first element&lt;/li&gt; <span class="comment">&lt;!-- written on first iteration --&gt;</span>
&lt;li&gt;second element&lt;/li&gt; <span class="comment">&lt;!-- written on second iteration --&gt;</span>
&lt;li&gt;third element&lt;/li&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
&lt;/ul&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
</pre></blockquote>
<p>As you can see, all three elements are written down as well as the markup for the first iteration and the last one. Sometimes you want to omit writing the general markup - for example:</p>
<blockquote><pre>
<span class="comment">&lt;!-- IF folder.S_FIRST_ROW --&gt;</span>
&lt;ul class=&quot;nav&quot;&gt;
<span class="comment">&lt;!-- ELSEIF folder.S_LAST_ROW --&gt;</span>
&lt;/ul&gt;
<span class="comment">&lt;!-- ELSE --&gt;</span>
&lt;li&gt;&lt;a href=&quot;{folder.U_FOLDER}&quot;&gt;{folder.FOLDER_NAME}&lt;/a&gt;&lt;/li&gt;
<span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></blockquote>
<p>would result in the following markup:</p>
<blockquote><pre>
&lt;ul class=&quot;nav&quot;&gt; <span class="comment">&lt;!-- written on first iteration --&gt;</span>
&lt;li&gt;second element&lt;/li&gt; <span class="comment">&lt;!-- written on second iteration --&gt;</span>
&lt;/ul&gt; <span class="comment">&lt;!-- written on third iteration --&gt;</span>
</pre></blockquote>
<p>Just always remember that processing is taking place from up to down.</p>
</div>
<a href="#top">Top</a>
<br /><br />
@ -1171,6 +1518,17 @@ markup
<a name="changes"></a><h1>5. Guidelines Changelog</h1>
<div class="paragraph">
<h2>Revision 1.8</h2>
<ul class="menu">
<li>Some adjustements to wordings</li>
<li>Updated paragraph <a href="#locations">1.iii. File Locations</a> to reflect recent changes</li>
<li>Extended paragraph <a href="#codelayout">2.ii. Code Layout</a>.</li>
<li>Added sql_in_set and sql_build_query explanation to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li>
<li>Updated paragraph <a href="#styling">3. Styling</a>.</li>
<li>Updated paragraph <a href="#templating">4. Templating</a> to explain loop checking, loop breaking and other changes we recently made.</li>
</ul>
<h2>Revision 1.5</h2>
<ul class="menu">

View file

@ -34,7 +34,7 @@ if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
}
$sql = 'SELECT attach_id, in_message, post_msg_id, extension
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id
FROM ' . ATTACHMENTS_TABLE . "
WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1);
@ -52,57 +52,73 @@ if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachmen
}
$row = array();
if (!$attachment['in_message'])
if ($attachment['is_orphan'])
{
//
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
AND p.forum_id = f.forum_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// We allow admins having attachment permissions to see orphan attachments...
$own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false;
// Global announcement?
if (!$row)
if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download')))
{
$forum_id = request_var('f', 0);
$sql = 'SELECT forum_id, forum_password, parent_id
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
trigger_error('ERROR_NO_ATTACHMENT');
}
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
$extensions = $cache->obtain_attach_extensions();
}
else
{
if (!$attachment['in_message'])
{
if ($row['forum_password'])
//
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
AND p.forum_id = f.forum_id';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Global announcement?
if (!$row)
{
// Do something else ... ?
login_forum_box($row);
$forum_id = request_var('f', 0);
$sql = 'SELECT forum_id, forum_password, parent_id
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']))
{
if ($row['forum_password'])
{
// Do something else ... ?
login_forum_box($row);
}
}
else
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
}
else
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
$row['forum_id'] = 0;
if (!$auth->acl_get('u_pm_download'))
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
}
}
else
{
$row['forum_id'] = 0;
if (!$auth->acl_get('u_pm_download'))
{
trigger_error('SORRY_AUTH_VIEW_ATTACH');
}
}
// disallowed ?
$extensions = array();
if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
{
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
// disallowed ?
$extensions = array();
if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions))
{
trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
}
}
if (!download_allowed())
@ -113,7 +129,7 @@ if (!download_allowed())
$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
// Fetching filename here to prevent sniffing of filename
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
FROM ' . ATTACHMENTS_TABLE . "
WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1);
@ -125,7 +141,6 @@ if (!$attachment)
trigger_error('ERROR_NO_ATTACHMENT');
}
$attachment['physical_filename'] = basename($attachment['physical_filename']);
$display_cat = $extensions[$attachment['extension']]['display_cat'];
@ -133,7 +148,7 @@ if ($thumbnail)
{
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
else if ($display_cat == ATTACHMENT_CATEGORY_NONE)
else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan'])
{
// Update download count
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
@ -176,7 +191,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Correct the mime type - we force application/octetstream for all files, except images
// Please do not change this, it is a security precaution
if ($category == ATTACHMENT_CATEGORY_NONE && strpos($attachment['mimetype'], 'image') === false)
if (strpos($attachment['mimetype'], 'image') !== 0)
{
$attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream';
}
@ -189,15 +204,11 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Now send the File Contents to the Browser
$size = @filesize($filename);
// Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method
// To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
$contents = @file_get_contents($filename);
// Check if headers already sent or not able to get the file contents.
if (headers_sent() || $contents === false)
if (headers_sent() || !@file_exists($filename) || !@is_readable($filename))
{
unset($contents);
// PHP track_errors setting On?
if (!empty($php_errormsg))
{
@ -210,21 +221,54 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Now the tricky part... let's dance
header('Pragma: public');
// Send out the Headers
header('Content-type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"');
header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"');
/**
* Commented out X-Sendfile support. To not expose the physical filename within the header if xsendfile is absent we need to look into methods of checking it's status.
*
* Try X-Sendfile since it is much more server friendly - only works if the path is *not* outside of the root path...
* lighttpd has core support for it. An apache2 module is available at http://celebnamer.celebworld.ws/stuff/mod_xsendfile/
*
* Not really ideal, but should work fine...
* <code>
* if (strpos($upload_dir, '/') !== 0 && strpos($upload_dir, '../') === false)
* {
* header('X-Sendfile: ' . $filename);
* }
* </code>
*/
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
header('Content-Type: ' . $attachment['mimetype']);
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename($attachment['real_filename']));
if ($size)
{
header("Content-length: $size");
header("Content-Length: $size");
}
echo $contents;
unset($contents);
// Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method
echo @file_get_contents($filename);
flush();
exit;
}
/*
* Get a browser friendly UTF-8 encoded filename
*/
function header_filename($file)
{
// There be dragons here...
// IE follows no RFC, follow the RFC for extended filename for the rest
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
{
return "filename=" . rawurlencode($file);
}
else
{
return "filename*=UTF-8''" . rawurlencode($file);
}
}
/**
* Check if downloading item is allowed
*/

View file

@ -0,0 +1,10 @@
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</html>

View file

@ -80,6 +80,16 @@ class acm
@flock($fp, LOCK_UN);
fclose($fp);
}
else
{
// Now, this occurred how often? ... phew, just tell the user then...
if (!@is_writeable($this->cache_dir))
{
trigger_error($this->cache_dir . ' is NOT writeable.', E_USER_ERROR);
}
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
}
$this->is_modified = false;
}
@ -132,7 +142,7 @@ class acm
*/
function get($var_name)
{
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
global $phpEx;
@ -155,7 +165,7 @@ class acm
*/
function put($var_name, $var, $ttl = 31536000)
{
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
global $phpEx;
@ -175,6 +185,32 @@ class acm
}
}
/**
* Purge cache data
*/
function purge()
{
// Purge all phpbb cache files
$dir = opendir($this->cache_dir);
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
{
continue;
}
@unlink($this->cache_dir . $entry);
}
@closedir($dir);
unset($this->vars);
unset($this->var_expires);
unset($this->sql_rowset);
unset($this->sql_row_pointer);
$this->is_modified = false;
}
/**
* Destroy cache data
*/
@ -213,7 +249,7 @@ class acm
return;
}
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
@unlink($this->cache_dir . 'data' . $var_name . ".$phpEx");
}
@ -233,7 +269,7 @@ class acm
*/
function _exists($var_name)
{
if ($var_name{0} == '_')
if ($var_name[0] == '_')
{
global $phpEx;
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
@ -345,7 +381,7 @@ class acm
}
$db->sql_freeresult($query_result);
fwrite($fp, "<?php\n\n/*\n$query\n*/\n\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>');
fwrite($fp, "<?php\n\n/*\n" . str_replace('*/', '*\/', $query) . "\n*/\n\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>');
@flock($fp, LOCK_UN);
fclose($fp);
@ -374,14 +410,6 @@ class acm
return false;
}
/**
* Fetch the number of rows from cache (database)
*/
function sql_numrows($query_id)
{
return sizeof($this->sql_rowset[$query_id]);
}
/**
* Fetch a field from the current row of a cached database result (database)
*/
@ -398,7 +426,7 @@ class acm
/**
* Seek a specific row in an a cached database result (database)
*/
function sql_rowseek($query_id, $rownum)
function sql_rowseek($rownum, $query_id)
{
if ($rownum >= sizeof($this->sql_rowset[$query_id]))
{

View file

@ -46,7 +46,8 @@ class acp_attachments
break;
default:
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
$this->tpl_name = 'acp_attachments';
@ -86,31 +87,42 @@ class acp_attachments
'img_max_width' => false, 'img_max_height' => false, 'img_link_width' => false, 'img_link_height' => false,
'legend1' => 'ACP_ATTACHMENT_SETTINGS',
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'upload_path' => array('lang' => 'UPLOAD_DIR', 'type' => 'text:25:100', 'explain' => true),
'display_order' => array('lang' => 'DISPLAY_ORDER', 'type' => 'custom', 'method' => 'display_order', 'explain' => true),
'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'type' => 'text:3:3', 'explain' => false),
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'type' => 'text:3:3', 'explain' => false),
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'type' => 'radio:yes_no', 'explain' => true),
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'type' => 'radio:yes_no', 'explain' => true),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true),
'display_order' => array('lang' => 'DISPLAY_ORDER', 'validate' => 'bool', 'type' => 'custom', 'method' => 'display_order', 'explain' => true),
'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false),
'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true),
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'type' => 'radio:yes_no', 'explain' => true),
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'img_imagick' => array('lang' => 'IMAGICK_PATH', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' px'),
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
)
);
$this->new_config = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
$error = array();
// We validate the complete config if whished
validate_config_vars($display_vars['vars'], $cfg_array, $error);
// Do not write values if there is an error
if (sizeof($error))
{
$submit = false;
}
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
foreach ($display_vars['vars'] as $config_name => $null)
@ -197,7 +209,9 @@ class acp_attachments
$template->assign_vars(array(
'S_SECURE_DOWNLOADS' => $this->new_config['secure_downloads'],
'S_DEFINED_IPS' => ($defined_ips != '') ? true : false,
'S_WARNING' => (sizeof($error)) ? true : false,
'WARNING_MSG' => implode('<br />', $error),
'DEFINED_IPS' => $defined_ips,
'L_SECURE_TITLE' => $user->lang['DEFINE_' . $allow_deny . '_IPS'],
@ -403,12 +417,12 @@ class acp_attachments
if ($action != 'add' && $action != 'edit')
{
trigger_error('WRONG_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
}
if (!$group_id && $action == 'edit')
{
trigger_error('NO_EXT_GROUP_SPECIFIED');
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($group_id)
@ -437,7 +451,7 @@ class acp_attachments
{
$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . "
WHERE LOWER(group_name) = '" . $db->sql_escape(strtolower($new_group_name)) . "'";
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'";
$result = $db->sql_query($sql);
if ($db->sql_fetchrow($result))
@ -521,15 +535,16 @@ class acp_attachments
}
$cat_lang = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES']
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'],
);
$group_id = request_var('g', 0);
$action = (isset($_POST['add'])) ? 'add' : $action;
// $action = (($action == 'add' || $action == 'edit') && $submit && !sizeof($error)) ? 'show' : $action;
switch ($action)
{
@ -578,7 +593,7 @@ class acp_attachments
if (!$group_id)
{
trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -770,7 +785,7 @@ class acp_attachments
if (!$group_id)
{
trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
@ -823,24 +838,45 @@ class acp_attachments
$add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array();
$post_ids = request_var('post_id', array('' => 0));
foreach ($delete_files as $delete)
if (sizeof($delete_files))
{
phpbb_unlink($delete);
phpbb_unlink($delete, 'thumbnail');
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', $delete_files) . '
AND is_orphan = 1';
$result = $db->sql_query($sql);
$delete_files = array();
while ($row = $db->sql_fetchrow($result))
{
phpbb_unlink($row['physical_filename']);
if ($row['thumbnail'])
{
phpbb_unlink($row['physical_filename'], 'thumbnail');
}
$delete_files[$row['attach_id']] = $row['real_filename'];
}
$db->sql_freeresult($result);
}
if (sizeof($delete_files))
{
$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files));
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files));
$notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files));
}
$upload_list = array();
foreach ($add_files as $file)
foreach ($add_files as $attach_id)
{
if (!in_array($file, $delete_files) && $post_ids[$file])
if (!in_array($attach_id, array_keys($delete_files)) && !empty($post_ids[$attach_id]))
{
$upload_list[$post_ids[$file]] = $file;
$upload_list[$attach_id] = $post_ids[$attach_id];
}
}
unset($add_files);
@ -849,13 +885,10 @@ class acp_attachments
{
$template->assign_var('S_UPLOADING_FILES', true);
include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
$message_parser = new parse_message();
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE;
$result = $db->sql_query($sql);
$forum_names = array();
while ($row = $db->sql_fetchrow($result))
{
@ -863,30 +896,67 @@ class acp_attachments
}
$db->sql_freeresult($result);
$sql = 'SELECT forum_id, topic_id, post_id
$sql = 'SELECT forum_id, topic_id, post_id, poster_id
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('post_id', array_keys($upload_list));
WHERE ' . $db->sql_in_set('post_id', $upload_list);
$result = $db->sql_query($sql);
$post_info = array();
while ($row = $db->sql_fetchrow($result))
{
$post_info[$row['post_id']] = $row;
}
$db->sql_freeresult($result);
// Select those attachments we want to change...
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', array_keys($upload_list)) . '
AND is_orphan = 1';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$return = true;
if ($auth->acl_get('f_attach', $row['forum_id']))
{
$return = $this->upload_file($row['post_id'], $row['topic_id'], $row['forum_id'], $config['upload_path'], $upload_list[$row['post_id']]);
}
$post_row = $post_info[$upload_list[$row['attach_id']]];
$template->assign_block_vars('upload', array(
'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $upload_list[$row['post_id']], $row['post_id']),
'S_DENIED' => (!$auth->acl_get('f_attach', $row['forum_id'])) ? true : false,
'L_DENIED' => (!$auth->acl_get('f_attach', $row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '',
'ERROR_MSG' => ($return === true) ? false : $return)
'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $row['real_filename'], $post_row['post_id']),
'S_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? true : false,
'L_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '')
);
if (!$auth->acl_get('f_attach', $post_row['forum_id']))
{
continue;
}
// Adjust attachment entry
$sql_ary = array(
'in_message' => 0,
'is_orphan' => 0,
'poster_id' => $post_row['poster_id'],
'post_msg_id' => $post_row['post_id'],
'topic_id' => $post_row['topic_id'],
);
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE attach_id = ' . $row['attach_id'];
$db->sql_query($sql);
$sql = 'UPDATE ' . POSTS_TABLE . '
SET post_attachment = 1
WHERE post_id = ' . $post_row['post_id'];
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_attachment = 1
WHERE topic_id = ' . $post_row['topic_id'];
$db->sql_query($sql);
add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']);
}
$db->sql_freeresult($result);
unset($message_parser);
}
}
@ -894,43 +964,31 @@ class acp_attachments
'S_ORPHAN' => true)
);
$attach_filelist = array();
$dir = @opendir($phpbb_root_path . $config['upload_path']);
while (($file = @readdir($dir)) !== false)
{
if (is_file($phpbb_root_path . $config['upload_path'] . '/' . $file) && filesize($phpbb_root_path . $config['upload_path'] . '/' . $file) && $file{0} != '.' && $file != 'index.htm' && !preg_match('#^thumb\_#', $file))
{
$attach_filelist[$file] = $file;
}
}
@closedir($dir);
$sql = 'SELECT physical_filename
FROM ' . ATTACHMENTS_TABLE;
// Just get the files with is_orphan set and older than 3 hours
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1
AND filetime < ' . (time() - 3*60*60) . '
ORDER BY filetime DESC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
unset($attach_filelist[$row['physical_filename']]);
$size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MB'] : (($row['filesize'] >= 1024) ? $user->lang['KB'] : $user->lang['BYTES']);
$row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']);
$template->assign_block_vars('orphan', array(
'FILESIZE' => $row['filesize'] . ' ' . $size_lang,
'FILETIME' => $user->format_date($row['filetime']),
'REAL_FILENAME' => basename($row['real_filename']),
'PHYSICAL_FILENAME' => basename($row['physical_filename']),
'ATTACH_ID' => $row['attach_id'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
'U_FILE' => append_sid($phpbb_root_path . 'download.' . $phpEx, 'id=' . $row['attach_id']))
);
}
$db->sql_freeresult($result);
$i = 0;
foreach ($attach_filelist as $file)
{
$filesize = @filesize($phpbb_root_path . $config['upload_path'] . '/' . $file);
$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);
$template->assign_block_vars('orphan', array(
'FILESIZE' => $filesize . ' ' . $size_lang,
'U_FILE' => $phpbb_root_path . $config['upload_path'] . '/' . $file,
'FILE' => $file,
'POST_IDS' => (!empty($post_ids[$file])) ? $post_ids[$file] : '')
);
}
break;
}
@ -959,10 +1017,12 @@ class acp_attachments
global $db, $user;
$types = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES']
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'],
);
if ($group_id)
@ -1079,70 +1139,6 @@ class acp_attachments
return $group_select;
}
/**
* Upload already uploaded file... huh? are you kidding?
*/
function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
{
global $message_parser, $db, $user, $phpbb_root_path;
$message_parser->attachment_data = array();
$message_parser->filename_data['filecomment'] = '';
$message_parser->filename_data['filename'] = $phpbb_root_path . $upload_dir . '/' . basename($filename);
$filedata = upload_attachment('local', $forum_id, true, $phpbb_root_path . $upload_dir . '/' . basename($filename));
if ($filedata['post_attach'] && !sizeof($filedata['error']))
{
$message_parser->attachment_data = array(
'post_msg_id' => $post_id,
'poster_id' => $user->data['user_id'],
'topic_id' => $topic_id,
'in_message' => 0,
'physical_filename' => $filedata['physical_filename'],
'real_filename' => $filedata['real_filename'],
'attach_comment' => $message_parser->filename_data['filecomment'],
'extension' => $filedata['extension'],
'mimetype' => $filedata['mimetype'],
'filesize' => $filedata['filesize'],
'filetime' => $filedata['filetime'],
'thumbnail' => $filedata['thumbnail']
);
$message_parser->filename_data['filecomment'] = '';
$filedata['post_attach'] = false;
// Submit Attachment
$attach_sql = $message_parser->attachment_data;
$db->sql_transaction('begin');
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
$db->sql_query($sql);
$sql = 'UPDATE ' . POSTS_TABLE . "
SET post_attachment = 1
WHERE post_id = $post_id";
$db->sql_query($sql);
$sql = 'UPDATE ' . TOPICS_TABLE . "
SET topic_attachment = 1
WHERE topic_id = $topic_id";
$db->sql_query($sql);
$db->sql_transaction('commit');
add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_id, $filename);
return true;
}
else if (sizeof($filedata['error']))
{
return sprintf($user->lang['ADMIN_UPLOAD_ERROR'], implode('<br />', $filedata['error']));
}
}
/**
* Search Imagick
*/
@ -1369,7 +1365,7 @@ class acp_attachments
add_log('admin', $log_entry, $ip_list_log);
}
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
else if (isset($_POST['unsecuresubmit']))
{
@ -1398,7 +1394,7 @@ class acp_attachments
add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list);
}
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']);
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
}

View file

@ -189,7 +189,7 @@ class acp_ban
$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
'A_REASON' => addslashes(html_entity_decode($reason)))
'A_REASON' => addslashes(htmlspecialchars_decode($reason)))
);
}
}
@ -201,7 +201,7 @@ class acp_ban
$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
'A_REASON' => addslashes(html_entity_decode($reason)))
'A_REASON' => addslashes(htmlspecialchars_decode($reason)))
);
}
}

View file

@ -47,13 +47,13 @@ class acp_bbcodes
if (!$row)
{
trigger_error('BBCODE_NOT_EXIST');
trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$bbcode_match = $row['bbcode_match'];
$bbcode_tpl = htmlspecialchars($row['bbcode_tpl']);
$display_on_posting = $row['display_on_posting'];
$bbcode_helpline = html_entity_decode($row['bbcode_helpline']);
$bbcode_helpline = $row['bbcode_helpline'];
break;
case 'modify':
@ -66,7 +66,7 @@ class acp_bbcodes
if (!$row)
{
trigger_error('BBCODE_NOT_EXIST');
trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// No break here
@ -75,8 +75,8 @@ class acp_bbcodes
$display_on_posting = request_var('display_on_posting', 0);
$bbcode_match = request_var('bbcode_match', '');
$bbcode_tpl = html_entity_decode(request_var('bbcode_tpl', ''));
$bbcode_helpline = htmlspecialchars(request_var('bbcode_helpline', ''));
$bbcode_tpl = htmlspecialchars_decode(request_var('bbcode_tpl', ''));
$bbcode_helpline = request_var('bbcode_helpline', '');
break;
}
@ -127,9 +127,11 @@ class acp_bbcodes
$info = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded))
// Grab the end, interrogate the last closing tag
preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs);
if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || in_array(strtolower($regs[1]), $hard_coded))
{
trigger_error('BBCODE_INVALID_TAG_NAME');
trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@ -170,12 +172,13 @@ class acp_bbcodes
if ($bbcode_id > 1511)
{
trigger_error('TOO_MANY_BBCODES');
trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary['bbcode_id'] = (int) $bbcode_id;
$db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
$cache->destroy('sql', BBCODES_TABLE);
$lang = 'BBCODE_ADDED';
$log_action = 'LOG_BBCODE_ADD';
@ -186,6 +189,7 @@ class acp_bbcodes
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE bbcode_id = ' . $bbcode_id;
$db->sql_query($sql);
$cache->destroy('sql', BBCODES_TABLE);
$lang = 'BBCODE_EDITED';
$log_action = 'LOG_BBCODE_EDIT';
@ -208,8 +212,21 @@ class acp_bbcodes
if ($row)
{
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
if (confirm_box(true))
{
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
}
else
{
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
'bbcode' => $bbcode_id,
'i' => $id,
'mode' => $mode,
'action' => $action))
);
}
}
break;
@ -290,7 +307,7 @@ class acp_bbcodes
if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
{
$repad = $pad + sizeof(array_unique($repad[0]));
$replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\$' . (\$1 + \$pad)", $replace);
$replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
$pad = $repad;
}
@ -320,7 +337,7 @@ class acp_bbcodes
$fp_replace = str_replace($token, $replace, $fp_replace);
$sp_match = str_replace(preg_quote($token, '!'), '(.*?)', $sp_match);
$sp_replace = str_replace($token, '$' . ($n + 1), $sp_replace);
$sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
}
$fp_match = '!' . $fp_match . '!' . $modifiers;

View file

@ -27,6 +27,7 @@ class acp_board
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
// Validation types are: string, int, bool, rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable)
switch ($mode)
{
case 'settings':
@ -34,19 +35,19 @@ class acp_board
'title' => 'ACP_BOARD_SETTINGS',
'vars' => array(
'legend1' => 'ACP_BOARD_SETTINGS',
'sitename' => array('lang' => 'SITE_NAME', 'type' => 'text:40:255', 'explain' => false),
'site_desc' => array('lang' => 'SITE_DESC', 'type' => 'text:40:255', 'explain' => false),
'board_disable' => array('lang' => 'DISABLE_BOARD', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false),
'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true),
'board_disable_msg' => false,
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'board_dst' => array('lang' => 'SYSTEM_DST', 'type' => 'radio:yes_no', 'explain' => false),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'type' => 'radio:yes_no', 'explain' => true),
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'string', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'WARNINGS',
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'type' => 'text:3:4', 'explain' => true),
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true),
)
);
break;
@ -56,29 +57,25 @@ class acp_board
'title' => 'ACP_BOARD_FEATURES',
'vars' => array(
'legend1' => 'ACP_BOARD_FEATURES',
'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true),
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'ACP_LOAD_SETTINGS',
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'type' => 'radio:yes_no', 'explain' => false),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
)
);
break;
@ -90,14 +87,14 @@ class acp_board
'legend1' => 'ACP_AVATAR_SETTINGS',
'avatar_min_height' => false, 'avatar_min_width' => false, 'avatar_max_height' => false, 'avatar_max_width' => false,
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'type' => 'radio:yes_no', 'explain' => false),
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'type' => 'radio:yes_no', 'explain' => true),
'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'type' => 'radio:yes_no', 'explain' => false),
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'type' => 'text:20:255', 'explain' => true),
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'type' => 'text:20:255', 'explain' => true)
'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true),
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true)
)
);
break;
@ -108,23 +105,23 @@ class acp_board
'lang' => 'ucp',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true),
'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'type' => 'text:4:4', 'explain' => true),
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'legend2' => 'GENERAL_OPTIONS',
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false),
'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false),
'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false),
'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'type' => 'radio:yes_no', 'explain' => false)
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false)
)
);
break;
@ -134,31 +131,32 @@ class acp_board
'title' => 'ACP_POST_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_OPTIONS',
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'type' => 'radio:yes_no', 'explain' => true),
'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'POSTING',
'bump_type' => false,
'edit_time' => array('lang' => 'EDIT_TIME', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'type' => 'radio:yes_no', 'explain' => true),
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'type' => 'text:3:4', 'explain' => true),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false),
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false),
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'type' => 'text:3:4', 'explain' => false),
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'type' => 'text:4:4', 'explain' => false),
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'type' => 'text:5:4', 'explain' => true),
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true),
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true),
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true),
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => false),
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
)
);
break;
@ -168,19 +166,20 @@ class acp_board
'title' => 'ACP_SIGNATURE_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_OPTIONS',
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_links' => array('lang' => 'ALLOW_SIG_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'GENERAL_SETTINGS',
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true),
'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'type' => 'text:5:4', 'explain' => true),
'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true),
'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true),
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
)
);
break;
@ -193,24 +192,24 @@ class acp_board
'max_name_chars' => false,
'max_pass_chars' => false,
'require_activation' => array('lang' => 'ACC_ACTIVATION', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'type' => 'custom', 'method' => 'username_length', 'explain' => true),
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true),
'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'username_length', 'explain' => true),
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'type' => 'radio:yes_no', 'explain' => true),
'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'type' => 'radio:yes_no', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'type' => 'text:3:3', 'explain' => true),
'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'type' => 'text:4:4', 'explain' => true),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'legend3' => 'COPPA',
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true),
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true),
'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false),
'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'coppa_mail' => array('lang' => 'COPPA_MAIL', 'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true),
'coppa_fax' => array('lang' => 'COPPA_FAX', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false),
)
);
break;
@ -220,10 +219,10 @@ class acp_board
'title' => 'ACP_COOKIE_SETTINGS',
'vars' => array(
'legend1' => 'ACP_COOKIE_SETTINGS',
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'type' => 'text::255', 'explain' => false),
'cookie_name' => array('lang' => 'COOKIE_NAME', 'type' => 'text::16', 'explain' => false),
'cookie_path' => array('lang' => 'COOKIE_PATH', 'type' => 'text::255', 'explain' => false),
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:disabled_enabled', 'explain' => true)
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false),
'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true)
)
);
break;
@ -233,28 +232,28 @@ class acp_board
'title' => 'ACP_LOAD_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'limit_load' => array('lang' => 'LIMIT_LOAD', 'type' => 'text:4:4', 'explain' => true),
'session_length' => array('lang' => 'SESSION_LENGTH', 'type' => 'text:5:5', 'explain' => true),
'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'type' => 'text:4:4', 'explain' => true),
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'type' => 'text:4:3', 'explain' => true),
'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int', 'type' => 'text:4:3', 'explain' => true),
'legend2' => 'GENERAL_OPTIONS',
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true),
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true),
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false),
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'type' => 'radio:yes_no', 'explain' => true),
'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_online' => array('lang' => 'YES_ONLINE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'CUSTOM_PROFILE_FIELDS',
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
)
);
break;
@ -264,7 +263,7 @@ class acp_board
'title' => 'ACP_AUTH_SETTINGS',
'vars' => array(
'legend1' => 'ACP_AUTH_SETTINGS',
'auth_method' => array('lang' => 'AUTH_METHOD', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false)
)
);
break;
@ -274,20 +273,20 @@ class acp_board
'title' => 'ACP_SERVER_SETTINGS',
'vars' => array(
'legend1' => 'ACP_SERVER_SETTINGS',
'send_encoding' => array('lang' => 'SEND_ENCODING', 'type' => 'radio:yes_no', 'explain' => true),
'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'type' => 'radio:yes_no', 'explain' => false),
'send_encoding' => array('lang' => 'SEND_ENCODING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'legend2' => 'PATH_SETTINGS',
'smilies_path' => array('lang' => 'SMILIES_PATH', 'type' => 'text:20:255', 'explain' => true),
'icons_path' => array('lang' => 'ICONS_PATH', 'type' => 'text:20:255', 'explain' => true),
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'type' => 'text:20:255', 'explain' => true),
'ranks_path' => array('lang' => 'RANKS_PATH', 'type' => 'text:20:255', 'explain' => true),
'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
'legend3' => 'SERVER_URL_SETTINGS',
'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'type' => 'radio:yes_no', 'explain' => true),
'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true),
'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true),
'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true),
'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true),
'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
)
);
break;
@ -297,14 +296,16 @@ class acp_board
'title' => 'ACP_SECURITY_SETTINGS',
'vars' => array(
'legend1' => 'ACP_SECURITY_SETTINGS',
'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'type' => 'radio:yes_no', 'explain' => true),
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'type' => 'text:5:5', 'explain' => true),
'ip_check' => array('lang' => 'IP_VALID', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'type' => 'radio:yes_no', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'type' => 'text:3:3', 'explain' => true),
'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'type' => 'radio:yes_no', 'explain' => true),
'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
@ -314,28 +315,29 @@ class acp_board
'title' => 'ACP_EMAIL_SETTINGS',
'vars' => array(
'legend1' => 'GENERAL_SETTINGS',
'email_enable' => array('lang' => 'ENABLE_EMAIL', 'type' => 'radio:enabled_disabled', 'explain' => true),
'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'type' => 'radio:enabled_disabled', 'explain' => true),
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'type' => 'text:20:50', 'explain' => true),
'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'type' => 'text:5:5', 'explain' => true),
'board_contact' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => true),
'board_email' => array('lang' => 'ADMIN_EMAIL', 'type' => 'text:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'type' => 'radio:yes_no', 'explain' => true),
'email_enable' => array('lang' => 'ENABLE_EMAIL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true),
'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true),
'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'SMTP_SETTINGS',
'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true),
'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false),
'smtp_port' => array('lang' => 'SMTP_PORT', 'type' => 'text:4:5', 'explain' => true),
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true)
'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false),
'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int', 'type' => 'text:4:5', 'explain' => true),
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true)
)
);
break;
default:
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
if (isset($display_vars['lang']))
@ -345,6 +347,20 @@ class acp_board
$this->new_config = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : $this->new_config;
if (isset($_REQUEST['config']))
{
utf8_normalize_nfc(&$cfg_array);
}
$error = array();
// We validate the complete config if whished
validate_config_vars($display_vars['vars'], $cfg_array, $error);
// Do not write values if there is an error
if (sizeof($error))
{
$submit = false;
}
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
foreach ($display_vars['vars'] as $config_name => $null)
@ -448,14 +464,14 @@ class acp_board
{
set_config($config_name, $config_value);
}
trigger_error($error . adm_back_link($this->u_action));
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
set_config('auth_method', $cfg_array['auth_method']);
}
else
{
trigger_error('NO_AUTH_PLUGIN');
trigger_error('NO_AUTH_PLUGIN', E_USER_ERROR);
}
}
}
@ -473,6 +489,10 @@ class acp_board
$template->assign_vars(array(
'L_TITLE' => $user->lang[$display_vars['title']],
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
'S_ERROR' => (sizeof($error)) ? true : false,
'ERROR_MSG' => implode('<br />', $error),
'U_ACTION' => $this->u_action)
);

View file

@ -142,6 +142,12 @@ class acp_bots
}
$bot_row['bot_ip'] = str_replace(' ', '', $bot_row['bot_ip']);
// Make sure the admin is not adding a bot with an user agent similar to his one
if ($bot_row['bot_agent'] && substr($user->data['session_browser'], 0, 149) === substr($bot_row['bot_agent'], 0, 149))
{
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
}
if (!sizeof($error))
{
$db->sql_transaction('begin');
@ -159,7 +165,7 @@ class acp_bots
if (!$group_row)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));
trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
$user_id = user_add(array(
@ -197,7 +203,7 @@ class acp_bots
if (!$row)
{
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
@ -237,7 +243,7 @@ class acp_bots
if (!$bot_row)
{
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"));
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
$bot_row['bot_lang'] = $bot_row['user_lang'];

View file

@ -21,91 +21,37 @@ class acp_captcha
$user->add_lang('acp/board');
$config_vars = array('enable_confirm' => 'REG_ENABLE',
'enable_post_confirm' => 'POST_ENABLE',
'policy_overlap' => 'OVERLAP_ENABLE',
'policy_overlap_noise_pixel' => 'OVERLAP_NOISE_PIXEL',
'policy_overlap_noise_line' => 'OVERLAP_NOISE_LINE_ENABLE',
'policy_entropy' => 'ENTROPY_ENABLE',
'policy_entropy_noise_pixel' => 'ENTROPY_NOISE_PIXEL',
'policy_entropy_noise_line' => 'ENTROPY_NOISE_LINE_ENABLE',
'policy_shape' => 'SHAPE_ENABLE',
'policy_shape_noise_pixel' => 'SHAPE_NOISE_PIXEL',
'policy_shape_noise_line' => 'SHAPE_NOISE_LINE_ENABLE',
'policy_3dbitmap' => 'THREEDBITMAP_ENABLE',
'policy_cells' => 'CELLS_ENABLE',
'policy_stencil' => 'STENCIL_ENABLE',
'policy_composite' => 'COMPOSITE_ENABLE'
);
$config_vars = array(
'enable_confirm' => 'REG_ENABLE',
'enable_post_confirm' => 'POST_ENABLE',
'captcha_gd' => 'CAPTCHA_GD',
'captcha_gd_noise' => 'CAPTCHA_GD_NOISE',
);
$policy_modules = array('policy_entropy', 'policy_3dbitmap', 'policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite');
switch ($mode)
$this->tpl_name = 'acp_captcha';
$this->page_title = 'ACP_VC_SETTINGS';
$submit = request_var('submit', '');
if ($submit)
{
case 'visual':
$this->tpl_name = 'acp_captcha';
$this->page_title = 'ACP_VC_SETTINGS';
$submit = request_var('submit', '');
if ($submit)
{
$config_vars = array_keys($config_vars);
foreach ($config_vars as $config_var)
{
set_config($config_var, request_var($config_var, ''));
}
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
else
{
$array = array();
$config_vars = array_keys($config_vars);
foreach ($config_vars as $config_var)
{
set_config($config_var, request_var($config_var, ''));
}
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
else
{
$array = array();
foreach ($config_vars as $config_var => $template_var)
{
$array[$template_var] = $config[$config_var];
}
$template->assign_vars($array);
if (@extension_loaded('gd'))
{
$template->assign_var('GD', true);
foreach ($policy_modules as $module_name)
{
$template->assign_var('U_' . strtoupper($module_name), sprintf($user->lang['CAPTCHA_EXPLAIN'], '<a href="' . append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=captcha&amp;mode=img&amp;policy=' . $module_name) . '" target="_blank">', '</a>'));
}
if (function_exists('imagettfbbox') && function_exists('imagettftext'))
{
$template->assign_var('TTF', true);
}
}
}
break;
case 'img':
$policy = request_var('policy', '');
if (!@extension_loaded('gd'))
{
trigger_error($user->lang['NO_GD']);
}
if (!($policy === 'policy_entropy' || $policy === 'policy_3dbitmap') && (!function_exists('imagettfbbox') || !function_exists('imagettftext')))
{
trigger_error($user->lang['NO_TTF']);
}
if (!in_array($policy, $policy_modules))
{
trigger_error($user->lang['BAD_POLICY']);
}
$user->add_lang('ucp');
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
$captcha = new captcha();
$captcha->execute(gen_rand_string(), $policy);
break;
if (@extension_loaded('gd') && function_exists('imagettfbbox') && function_exists('imagettftext'))
{
$template->assign_var('GD', true);
}
foreach ($config_vars as $config_var => $template_var)
{
$template->assign_var($template_var, $config[$config_var]);
}
}
}
}

View file

@ -68,7 +68,9 @@ class acp_database
@set_time_limit(1200);
$filename = 'backup_' . time();
$time = time();
$filename = 'backup_' . $time;
// We set up the info needed for our on-the-fly creation :D
switch ($format)
@ -111,7 +113,7 @@ class acp_database
if (!$fp)
{
trigger_error('Unable to write temporary file to storage folder');
trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR);
}
}
@ -128,10 +130,10 @@ class acp_database
$sql_data .= "#\n";
$sql_data .= "# phpBB Backup Script\n";
$sql_data .= "# Dump of tables for $table_prefix\n";
$sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $filename) . " GMT\n";
$sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $time) . " GMT\n";
$sql_data .= "#\n";
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
$sql_data .= "BEGIN TRANSACTION;\n";
@ -149,12 +151,37 @@ class acp_database
break;
}
if ($structure && $db->sql_layer == 'firebird')
{
$sql = 'SELECT RDB$FUNCTION_NAME, RDB$DESCRIPTION
FROM RDB$FUNCTIONS
ORDER BY RDB$FUNCTION_NAME';
$result = $db->sql_query($sql);
$rows = array();
while ($row = $db->sql_fetchrow($result))
{
$sql = 'SELECT F.RDB$FUNCTION_NAME, F.RDB$MODULE_NAME, F.RDB$ENTRYPOINT, F.RDB$RETURN_ARGUMENT, F.RDB$DESCRIPTION, FA.RDB$ARGUMENT_POSITION, FA.RDB$MECHANISM, FA.RDB$FIELD_TYPE, FA.RDB$FIELD_SCALE, FA.RDB$FIELD_LENGTH, FA.RDB$FIELD_SUB_TYPE, C.RDB$BYTES_PER_CHARACTER, C.RDB$CHARACTER_SET_NAME ,FA.RDB$FIELD_PRECISION
FROM RDB$FUNCTIONS F
LEFT JOIN RDB$FUNCTION_ARGUMENTS FA ON F.RDB$FUNCTION_NAME = FA.RDB$FUNCTION_NAME
LEFT JOIN RDB$CHARACTER_SETS C ON FA.RDB$CHARACTER_SET_ID = C.RDB$CHARACTER_SET_ID
WHERE (F.RDB$FUNCTION_NAME = ' . $row['FUNCTION_NAME'] . ')
ORDER BY FA.RDB$ARGUMENT_POSITION';
$result2 = $db->sql_query($sql);
while ($row2 = $db->sql_fetchrow($result2))
{
}
$db->sql_freeresult($result2);
}
$db->sql_freeresult($result);
}
foreach ($table as $table_name)
{
// Get the table structure
if ($structure)
{
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysqli':
case 'mysql4':
@ -197,27 +224,12 @@ class acp_database
}
$sql_data .= $this->get_table_structure($table_name);
}
// We might wanna empty out all that junk :D
else
{
switch (SQL_LAYER)
{
case 'mysqli':
case 'mysql4':
case 'mysql':
case 'mssql':
case 'mssql_odbc':
case 'oracle':
case 'postgres':
case 'firebird':
$sql_data .= 'TRUNCATE TABLE ' . $table_name . ";\n";
break;
case 'sqlite':
$sql_data .= 'DELETE FROM ' . $table_name . ";\n";
break;
}
// We might wanna empty out all that junk :D
$sql_data .= (($db->sql_layer == 'sqlite') ? 'DELETE FROM ' : 'TRUNCATE TABLE ') . $table_name . ";\n";
}
// Now write the data for the first time. :)
if ($store == true)
{
@ -243,7 +255,7 @@ class acp_database
{
$sql_data .= "\n";
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysqli':
@ -263,8 +275,8 @@ class acp_database
$field_set[$j] = $field[$j]->name;
}
$search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a");
$replace = array('\\\\\\\\', "''", '\0', '\n', '\r', '\Z');
$search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
$replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
$fields = implode(', ', $field_set);
$values = array();
$schema_insert = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES (';
@ -336,8 +348,8 @@ class acp_database
$field_set[$j] = $field[$j]->name;
}
$search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a");
$replace = array('\\\\\\\\', "''", '\0', '\n', '\r', '\Z');
$search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
$replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
$fields = implode(', ', $field_set);
$schema_insert = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES (';
@ -406,7 +418,7 @@ class acp_database
$column_list = array();
$table_cols = explode(',', trim($matches[1]));
foreach($table_cols as $declaration)
foreach ($table_cols as $declaration)
{
$entities = preg_split('#\s+#', trim($declaration));
$column_name = preg_replace('/"?([^"]+)"?/', '\1', $entities[0]);
@ -442,7 +454,7 @@ class acp_database
{
$row_data = "''";
}
else if (strpos($col_types[$row_name], 'text') !== false || strpos($col_types[$row_name], 'char') !== false)
else if (strpos($col_types[$row_name], 'text') !== false || strpos($col_types[$row_name], 'char') !== false || strpos($col_types[$row_name], 'blob') !== false)
{
$row_data = "'" . $row_data . "'";
}
@ -516,7 +528,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|bytea#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@ -637,7 +649,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@ -748,7 +760,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@ -843,7 +855,7 @@ class acp_database
{
$str_val = $row[strtolower($ary_name[$i])];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@ -927,7 +939,7 @@ class acp_database
{
$str_val = $row[$ary_name[$i]];
if (preg_match('#char|text|bool#i', $ary_type[$i]))
if (preg_match('#char|text|bool|raw#i', $ary_type[$i]))
{
$str_quote = "'";
$str_empty = '';
@ -989,7 +1001,7 @@ class acp_database
}
}
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
case 'postgres':
@ -1024,12 +1036,12 @@ class acp_database
unset($sql_data);
add_log('admin', 'LOG_DB_BACKUP');
trigger_error($user->lang['BACKUP_SUCCESS']);
trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action));
break;
default:
$tables = array();
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
$sql = "SELECT name
@ -1167,13 +1179,13 @@ class acp_database
if (!(file_exists($file_name) && is_readable($file_name)))
{
trigger_error($user->lang['BACKUP_INVALID']);
trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($delete)
{
unlink($file_name);
trigger_error($user->lang['BACKUP_DELETE']);
trigger_error($user->lang['BACKUP_DELETE'] . adm_back_link($this->u_action));
}
$data = file_get_contents($file_name);
@ -1220,13 +1232,13 @@ class acp_database
remove_remarks($data);
// SQLite gets improved performance when you shove all of these disk write queries at once :D
if (SQL_LAYER == 'sqlite')
if ($db->sql_layer == 'sqlite')
{
$db->sql_query($data);
}
else
{
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'firebird':
$delim = ';;';
@ -1263,7 +1275,7 @@ class acp_database
}
}
add_log('admin', 'LOG_DB_RESTORE');
trigger_error($user->lang['RESTORE_SUCCESS']);
trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
break;
default:
@ -1324,7 +1336,7 @@ class acp_database
$sql_data = '';
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysqli':
case 'mysql4':
@ -1370,11 +1382,22 @@ class acp_database
{
$kname = $row['Key_name'];
if ($kname != 'PRIMARY' && $row['Non_unique'] == 0)
if ($kname != 'PRIMARY')
{
$kname = "UNIQUE|$kname";
if ($row['Index_type'] == 'FULLTEXT')
{
$kname = "FULLTEXT|$kname";
}
else if ($row['Non_unique'] == 0)
{
$kname = "UNIQUE|$kname";
}
}
if ($row['Sub_part'])
{
$row['Column_name'] .= '(' . $row['Sub_part'] . ')';
}
$index[$kname][] = $row['Column_name'];
}
$db->sql_freeresult($result);
@ -1391,6 +1414,10 @@ class acp_database
{
$line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')';
}
else if (strpos($key, 'FULLTEXT') === 0)
{
$line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')';
}
else
{
$line .= "KEY $key (" . implode(', ', $columns) . ')';

View file

@ -37,12 +37,14 @@ class acp_disallow
if (!$disallowed_user)
{
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
$db->sql_query($sql);
$cache->destroy('disallowed_usernames');
$message = $user->lang['DISALLOW_SUCCESSFUL'];
add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
@ -54,16 +56,18 @@ class acp_disallow
if (!$disallowed_id)
{
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'DELETE FROM ' . DISALLOW_TABLE . "
WHERE disallow_id = $disallowed_id";
$sql = 'DELETE FROM ' . DISALLOW_TABLE . '
WHERE disallow_id = ' . $disallowed_id;
$db->sql_query($sql);
$cache->destroy('disallowed_usernames');
add_log('admin', 'LOG_DISALLOW_DELETE');
trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Grab the current list of disallowed usernames...

View file

@ -28,7 +28,7 @@ class acp_email
$submit = (isset($_POST['submit'])) ? true : false;
$error = array();
$usernames = request_var('usernames', '');
$usernames = request_var('usernames', '', true);
$group_id = request_var('g', 0);
$subject = request_var('subject', '', true);
$message = request_var('message', '', true);
@ -57,7 +57,7 @@ class acp_email
{
$sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('username', explode("\n", $usernames)) . '
WHERE ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . '
AND user_allow_massemail = 1
ORDER BY user_lang, user_notify_type'; // , SUBSTRING(user_email FROM INSTR(user_email, '@'))
}
@ -87,7 +87,7 @@ class acp_email
if (!$row)
{
$db->sql_freeresult($result);
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$i = $j = 0;
@ -150,15 +150,13 @@ class acp_email
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->subject(html_entity_decode($subject));
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->replyto($config['board_email']);
$messenger->set_mail_priority($priority);
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'CONTACT_EMAIL' => $config['board_contact'],
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'MESSAGE' => html_entity_decode($message))
'MESSAGE' => htmlspecialchars_decode($message))
);
if (!($messenger->send($used_method)))
@ -185,12 +183,13 @@ class acp_email
if (!$errored)
{
$message = ($use_queue) ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
trigger_error($message . adm_back_link($this->u_action));
}
else
{
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=critical') . '">', '</a>');
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
trigger_error($message . adm_back_link($this->u_action));
}
}
@ -216,6 +215,7 @@ class acp_email
'S_GROUP_OPTIONS' => $select_list,
'USERNAMES' => $usernames,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames', false),
'SUBJECT' => $subject,
'MESSAGE' => $message,
'S_PRIORITY_OPTIONS' => $s_priority_options)

View file

@ -36,11 +36,19 @@ class acp_forums
// Check additional permissions
switch ($action)
{
case 'progress_bar':
$start = request_var('start', 0);
$total = request_var('total', 0);
$this->display_progress_bar($start, $total);
exit;
break;
case 'delete':
if (!$auth->acl_get('a_forumdel'))
{
trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
break;
@ -49,7 +57,7 @@ class acp_forums
if (!$auth->acl_get('a_forumadd'))
{
trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
break;
@ -94,23 +102,24 @@ class acp_forums
'forum_type' => request_var('forum_type', FORUM_POST),
'type_action' => request_var('type_action', ''),
'forum_status' => request_var('forum_status', ITEM_UNLOCKED),
'forum_parents' => '',
'forum_name' => request_var('forum_name', '', true),
'forum_link' => request_var('forum_link', ''),
'forum_link_track' => request_var('forum_link_track', false),
'forum_desc' => request_var('forum_desc', '', true),
'forum_desc_uid' => '',
'forum_desc_options' => 0,
'forum_desc_options' => 7,
'forum_desc_bitfield' => '',
'forum_rules' => request_var('forum_rules', '', true),
'forum_rules_uid' => '',
'forum_rules_options' => 0,
'forum_rules_options' => 7,
'forum_rules_bitfield' => '',
'forum_rules_link' => request_var('forum_rules_link', ''),
'forum_image' => request_var('forum_image', ''),
'forum_style' => request_var('forum_style', 0),
'display_on_index' => request_var('display_on_index', false),
'forum_topics_per_page' => request_var('topics_per_page', 0),
'enable_indexing' => request_var('enable_indexing',true),
'enable_indexing' => request_var('enable_indexing', true),
'enable_icons' => request_var('enable_icons', false),
'enable_prune' => request_var('enable_prune', false),
'enable_post_review' => request_var('enable_post_review', true),
@ -202,34 +211,8 @@ class acp_forums
$db->sql_freeresult($result);
// Now insert the data
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
if (sizeof($users_sql_ary))
{
$db->sql_query('INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $users_sql_ary));
}
if (sizeof($groups_sql_ary))
{
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary));
}
break;
default:
foreach ($users_sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
foreach ($groups_sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
$db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary);
$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
}
$auth->acl_clear_prefetch();
@ -265,7 +248,7 @@ class acp_forums
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT *
@ -277,7 +260,7 @@ class acp_forums
if (!$row)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$move_forum_name = $this->move_forum_by($row, $action, 1);
@ -293,7 +276,7 @@ class acp_forums
case 'sync':
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT forum_name, forum_type
@ -305,10 +288,76 @@ class acp_forums
if (!$row)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
sync('forum', 'forum_id', $forum_id, false, true);
$cache->destroy('sql', FORUMS_TABLE);
$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;f=$forum_id&amp;action=sync_topic";
meta_refresh(0, $url);
$sql = 'SELECT forum_topics_real
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$template->assign_vars(array(
'U_PROGRESS_BAR' => $this->u_action . '&amp;action=progress_bar',
'UA_PROGRESS_BAR' => str_replace('&amp;', '&', $this->u_action) . '&action=progress_bar',
'S_CONTINUE_SYNC' => true,
'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['forum_topics_real']))
);
// add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
return;
break;
case 'sync_topic':
@set_time_limit(0);
$sql = 'SELECT forum_name, forum_topics_real
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row['forum_topics_real'])
{
$start = request_var('start', 0);
$batch_size = 3000;
$end = $start + $batch_size;
// Sync all topics in batch mode...
sync('topic_approved', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false);
sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true);
if ($end < $row['forum_topics_real'])
{
$start += $batch_size;
$url = $this->u_action . "&amp;parent_id={$this->parent_id}&amp;f=$forum_id&amp;action=sync_topic&amp;start=$start&amp;total={$row['forum_topics_real']}";
meta_refresh(0, $url);
$template->assign_vars(array(
'U_PROGRESS_BAR' => $this->u_action . "&amp;action=progress_bar&amp;start=$start&amp;total={$row['forum_topics_real']}",
'UA_PROGRESS_BAR' => str_replace('&amp;', '&', $this->u_action) . "&action=progress_bar&start=$start&total={$row['forum_topics_real']}",
'S_CONTINUE_SYNC' => true,
'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $row['forum_topics_real']))
);
return;
}
}
sync('forum', 'forum_id', $forum_id);
add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
$cache->destroy('sql', FORUMS_TABLE);
@ -322,12 +371,12 @@ class acp_forums
if ($update)
{
$forum_data['forum_flags'] = 0;
$forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? 1 : 0;
$forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? 2 : 0;
$forum_data['forum_flags'] += (request_var('prune_announce', false)) ? 4 : 0;
$forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? 8 : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0;
$forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? 32 : 0;
$forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0;
$forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0;
$forum_data['forum_flags'] += (request_var('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0;
$forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
$forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0;
}
// Show form to create/modify a forum
@ -389,7 +438,7 @@ class acp_forums
'prune_days' => 7,
'prune_viewed' => 7,
'prune_freq' => 1,
'forum_flags' => 0,
'forum_flags' => FORUM_FLAG_POST_REVIEW,
'forum_password' => '',
'forum_password_confirm'=> '',
);
@ -543,12 +592,12 @@ class acp_forums
'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false,
'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false,
'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false,
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & 1) ? true : false,
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & 2) ? true : false,
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & 4) ? true : false,
'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & 8) ? true : false,
'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & 16) ? true : false,
'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & 32) ? true : false,
'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false,
'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false,
'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false,
'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_STICKY) ? true : false,
'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) ? true : false,
'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
)
);
@ -560,7 +609,7 @@ class acp_forums
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$forum_data = $this->get_forum_info($forum_id);
@ -634,7 +683,7 @@ class acp_forums
// Jumpbox
$forum_box = make_forum_select($this->parent_id, false, false, false, false); //make_forum_select($this->parent_id);
if ($action == 'sync')
if ($action == 'sync' || $action == 'sync_topic')
{
$template->assign_var('S_RESYNCED', true);
}
@ -677,6 +726,8 @@ class acp_forums
$template->assign_block_vars('forums', array(
'FOLDER_IMAGE' => $folder_image,
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'FORUM_TOPICS' => $row['forum_topics'],
@ -716,7 +767,10 @@ class acp_forums
'NAVIGATION' => $navigation,
'FORUM_BOX' => $forum_box,
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id)
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'U_PROGRESS_BAR' => $this->u_action . '&amp;action=progress_bar',
'UA_PROGRESS_BAR' => str_replace('&amp;', '&', $this->u_action) . '&action=progress_bar')
);
}
@ -779,12 +833,12 @@ class acp_forums
// 16 = show active topics
// 32 = enable post review
$forum_data['forum_flags'] = 0;
$forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? 1 : 0;
$forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? 2 : 0;
$forum_data['forum_flags'] += ($forum_data['prune_announce']) ? 4 : 0;
$forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? 8 : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0;
$forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? 32 : 0;
$forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? FORUM_FLAG_LINK_TRACK : 0;
$forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? FORUM_FLAG_PRUNE_POLL : 0;
$forum_data['forum_flags'] += ($forum_data['prune_announce']) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0;
$forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? FORUM_FLAG_PRUNE_STICKY : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
$forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? FORUM_FLAG_POST_REVIEW : 0;
// Unset data that are not database fields
$forum_data_sql = $forum_data;
@ -821,7 +875,7 @@ class acp_forums
if (!$row)
{
trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id));
trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . FORUMS_TABLE . '
@ -885,7 +939,8 @@ class acp_forums
return array($user->lang['NO_FORUM_ACTION']);
}
$forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = 0;
$forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0;
$forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = '';
}
if (sizeof($errors))
@ -1018,7 +1073,7 @@ class acp_forums
{
global $db;
$table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
$table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
foreach ($table_ary as $table)
{
@ -1121,6 +1176,14 @@ class acp_forums
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
}
else if ($action_subforums == 'move')
{
@ -1167,6 +1230,14 @@ class acp_forums
$sql = 'DELETE FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
}
}
@ -1181,6 +1252,14 @@ class acp_forums
$sql = 'DELETE FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . "
WHERE forum_id = $forum_id";
$db->sql_query($sql);
}
// Resync tree
@ -1290,7 +1369,21 @@ class acp_forums
delete_attachments('topic', $topic_ids, false);
switch (SQL_LAYER)
// Before we remove anything we make sure we are able to adjust the post counts later. ;)
$sql = 'SELECT poster_id
FROM ' . POSTS_TABLE . '
WHERE forum_id = ' . $forum_id . '
AND post_postcount = 1';
$result = $db->sql_query($sql);
$post_counts = array();
while ($row = $db->sql_fetchrow($result))
{
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
}
$db->sql_freeresult($result);
switch ($db->sql_layer)
{
case 'mysql4':
case 'mysqli':
@ -1365,18 +1458,18 @@ class acp_forums
foreach ($tables as $table)
{
$db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $id_list));
$db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $ids));
}
}
}
while ($row);
}
unset($ids, $id_list);
unset($ids);
break;
}
$table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
$table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE);
foreach ($table_ary as $table)
{
@ -1391,6 +1484,18 @@ class acp_forums
$db->sql_query("UPDATE $table SET forum_id = 0 WHERE forum_id = $forum_id");
}
// Adjust users post counts
if (sizeof($post_counts))
{
foreach ($post_counts as $poster_id => $substract)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_posts = user_posts - ' . $substract . '
WHERE user_id = ' . $poster_id;
$db->sql_query($sql);
}
}
$db->sql_transaction('commit');
// Make sure the overall post/topic count is correct...
@ -1513,6 +1618,27 @@ class acp_forums
return $target['forum_name'];
}
/**
* Display progress bar for syncinc forums
*/
function display_progress_bar($start, $total)
{
global $template, $user;
adm_page_header($user->lang['SYNC_IN_PROGRESS']);
$template->set_filenames(array(
'body' => 'progress_bar.html')
);
$template->assign_vars(array(
'L_PROGRESS' => $user->lang['SYNC_IN_PROGRESS'],
'L_PROGRESS_EXPLAIN' => ($start && $total) ? sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $total) : $user->lang['SYNC_IN_PROGRESS'])
);
adm_page_footer();
}
}
?>

View file

@ -30,7 +30,7 @@ class acp_groups
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
$group_id = request_var('g', 0);
$mark_ary = request_var('mark', array(0));
$name_ary = request_var('usernames', '');
$name_ary = request_var('usernames', '', true);
$leader = request_var('leader', 0);
$default = request_var('default', 0);
$start = request_var('start', 0);
@ -52,7 +52,7 @@ class acp_groups
if (!$group_row)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@ -64,11 +64,11 @@ class acp_groups
case 'promote':
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Approve, demote or promote
group_user_attributes($action, $group_id, $mark_ary, false, ($group_id) ? $group_row['group_name'] : false);
group_user_attributes($action, $group_id, $mark_ary, false, $group_row['group_name']);
switch ($action)
{
@ -85,13 +85,15 @@ class acp_groups
break;
}
group_update_listings($group_id);
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
break;
case 'default':
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@ -134,6 +136,8 @@ class acp_groups
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
}
group_update_listings($group_id);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
else
@ -155,7 +159,7 @@ class acp_groups
{
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$error = '';
@ -165,7 +169,7 @@ class acp_groups
case 'delete':
if (!$auth->acl_get('a_groupdel'))
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$error = group_delete($group_id, $group_row['group_name']);
@ -180,7 +184,7 @@ class acp_groups
if ($error)
{
trigger_error($user->lang[$error] . adm_back_link($back_link));
trigger_error($user->lang[$error] . adm_back_link($back_link), E_USER_WARNING);
}
$message = ($action == 'delete') ? 'GROUP_DELETED' : 'GROUP_USERS_REMOVE';
@ -201,12 +205,12 @@ class acp_groups
case 'addusers':
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$name_ary)
{
trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
}
$name_ary = array_unique(explode("\n", $name_ary));
@ -214,10 +218,10 @@ class acp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row))
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
}
$message = ($action == 'addleaders') ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';
$message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
break;
@ -228,12 +232,12 @@ class acp_groups
if ($action == 'edit' && !$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($action == 'add' && !$auth->acl_get('a_groupadd'))
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$error = array();
@ -313,7 +317,7 @@ class acp_groups
{
if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
{
avatar_delete($group_row['group_avatar']);
avatar_delete('group', $group_row);
}
}
@ -364,24 +368,7 @@ class acp_groups
$db->sql_freeresult($result);
// Now insert the data
if (sizeof($groups_sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary));
break;
default:
foreach ($groups_sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
$auth->acl_clear_prefetch();
}
@ -542,7 +529,7 @@ class acp_groups
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->page_title = 'GROUP_MEMBERS';
@ -614,6 +601,7 @@ class acp_groups
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames', false),
'U_DEFAULT_ALL' => "{$this->u_action}&amp;action=default&amp;g=$group_id")
);

View file

@ -60,7 +60,7 @@ class acp_icons
if ($action == 'edit' || $action == 'add' || $action == 'import')
{
$imglist = filelist($phpbb_root_path . $img_path, '');
foreach ($imglist as $path => $img_ary)
{
foreach ($img_ary as $img)
@ -108,6 +108,7 @@ class acp_icons
ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
$result = $db->sql_query($sql);
$data = array();
while ($row = $db->sql_fetchrow($result))
{
if ($action == 'add')
@ -135,14 +136,13 @@ class acp_icons
}
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
$order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
$order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
}
}
$db->sql_freeresult($result);
$order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list;
$data = array();
if ($action == 'add')
{
$data = $_images;
@ -242,11 +242,32 @@ class acp_icons
);
}
// Image_order holds the 'new' order value
if (!empty($image_order[$image]))
{
$img_sql = array_merge($img_sql, array(
$fields . '_order' => $image_order[$image] . '.5')
$fields . '_order' => $image_order[$image])
);
// Since we always add 'after' an item, we just need to increase all following + the current by one
$sql = "UPDATE $table
SET {$fields}_order = {$fields}_order + 1
WHERE {$fields}_order >= {$image_order[$image]}";
$db->sql_query($sql);
// If we adjust the order, we need to adjust all other orders too - they became inaccurate...
foreach ($image_order as $_image => $_order)
{
if ($_image == $image)
{
continue;
}
if ($_order >= $image_order[$image])
{
$image_order[$_image]++;
}
}
}
if ($action == 'modify')
@ -261,45 +282,6 @@ class acp_icons
$sql = "INSERT INTO $table " . $db->sql_build_array('INSERT', $img_sql);
$db->sql_query($sql);
}
$update = false;
if ($action == 'modify' && !empty($image_order[$image]))
{
$update = true;
$sql = "SELECT {$fields}_order
FROM $table
WHERE {$fields}_id = " . $image_id[$image];
$result = $db->sql_query($sql);
$order_old = (int) $db->sql_fetchfield($fields . '_order');
$db->sql_freeresult($result);
if ($order_old == $image_order[$image])
{
$update = false;
}
if ($order_old > $image_order[$image])
{
$sign = '+';
$where = $fields . '_order >= ' . $image_order[$image] . " AND {$fields}_order < $order_old";
}
else if ($order_old < $image_order[$image])
{
$sign = '-';
$where = "{$fields}_order > $order_old AND {$fields}_order < " . $image_order[$image];
$sql[$fields . '_order'] = $image_order[$image] - 1;
}
}
if ($update)
{
$sql = "UPDATE $table
SET {$fields}_order = {$fields}_order $sign 1
WHERE $where";
$db->sql_query($sql);
}
}
}
@ -329,7 +311,7 @@ class acp_icons
// The user has already selected a smilies_pak file
if ($current == 'delete')
{
$db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . $table);
$db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . $table);
switch ($mode)
{
@ -363,7 +345,7 @@ class acp_icons
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
{
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action));
trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
foreach ($pak_ary as $pak_entry)
@ -374,7 +356,7 @@ class acp_icons
if ((sizeof($data[1]) != 4 && $mode == 'icons') ||
(sizeof($data[1]) != 6 && $mode == 'smilies'))
{
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action));
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Stripslash here because it got addslashed before... (on export)
@ -523,7 +505,7 @@ class acp_icons
}
else
{
trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;
@ -562,14 +544,40 @@ class acp_icons
case 'move_up':
case 'move_down':
$image_order = request_var('order', 0);
$order_total = $image_order * 2 + (($action == 'move_up') ? -1 : 1);
// Get current order id...
$sql = "SELECT {$fields}_order as current_order
FROM $table
WHERE {$fields}_id = $icon_id";
$result = $db->sql_query($sql);
$current_order = (int) $db->sql_fetchfield('current_order');
$db->sql_freeresult($result);
$sql = 'UPDATE ' . $table . '
SET ' . $fields . "_order = $order_total - " . $fields . '_order
WHERE ' . $fields . "_order IN ($image_order, " . (($action == 'move_up') ? $image_order - 1 : $image_order + 1) . ')';
if ($current_order == 0 && $action == 'move_up')
{
break;
}
// on move_down, switch position with next order_id...
// on move_up, switch position with previous order_id...
$switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1;
//
$sql = "UPDATE $table
SET {$fields}_order = $current_order
WHERE {$fields}_order = $switch_order_id
AND {$fields}_id <> $icon_id";
$db->sql_query($sql);
// Only update the other entry too if the previous entry got updated
if ($db->sql_affectedrows())
{
$sql = "UPDATE $table
SET {$fields}_order = $switch_order_id
WHERE {$fields}_order = $current_order
AND {$fields}_id = $icon_id";
$db->sql_query($sql);
}
$cache->destroy('icons');
$cache->destroy('sql', $table);
@ -640,8 +648,8 @@ class acp_icons
'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '',
'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;order=' . $row[$fields . '_order'],
'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;order=' . $row[$fields . '_order'])
'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'],
'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'])
);
if (!$spacer && !$row['display_on_posting'])

View file

@ -0,0 +1,184 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2006 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package acp
*/
class acp_inactive
{
var $u_action;
var $p_master;
function acp_inactive(&$p_master)
{
$this->p_master = &$p_master;
}
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$user->add_lang('memberlist');
$action = request_var('action', '');
$mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array();
$start = request_var('start', 0);
// Sort keys
$sort_days = request_var('st', 0);
$sort_key = request_var('sk', 'i');
$sort_dir = request_var('sd', 'd');
if (sizeof($mark))
{
switch ($action)
{
case 'activate':
case 'delete':
$sql = 'SELECT username
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark);
$result = $db->sql_query($sql);
$user_affected = array();
while ($row = $db->sql_fetchrow($result))
{
$user_affected[] = $row['username'];
}
$db->sql_freeresult($result);
if ($action == 'activate')
{
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
user_active_flip('activate', $mark);
}
else if ($action == 'delete')
{
if (!$auth->acl_get('a_userdel'))
{
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
$db->sql_query($sql);
add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
}
break;
case 'remind':
if (empty($config['email_enable']))
{
trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark);
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
$board_url = generate_board_url() . "/ucp.$phpEx?mode=activate";
$usernames = array();
do
{
$messenger->template('user_remind_inactive', $row['user_lang']);
$messenger->replyto($config['board_email']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username']),
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
);
$messenger->send($row['user_notify_type']);
$usernames[] = $row['username'];
}
while ($row = $db->sql_fetchrow($result));
$messenger->save_queue();
add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
unset($usernames);
}
$db->sql_freeresult($result);
break;
}
}
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']);
$sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
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);
// Define where and sort sql for use in displaying logs
$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
$inactive = array();
$inactive_count = 0;
view_inactive_users($inactive, $inactive_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
foreach ($inactive as $row)
{
$template->assign_block_vars('inactive', array(
'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
'JOINED' => $user->format_date($row['user_regdate']),
'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
$option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE');
if ($config['email_enable'])
{
$option_ary += array('remind' => 'REMIND');
}
$template->assign_vars(array(
'S_INACTIVE_USERS' => true,
'S_INACTIVE_OPTIONS' => build_select($option_ary),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
'S_ON_PAGE' => on_page($inactive_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true),
));
$this->tpl_name = 'acp_inactive';
$this->page_title = 'ACP_INACTIVE_USERS';
}
}
?>

View file

@ -44,16 +44,9 @@ class acp_jabber
$jab_resource = request_var('jab_resource', $config['jab_resource']);
$jab_package_size = request_var('jab_package_size', $config['jab_package_size']);
$jabber = new jabber();
$jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_resource);
$error = array();
// Setup the basis vars for jabber connection
$jabber->server = $jab_host;
$jabber->port = ($jab_port) ? $jab_port : 5222;
$jabber->username = $jab_username;
$jabber->password = $jab_password;
$jabber->resource = $jab_resource;
$message = $user->lang['JAB_SETTINGS_CHANGED'];
$log = 'JAB_SETTINGS_CHANGED';
@ -65,7 +58,7 @@ class acp_jabber
{
if (!$jabber->connect())
{
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action));
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// First we'll try to authorise using this account, if that fails we'll try to create it.
@ -94,12 +87,12 @@ class acp_jabber
{
if (!$jabber->connect())
{
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action));
trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$jabber->send_auth())
{
trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action));
trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$jabber->send_presence(NULL, NULL, 'online');

View file

@ -47,8 +47,10 @@ class acp_language
$missing_file = request_var('missing_file', array('' => 0));
list($_REQUEST['language_file'], ) = array_keys($missing_file);
}
list($this->language_directory, $this->language_file) = explode('|', request_var('language_file', '|common.' . $phpEx));
$selected_lang_file = request_var('language_file', '|common.' . $phpEx);
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
$this->language_directory = basename($this->language_directory);
$this->language_file = basename($this->language_file);
@ -76,7 +78,8 @@ class acp_language
break;
default:
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
break;
}
$test_connection = $transfer->open_session();
@ -124,7 +127,7 @@ class acp_language
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -153,14 +156,14 @@ class acp_language
case 'download_file':
case 'upload_data':
if (!$lang_id || !isset($_POST['entry']) || !is_array($_POST['entry']))
if (!$lang_id || empty($_POST['entry']))
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$this->language_file || (!$this->language_directory && !in_array($this->language_file, $this->main_files)))
{
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -187,7 +190,7 @@ class acp_language
{
if (!@mkdir($dir, 0777))
{
trigger_error("Could not create directory $dir");
trigger_error("Could not create directory $dir", E_USER_ERROR);
}
@chmod($dir, 0777);
}
@ -200,7 +203,7 @@ class acp_language
if (!$fp)
{
trigger_error($user->lang['UNABLE_TO_WRITE_FILE']);
trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
}
if ($this->language_directory == 'email')
@ -284,6 +287,8 @@ class acp_language
$file = request_var('file', '');
$dir = request_var('dir', '');
$selected_lang_file = $dir . '|' . $file;
$old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true);
$lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : '');
@ -301,12 +306,13 @@ class acp_language
break;
default:
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
break;
}
if (($result = $transfer->open_session()) !== true)
{
trigger_error($user->lang[$result] . adm_back_link($this->u_action));
trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
}
$transfer->rename($lang_path . $file, $lang_path . $file . '.bak');
@ -318,7 +324,7 @@ class acp_language
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
trigger_error($user->lang['UPLOAD_COMPLETED']);
trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)));
}
$action = 'details';
@ -329,7 +335,7 @@ class acp_language
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->page_title = 'LANGUAGE_PACK_DETAILS';
@ -362,28 +368,28 @@ class acp_language
case 'email':
if (!in_array($this->language_file, $email_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
break;
case 'acp':
if (!in_array($this->language_file, $acp_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
break;
case 'mods':
if (!in_array($this->language_file, $mods_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
break;
default:
if (!in_array($this->language_file, $this->main_files))
{
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
}
}
@ -491,7 +497,7 @@ class acp_language
'S_MISSING_FILES' => true,
'L_MISSING_FILES' => sprintf($user->lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']),
'MISSING_FILES' => implode('<br />', $missing_files))
);
);
}
if ($is_missing_var)
@ -500,7 +506,7 @@ class acp_language
'S_MISSING_VARS' => true,
'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
'U_MISSING_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id")
);
);
foreach ($missing_vars as $file => $vars)
{
@ -532,7 +538,7 @@ class acp_language
$selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : '';
$s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
}
// Help Files
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
foreach ($this->main_files as $file)
@ -559,7 +565,7 @@ class acp_language
}
$s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
foreach (${$check . '_files'} as $file)
{
$prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : '';
@ -599,6 +605,7 @@ class acp_language
unset($help);
}
}
$print_message = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file;
}
@ -611,7 +618,7 @@ class acp_language
'PRINT_MESSAGE' => $print_message,
)
);
if (!$is_email_file)
{
$method = ($is_help_file) ? 'print_help_entries' : 'print_language_entries';
@ -622,7 +629,7 @@ class acp_language
{
$tpl .= $this->$method($missing_vars[$name], '* ');
}
$tpl .= $this->$method($lang);
$template->assign_var('TPL', $tpl);
@ -633,20 +640,21 @@ class acp_language
$template->assign_vars(array(
'LANG' => $lang)
);
unset($lang);
}
return;
break;
case 'delete':
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
FROM ' . LANG_TABLE . '
WHERE lang_id = ' . $lang_id;
@ -656,18 +664,18 @@ class acp_language
if ($row['lang_iso'] == $config['default_lang'])
{
trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_lang = '{$config['default_lang']}'
WHERE user_lang = '{$row['lang_iso']}'";
SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
$db->sql_query($sql);
add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
break;
@ -677,7 +685,7 @@ class acp_language
if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
{
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action));
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
@ -685,8 +693,8 @@ class acp_language
$lang_pack = array(
'iso' => $lang_iso,
'name' => trim(htmlspecialchars($file[0])),
'local_name'=> trim(htmlspecialchars($file[1])),
'author' => trim(htmlspecialchars($file[2]))
'local_name'=> trim(htmlspecialchars($file[1], ENT_COMPAT, 'UTF-8')),
'author' => trim(htmlspecialchars($file[2], ENT_COMPAT, 'UTF-8'))
);
unset($file);
@ -694,18 +702,19 @@ class acp_language
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action));
}
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$lang_pack['name'] || !$lang_pack['local_name'])
{
trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action));
trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Add language pack
$sql_ary = array(
'lang_iso' => $lang_pack['iso'],
@ -716,18 +725,18 @@ class acp_language
);
$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
break;
case 'download':
if (!$lang_id)
{
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -747,7 +756,7 @@ class acp_language
{
continue;
}
$methods[] = $type;
}
@ -768,7 +777,7 @@ class acp_language
'U_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id",
'RADIO_BUTTONS' => $radio_buttons)
);
return;
}
@ -820,9 +829,9 @@ class acp_language
$this->add_to_archive($compress, $mod_files, $row['lang_iso'], 'mods');
// Write ISO File
$iso_src = html_entity_decode($row['lang_english_name']) . "\n";
$iso_src .= html_entity_decode($row['lang_local_name']) . "\n";
$iso_src .= html_entity_decode($row['lang_author']);
$iso_src = htmlspecialchars_decode($row['lang_english_name']) . "\n";
$iso_src .= htmlspecialchars_decode($row['lang_local_name']) . "\n";
$iso_src .= htmlspecialchars_decode($row['lang_author']);
$compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt');
// index.html files
@ -838,7 +847,7 @@ class acp_language
$compress->close();
$compress->download('lang_' . $row['lang_iso']);
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . '.' . $use_method);
@unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method);
exit;
@ -870,18 +879,16 @@ class acp_language
$tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : '';
$template->assign_block_vars('lang', array(
'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
'ENGLISH_NAME' => $row['lang_english_name'],
'TAG' => $tagstyle,
'LOCAL_NAME' => $row['lang_local_name'],
'ISO' => $row['lang_iso'],
'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0,
)
);
'ENGLISH_NAME' => $row['lang_english_name'],
'TAG' => $tagstyle,
'LOCAL_NAME' => $row['lang_local_name'],
'ISO' => $row['lang_iso'],
'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0,
));
}
$db->sql_freeresult($result);
@ -890,7 +897,7 @@ class acp_language
while (($file = readdir($dp)) !== false)
{
if ($file{0} != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
{
if (!in_array($file, $installed))
{
@ -917,14 +924,14 @@ class acp_language
foreach ($new_ary as $iso => $lang_ary)
{
$template->assign_block_vars('notinst', array(
'ISO' => $lang_ary['iso'],
'LOCAL_NAME' => $lang_ary['local_name'],
'NAME' => $lang_ary['name'],
'ISO' => htmlspecialchars($lang_ary['iso']),
'LOCAL_NAME' => htmlspecialchars($lang_ary['local_name'], ENT_COMPAT, 'UTF-8'),
'NAME' => htmlspecialchars($lang_ary['name'], ENT_COMPAT, 'UTF-8'),
'U_INSTALL' => $this->u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']))
);
}
}
unset($new_ary);
}
@ -942,7 +949,7 @@ class acp_language
* {FILENAME} [{LANG_NAME}]
*
* @package language
* @copyright (c) 2005 phpBB Group
* @copyright (c) 2006 phpBB Group
* @author {CHANGED} - {AUTHOR}
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@ -958,6 +965,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// \'Page %s of %s\' you can (and should) write \'Page %1$s of %2$s\', this allows
// translators to re-order the output of data while ensuring it remains correct
@ -1032,7 +1041,7 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($value as $_key => $_value)
@ -1041,23 +1050,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row3" colspan="2">' . $key_prefix . '&nbsp; &nbsp;<b>' . $_key . '</b></td>
<td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '&nbsp; &nbsp;<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($_value as $__key => $__value)
{
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $__key . '</b></td>
<td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
$tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . '][' . $__key . ']" value="' . htmlspecialchars($__value) . '" size="50" />';
$tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
$tpl .= '<b>' . htmlspecialchars($__value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@ -1068,16 +1077,16 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td>
<td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
$tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . ']" value="' . htmlspecialchars($_value) . '" size="50" />';
$tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
$tpl .= '<b>' . htmlspecialchars($_value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@ -1094,16 +1103,16 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($input_field)
{
$tpl .= '<input type="text" name="entry[' . $key . ']" value="' . htmlspecialchars($value) . '" size="50" />';
$tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" size="50" />';
}
else
{
$tpl .= '<b>' . htmlspecialchars($value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@ -1127,23 +1136,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
</tr>';
foreach ($value as $_key => $_value)
{
$tpl .= '
<tr>
<td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td>
<td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($text_field)
{
$tpl .= '<textarea name="entry[' . $key . '][' . $_key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value) . '</textarea>';
$tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</textarea>';
}
else
{
$tpl .= '<b>' . htmlspecialchars($_value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
@ -1159,23 +1168,23 @@ $lang = array_merge($lang, array(
{
$tpl .= '
<tr>
<td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td>
<td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td>
<td class="row2">';
if ($text_field)
{
$tpl .= '<textarea name="entry[' . $key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value) . '</textarea>';
$tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</textarea>';
}
else
{
$tpl .= '<b>' . htmlspecialchars($value) . '</b>';
$tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>';
}
$tpl .= '</td>
</tr>';
}
}
return $tpl;
}

View file

@ -20,131 +20,43 @@ class acp_main
global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
$mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array();
if (sizeof($mark))
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
{
switch ($action)
{
case 'activate':
case 'delete':
$this->tpl_name = 'acp_main';
$this->page_title = 'ACP_MAIN';
if (!$auth->acl_get('a_user'))
{
trigger_error($user->lang['NO_ADMIN']);
}
$sql = 'SELECT user_id, username, user_colour
FROM ' . USERS_TABLE . '
WHERE user_id = ' . $user->data['user_perm_from'];
$result = $db->sql_query($sql);
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT username
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark);
$result = $db->sql_query($sql);
$user_affected = array();
while ($row = $db->sql_fetchrow($result))
{
$user_affected[] = $row['username'];
}
$db->sql_freeresult($result);
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $user_row['user_id']) . '">' : '';
$perm_from .= $user_row['username'];
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
$perm_from .= '</strong>';
if ($action == 'activate')
{
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$template->assign_vars(array(
'S_RESTORE_PERMISSIONS' => true,
'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'),
'PERM_FROM' => $perm_from,
'L_PERMISSIONS_TRANSFERED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')),
));
foreach ($mark as $user_id)
{
user_active_flip($user_id, USER_INACTIVE);
}
set_config('num_users', $config['num_users'] + sizeof($mark), true);
// Update latest username
update_last_username();
}
else if ($action == 'delete')
{
if (!$auth->acl_get('a_userdel'))
{
trigger_error($user->lang['NO_ADMIN']);
}
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark);
$db->sql_query($sql);
add_log('admin', 'LOG_INDEX_' . strtoupper($action), implode(', ', $user_affected));
}
break;
case 'remind':
if (!$auth->acl_get('a_user'))
{
trigger_error($user->lang['NO_ADMIN']);
}
if (empty($config['email_enable']))
{
trigger_error($user->lang['EMAIL_DISABLED']);
}
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $mark);
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
// Send the messages
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$messenger = new messenger();
$board_url = generate_board_url() . "/ucp.$phpEx?mode=activate";
$sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
$usernames = array();
do
{
$messenger->template('user_remind_inactive', $row['user_lang']);
$messenger->replyto($config['board_email']);
$messenger->to($row['user_email'], $row['username']);
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
'EMAIL_SIG' => $sig,
'USERNAME' => html_entity_decode($row['username']),
'SITENAME' => $config['sitename'],
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
);
$messenger->send($row['user_notify_type']);
$usernames[] = $row['username'];
}
while ($row = $db->sql_fetchrow($result));
$messenger->save_queue();
add_log('admin', 'LOG_INDEX_REMIND', implode(', ', $usernames));
unset($usernames);
}
$db->sql_freeresult($result);
break;
}
return;
}
$action = request_var('action', '');
switch ($action)
{
case 'online':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('record_online_users', 1, true);
@ -155,47 +67,47 @@ class acp_main
case 'stats':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT COUNT(post_id) AS stat
FROM ' . POSTS_TABLE . '
WHERE post_approved = 1';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_posts', (int) $row['stat'], true);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
WHERE topic_approved = 1';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_topics', (int) $row['stat'], true);
$sql = 'SELECT COUNT(user_id) AS stat
FROM ' . USERS_TABLE . '
WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
set_config('num_users', (int) $row['stat'], true);
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE;
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
$sql = 'SELECT SUM(filesize) as stat
FROM ' . ATTACHMENTS_TABLE;
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true);
$db->sql_freeresult($result);
@ -205,7 +117,7 @@ class acp_main
case 'user':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
@ -227,7 +139,7 @@ class acp_main
case 'date':
if (!$auth->acl_get('a_board'))
{
trigger_error($user->lang['NO_ADMIN']);
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
set_config('board_startdate', time() - 1);
@ -235,7 +147,7 @@ class acp_main
break;
case 'db_track':
$db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . TOPICS_POSTED_TABLE);
$db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . TOPICS_POSTED_TABLE);
// This can get really nasty... therefore we only do the last six months
$get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60);
@ -290,24 +202,7 @@ class acp_main
}
unset($posted);
if (sizeof($sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
}
add_log('admin', 'LOG_RESYNC_POST_MARKING');
@ -337,7 +232,7 @@ class acp_main
{
while (($file = readdir($avatar_dir)) !== false)
{
if ($file{0} != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false)
{
$avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
}
@ -375,6 +270,21 @@ class acp_main
$files_per_day = $total_files;
}
if ($config['allow_attachments'] || $config['allow_pm_attach'])
{
$sql = 'SELECT COUNT(attach_id) AS total_orphan
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 1
AND filetime < ' . (time() - 3*60*60);
$result = $db->sql_query($sql);
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
$db->sql_freeresult($result);
}
else
{
$total_orphan = false;
}
$dbsize = get_database_size();
$s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING'));
@ -391,11 +301,14 @@ class acp_main
'AVATAR_DIR_SIZE' => $avatar_dir_size,
'DBSIZE' => $dbsize,
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'TOTAL_ORPHAN' => $total_orphan,
'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true,
'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
'DATABASE_INFO' => $db->sql_server_info(),
'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"),
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '',
)
@ -421,17 +334,18 @@ class acp_main
if ($auth->acl_get('a_user'))
{
$sql = 'SELECT user_id, username, user_regdate, user_lastvisit
FROM ' . USERS_TABLE . '
WHERE user_type = ' . USER_INACTIVE . '
ORDER BY user_regdate ASC';
$result = $db->sql_query($sql);
$inactive = array();
$inactive_count = 0;
while ($row = $db->sql_fetchrow($result))
view_inactive_users($inactive, $inactive_count, 10);
foreach ($inactive as $row)
{
$template->assign_block_vars('inactive', array(
'DATE' => $user->format_date($row['user_regdate']),
'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
'JOINED' => $user->format_date($row['user_regdate']),
'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
'REASON' => $row['inactive_reason'],
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
@ -450,12 +364,6 @@ class acp_main
);
}
// Display debug_extra notice
if (defined('DEBUG_EXTRA'))
{
$template->assign_var('S_DEBUG_EXTRA', true);
}
// Warn if install is still present
if (file_exists($phpbb_root_path . 'install'))
{

View file

@ -24,6 +24,7 @@
class acp_modules
{
var $module_class = '';
var $parent_id;
var $u_action;
function main($id, $mode)
@ -51,7 +52,7 @@ class acp_modules
$this->page_title = strtoupper($this->module_class);
$parent_id = request_var('parent_id', 0);
$this->parent_id = request_var('parent_id', 0);
$module_id = request_var('m', 0);
$action = request_var('action', '');
$errors = array();
@ -61,9 +62,9 @@ class acp_modules
case 'delete':
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
if (confirm_box(true))
{
$errors = $this->delete_module($module_id);
@ -71,7 +72,7 @@ class acp_modules
if (!sizeof($errors))
{
$this->remove_cache_file();
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
else
@ -79,7 +80,7 @@ class acp_modules
confirm_box(false, 'DELETE_MODULE', build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'parent_id' => $parent_id,
'parent_id' => $this->parent_id,
'module_id' => $module_id,
'action' => $action,
)));
@ -91,9 +92,9 @@ class acp_modules
case 'disable':
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . MODULES_TABLE . '
SET module_enabled = ' . (($action == 'enable') ? 1 : 0) . "
WHERE module_id = $module_id";
@ -108,7 +109,7 @@ class acp_modules
case 'move_down':
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'SELECT *
@ -121,7 +122,7 @@ class acp_modules
if (!$row)
{
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$move_module_name = $this->move_module_by($row, $action, 1);
@ -156,7 +157,7 @@ class acp_modules
'module_basename' => $module_basename,
'module_enabled' => 0,
'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1,
'parent_id' => $parent_id,
'parent_id' => $this->parent_id,
'module_class' => $this->module_class,
'module_langname' => $fileinfo['modes'][$module_mode]['title'],
'module_mode' => $module_mode,
@ -169,7 +170,7 @@ class acp_modules
{
$this->remove_cache_file();
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
}
@ -178,7 +179,7 @@ class acp_modules
confirm_box(false, 'ADD_MODULE', build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'parent_id' => $parent_id,
'parent_id' => $this->parent_id,
'action' => 'quickadd',
'quick_install' => $quick_install,
)));
@ -190,7 +191,7 @@ class acp_modules
if (!$module_id)
{
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$module_row = $this->get_module_row($module_id);
@ -228,7 +229,7 @@ class acp_modules
{
if (!$module_data['module_langname'])
{
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$module_type = request_var('module_type', 'category');
@ -257,7 +258,7 @@ class acp_modules
{
$this->remove_cache_file();
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
}
@ -306,8 +307,8 @@ class acp_modules
'S_CAT_OPTIONS' => $s_cat_option . $this->make_module_select($module_data['parent_id'], ($action == 'edit') ? $module_row['module_id'] : false, false, false, false, true),
'S_MODULE_NAMES' => $s_name_options,
'S_MODULE_MODES' => $s_mode_options,
'U_BACK' => $this->u_action . '&amp;parent_id=' . $parent_id,
'U_EDIT_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
'U_BACK' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'U_EDIT_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
@ -341,7 +342,7 @@ class acp_modules
);
}
if (!$parent_id)
if (!$this->parent_id)
{
$navigation = strtoupper($this->module_class);
}
@ -349,12 +350,13 @@ class acp_modules
{
$navigation = '<a href="' . $this->u_action . '">' . strtoupper($this->module_class) . '</a>';
$modules_nav = $this->get_module_branch($parent_id, 'parents', 'descending');
$modules_nav = $this->get_module_branch($this->parent_id, 'parents', 'descending');
foreach ($modules_nav as $row)
{
$langname = $this->lang_name($row['module_langname']);
if ($row['module_id'] == $parent_id)
if ($row['module_id'] == $this->parent_id)
{
$navigation .= ' -&gt; ' . $langname;
}
@ -366,11 +368,11 @@ class acp_modules
}
// Jumpbox
$module_box = $this->make_module_select($parent_id, false, false, false, false);
$module_box = $this->make_module_select($this->parent_id, false, false, false, false);
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE parent_id = $parent_id
WHERE parent_id = {$this->parent_id}
AND module_class = '" . $db->sql_escape($this->module_class) . "'
ORDER BY left_id";
$result = $db->sql_query($sql);
@ -390,14 +392,17 @@ class acp_modules
$module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />';
}
$url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
$template->assign_block_vars('modules', array(
'MODULE_IMAGE' => $module_image,
'MODULE_TITLE' => $langname,
'MODULE_ENABLED' => ($row['module_enabled']) ? true : false,
'MODULE_DISPLAYED' => ($row['module_display']) ? true : false,
'S_ACP_CAT_SYSTEM' => ($this->module_class == 'acp' && $row['module_langname'] == 'ACP_CAT_SYSTEM') ? true : false,
'S_ACP_MODULE_MANAGEMENT' => ($this->module_class == 'acp' && ($row['module_basename'] == 'modules' || $row['module_langname'] == 'ACP_MODULE_MANAGEMENT')) ? true : false,
'U_MODULE' => $this->u_action . '&amp;parent_id=' . $row['module_id'],
'U_MOVE_UP' => $url . '&amp;action=move_up',
'U_MOVE_DOWN' => $url . '&amp;action=move_down',
@ -409,11 +414,11 @@ class acp_modules
}
while ($row = $db->sql_fetchrow($result));
}
else if ($parent_id)
else if ($this->parent_id)
{
$row = $this->get_module_row($parent_id);
$row = $this->get_module_row($this->parent_id);
$url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
$template->assign_vars(array(
'S_NO_MODULES' => true,
@ -449,11 +454,11 @@ class acp_modules
}
$template->assign_vars(array(
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
'NAVIGATION' => $navigation,
'MODULE_BOX' => $module_box,
'PARENT_ID' => $parent_id,
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id,
'NAVIGATION' => $navigation,
'MODULE_BOX' => $module_box,
'PARENT_ID' => $this->parent_id,
'S_INSTALL_OPTIONS' => $s_install_options,
)
);
@ -476,7 +481,7 @@ class acp_modules
if (!$row)
{
trigger_error($user->lang['NO_MODULE']);
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
return $row;
@ -721,7 +726,7 @@ class acp_modules
return 'PARENT_NO_EXIST';
}
trigger_error($user->lang['PARENT_NO_EXIST']);
trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
$sql = 'UPDATE ' . MODULES_TABLE . "
@ -1007,6 +1012,14 @@ class acp_modules
return $this->lang_name($target['module_langname']);
}
/**
* Check if the module or her childs hold the management module(s)
*/
function is_management_module($module_id)
{
}
}
?>

View file

@ -26,7 +26,7 @@ class acp_permission_roles
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
$user->add_lang('acp/permissions_phpbb');
add_permission_language();
$this->tpl_name = 'acp_permission_roles';
@ -58,7 +58,8 @@ class acp_permission_roles
break;
default:
trigger_error('INVALID_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
$template->assign_vars(array(
@ -75,7 +76,7 @@ class acp_permission_roles
if (!$role_id)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -87,7 +88,7 @@ class acp_permission_roles
if (!$role_row)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@ -112,7 +113,7 @@ class acp_permission_roles
case 'edit':
if (!$role_id)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Get role we edit
@ -125,7 +126,7 @@ class acp_permission_roles
if (!$role_row)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// no break;
@ -138,22 +139,22 @@ class acp_permission_roles
if (!$role_name)
{
trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// if we add/edit a role we check the name to be unique among the settings...
$sql = 'SELECT role_id
FROM ' . ACL_ROLES_TABLE . "
WHERE role_type = '" . $db->sql_escape($permission_type) . "'
AND LOWER(role_name) = '" . $db->sql_escape(strtolower($role_name)) . "'";
AND role_name = '" . $db->sql_escape($role_name) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Make sure we only print out the error if we add the role or change it's name
if ($row && ($mode == 'add' || ($mode == 'edit' && strtolower($role_row['role_name']) != strtolower($role_name))))
if ($row && ($mode == 'add' || ($mode == 'edit' && $role_row['role_name'] != $role_name)))
{
trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action));
trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary = array(
@ -252,7 +253,7 @@ class acp_permission_roles
{
if (!$role_id)
{
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -279,7 +280,7 @@ class acp_permission_roles
if (!$role_row)
{
trigger_error($user->lang['NO_PRESET_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$template->assign_vars(array(

View file

@ -27,7 +27,7 @@ class acp_permissions
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
$user->add_lang('acp/permissions_phpbb');
add_permission_language();
$this->tpl_name = 'acp_permissions';
@ -47,7 +47,7 @@ class acp_permissions
return;
}
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
}
// Set some vars
@ -59,8 +59,8 @@ class acp_permissions
$subforum_id = request_var('subforum_id', 0);
$forum_id = request_var('forum_id', array(0));
$username = request_var('username', array(''));
$usernames = request_var('usernames', '');
$username = request_var('username', array(''), true);
$usernames = request_var('usernames', '', true);
$user_id = request_var('user_id', array(0));
$group_id = request_var('group_id', array(0));
@ -70,7 +70,7 @@ class acp_permissions
if ($select_all_groups)
{
// Add default groups to selection
$sql_and = (!$config['coppa_enable']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
$sql_and = (!$config['coppa_enable']) ? " AND group_name <> 'REGISTERED_COPPA'" : '';
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . '
@ -98,7 +98,7 @@ class acp_permissions
if (!sizeof($user_id))
{
trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action));
trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
unset($username);
@ -190,7 +190,8 @@ class acp_permissions
break;
default:
trigger_error('INVALID_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
break;
}
$template->assign_vars(array(
@ -203,7 +204,7 @@ class acp_permissions
if (!in_array($permission_type, $this->permission_dropdown))
{
trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action));
trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
@ -237,14 +238,14 @@ class acp_permissions
}
else
{
trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;
case 'apply_permissions':
if (!isset($_POST['setting']))
{
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->set_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id);
@ -253,7 +254,7 @@ class acp_permissions
case 'apply_all_permissions':
if (!isset($_POST['setting']))
{
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->set_all_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id);
@ -330,7 +331,8 @@ class acp_permissions
$template->assign_vars(array(
'S_SELECT_USER' => true,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username'))
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username', false))
);
break;
@ -392,17 +394,23 @@ class acp_permissions
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids']),
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username'))
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username', false))
);
break;
}
// The S_ALLOW_SELECT parameter below is a measure to lower memory usage.
// If there are more than 5 forums selected the admin is not able to select all users/groups too.
// We need to see if the number of forums can be increased or need to be decreased.
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
'ANONYMOUS_USER_ID' => ANONYMOUS,
'S_SELECT_VICTIM' => true,
'S_ALLOW_ALL_SELECT' => (sizeof($forum_id) > 5) ? false : true,
'S_CAN_SELECT_USER' => ($auth->acl_get('a_authusers')) ? true : false,
'S_CAN_SELECT_GROUP' => ($auth->acl_get('a_authgroups')) ? true : false,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@ -436,7 +444,7 @@ class acp_permissions
// Do not allow forum_ids being set and no other setting defined (will bog down the server too much)
if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id))
{
trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action));
trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$template->assign_vars(array(
@ -566,7 +574,7 @@ class acp_permissions
if (!sizeof($ids))
{
trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action));
trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@ -585,7 +593,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$ug_id = $forum_id = 0;
@ -643,7 +651,7 @@ class acp_permissions
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
$this->update_foes();
update_foes();
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id);
@ -664,7 +672,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_settings = (isset($_POST['setting'])) ? $_POST['setting'] : array();
@ -710,7 +718,7 @@ class acp_permissions
// Remove users who are now moderators or admins from everyones foes list
if ($permission_type == 'm_' || $permission_type == 'a_')
{
$this->update_foes();
update_foes();
}
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids);
@ -769,7 +777,7 @@ class acp_permissions
// Check the permission setting again
if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $permission_type);
@ -839,32 +847,6 @@ class acp_permissions
}
}
/**
* Update foes - remove moderators and administrators from foe lists...
*/
function update_foes()
{
global $db, $auth;
$perms = array();
foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary)
{
foreach ($forum_ary as $auth_option => $user_ary)
{
$perms = array_merge($perms, $user_ary);
}
}
if (sizeof($perms))
{
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
WHERE ' . $db->sql_in_set('zebra_id', array_unique($perms)) . '
AND foe = 1';
$db->sql_query($sql);
}
unset($perms);
}
/**
* Display a complete trace tree for the selected permission to determine where settings are set/unset
*/
@ -888,7 +870,7 @@ class acp_permissions
if (!$userdata)
{
trigger_error('NO_USERS');
trigger_error('NO_USERS', E_USER_ERROR);
}
$forum_name = false;

View file

@ -22,7 +22,7 @@ class acp_php_info
if ($mode != 'info')
{
trigger_error('NO_MODE');
trigger_error('NO_MODE', E_USER_ERROR);
}
$this->tpl_name = 'acp_php_info';

View file

@ -91,7 +91,7 @@ class acp_profile
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@ -107,7 +107,7 @@ class acp_profile
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'sqlite':
$sql = "SELECT sql
@ -119,6 +119,8 @@ class acp_profile
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$db->sql_transaction('begin');
// Create a temp table and populate it, destroy the existing one
$db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
@ -127,12 +129,13 @@ class acp_profile
preg_match('#\((.*)\)#s', $row['sql'], $matches);
$new_table_cols = trim($matches[1]);
$old_table_cols = explode(',', $new_table_cols);
$old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols);
$column_list = array();
foreach($old_table_cols as $declaration)
foreach ($old_table_cols as $declaration)
{
$entities = preg_split('#\s+#', trim($declaration));
if ($entities[0] !== '_' . $field_ident)
if ($entities[0] !== 'pf_' . $field_ident)
{
$column_list[] = $entities[0];
}
@ -140,16 +143,18 @@ class acp_profile
$columns = implode(',', $column_list);
$new_table_cols = preg_replace('/' . '_' . $field_ident . '[^,]+,/', '', $new_table_cols);
$new_table_cols = preg_replace('/' . 'pf_' . $field_ident . '[^,]+,/', '', $new_table_cols);
// create a new table and fill it up. destroy the temp one
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
$db->sql_transaction('commit');
break;
default:
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP _$field_ident");
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP pf_$field_ident");
}
$order = 0;
@ -192,7 +197,7 @@ class acp_profile
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT lang_id
@ -204,7 +209,7 @@ class acp_profile
if (!in_array($default_lang_id, $lang_defs['entry'][$field_id]))
{
trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action));
trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
@ -229,7 +234,7 @@ class acp_profile
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
@ -275,7 +280,7 @@ class acp_profile
{
if (!$field_id)
{
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT l.*, f.*
@ -289,7 +294,7 @@ class acp_profile
if (!$field_row)
{
trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action));
trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$field_type = $field_row['field_type'];
@ -319,7 +324,7 @@ class acp_profile
if (!$field_type)
{
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$field_row = array_merge($default_values[$field_type], array(
@ -359,7 +364,7 @@ class acp_profile
$cp->vars['lang_name'] = request_var('lang_name', $field_row['lang_name'], true);
$cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true);
$cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true);
// Field option...
if (isset($_REQUEST['field_option']))
{
@ -525,7 +530,8 @@ class acp_profile
}
}
if ($submit && $step == 1)
// Check for general issues in every step
if ($submit) // && $step == 1
{
// Check values for step 1
if ($cp->vars['field_ident'] == '')
@ -538,16 +544,39 @@ class acp_profile
$error[] = $user->lang['INVALID_CHARS_FIELD_IDENT'];
}
if (strlen($cp->vars['field_ident']) > 17)
{
$error[] = $user->lang['INVALID_FIELD_IDENT_LEN'];
}
if ($cp->vars['lang_name'] == '')
{
$error[] = $user->lang['EMPTY_USER_FIELD_NAME'];
}
if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
if ($field_type == FIELD_DROPDOWN && !sizeof($cp->vars['lang_options']))
{
if (!sizeof($cp->vars['lang_options']))
$error[] = $user->lang['NO_FIELD_ENTRIES'];
}
if ($field_type == FIELD_BOOL && (empty($cp->vars['lang_options'][0]) || empty($cp->vars['lang_options'][1])))
{
$error[] = $user->lang['NO_FIELD_ENTRIES'];
}
// Check for already existing field ident
if ($action != 'edit')
{
$sql = 'SELECT field_ident
FROM ' . PROFILE_FIELDS_TABLE . "
WHERE field_ident = '" . $db->sql_escape($cp->vars['field_ident']) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
$error[] = $user->lang['NO_FIELD_ENTRIES'];
$error[] = $user->lang['FIELD_IDENT_ALREADY_EXIST'];
}
}
}
@ -730,12 +759,20 @@ class acp_profile
ORDER BY field_order';
$result = $db->sql_query($sql);
$s_one_need_edit = false;
while ($row = $db->sql_fetchrow($result))
{
$active_lang = (!$row['field_active']) ? 'ACTIVATE' : 'DEACTIVATE';
$active_value = (!$row['field_active']) ? 'activate' : 'deactivate';
$id = $row['field_id'];
$s_need_edit = (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false;
if ($s_need_edit)
{
$s_one_need_edit = true;
}
$template->assign_block_vars('fields', array(
'FIELD_IDENT' => $row['field_ident'],
'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])],
@ -743,15 +780,22 @@ class acp_profile
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;action=$active_value&amp;field_id=$id",
'U_EDIT' => $this->u_action . "&amp;action=edit&amp;field_id=$id",
'U_TRANSLATE' => $this->u_action . "&amp;action=edit&amp;field_id=$id&amp;step=3",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;field_id=$id",
'U_MOVE_UP' => $this->u_action . "&amp;action=move_up&amp;order={$row['field_order']}",
'U_MOVE_DOWN' => $this->u_action . "&amp;action=move_down&amp;order={$row['field_order']}",
'S_NEED_EDIT' => (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false)
'S_NEED_EDIT' => $s_need_edit)
);
}
$db->sql_freeresult($result);
// At least one option field needs editing?
if ($s_one_need_edit)
{
$template->assign_var('S_NEED_EDIT', true);
}
$s_select_type = '';
foreach ($cp->profile_types as $key => $value)
{
@ -831,12 +875,11 @@ class acp_profile
$lang_options[$lang_id]['lang_iso'] = $lang_iso;
foreach ($options as $field => $field_type)
{
$value = ($action == 'create') ? request_var('l_' . $field, '', true) : $cp->vars['l_' . $field];
$value = ($action == 'create') ? request_var('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field];
if ($field == 'lang_options')
{
$var = ($action == 'create' || !is_array($cp->vars['lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id];
$var = ($action == 'create' || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id];
switch ($field_type)
{
@ -948,7 +991,7 @@ class acp_profile
if ($action == 'create')
{
$field_ident = '_' . $field_ident;
$field_ident = 'pf_' . $field_ident;
$profile_sql[] = $this->add_field_ident($field_ident, $field_type);
}
@ -1003,10 +1046,11 @@ class acp_profile
}
}
$cp->vars['l_lang_name'] = request_var('l_lang_name', '', true);
$cp->vars['l_lang_explain'] = request_var('l_lang_explain', '', true);
$cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', '', true);
$cp->vars['l_lang_options'] = request_var('l_lang_options', '', true);
// These are always arrays because the key is the language id...
$cp->vars['l_lang_name'] = request_var('l_lang_name', array(0 => ''), true);
$cp->vars['l_lang_explain'] = request_var('l_lang_explain', array(0 => ''), true);
$cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => ''), true);
$cp->vars['l_lang_options'] = request_var('l_lang_options', array(0 => ''), true);
if ($cp->vars['lang_options'])
{
@ -1155,7 +1199,7 @@ class acp_profile
}
else
{
add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 1) . ':' . $cp->vars['lang_name']);
add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 3) . ':' . $cp->vars['lang_name']);
trigger_error($user->lang['ADDED_PROFILE_FIELD'] . adm_back_link($this->u_action));
}
}
@ -1215,7 +1259,7 @@ class acp_profile
{
global $db;
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'mysql':
case 'mysql4':

View file

@ -155,7 +155,7 @@ class acp_prune
if (!$row)
{
$db->sql_freeresult($result);
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$forum_list = $s_hidden_fields = '';
@ -196,17 +196,18 @@ class acp_prune
{
if (confirm_box(true))
{
$users = request_var('users', '');
$users = request_var('users', '', true);
$action = request_var('action', 'deactivate');
$deleteposts = request_var('deleteposts', 0);
if ($users)
{
$where_sql = ' AND ' . $db->sql_in_set('username', explode("\n", $users));
$users = explode("\n", $users);
$where_sql = ' AND ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', $users));
}
else
{
$username = request_var('username', '');
$username = request_var('username', '', true);
$email = request_var('email', '');
$joined_select = request_var('joined_select', 'lt');
@ -224,7 +225,7 @@ class acp_prune
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
$where_sql = '';
$where_sql .= ($username) ? " AND username LIKE '" . $db->sql_escape(str_replace('*', '%', $username)) . "'" : '';
$where_sql .= ($username) ? " AND username_clean LIKE '" . $db->sql_escape(str_replace('*', '%', utf8_clean_string($username))) . "'" : '';
$where_sql .= ($email) ? " AND user_email LIKE '" . $db->sql_escape(str_replace('*', '%', $email)) . "' " : '';
$where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : '';
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . " $count " : '';
@ -244,7 +245,8 @@ class acp_prune
$db->sql_freeresult($result);
// Do not prune founder members
$sql = 'SELECT username, user_id FROM ' . USERS_TABLE . '
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . '
AND user_type <> ' . USER_FOUNDER . "
$where_sql";
@ -267,11 +269,7 @@ class acp_prune
{
if ($action == 'deactivate')
{
foreach ($user_ids as $user_id)
{
user_active_flip($user_id, USER_NORMAL, false, false, true);
}
user_active_flip('deactivate', $user_ids);
$l_log = 'LOG_PRUNE_USER_DEAC';
}
else if ($action == 'delete')
@ -309,7 +307,7 @@ class acp_prune
'prune' => 1,
'users' => request_var('users', ''),
'username' => request_var('username', ''),
'username' => request_var('username', '', true),
'email' => request_var('email', ''),
'joined_select' => request_var('joined_select', ''),
'joined' => request_var('joined', ''),

View file

@ -48,14 +48,14 @@ class acp_ranks
if (!$rank_title)
{
trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary = array(
'rank_title' => $rank_title,
'rank_special' => $special_rank,
'rank_min' => $min_posts,
'rank_image' => html_entity_decode($rank_image)
'rank_image' => htmlspecialchars_decode($rank_image)
);
if ($rank_id)
@ -96,7 +96,7 @@ class acp_ranks
}
else
{
trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action));
trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING);
}
break;

View file

@ -61,11 +61,11 @@ class acp_reasons
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row['reason_title'] == 'other')
if (strtolower($row['reason_title']) == 'other')
{
$reason_row['reason_title'] = 'other';
}
else if (strtolower($row['reason_title']) != strtolower($reason_row['reason_title']))
else if ($row['reason_title'] != $reason_row['reason_title'])
{
$check_double = true;
}
@ -76,12 +76,12 @@ class acp_reasons
{
$sql = 'SELECT reason_id
FROM ' . REPORTS_REASONS_TABLE . "
WHERE LOWER(reason_title) = '" . strtolower($db->sql_escape($reason_row['reason_title'])) . "'";
WHERE reason_title = '" . $db->sql_escape($reason_row['reason_title']) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
if ($row || ($action == 'add' && strtolower($reason_row['reason_title']) == 'other'))
{
$error[] = $user->lang['REASON_ALREADY_EXIST'];
}
@ -137,7 +137,7 @@ class acp_reasons
if (!$reason_row)
{
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@ -159,10 +159,14 @@ class acp_reasons
'REASON_TITLE' => $reason_row['reason_title'],
'REASON_DESCRIPTION' => $reason_row['reason_description'],
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '',
'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '',
'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))),
'S_EDIT_REASON' => true,
'S_TRANSLATED' => $translated,
'S_ERROR' => (sizeof($error)) ? true : false,
)
);
@ -180,12 +184,12 @@ class acp_reasons
if (!$reason_row)
{
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if ($reason_row['reason_title'] == 'other')
if (strtolower($reason_row['reason_title']) == 'other')
{
trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Let the deletion be confirmed...
@ -193,12 +197,12 @@ class acp_reasons
{
$sql = 'SELECT reason_id
FROM ' . REPORTS_REASONS_TABLE . "
WHERE reason_title = 'other'";
WHERE LOWER(reason_title) = 'other'";
$result = $db->sql_query($sql);
$other_reason_id = (int) $db->sql_fetchfield('reason_id');
$db->sql_freeresult($result);
switch (SQL_LAYER)
switch ($db->sql_layer)
{
// The ugly one!
case 'mysqli':
@ -214,9 +218,17 @@ class acp_reasons
case 'mssql':
case 'mssql_odbc':
// Change the reports using this reason to 'other'
$sql = 'UPDATE ' . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' + report_text
WHERE reason_id = $reason_id";
$sql = "DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR(report_text)
FROM " . REPORTS_TABLE . "
WHERE reason_id = " . $reason_id . "
UPDATETEXT " . REPORTS_TABLE . ".report_text @ptrval 0 0 '" . $db->sql_escape($reason_row['reason_description']) . "\n\n'
UPDATE " . REPORTS_TABLE . '
SET reason_id = ' . $other_reason_id . "
WHERE reason_id = $reason_id";
break;
// Teh standard
@ -319,7 +331,7 @@ class acp_reasons
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
{
$row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
$row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
$row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
$translated = true;

View file

@ -152,7 +152,7 @@ class acp_search
}
else
{
trigger_error($error);
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
else
@ -168,7 +168,7 @@ class acp_search
}
else
{
trigger_error($error);
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@ -228,7 +228,8 @@ class acp_search
break;
default:
trigger_error('NO_ACTION');
trigger_error('NO_ACTION', E_USER_ERROR);
break;
}
if (empty($this->state[0]))
@ -240,7 +241,7 @@ class acp_search
$error = false;
if ($this->init_search($this->state[0], $this->search, $error))
{
trigger_error($error);
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
$action = &$this->state[1];
@ -262,7 +263,7 @@ class acp_search
{
$this->state = array('');
$this->save_state();
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js());
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING);
}
}
else
@ -294,7 +295,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
redirect($this->u_action . '&amp;action=delete', 3);
redirect($this->u_action . '&amp;action=delete');
}
}
@ -314,12 +315,12 @@ class acp_search
{
$this->state = array('');
$this->save_state();
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js());
trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING);
}
}
else
{
$sql = 'SELECT post_id, post_subject, post_text, post_encoding, poster_id, forum_id
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE post_id >= ' . (int) ($post_counter + 1) . '
AND post_id < ' . (int) ($post_counter + $this->batch_size);
@ -327,7 +328,7 @@ class acp_search
while ($row = $db->sql_fetchrow($result))
{
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['post_encoding'], $row['poster_id'], $row['forum_id']);
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']);
}
$db->sql_freeresult($result);
@ -338,7 +339,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
redirect($this->u_action . '&amp;action=create', 3);
redirect($this->u_action . '&amp;action=create');
}
}
@ -440,7 +441,7 @@ class acp_search
adm_page_header($user->lang[$l_type]);
$template->set_filenames(array(
'body' => 'search_index_progress_bar.html')
'body' => 'progress_bar.html')
);
$template->assign_vars(array(

View file

@ -191,7 +191,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if ($style_id == $config['default_style'])
{
trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action));
trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'UPDATE ' . STYLES_TABLE . '
@ -234,7 +234,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$template_row)
{
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@ -311,12 +311,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$theme_row)
{
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (!$theme_row['theme_storedb'])
{
trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action));
trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@ -369,7 +369,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$imageset_row)
{
trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
}
if (confirm_box(true))
@ -397,9 +397,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
unset($cfg_data);
$sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE imageset_id = $style_id";
$db->sql_query($sql);
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE imageset_id = $style_id";
$db->sql_query($sql);
}
$cache->destroy('sql', STYLES_IMAGESET_TABLE);
@ -533,7 +536,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
while (($file = readdir($dp)) !== false)
{
$subpath = ($mode != 'style') ? "$mode/" : '';
if ($file{0} != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
{
@ -590,7 +593,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : '';
$template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data'];
$template_file = request_var('template_file', '');
$template_file = request_var('template_file', '');
$text_rows = max(5, min(999, request_var('text_rows', 20)));
$save_changes = (isset($_POST['save'])) ? true : false;
@ -602,13 +605,14 @@ pagination_sep = \'{PAGINATION_SEP}\'
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
if (!($template_info = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_TEMPLATE']);
}
$template_info = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$template_info)
{
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// save changes to the template if the user submitted any
if ($save_changes && $template_file)
{
@ -621,7 +625,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!($fp = fopen($file, 'wb')))
{
trigger_error($user->lang['NO_TEMPLATE']);
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
fwrite($fp, $template_data);
fclose($fp);
@ -674,7 +678,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file")))
{
trigger_error($user->lang['NO_TEMPLATE']);
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
}
@ -779,7 +783,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'SELECTED_TEMPLATE' => $template_info['template_name'],
'TEMPLATE_FILE' => $template_file,
'TEMPLATE_DATA' => htmlentities($template_data),
'TEMPLATE_DATA' => htmlspecialchars($template_data),
'TEXT_ROWS' => $text_rows)
);
}
@ -801,13 +805,14 @@ pagination_sep = \'{PAGINATION_SEP}\'
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
if (!($template_row = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_TEMPLATE']);
}
$template_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$template_row)
{
trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// User wants to delete one or more files ...
if ($submit && $file_ary)
{
@ -941,7 +946,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!($theme_info = $db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_THEME']);
trigger_error($user->lang['NO_THEME'] . adm_bacl_link($this->u_action), E_USER_WARNING);
}
$db->sql_freeresult($result);
@ -951,7 +956,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!file_exists($stylesheet_path) || !($stylesheet = file_get_contents($stylesheet_path)))
{
trigger_error($user->lang['NO_THEME']);
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
else
@ -961,7 +966,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// Pull out a list of classes
$classes = array();
if (preg_match_all('/^([a-z0-9\.:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
if (preg_match_all('/^([a-z0-9\.,:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches))
{
$classes = $matches[1];
}
@ -1007,7 +1012,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// Used in an sprintf statement to generate appropriate output for rawcss mode
$map_elements = array(
'colors' => '%s',
'sizes' => '%d',
'sizes' => '%1.10f',
'images' => 'url(\'./%s\')',
'repeat' => '%s',
'other' => '%s',
@ -1015,11 +1020,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
$units = array('px', '%', 'em', 'pt');
$repeat_types = array(
'' => $user->lang['UNSET'],
'none' => $user->lang['REPEAT_NO'],
'repeat-x' => $user->lang['REPEAT_X'],
'repeat-y' => $user->lang['REPEAT_Y'],
'both' => $user->lang['REPEAT_ALL'],
'' => $user->lang['UNSET'],
'none' => $user->lang['REPEAT_NO'],
'repeat-x' => $user->lang['REPEAT_X'],
'repeat-y' => $user->lang['REPEAT_Y'],
'both' => $user->lang['REPEAT_ALL'],
);
// Fill css_data with the class contents from the stylesheet
@ -1030,7 +1035,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!isset($matches[1]))
{
trigger_error($user->lang['NO_CLASS']);
trigger_error($user->lang['NO_CLASS'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$css_data = implode(";\n", array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $matches[1]))), array('')));
@ -1183,11 +1188,11 @@ pagination_sep = \'{PAGINATION_SEP}\'
$value = '';
$unit = '';
// retrieve and validate date for this setting
// retrieve and validate data for this setting
switch ($type)
{
case 'sizes':
$value = request_var($var, 0);
$value = request_var($var, 0.0);
$unit = request_var($var . '_unit', '');
if ((request_var($var, '') === '') || !in_array($unit, $units))
@ -1227,7 +1232,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// use the element mapping to create raw css code
if ($value !== '')
{
$css_data .= $match . ': ' . sprintf($map_elements[$type], $value) . $unit . ";\n";
$css_data .= $match . ': ' . ($type == 'sizes' ? rtrim(sprintf($map_elements[$type], $value), '0') : sprintf($map_elements[$type], $value)) . $unit . ";\n";
}
}
}
@ -1262,7 +1267,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// check whether the custom class name is valid
if (!preg_match('/^[a-z0-9#:.\- ]+$/i', $add_custom))
{
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows"));
trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&amp;action=edit&amp;id=$theme_id&amp;text_rows=$text_rows"), E_USER_WARNING);
}
else
{
@ -1278,7 +1283,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
// write stylesheet to file
if (!($fp = fopen($stylesheet_path, 'wb')))
{
trigger_error($user->lang['NO_THEME']);
trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
}
fwrite($fp, $stylesheet);
fclose($fp);
@ -1348,17 +1353,20 @@ pagination_sep = \'{PAGINATION_SEP}\'
if ($imageset_id)
{
$sql_select = ($imgname) ? ", $imgname" : '';
$sql = "SELECT imageset_path, imageset_name, imageset_copyright$sql_select
FROM " . STYLES_IMAGESET_TABLE . "
WHERE imageset_id = $imageset_id";
$result = $db->sql_query($sql);
if (!extract($db->sql_fetchrow($result)))
{
trigger_error($user->lang['NO_IMAGESET']);
}
$imageset_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$imageset_row)
{
trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
}
extract($imageset_row);
// Check to see whether the selected image exists in the table
$valid_name = ($update) ? false : true;
@ -1431,7 +1439,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
$dp = opendir($dir);
while (($file = readdir($dp)) !== false)
{
if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file{0} != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file[0] != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
{
$dp2 = opendir("$dir/$file");
while (($file2 = readdir($dp2)) !== false)
@ -1540,7 +1548,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = "SELECT {$mode}_id, {$mode}_name
@ -1561,7 +1569,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
else
{
trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$db->sql_freeresult($result);
@ -1719,7 +1727,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_storedb', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright', 'theme_storedb', 'theme_mtime', 'theme_data', 'imageset_id', 'imageset_name', 'imageset_path', 'imageset_copyright');
@ -1843,7 +1851,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
foreach ($key_array as $key)
{
$imageset_cfg .= "\n" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]);
$imageset_cfg .= "\nimg_" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]);
}
}
@ -1951,7 +1959,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
$this->page_title = $l_prefix . '_EXPORT';
@ -2021,7 +2029,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!$style_row)
{
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
}
$style_row['style_default'] = ($mode == 'style' && $config['default_style'] == $style_id) ? 1 : 0;
@ -2057,12 +2065,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!sizeof($error))
{
// Check length settings
if (strlen($name) > 30)
if (utf8_strlen($name) > 30)
{
$error[] = $user->lang[$l_type . '_ERR_NAME_LONG'];
}
if (strlen($copyright) > 60)
if (utf8_strlen($copyright) > 60)
{
$error[] = $user->lang[$l_type . '_ERR_COPY_LONG'];
}
@ -2308,7 +2316,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
foreach ($matches[0] as $idx => $match)
{
$stylesheet = str_replace($match, $this->load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
$stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
}
}
@ -2331,7 +2339,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
{
if (!($fp = fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r')))
{
trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file");
trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
}
$template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
fclose($fp);
@ -2396,7 +2404,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
if (!($dp = @opendir("{$phpbb_root_path}cache")))
{
trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ']);
trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$file_ary = array();
@ -2538,7 +2546,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
else
{
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
}
$style_row['store_db'] = request_var('store_db', 0);
@ -2822,12 +2830,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
// Check length settings
if (strlen($name) > 30)
if (utf8_strlen($name) > 30)
{
$error[] = $user->lang['STYLE_ERR_NAME_LONG'];
}
if (strlen($copyright) > 60)
if (utf8_strlen($copyright) > 60)
{
$error[] = $user->lang['STYLE_ERR_COPY_LONG'];
}
@ -2932,12 +2940,12 @@ pagination_sep = \'{PAGINATION_SEP}\'
}
// Check length settings
if (strlen($name) > 30)
if (utf8_strlen($name) > 30)
{
$error[] = $user->lang[$l_type . '_ERR_NAME_LONG'];
}
if (strlen($copyright) > 60)
if (utf8_strlen($copyright) > 60)
{
$error[] = $user->lang[$l_type . '_ERR_COPY_LONG'];
}

View file

@ -0,0 +1,61 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package acp
*/
class acp_update
{
var $u_action;
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('install');
$this->tpl_name = 'acp_update';
$this->page_title = 'ACP_UPDATE';
// Get current and latest version
$errstr = '';
$errno = 0;
$info = get_remote_file('www.phpbb.com', '/updatecheck', '30x.txt', $errstr, $errno);
if ($info === false)
{
trigger_error($errstr . adm_back_link($this->u_action));
}
$info = explode("\n", $info);
$latest_version = trim($info[0]);
$announcement_url = trim($info[1]);
$update_archive_link = 'http://www.phpbb.com/files/releases/phpBB-' . $config['version'] . '_to_' . $latest_version . '.zip';
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
$up_to_date = (version_compare(strtolower($config['version']), strtolower($latest_version), '<')) ? false : true;
$template->assign_vars(array(
'S_UP_TO_DATE' => $up_to_date,
'S_VERSION_CHECK' => true,
'U_ACTION' => $this->u_action,
'LATEST_VERSION' => $latest_version,
'CURRENT_VERSION' => $config['version'],
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_archive_link, $update_link),
));
}
}
?>

View file

@ -34,7 +34,7 @@ class acp_users
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$error = array();
$username = request_var('username', '');
$username = request_var('username', '', true);
$user_id = request_var('u', 0);
$action = request_var('action', '');
@ -53,7 +53,7 @@ class acp_users
if ($ipwhois = user_ipwhois($user_ip))
{
$ipwhois = preg_replace('#(\s)([\w\-\._\+]+@[\w\-\.]+)(\s)#', '\1<a href="mailto:\2">\2</a>\3', $ipwhois);
$ipwhois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $ipwhois);
$ipwhois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2">\2</a>\3', $ipwhois);
}
$template->assign_vars(array(
@ -75,6 +75,7 @@ class acp_users
'S_SELECT_USER' => true,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_user&amp;field=username'),
'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username', false),
)
);
@ -85,14 +86,14 @@ class acp_users
{
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'";
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql);
$user_id = (int) $db->sql_fetchfield('user_id');
$db->sql_freeresult($result);
if (!$user_id)
{
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
@ -108,7 +109,7 @@ class acp_users
if (!$user_row)
{
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
// Generate overall "header" for user admin
@ -139,7 +140,7 @@ class acp_users
// Prevent normal users/admins change/view founders if they are not a founder by themselves
if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
switch ($mode)
@ -157,23 +158,23 @@ class acp_users
{
if (!$auth->acl_get('a_userdel'))
{
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
// Check if the user wants to remove himself or the guest user account
if ($user_id == ANONYMOUS)
{
trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($user_id == $user->data['user_id'])
{
trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if (confirm_box(true))
{
user_delete($delete_type, $user_id);
user_delete($delete_type, $user_id, $user_row['username']);
add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action));
@ -201,7 +202,12 @@ class acp_users
if ($user_id == $user->data['user_id'])
{
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['CANNOT_BAN_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
$ban = array();
@ -241,8 +247,8 @@ class acp_users
user_ban(substr($action, 3), $ban, 0, 0, 0, $user->lang[$reason]);
add_log('admin', $log, $user->lang[$reason]);
add_log('user', $user_id, $log, $user->lang[$reason]);
add_log('admin', $log, $user->lang[$reason], implode(', ', $ban));
add_log('user', $user_id, $log, $user->lang[$reason], implode(', ', $ban));
trigger_error($user->lang['BAN_SUCCESSFUL'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
@ -252,7 +258,17 @@ class acp_users
if ($user_id == $user->data['user_id'])
{
trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['CANNOT_FORCE_REACT_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($user_row['user_type'] == USER_IGNORE)
{
trigger_error($user->lang['CANNOT_FORCE_REACT_BOT'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($config['email_enable'])
@ -266,9 +282,14 @@ class acp_users
$key_len = ($key_len > 6) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
if ($user_row['user_type'] != USER_INACTIVE)
if ($user_row['user_type'] == USER_NORMAL)
{
user_active_flip($user_id, $user_row['user_type'], $user_actkey, $user_row['username']);
user_active_flip('deactivate', $user_id, INACTIVE_REMIND);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = $user_id";
$db->sql_query($sql);
}
$messenger = new messenger(false);
@ -284,11 +305,8 @@ class acp_users
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']),
'USERNAME' => html_entity_decode($user_row['username']),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
'USERNAME' => htmlspecialchars_decode($user_row['username']),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
@ -307,28 +325,27 @@ class acp_users
if ($user_id == $user->data['user_id'])
{
// It is only deactivation since the user is already activated (else he would not have reached this page)
trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
user_active_flip($user_id, $user_row['user_type'], false, $user_row['username']);
if ($user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['CANNOT_DEACTIVATE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($user_row['user_type'] == USER_IGNORE)
{
trigger_error($user->lang['CANNOT_DEACTIVATE_BOT'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
user_active_flip('flip', $user_id);
$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
$log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
add_log('admin', $log, $user_row['username']);
add_log('user', $user_id, $log . '_USER');
if ($user_row['user_type'] == USER_INACTIVE)
{
set_config('num_users', $config['num_users'] + 1, true);
}
else
{
set_config('num_users', $config['num_users'] - 1, true);
}
// Update latest username
update_last_username();
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
break;
@ -338,7 +355,7 @@ class acp_users
$sql_ary = array(
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_sig_bbcode_bitfield' => 0
'user_sig_bbcode_bitfield' => ''
);
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
@ -369,7 +386,7 @@ class acp_users
// Delete old avatar if present
if ($user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY)
{
avatar_delete($user_row['user_avatar']);
avatar_delete('user', $user_row);
}
add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
@ -599,32 +616,22 @@ class acp_users
break;
}
$data = array();
// Handle registration info updates
$var_ary = array(
'user' => (string) $user_row['username'],
'user_founder' => (int) (($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'user_email' => (string) $user_row['user_email'],
'email_confirm' => (string) '',
'user_password' => (string) '',
'password_confirm' => (string) '',
'warnings' => (int) $user_row['user_warnings'],
$data = array(
'username' => request_var('user', $user_row['username'], true),
'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => request_var('user_email', $user_row['user_email']),
'email_confirm' => request_var('email_confirm', ''),
'user_password' => request_var('user_password', '', true),
'password_confirm' => request_var('password_confirm', '', true),
'warnings' => request_var('warnings', $user_row['user_warnings']),
);
// Get the data from the form. Use data from the database if no info is provided
foreach ($var_ary as $var => $default)
{
$data[$var] = request_var($var, $default);
}
// We use user within the form to circumvent auto filling
$data['username'] = $data['user'];
unset($data['user']);
// Validation data
$var_ary = array(
'user_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
// Validation data - we do not check the password complexity setting here
$check_ary = array(
'user_password' => array(
array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
array('password')),
'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
'warnings' => array('num'),
);
@ -632,7 +639,7 @@ class acp_users
// Check username if altered
if ($data['username'] != $user_row['username'])
{
$var_ary += array(
$check_ary += array(
'username' => array(
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
array('username', $user_row['username'])),
@ -640,10 +647,10 @@ class acp_users
}
// Check email if altered
if ($data['user_email'] != $user_row['user_email'])
if ($data['email'] != $user_row['user_email'])
{
$var_ary += array(
'user_email' => array(
$check_ary += array(
'email' => array(
array('string', false, 6, 60),
array('email', $user_row['user_email'])
),
@ -651,14 +658,14 @@ class acp_users
);
}
$error = validate_data($data, $var_ary);
$error = validate_data($data, $check_ary);
if ($data['user_password'] && $data['password_confirm'] != $data['user_password'])
{
$error[] = 'NEW_PASSWORD_ERROR';
}
if ($data['user_email'] != $user_row['user_email'] && $data['email_confirm'] != $data['user_email'])
if ($data['email'] != $user_row['user_email'] && $data['email_confirm'] != $data['email'])
{
$error[] = 'NEW_EMAIL_ERROR';
}
@ -667,7 +674,7 @@ class acp_users
$update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false;
$update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false;
$update_password = ($data['user_password'] && $user_row['user_password'] != md5($data['user_password'])) ? true : false;
$update_email = ($data['user_email'] != $user_row['user_email']) ? $data['user_email'] : false;
$update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false;
if (!sizeof($error))
{
@ -686,6 +693,17 @@ class acp_users
// Setting a normal member to be a founder
if ($data['user_founder'] && $user_row['user_type'] != USER_FOUNDER)
{
// Make sure the user is not setting an Inactive or ignored user to be a founder
if ($user_row['user_type'] == USER_IGNORE)
{
trigger_error($user->lang['CANNOT_SET_FOUNDER_BOT'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($user_row['user_type'] == USER_INACTIVE)
{
trigger_error($user->lang['CANNOT_SET_FOUNDER_INACTIVE'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
$sql_ary['user_type'] = USER_FOUNDER;
}
else if (!$data['user_founder'] && $user_row['user_type'] == USER_FOUNDER)
@ -705,7 +723,7 @@ class acp_users
}
else
{
trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
}
}
@ -714,6 +732,7 @@ class acp_users
if ($update_username !== false)
{
$sql_ary['username'] = $update_username;
$sql_ary['username_clean'] = utf8_clean_string($update_username);
add_log('user', $user_id, 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);
}
@ -772,6 +791,7 @@ class acp_users
}
$user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
$pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL');
if ($user_id == $user->data['user_id'])
{
@ -779,9 +799,21 @@ class acp_users
}
else
{
$quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
$quick_tool_ary = array();
if ($user_row['user_type'] != USER_FOUNDER)
{
$quick_tool_ary += array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP');
}
if ($user_row['user_type'] != USER_FOUNDER && $user_row['user_type'] != USER_IGNORE)
{
$quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'));
}
if ($config['email_enable'])
$quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE))
{
$quick_tool_ary['reactivate'] = 'FORCE';
}
@ -793,9 +825,25 @@ class acp_users
$s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>';
}
if ($config['load_onlinetrack'])
{
$sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline
FROM ' . SESSIONS_TABLE . "
WHERE session_user_id = $user_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$user_row['session_time'] = (isset($row['session_time'])) ? $row['session_time'] : 0;
$user_row['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0;
unset($row);
}
$last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit'];
$template->assign_vars(array(
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[$config['allow_name_chars']] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
'S_OVERVIEW' => true,
@ -803,6 +851,7 @@ class acp_users
'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
'S_ACTION_OPTIONS' => $s_action_options,
'S_OWN_ACCOUNT' => ($user_id == $user->data['user_id']) ? true : false,
'S_USER_INACTIVE' => ($user_row['user_type'] == USER_INACTIVE) ? true : false,
'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']}",
@ -812,7 +861,7 @@ class acp_users
'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'],
'USER_LASTACTIVE' => ($user_row['user_lastvisit']) ? $user->format_date($user_row['user_lastvisit']) : ' - ',
'USER_LASTACTIVE' => ($last_visit) ? $user->format_date($last_visit) : ' - ',
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
@ -917,40 +966,45 @@ class acp_users
$cp = new custom_profile();
$cp_data = $cp_error = array();
$data = array();
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($user_row['user_lang']) . "'";
WHERE lang_iso = '" . $db->sql_escape($user->data['user_lang']) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$user_row['iso_lang_id'] = $row['lang_id'];
$data = array(
'icq' => request_var('icq', $user_row['user_icq']),
'aim' => request_var('aim', $user_row['user_aim']),
'msn' => request_var('msn', $user_row['user_msnm']),
'yim' => request_var('yim', $user_row['user_yim']),
'jabber' => request_var('jabber', $user_row['user_jabber']),
'website' => request_var('website', $user_row['user_website']),
'location' => request_var('location', $user_row['user_from'], true),
'occupation' => request_var('occupation', $user_row['user_occ'], true),
'interests' => request_var('interests', $user_row['user_interests'], true),
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0,
);
utf8_normalize_nfc(array(&$data['location'], &$data['occupation'], &$data['interests']));
if ($user_row['user_birthday'])
{
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
}
$data['bday_day'] = request_var('bday_day', $data['bday_day']);
$data['bday_month'] = request_var('bday_month', $data['bday_month']);
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
if ($submit)
{
$var_ary = array(
'icq' => (string) '',
'aim' => (string) '',
'msn' => (string) '',
'yim' => (string) '',
'jabber' => (string) '',
'website' => (string) '',
'location' => (string) '',
'occupation' => (string) '',
'interests' => (string) '',
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0,
);
foreach ($var_ary as $var => $default)
{
$data[$var] = (in_array($var, array('location', 'occupation', 'interests'))) ? request_var($var, $default, true) : $data[$var] = request_var($var, $default);
}
$var_ary = array(
$error = validate_data($data, array(
'icq' => array(
array('string', true, 3, 15),
array('match', true, '#^[0-9]+$#i')),
@ -969,9 +1023,7 @@ class acp_users
'bday_day' => array('num', true, 1, 31),
'bday_month' => array('num', true, 1, 12),
'bday_year' => array('num', true, 1901, gmdate('Y', time())),
);
$error = validate_data($data, $var_ary);
));
// validate custom profile fields
$cp->submit_cp_field('profile', $user_row['iso_lang_id'], $cp_data, $cp_error);
@ -1004,7 +1056,7 @@ class acp_users
// Update Custom Fields
if (sizeof($cp_data))
{
switch (SQL_LAYER)
switch ($db->sql_layer)
{
case 'oracle':
case 'firebird':
@ -1057,18 +1109,6 @@ class acp_users
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
if (!isset($data['bday_day']))
{
if ($user_row['user_birthday'])
{
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
}
else
{
$data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0;
}
}
$s_birthday_day_options = '<option value="0"' . ((!$data['bday_day']) ? ' selected="selected"' : '') . '>--</option>';
for ($i = 1; $i < 32; $i++)
{
@ -1094,15 +1134,15 @@ class acp_users
unset($now);
$template->assign_vars(array(
'ICQ' => (isset($data['icq'])) ? $data['icq'] : $user_row['user_icq'],
'YIM' => (isset($data['yim'])) ? $data['yim'] : $user_row['user_yim'],
'AIM' => (isset($data['aim'])) ? $data['aim'] : $user_row['user_aim'],
'MSN' => (isset($data['msn'])) ? $data['msn'] : $user_row['user_msnm'],
'JABBER' => (isset($data['jabber'])) ? $data['jabber'] : $user_row['user_jabber'],
'WEBSITE' => (isset($data['website'])) ? $data['website']: $user_row['user_website'],
'LOCATION' => (isset($data['location'])) ? $data['location'] : $user_row['user_from'],
'OCCUPATION' => (isset($data['occupation'])) ? $data['occupation'] : $user_row['user_occ'],
'INTERESTS' => (isset($data['interests'])) ? $data['interests'] : $user_row['user_interests'],
'ICQ' => $data['icq'],
'YIM' => $data['yim'],
'AIM' => $data['aim'],
'MSN' => $data['msn'],
'JABBER' => $data['jabber'],
'WEBSITE' => $data['website'],
'LOCATION' => $data['location'],
'OCCUPATION' => $data['occupation'],
'INTERESTS' => $data['interests'],
'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options,
'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options,
@ -1120,51 +1160,44 @@ class acp_users
case 'prefs':
$data = array();
$data = array(
'dateformat' => request_var('dateformat', $user_row['user_dateformat']),
'lang' => request_var('lang', $user_row['user_lang']),
'tz' => request_var('tz', (float) $user_row['user_timezone']),
'style' => request_var('style', $user_row['user_style']),
'dst' => request_var('dst', $user_row['user_dst']),
'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']),
'massemail' => request_var('massemail', $user_row['user_allow_massemail']),
'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']),
'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']),
'notifypm' => request_var('notifypm', $user_row['user_notify_pm']),
'popuppm' => request_var('popuppm', $this->optionget($user_row, 'popuppm')),
'allowpm' => request_var('allowpm', $user_row['user_allow_pm']),
'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
'topic_sd' => request_var('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'),
'topic_st' => request_var('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0),
'post_sk' => request_var('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'),
'post_sd' => request_var('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'),
'post_st' => request_var('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0),
'view_images' => request_var('view_images', $this->optionget($user_row, 'viewimg')),
'view_flash' => request_var('view_flash', $this->optionget($user_row, 'viewflash')),
'view_smilies' => request_var('view_smilies', $this->optionget($user_row, 'viewsmilies')),
'view_sigs' => request_var('view_sigs', $this->optionget($user_row, 'viewsigs')),
'view_avatars' => request_var('view_avatars', $this->optionget($user_row, 'viewavatars')),
'view_wordcensor' => request_var('view_wordcensore', $this->optionget($user_row, 'viewcensors')),
'bbcode' => request_var('bbcode', $this->optionget($user_row, 'bbcode')),
'smilies' => request_var('smilies', $this->optionget($user_row, 'smilies')),
'sig' => request_var('sig', $this->optionget($user_row, 'attachsig')),
'notify' => request_var('notify', $user_row['user_notify']),
);
if ($submit)
{
$var_ary = array(
'dateformat' => (string) $config['default_dateformat'],
'lang' => (string) $config['default_lang'],
'tz' => (float) $config['board_timezone'],
'style' => (int) $config['default_style'],
'dst' => (bool) $config['board_dst'],
'viewemail' => false,
'massemail' => true,
'hideonline' => false,
'notifymethod' => 0,
'notifypm' => true,
'popuppm' => false,
'allowpm' => true,
'topic_sk' => (string) 't',
'topic_sd' => (string) 'd',
'topic_st' => 0,
'post_sk' => (string) 't',
'post_sd' => (string) 'a',
'post_st' => 0,
'view_images' => true,
'view_flash' => false,
'view_smilies' => true,
'view_sigs' => true,
'view_avatars' => true,
'view_wordcensor' => false,
'bbcode' => true,
'smilies' => true,
'sig' => true,
'notify' => false,
);
foreach ($var_ary as $var => $default)
{
$data[$var] = request_var($var, $default);
}
$var_ary = array(
$error = validate_data($data, array(
'dateformat' => array('string', false, 3, 30),
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
'tz' => array('num', false, -14, 14),
@ -1173,9 +1206,7 @@ class acp_users
'topic_sd' => array('string', false, 1, 1),
'post_sk' => array('string', false, 1, 1),
'post_sd' => array('string', false, 1, 1),
);
$error = validate_data($data, $var_ary);
));
if (!sizeof($error))
{
@ -1229,17 +1260,10 @@ class acp_users
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$notify_method = (isset($data['notifymethod'])) ? $data['notifymethod'] : $user_row['user_notify_type'];
$dateformat = (isset($data['dateformat'])) ? $data['dateformat'] : $user_row['user_dateformat'];
$lang = (isset($data['lang'])) ? $data['lang'] : $user_row['user_lang'];
$style = (isset($data['style'])) ? $data['style'] : $user_row['user_style'];
$tz = (isset($data['tz'])) ? $data['tz'] : $user_row['user_timezone'];
$dateformat_options = '';
foreach ($user->lang['dateformats'] as $format => $null)
{
$dateformat_options .= '<option value="' . $format . '"' . (($format == $dateformat) ? ' selected="selected"' : '') . '>';
$dateformat_options .= '<option value="' . $format . '"' . (($format == $data['dateformat']) ? ' selected="selected"' : '') . '>';
$dateformat_options .= $user->format_date(time(), $format, true) . ((strpos($format, '|') !== false) ? ' [' . $user->lang['RELATIVE_DAYS'] . ']' : '');
$dateformat_options .= '</option>';
}
@ -1247,22 +1271,13 @@ class acp_users
$s_custom = false;
$dateformat_options .= '<option value="custom"';
if (!in_array($dateformat, array_keys($user->lang['dateformats'])))
if (!in_array($data['dateformat'], array_keys($user->lang['dateformats'])))
{
$dateformat_options .= ' selected="selected"';
$s_custom = true;
}
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
$topic_sk = (isset($data['topic_sk'])) ? $data['topic_sk'] : (($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't');
$post_sk = (isset($data['post_sk'])) ? $data['post_sk'] : (($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't');
$topic_sd = (isset($data['topic_sd'])) ? $data['topic_sd'] : (($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd');
$post_sd = (isset($data['post_sd'])) ? $data['post_sd'] : (($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'd');
$topic_st = (isset($data['topic_st'])) ? $data['topic_st'] : (($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0);
$post_st = (isset($data['post_st'])) ? $data['post_st'] : (($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0);
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
// Topic ordering options
@ -1279,7 +1294,7 @@ class acp_users
${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">';
foreach (${'limit_' . $sort_option . '_days'} as $day => $text)
{
$selected = (${$sort_option . '_st'} == $day) ? ' selected="selected"' : '';
$selected = ($data[$sort_option . '_st'] == $day) ? ' selected="selected"' : '';
${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
}
${'s_limit_' . $sort_option . '_days'} .= '</select>';
@ -1287,7 +1302,7 @@ class acp_users
${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">';
foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text)
{
$selected = (${$sort_option . '_sk'} == $key) ? ' selected="selected"' : '';
$selected = ($data[$sort_option . '_sk'] == $key) ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
}
${'s_sort_' . $sort_option . '_key'} .= '</select>';
@ -1295,7 +1310,7 @@ class acp_users
${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">';
foreach ($sort_dir_text as $key => $value)
{
$selected = (${$sort_option . '_sd'} == $key) ? ' selected="selected"' : '';
$selected = ($data[$sort_option . '_sd'] == $key) ? ' selected="selected"' : '';
${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
${'s_sort_' . $sort_option . '_dir'} .= '</select>';
@ -1303,28 +1318,28 @@ class acp_users
$template->assign_vars(array(
'S_PREFS' => true,
'S_JABBER_DISABLED' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? false : true,
'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true,
'VIEW_EMAIL' => (isset($data['viewemail'])) ? $data['viewemail'] : $user_row['user_allow_viewemail'],
'MASS_EMAIL' => (isset($data['massemail'])) ? $data['massemail'] : $user_row['user_allow_massemail'],
'ALLOW_PM' => (isset($data['allowpm'])) ? $data['allowpm'] : $user_row['user_allow_pm'],
'HIDE_ONLINE' => (isset($data['hideonline'])) ? $data['hideonline'] : !$user_row['user_allow_viewonline'],
'NOTIFY_EMAIL' => ($notify_method == NOTIFY_EMAIL) ? true : false,
'NOTIFY_IM' => ($notify_method == NOTIFY_IM) ? true : false,
'NOTIFY_BOTH' => ($notify_method == NOTIFY_BOTH) ? true : false,
'NOTIFY_PM' => (isset($data['notifypm'])) ? $data['notifypm'] : $user_row['user_notify_pm'],
'POPUP_PM' => (isset($data['popuppm'])) ? $data['popuppm'] : $this->optionget($user_row, 'popuppm'),
'DST' => (isset($data['dst'])) ? $data['dst'] : $user_row['user_dst'],
'BBCODE' => (isset($data['bbcode'])) ? $data['bbcode'] : $this->optionget($user_row, 'bbcode'),
'SMILIES' => (isset($data['smilies'])) ? $data['smilies'] : $this->optionget($user_row, 'smilies'),
'ATTACH_SIG' => (isset($data['sig'])) ? $data['sig'] : $this->optionget($user_row, 'attachsig'),
'NOTIFY' => (isset($data['notify'])) ? $data['notify'] : $user_row['user_notify'],
'VIEW_IMAGES' => (isset($data['view_images'])) ? $data['view_images'] : $this->optionget($user_row, 'viewimg'),
'VIEW_FLASH' => (isset($data['view_flash'])) ? $data['view_flash'] : $this->optionget($user_row, 'viewflash'),
'VIEW_SMILIES' => (isset($data['view_smilies'])) ? $data['view_smilies'] : $this->optionget($user_row, 'viewsmilies'),
'VIEW_SIGS' => (isset($data['view_sigs'])) ? $data['view_sigs'] : $this->optionget($user_row, 'viewsigs'),
'VIEW_AVATARS' => (isset($data['view_avatars'])) ? $data['view_avatars'] : $this->optionget($user_row, 'viewavatars'),
'VIEW_WORDCENSOR' => (isset($data['view_wordcensor'])) ? $data['view_wordcensor'] : $this->optionget($user_row, 'viewcensors'),
'VIEW_EMAIL' => $data['viewemail'],
'MASS_EMAIL' => $data['massemail'],
'ALLOW_PM' => $data['allowpm'],
'HIDE_ONLINE' => $data['hideonline'],
'NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false,
'NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false,
'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false,
'NOTIFY_PM' => $data['notifypm'],
'POPUP_PM' => $data['popuppm'],
'DST' => $data['dst'],
'BBCODE' => $data['bbcode'],
'SMILIES' => $data['smilies'],
'ATTACH_SIG' => $data['sig'],
'NOTIFY' => $data['notify'],
'VIEW_IMAGES' => $data['view_images'],
'VIEW_FLASH' => $data['view_flash'],
'VIEW_SMILIES' => $data['view_smilies'],
'VIEW_SIGS' => $data['view_sigs'],
'VIEW_AVATARS' => $data['view_avatars'],
'VIEW_WORDCENSOR' => $data['view_wordcensor'],
'S_TOPIC_SORT_DAYS' => $s_limit_topic_days,
'S_TOPIC_SORT_KEY' => $s_sort_topic_key,
@ -1333,15 +1348,15 @@ class acp_users
'S_POST_SORT_KEY' => $s_sort_post_key,
'S_POST_SORT_DIR' => $s_sort_post_dir,
'DATE_FORMAT' => $dateformat,
'DATE_FORMAT' => $data['dateformat'],
'S_DATEFORMAT_OPTIONS' => $dateformat_options,
'S_CUSTOM_DATEFORMAT' => $s_custom,
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
'S_LANG_OPTIONS' => language_select($lang),
'S_STYLE_OPTIONS' => style_select($style),
'S_TZ_OPTIONS' => tz_select($tz, true),
'S_LANG_OPTIONS' => language_select($data['lang']),
'S_STYLE_OPTIONS' => style_select($data['style']),
'S_TZ_OPTIONS' => tz_select($data['tz'], true),
)
);
@ -1359,26 +1374,19 @@ class acp_users
{
$delete = request_var('delete', '');
$var_ary = array(
'uploadurl' => (string) '',
'remotelink' => (string) '',
'width' => (string) '',
'height' => (string) '',
$data = array(
'uploadurl' => request_var('uploadurl', ''),
'remotelink' => request_var('remotelink', ''),
'width' => request_var('width', ''),
'height' => request_var('height', ''),
);
foreach ($var_ary as $var => $default)
{
$data[$var] = request_var($var, $default);
}
$var_ary = array(
$error = validate_data($data, array(
'uploadurl' => array('string', true, 5, 255),
'remotelink' => array('string', true, 5, 255),
'width' => array('string', true, 1, 3),
'height' => array('string', true, 1, 3),
);
$error = validate_data($data, $var_ary);
));
if (!sizeof($error))
{
@ -1440,7 +1448,7 @@ class acp_users
// Delete old avatar if present
if ($user_row['user_avatar'] && $filename != $user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY)
{
avatar_delete($user_row['user_avatar']);
avatar_delete('user', $user_row);
}
}
@ -1545,6 +1553,8 @@ class acp_users
$enable_urls = request_var('enable_urls', true);
$signature = request_var('signature', $user_row['user_sig'], true);
utf8_normalize_nfc(&$signature);
$preview = (isset($_POST['preview'])) ? true : false;
if ($submit || $preview)
@ -1554,7 +1564,7 @@ class acp_users
$message_parser = new parse_message($signature);
// Allowing Quote BBCode
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig');
$message_parser->parse($enable_bbcode, ($config['allow_sig_links']) ? $enable_urls : false, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
if (sizeof($message_parser->warn_msg))
{
@ -1566,7 +1576,7 @@ class acp_users
$sql_ary = array(
'user_sig' => (string) $message_parser->message,
'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid,
'user_sig_bbcode_bitfield' => (int) $message_parser->bbcode_bitfield
'user_sig_bbcode_bitfield' => (string) $message_parser->bbcode_bitfield
);
$sql = 'UPDATE ' . USERS_TABLE . '
@ -1602,17 +1612,19 @@ class acp_users
'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '',
'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>'),
'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false,
'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false)
'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false,
'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false)
);
// Assigning custom bbcodes
@ -1686,7 +1698,12 @@ class acp_users
$s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
$order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
if (!isset($sk_sql[$sort_key]))
{
$sort_key = 'a';
}
$order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
$sql = 'SELECT COUNT(attach_id) as num_attachments
FROM ' . ATTACHMENTS_TABLE . "
@ -1772,12 +1789,12 @@ class acp_users
{
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
if ($error = group_user_del($group_id, $user_id))
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
$error = array();
@ -1801,13 +1818,13 @@ class acp_users
{
if (!$group_id)
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
// Add user/s to group
if ($error = group_user_add($group_id, $user_id))
{
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
$error = array();
@ -1847,11 +1864,11 @@ class acp_users
$s_group_options = '';
while ($row = $db->sql_fetchrow($result))
{
if (!$config['coppa_enable'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
if (!$config['coppa_enable'] && $row['group_name'] == 'REGISTERED_COPPA')
{
continue;
}
$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@ -1899,14 +1916,14 @@ class acp_users
$auth_admin = new auth_admin();
$user->add_lang('acp/permissions');
$user->add_lang('acp/permissions_phpbb');
add_permission_language();
// Select auth options
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '%\_'";
if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc')
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{
$sql .= " ESCAPE '\\'";
}
@ -1926,7 +1943,7 @@ class acp_users
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '%\_'";
if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc')
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{
$sql .= " ESCAPE '\\'";
}

View file

@ -40,7 +40,7 @@ class acp_words
if (!$word_id)
{
trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT *
@ -71,10 +71,12 @@ class acp_words
$word_id = request_var('id', 0);
$word = request_var('word', '', true);
$replacement = request_var('replacement', '', true);
utf8_normalize_nfc(array(&$word, &$replacement));
if (!$word || !$replacement)
{
trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action));
trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary = array(
@ -107,7 +109,7 @@ class acp_words
if (!$word_id)
{
trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action));
trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql = 'SELECT word

View file

@ -724,24 +724,7 @@ class auth_admin extends auth
}
}
if (sizeof($sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
$cache->destroy('acl_options');
$this->acl_clear_prefetch();
@ -874,24 +857,7 @@ class auth_admin extends auth
}
}
if (sizeof($sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert($table, $sql_ary);
if ($clear_prefetch)
{
@ -956,21 +922,8 @@ class auth_admin extends auth
WHERE role_id = ' . $role_id;
$db->sql_query($sql);
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
// Now insert the new values
$db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary);
$this->acl_clear_prefetch();
}
@ -1009,7 +962,9 @@ class auth_admin extends auth
// Get permission type
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '" . $db->sql_escape($permission_type) . "%'";
WHERE auth_option LIKE '" . $db->sql_escape(str_replace('_', "\_", $permission_type)) . "%'";
$sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
$result = $db->sql_query($sql);
$auth_id_ary = array();

View file

@ -0,0 +1,37 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2006 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package module_install
*/
class acp_inactive_info
{
function module()
{
return array(
'filename' => 'acp_inactive',
'title' => 'ACP_INACTIVE_USERS',
'version' => '1.0.0',
'modes' => array(
'list' => array('title' => 'ACP_INACTIVE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')),
),
);
}
function install()
{
}
function uninstall()
{
}
}
?>

View file

@ -0,0 +1,37 @@
<?php
/**
*
* @package acp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @package module_install
*/
class acp_update_info
{
function module()
{
return array(
'filename' => 'acp_update',
'title' => 'ACP_UPDATE',
'version' => '1.0.0',
'modes' => array(
'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_', 'cat' => array('ACP_AUTOMATION')),
),
);
}
function install()
{
}
function uninstall()
{
}
}
?>

View file

@ -396,7 +396,7 @@ class auth
$hold_str .= str_repeat("\n", $f - $last_f);
// Convert bitstring for storage - we do not use binary/bytes because PHP's string functions are not fully binary safe
for ($i = 0; $i < strlen($bitstring); $i += 31)
for ($i = 0, $bit_length = strlen($bitstring); $i < $bit_length; $i += 31)
{
$hold_str .= str_pad(base_convert(str_pad(substr($bitstring, $i, 31), 31, 0, STR_PAD_RIGHT), 2, 36), 6, 0, STR_PAD_LEFT);
}
@ -478,18 +478,11 @@ class auth
$sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : '';
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
$sql_opts = '';
$sql_opts = $sql_escape = '';
if ($opts !== false)
{
if (!is_array($opts))
{
$sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'";
}
else
{
$sql_opts = 'AND ' . $db->sql_in_set('ao.auth_option', $opts);
}
$this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape);
}
$hold_ary = array();
@ -519,7 +512,7 @@ class auth
'ORDER_BY' => 'a.forum_id, ao.auth_option'
));
$result = $db->sql_query($sql);
$result = $db->sql_query($sql . $sql_escape);
while ($row = $db->sql_fetchrow($result))
{
@ -595,18 +588,11 @@ class auth
$sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : '';
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
$sql_opts = '';
$sql_opts = $sql_escape = '';
if ($opts !== false)
{
if (!is_array($opts))
{
$sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'";
}
else
{
$sql_opts = 'AND ' . $db->sql_in_set('ao.auth_option', $opts);
}
$this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape);
}
$hold_ary = array();
@ -634,7 +620,7 @@ class auth
'ORDER_BY' => 'a.forum_id, ao.auth_option'
));
$result = $db->sql_query($sql);
$result = $db->sql_query($sql . $sql_escape);
while ($row = $db->sql_fetchrow($result))
{
@ -656,16 +642,11 @@ class auth
$sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? "group_id = $group_id" : $db->sql_in_set('group_id', $group_id)) : '';
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
$sql_opts = $sql_escape = '';
if ($opts !== false)
{
if (!is_array($opts))
{
$sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'";
}
else
{
$sql_opts = 'AND ' . $db->sql_in_set('ao.auth_option', $opts);
}
$this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape);
}
$hold_ary = array();
@ -693,7 +674,7 @@ class auth
'ORDER_BY' => 'a.forum_id, ao.auth_option'
));
$result = $db->sql_query($sql);
$result = $db->sql_query($sql . $sql_escape);
while ($row = $db->sql_fetchrow($result))
{
@ -726,14 +707,14 @@ class auth
// we are going to use the user_add function so include functions_user.php if it wasn't defined yet
if (!function_exists('user_add'))
{
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'";
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@ -757,11 +738,36 @@ class auth
// If login succeeded, we will log the user in... else we pass the login array through...
if ($login['status'] == LOGIN_SUCCESS)
{
$old_session_id = $user->session_id;
if ($admin)
{
global $SID, $_SID;
$cookie_expire = time() - 31536000;
$user->set_cookie('u', '', $cookie_expire);
$user->set_cookie('sid', '', $cookie_expire);
unset($cookie_expire);
$SID = '?sid=';
$user->session_id = $_SID = '';
}
$result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline);
// Successful session creation
if ($result === true)
{
// If admin re-authentication we remove the old session entry because a new one has been created...
if ($admin)
{
// the login array is used because the user ids do not differ for re-authentication
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
WHERE session_id = '" . $db->sql_escape($old_session_id) . "'
AND session_user_id = {$login['user_row']['user_id']}";
$db->sql_query($sql);
}
return array(
'status' => LOGIN_SUCCESS,
'error_msg' => false,
@ -781,6 +787,72 @@ class auth
trigger_error('Authentication method not found', E_USER_ERROR);
}
/**
* Fill auth_option statement for later querying based on the supplied options
*/
function build_auth_option_statement($key, $auth_options, &$sql_opts, &$sql_escape)
{
global $db;
if (!is_array($auth_options))
{
if (strpos($auth_options, '%') !== false)
{
if (strpos($auth_options, '_') !== false)
{
$sql_opts = "AND $key LIKE '" . $db->sql_escape(str_replace('_', "\_", $auth_options)) . "'";
$sql_escape = ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
}
else
{
$sql_opts = "AND $key LIKE '" . $db->sql_escape($auth_options) . "'";
}
}
else
{
$sql_opts = "AND $key = '" . $db->sql_escape($auth_options) . "'";
}
}
else
{
$is_like_expression = $is_underline = false;
foreach ($auth_options as $option)
{
if (strpos($option, '%') !== false)
{
$is_like_expression = true;
}
if (strpos($option, '_') !== false)
{
$is_underline = true;
}
}
if (!$is_like_expression)
{
$sql_opts = 'AND ' . $db->sql_in_set($key, $auth_options);
}
else
{
$sql = array();
foreach ($auth_options as $option)
{
$sql[] = $key . " LIKE '" . $db->sql_escape(str_replace('_', "\_", $option)) . "'";
}
$sql_opts = 'AND (' . implode(' OR ', $sql) . ')';
if ($is_underline)
{
$sql_escape = ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
}
}
}
}
}
?>

View file

@ -136,12 +136,19 @@ function autologin_apache()
return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? array() : $row;
}
if (!function_exists('user_add'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
// create the user if he does not exist yet
user_add(user_row_apache($php_auth_user, $php_auth_pw));
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($php_auth_user) . "'";
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($php_auth_user)) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@ -178,7 +185,7 @@ function user_row_apache($username, $password)
// generate user account data
return array(
'username' => $username,
'user_password' => $password,
'user_password' => md5($password),
'user_email' => '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,

View file

@ -22,7 +22,7 @@ function login_db(&$username, &$password)
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts
FROM ' . USERS_TABLE . "
WHERE username = '" . $db->sql_escape($username) . "'";
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

Some files were not shown because too many files have changed in this diff Show more