mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- removed a useless line [Bug #3656]
- do not reuse session ids [Bug #3626] - Bug #3684 - added refresh imageset option git-svn-id: file:///svn/phpbb/trunk@6257 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
53085a4c78
commit
83e6dcb1ce
6 changed files with 84 additions and 14 deletions
|
@ -274,7 +274,7 @@ class acp_search
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$ids = $posters = array();
|
$ids = $posters = array();
|
||||||
while (false !== ($row = $db->sql_fetchrow($result)))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$ids[] = $row['post_id'];
|
$ids[] = $row['post_id'];
|
||||||
$posters[] = $row['poster_id'];
|
$posters[] = $row['poster_id'];
|
||||||
|
@ -325,7 +325,7 @@ class acp_search
|
||||||
AND post_id < ' . (int) ($post_counter + $this->batch_size);
|
AND post_id < ' . (int) ($post_counter + $this->batch_size);
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while (false !== ($row = $db->sql_fetchrow($result)))
|
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['post_encoding'], $row['poster_id'], $row['forum_id']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,6 +335,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
|
||||||
|
|
||||||
$cache->destroy('sql', STYLES_THEME_TABLE);
|
$cache->destroy('sql', STYLES_THEME_TABLE);
|
||||||
|
|
||||||
|
add_log('admin', 'LOG_THEME_REFRESHED', $theme_row['theme_name']);
|
||||||
trigger_error($user->lang['THEME_REFRESHED'] . adm_back_link($this->u_action));
|
trigger_error($user->lang['THEME_REFRESHED'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -354,7 +355,70 @@ pagination_sep = \'{PAGINATION_SEP}\'
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'imageset':
|
case 'imageset':
|
||||||
$this->frontend('imageset', array('edit', 'details'), array('export', 'delete'));
|
|
||||||
|
switch ($action)
|
||||||
|
{
|
||||||
|
case 'refresh':
|
||||||
|
|
||||||
|
$sql = 'SELECT *
|
||||||
|
FROM ' . STYLES_IMAGESET_TABLE . "
|
||||||
|
WHERE imageset_id = $style_id";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$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));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (confirm_box(true))
|
||||||
|
{
|
||||||
|
$sql_ary = array();
|
||||||
|
|
||||||
|
$cfg_data = parse_cfg_file("{$phpbb_root_path}styles/{$imageset_row['imageset_path']}/imageset/imageset.cfg");
|
||||||
|
|
||||||
|
$imageset_definitions = array();
|
||||||
|
foreach ($this->imageset_keys as $topic => $key_array)
|
||||||
|
{
|
||||||
|
$imageset_definitions = array_merge($imageset_definitions, $key_array);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($cfg_data as $key => $value)
|
||||||
|
{
|
||||||
|
if (strpos($key, 'img_') === 0)
|
||||||
|
{
|
||||||
|
$key = substr($key, 4);
|
||||||
|
if (in_array($key, $imageset_definitions))
|
||||||
|
{
|
||||||
|
$sql_ary[$key] = str_replace('{PATH}', "styles/{$imageset_row['imageset_path']}/imageset/", trim($value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
|
||||||
|
$cache->destroy('sql', STYLES_IMAGESET_TABLE);
|
||||||
|
|
||||||
|
add_log('admin', 'LOG_IMAGESET_REFRESHED', $imageset_row['imageset_name']);
|
||||||
|
trigger_error($user->lang['IMAGESET_REFRESHED'] . adm_back_link($this->u_action));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
confirm_box(false, $user->lang['CONFIRM_IMAGESET_REFRESH'], build_hidden_fields(array(
|
||||||
|
'i' => $id,
|
||||||
|
'mode' => $mode,
|
||||||
|
'action' => $action,
|
||||||
|
'id' => $style_id
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->frontend('imageset', array('edit', 'details'), array('refresh', 'export', 'delete'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -463,8 +463,10 @@ class session
|
||||||
|
|
||||||
$db->sql_return_on_error(true);
|
$db->sql_return_on_error(true);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
$sql = 'DELETE
|
||||||
WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
|
FROM ' . SESSIONS_TABLE . '
|
||||||
|
WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\'
|
||||||
|
AND session_user_id = ' . ANONYMOUS;
|
||||||
|
|
||||||
if (!$this->session_id || !$db->sql_query($sql) || !$db->sql_affectedrows())
|
if (!$this->session_id || !$db->sql_query($sql) || !$db->sql_affectedrows())
|
||||||
{
|
{
|
||||||
|
@ -483,15 +485,16 @@ class session
|
||||||
trigger_error('BOARD_UNAVAILABLE');
|
trigger_error('BOARD_UNAVAILABLE');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->session_id = $this->data['session_id'] = md5(unique_id());
|
|
||||||
|
|
||||||
$sql_ary['session_id'] = (string) $this->session_id;
|
|
||||||
$sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
|
||||||
$db->sql_query($sql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->session_id = $this->data['session_id'] = md5(unique_id());
|
||||||
|
|
||||||
|
$sql_ary['session_id'] = (string) $this->session_id;
|
||||||
|
$sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199);
|
||||||
|
|
||||||
|
$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||||
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$db->sql_return_on_error(false);
|
$db->sql_return_on_error(false);
|
||||||
|
|
||||||
// Regenerate autologin/persistent login key
|
// Regenerate autologin/persistent login key
|
||||||
|
|
|
@ -473,6 +473,7 @@ $lang = array_merge($lang, array(
|
||||||
'LOG_IMAGESET_EDIT_DETAILS' => '<b>Edited imageset details</b><br />» %s',
|
'LOG_IMAGESET_EDIT_DETAILS' => '<b>Edited imageset details</b><br />» %s',
|
||||||
'LOG_IMAGESET_EDIT' => '<b>Edited imageset</b><br />» %s',
|
'LOG_IMAGESET_EDIT' => '<b>Edited imageset</b><br />» %s',
|
||||||
'LOG_IMAGESET_EXPORT' => '<b>Exported imageset</b><br />» %s',
|
'LOG_IMAGESET_EXPORT' => '<b>Exported imageset</b><br />» %s',
|
||||||
|
'LOG_IMAGESET_REFRESHED' => '<b>Refreshed imageset</b><br />» %s',
|
||||||
|
|
||||||
'LOG_INDEX_ACTIVATE' => '<b>Activated inactive users</b><br />» %s',
|
'LOG_INDEX_ACTIVATE' => '<b>Activated inactive users</b><br />» %s',
|
||||||
'LOG_INDEX_DELETE' => '<b>Deleted inactive users</b><br />» %s',
|
'LOG_INDEX_DELETE' => '<b>Deleted inactive users</b><br />» %s',
|
||||||
|
@ -560,6 +561,7 @@ $lang = array_merge($lang, array(
|
||||||
'LOG_THEME_EDIT' => '<b>Edited theme <i>%1$s</i></b><br />» Modified class <i>%2$s</i>',
|
'LOG_THEME_EDIT' => '<b>Edited theme <i>%1$s</i></b><br />» Modified class <i>%2$s</i>',
|
||||||
'LOG_THEME_EDIT_ADD' => '<b>Edited theme <i>%1$s</i></b><br />» Added class <i>%2$s</i>',
|
'LOG_THEME_EDIT_ADD' => '<b>Edited theme <i>%1$s</i></b><br />» Added class <i>%2$s</i>',
|
||||||
'LOG_THEME_EXPORT' => '<b>Exported theme</b><br />» %s',
|
'LOG_THEME_EXPORT' => '<b>Exported theme</b><br />» %s',
|
||||||
|
'LOG_THEME_REFRESHED' => '<b>Refreshed theme</b><br />» %s',
|
||||||
|
|
||||||
'LOG_USER_ACTIVE' => '<b>User activated</b><br />» %s',
|
'LOG_USER_ACTIVE' => '<b>User activated</b><br />» %s',
|
||||||
'LOG_USER_BAN_USER' => '<b>Banned User via user management</b> for reason "<i>%1$s</i>"<br />» %2$s',
|
'LOG_USER_BAN_USER' => '<b>Banned User via user management</b> for reason "<i>%1$s</i>"<br />» %2$s',
|
||||||
|
|
|
@ -54,6 +54,7 @@ $lang = array_merge($lang, array(
|
||||||
'CACHE_FILENAME' => 'Template file',
|
'CACHE_FILENAME' => 'Template file',
|
||||||
'CACHE_FILESIZE' => 'Filesize',
|
'CACHE_FILESIZE' => 'Filesize',
|
||||||
'CACHE_MODIFIED' => 'Modified',
|
'CACHE_MODIFIED' => 'Modified',
|
||||||
|
'CONFIRM_IMAGESET_REFRESH' => 'Are you sure you wish to refresh all imageset data? The settings from the imageset configuration file will overwrite all modifications to the imageset which have been carried out with the imageset editor.',
|
||||||
'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?',
|
'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?',
|
||||||
'CONFIRM_TEMPLATE_REFRESH' => 'Are you sure you wish to refresh all template data in the database with the contents of the template files on the filesystem? This will overwrite all modifications which have been carried out with the template editor while the template was stored in the database.',
|
'CONFIRM_TEMPLATE_REFRESH' => 'Are you sure you wish to refresh all template data in the database with the contents of the template files on the filesystem? This will overwrite all modifications which have been carried out with the template editor while the template was stored in the database.',
|
||||||
'CONFIRM_THEME_REFRESH' => 'Are you sure you wish to refresh the theme data stored in the database with the contents of the theme on the filesystem? This will overwrite all modifications which have been carried out with the theme editor while the theme was stored in the database.',
|
'CONFIRM_THEME_REFRESH' => 'Are you sure you wish to refresh the theme data stored in the database with the contents of the theme on the filesystem? This will overwrite all modifications which have been carried out with the theme editor while the theme was stored in the database.',
|
||||||
|
@ -133,6 +134,7 @@ $lang = array_merge($lang, array(
|
||||||
'IMAGESET_EXPORT_EXPLAIN' => 'Here you can export an imageset in the form of an archive. This archive will contain all the data necessary to install the set of images on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
|
'IMAGESET_EXPORT_EXPLAIN' => 'Here you can export an imageset in the form of an archive. This archive will contain all the data necessary to install the set of images on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
|
||||||
'IMAGESET_EXPORTED' => 'Imageset exported succesfully and stored in %s',
|
'IMAGESET_EXPORTED' => 'Imageset exported succesfully and stored in %s',
|
||||||
'IMAGESET_NAME' => 'Imageset Name',
|
'IMAGESET_NAME' => 'Imageset Name',
|
||||||
|
'IMAGESET_REFRESHED' => 'Imageset refreshed successfully',
|
||||||
'IMAGESET_UPDATED' => 'Imageset updated successfully',
|
'IMAGESET_UPDATED' => 'Imageset updated successfully',
|
||||||
'ITALIC' => 'Italic',
|
'ITALIC' => 'Italic',
|
||||||
|
|
||||||
|
|
|
@ -1089,7 +1089,6 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
$diff = ($diff < 0) ? 1 : 0;
|
$diff = ($diff < 0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$age = (int) (date('Y', time()) - $bday_year - $diff);
|
|
||||||
$user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff);
|
$user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue