aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2003-11-04 22:05:38 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2003-11-04 22:05:38 +0000
commitcd70db7976f43d01cd3cd41467c09f85298d447b (patch)
tree6f583aba6f9176a1e732652f10a928f0ae004c6c /phpBB/adm
parent88f814a5c57246250a82ad53d43f8f90da5afb60 (diff)
downloadforums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar
forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar.gz
forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar.bz2
forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar.xz
forums-cd70db7976f43d01cd3cd41467c09f85298d447b.zip
new permissions, merged attachment tables (the intended purpose of two tables is no longer valid), attachment updates along the merging...
Note: please merge your attachment tables (develop dir). git-svn-id: file:///svn/phpbb/trunk@4637 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm')
-rw-r--r--phpBB/adm/admin_attachments.php18
-rw-r--r--phpBB/adm/admin_forums.php2
2 files changed, 7 insertions, 13 deletions
diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php
index e129930dee..a4e6ecfed1 100644
--- a/phpBB/adm/admin_attachments.php
+++ b/phpBB/adm/admin_attachments.php
@@ -356,7 +356,7 @@ if ($submit && $mode == 'orphan')
while ($row = $db->sql_fetchrow($result))
{
echo sprintf($user->lang['UPLOADING_FILE_TO'], $upload_list[$row['post_id']], $row['post_id']) . '<br />';
- if (!$auth->acl_get('f_attach', $row['forum_id']))
+ if (!$auth->acl_gets('f_attach', 'u_attach', $row['forum_id']))
{
echo '<span style="color:red">' . sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) . '</span><br /><br />';
}
@@ -716,7 +716,7 @@ function marklist(match, name, status)
<?php
$sql = 'SELECT physical_filename
- FROM ' . ATTACHMENTS_DESC_TABLE;
+ FROM ' . ATTACHMENTS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -918,6 +918,9 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
if ($filedata['post_attach'] && !sizeof($filedata['error']))
{
$message_parser->attachment_data = array(
+ 'post_id' => $post_id,
+ 'poster_id' => $user->data['user_id'],
+ 'topic_id' => $topic_id,
'physical_filename' => $filedata['destination_filename'],
'real_filename' => $filedata['filename'],
'comment' => $message_parser->filename_data['filecomment'],
@@ -936,17 +939,6 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
$db->sql_transaction();
- $sql = 'INSERT INTO ' . ATTACHMENTS_DESC_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
- $db->sql_query($sql);
-
- $attach_sql = array(
- 'attach_id' => $db->sql_nextid(),
- 'post_id' => $post_id,
- 'privmsgs_id' => 0,
- 'user_id_from' => $user->data['user_id'],
- 'user_id_to' => 0
- );
-
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
$db->sql_query($sql);
diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php
index ee88d4d0f5..f30d63eb83 100644
--- a/phpBB/adm/admin_forums.php
+++ b/phpBB/adm/admin_forums.php
@@ -1307,6 +1307,8 @@ function delete_forum_content($forum_id)
switch (SQL_LAYER)
{
case 'mysql4':
+ // Use delete_attachments('topic', $ids, false) here...
+
// Select then delete all attachments
$sql = 'SELECT d.physical_filename, d.thumbnail
FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_DESC_TABLE . ' d, ' . ATTACHMENTS_TABLE . " a