aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorGraham Eames <grahamje@users.sourceforge.net>2006-03-14 20:35:19 +0000
committerGraham Eames <grahamje@users.sourceforge.net>2006-03-14 20:35:19 +0000
commit8c3f94f9ae8a1333be8c01dd2e0be74dffc91831 (patch)
tree7554df2047d48c480d13e01be113d41394390011 /phpBB
parent5f0f004a0f915599ba4b6e445da26830e32d560a (diff)
downloadforums-8c3f94f9ae8a1333be8c01dd2e0be74dffc91831.tar
forums-8c3f94f9ae8a1333be8c01dd2e0be74dffc91831.tar.gz
forums-8c3f94f9ae8a1333be8c01dd2e0be74dffc91831.tar.bz2
forums-8c3f94f9ae8a1333be8c01dd2e0be74dffc91831.tar.xz
forums-8c3f94f9ae8a1333be8c01dd2e0be74dffc91831.zip
We now return the log_id of newly created logs. This is used by the warnings code and may prove to be of use elsewhere or in MODs
git-svn-id: file:///svn/phpbb/trunk@5631 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php2
-rwxr-xr-xphpBB/includes/mcp/mcp_warn.php4
2 files changed, 4 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4c994881ce..4c3b0609d9 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1806,6 +1806,8 @@ function add_log()
}
$db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
+
+ return $db->sql_nextid();
}
/**
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index d0ffb37874..b852bdf9c8 100755
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -401,12 +401,12 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0)
}
add_log('admin', 'LOG_USER_WARNING', $userrow['username']);
- add_log('user', $userrow['user_id'], 'LOG_USER_WARNING_BODY', $warning);
+ $log_id = add_log('user', $userrow['user_id'], 'LOG_USER_WARNING_BODY', $warning);
$sql_ary = array(
'user_id' => $userrow['user_id'],
'post_id' => $post_id,
- 'log_id' => 0, // TODO : Obtain the log_id of the warning
+ 'log_id' => $log_id,
'warning_time' => time(),
);