ok, i am commiting this one, before i am going to disable main posting parts for revamping... i will commit the changes when posting works again then.

git-svn-id: file:///svn/phpbb/trunk@3563 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-02-27 12:56:36 +00:00
parent d128d5d800
commit ff93d24821
2 changed files with 28 additions and 14 deletions

View file

@ -53,7 +53,8 @@ class parse_message
// Smiley check // Smiley check
if (intval($config['max_post_smilies']) && $smilies ) if (intval($config['max_post_smilies']) && $smilies )
{ {
$sql = "SELECT code FROM " . SMILIES_TABLE; $sql = "SELECT code
FROM " . SMILIES_TABLE;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$match = 0; $match = 0;
@ -154,7 +155,8 @@ class parse_message
{ {
global $db, $user; global $db, $user;
$sql = "SELECT * FROM " . SMILIES_TABLE; $sql = "SELECT *
FROM " . SMILIES_TABLE;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))

View file

@ -164,30 +164,42 @@ if ($mode == 'edit' && !empty($poll_start))
// POST INFO // POST INFO
// --------- // ---------
// ----------------- // -----------------
// PERMISSION CHECKS // PERMISSION CHECKS
// Collect general Permissions to be used within the complete page
$forum_id = intval($forum_id);
$perm = array(
'm_lock' => $auth->acl_gets('m_lock', 'a_', intval($forum_id)),
'f_news' => $auth->acl_gets('f_news', 'm_', 'a_', intval($forum_id)),
'f_announce' => $auth->acl_gets('f_announce', 'm_', 'a_', intval($forum_id)),
'f_sticky' => $auth->acl_gets('f_sticky', 'm_', 'a_', intval($forum_id)),
'f_ignoreflood' => $auth->acl_gets('f_ignoreflood', 'm_', 'a_', intval($forum_id)),
'm_edit' => $auth->acl_gets('m_edit', 'a_')
);
if (!$auth->acl_gets('f_' . $mode, 'm_', 'a_', intval($forum_id)) && !empty($forum_postable)) if (!$auth->acl_gets('f_' . $mode, 'm_', 'a_', intval($forum_id)) && !empty($forum_postable))
{ {
trigger_error($user->lang['USER_CANNOT_' . strtoupper($mode)]); trigger_error($user->lang['USER_CANNOT_' . strtoupper($mode)]);
} }
// Forum/Topic locked? // Forum/Topic locked?
if ((intval($forum_status) == ITEM_LOCKED || intval($topic_status) == ITEM_LOCKED) && !$auth->acl_gets('m_edit', 'a_', intval($forum_id))) if ((intval($forum_status) == ITEM_LOCKED || intval($topic_status) == ITEM_LOCKED) && !$perm['m_edit'])
{ {
$message = (intval($forum_status) == ITEM_LOCKED) ? 'FORUM_LOCKED' : 'TOPIC_LOCKED'; $message = (intval($forum_status) == ITEM_LOCKED) ? 'FORUM_LOCKED' : 'TOPIC_LOCKED';
trigger_error($user->lang[$message]); trigger_error($user->lang[$message]);
} }
// Can we edit this post? // Can we edit this post?
if (($mode == 'edit' || $mode == 'delete') && !empty($config['edit_time']) && $post_time < time() - intval($config['edit_time']) && !$auth->acl_gets('m_edit', 'a_', intval($forum_id))) if (($mode == 'edit' || $mode == 'delete') && !empty($config['edit_time']) && $post_time < time() - intval($config['edit_time']) && !$perm['m_edit'])
{ {
trigger_error($user->lang['CANNOT_EDIT_TIME']); trigger_error($user->lang['CANNOT_EDIT_TIME']);
} }
// Do we want to edit our post ? // Do we want to edit our post ?
if ( ($mode == 'edit') && (!$auth->acl_get('m_edit', 'a_', intval($forum_id))) ) if ( ($mode == 'edit') && (!$perm['m_edit']) )
{ {
if ( ($user->data['user_id'] != $poster_id) ) if ( ($user->data['user_id'] != $poster_id) )
{ {
@ -259,7 +271,7 @@ if ($submit)
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
if (intval($row['last_post_time']) && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval']) && !$auth->acl_gets('f_ignoreflood', 'm_', 'a_', intval($forum_id))) if (intval($row['last_post_time']) && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval']) && !$perm['f_ignoreflood'])
{ {
$err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $user->lang['FLOOD_ERROR']; $err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $user->lang['FLOOD_ERROR'];
} }
@ -316,19 +328,19 @@ if ($submit)
switch ($topic_type) switch ($topic_type)
{ {
case POST_NEWS: case POST_NEWS:
$auth_option = 'NEWS'; $auth_option = 'news';
break; break;
case POST_ANNOUNCE: case POST_ANNOUNCE:
$auth_option = 'ANNOUNCE'; $auth_option = 'announce';
break; break;
case POST_STICKY: case POST_STICKY:
$auth_option = 'STICKY'; $auth_option = 'sticky';
break; break;
} }
if (!$auth->acl_gets('f_' . $auth_option, 'm_', 'a_', intval($forum_id))) if (!$perm['f_' . $auth_option])
{ {
$err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $user->lang['CANNOT_POST_' . $auth_option]; $err_msg .= ((!empty($err_msg)) ? '<br />' : '') . $user->lang['CANNOT_POST_' . strtoupper($auth_option)];
} }
} }
@ -606,7 +618,7 @@ if ( ($mode == 'post') || (($mode == 'edit') && (intval($post_id) == intval($top
@reset($topic_types); @reset($topic_types);
while (list($auth_key, $topic_value) = each($topic_types)) while (list($auth_key, $topic_value) = each($topic_types))
{ {
if ($auth->acl_gets('f_' . $auth_key, 'm_', 'a_', intval($forum_id))) if ($perm['f_' . $auth_key])
{ {
$topic_type_toggle .= '<input type="radio" name="topic_type" value="' . $topic_value['const'] . '"'; $topic_type_toggle .= '<input type="radio" name="topic_type" value="' . $topic_value['const'] . '"';
if (intval($topic_type) == $topic_value['const']) if (intval($topic_type) == $topic_value['const'])
@ -707,7 +719,7 @@ $template->assign_vars(array(
'S_NOTIFY_ALLOWED' => ($user->data['user_id'] != ANONYMOUS) ? true : false, 'S_NOTIFY_ALLOWED' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $topic_last_post_id && $poster_id == $user->data['user_id'] && $auth->acl_get('f_delete', intval($forum_id))) || $auth->acl_gets('m_delete', 'a_', intval($forum_id)))) ? true : false, 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $topic_last_post_id && $poster_id == $user->data['user_id'] && $auth->acl_get('f_delete', intval($forum_id))) || $auth->acl_gets('m_delete', 'a_', intval($forum_id)))) ? true : false,
'S_TYPE_TOGGLE' => $topic_type_toggle, 'S_TYPE_TOGGLE' => $topic_type_toggle,
'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_gets('m_lock', 'a_', intval($forum_id)))) ? true : false, 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', 'a_', intval($forum_id)))) ? true : false,
'S_DISPLAY_REVIEW' => ($mode == 'reply' || $mode == 'quote') ? true : false, 'S_DISPLAY_REVIEW' => ($mode == 'reply' || $mode == 'quote') ? true : false,
'S_TOPIC_ID' => intval($topic_id), 'S_TOPIC_ID' => intval($topic_id),