Browse Source

! And all the actual tests that relied on it, they're all back to 'not a guest'... or should be.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
ab36f1994b

+ 1 - 2
Sources/Display.php

@@ -1063,7 +1063,6 @@ function Display()
 		'can_merge' => 'merge_any',
 		'can_split' => 'split_any',
 		'calendar_post' => 'calendar_post',
-		'can_mark_notify' => 'mark_any_notify',
 		'can_send_topic' => 'send_topic',
 		'can_send_pm' => 'pm_send',
 		'can_send_email' => 'send_email_to_members',
@@ -1100,7 +1099,7 @@ function Display()
 	}
 
 	// Cleanup all the permissions with extra stuff...
-	$context['can_mark_notify'] &= !$context['user']['is_guest'];
+	$context['can_mark_notify'] = !$context['user']['is_guest'];
 	$context['calendar_post'] &= !empty($modSettings['cal_enabled']);
 	$context['can_add_poll'] &= $modSettings['pollMode'] == '1' && $topicinfo['id_poll'] <= 0;
 	$context['can_remove_poll'] &= $modSettings['pollMode'] == '1' && $topicinfo['id_poll'] > 0;

+ 0 - 8
Sources/ManagePermissions.php

@@ -1110,8 +1110,6 @@ function setPermissionLevel($level, $group, $profile = 'null')
 		'post_reply_any',
 		'delete_own',
 		'modify_own',
-		'mark_any_notify',
-		'mark_notify',
 		'report_any',
 		'send_topic',
 	);
@@ -1200,7 +1198,6 @@ function setPermissionLevel($level, $group, $profile = 'null')
 	// Locked - just that, you can't post here.
 	$boardLevels['locked'] = array(
 		'poll_view',
-		'mark_notify',
 		'report_any',
 		'send_topic',
 		'view_attachments',
@@ -1213,7 +1210,6 @@ function setPermissionLevel($level, $group, $profile = 'null')
 		'post_reply_any',
 		'delete_own',
 		'modify_own',
-		'mark_any_notify',
 		'delete_replies',
 		'modify_replies',
 		'poll_vote',
@@ -1536,8 +1532,6 @@ function loadAllPermissions($loadType = 'classic')
 			'poll_edit' => array(true, 'poll', 'modify', 'moderate'),
 			'poll_lock' => array(true, 'poll', 'moderate', 'moderate'),
 			'poll_remove' => array(true, 'poll', 'modify', 'moderate'),
-			'mark_any_notify' => array(false, 'notification', 'notification'),
-			'mark_notify' => array(false, 'notification', 'notification'),
 			'view_attachments' => array(false, 'attachment', 'participate'),
 			'post_unapproved_attachments' => array(false, 'attachment', 'make_unapproved_posts'),
 			'post_attachment' => array(false, 'attachment', 'attach'),
@@ -2258,8 +2252,6 @@ function loadIllegalGuestPermissions()
 		'manage_membergroups',
 		'manage_permissions',
 		'manage_smileys',
-		'mark_any_notify',
-		'mark_notify',
 		'merge_any',
 		'moderate_board',
 		'moderate_forum',

+ 1 - 1
Sources/MessageIndex.php

@@ -211,7 +211,7 @@ function MessageIndex()
 	$context['page_title'] = strip_tags($board_info['name']);
 
 	// Set the variables up for the template.
-	$context['can_mark_notify'] = allowedTo('mark_notify') && !$user_info['is_guest'];
+	$context['can_mark_notify'] = !$user_info['is_guest'];
 	$context['can_post_new'] = allowedTo('post_new') || ($modSettings['postmod_active'] && allowedTo('post_unapproved_topics'));
 	$context['can_post_poll'] = $modSettings['pollMode'] == '1' && allowedTo('poll_post') && $context['can_post_new'];
 	$context['can_moderate_forum'] = allowedTo('moderate_forum');

+ 0 - 5
Sources/Notify.php

@@ -21,7 +21,6 @@ if (!defined('SMF'))
  * Turn off/on notification for a particular topic.
  * Must be called with a topic specified in the URL.
  * The sub-action can be 'on', 'off', or nothing for what to do.
- * Requires the mark_any_notify permission.
  * Upon successful completion of action will direct user back to topic.
  * Accessed via ?action=notify.
  *
@@ -33,7 +32,6 @@ function Notify()
 
 	// Make sure they aren't a guest or something - guests can't really receive notifications!
 	is_not_guest();
-	isAllowedTo('mark_any_notify');
 
 	// Make sure the topic has been specified.
 	if (empty($topic))
@@ -103,7 +101,6 @@ function Notify()
  * Turn off/on notification for a particular board.
  * Must be called with a board specified in the URL.
  * Only uses the template if no sub action is used. (on/off)
- * Requires the mark_notify permission.
  * Redirects the user back to the board after it is done.
  * Accessed via ?action=notifyboard.
  *
@@ -115,7 +112,6 @@ function BoardNotify()
 
 	// Permissions are an important part of anything ;).
 	is_not_guest();
-	isAllowedTo('mark_notify');
 
 	// You have to specify a board to turn notifications on!
 	if (empty($board))
@@ -188,7 +184,6 @@ function BoardNotify()
  * Turn off/on unread replies subscription for a topic
  * Must be called with a topic specified in the URL.
  * The sub-action can be 'on', 'off', or nothing for what to do.
- * Requires the mark_any_notify permission.
  * Upon successful completion of action will direct user back to topic.
  * Accessed via ?action=unwatchtopic.
  */

+ 2 - 2
Sources/Post.php

@@ -160,7 +160,7 @@ function Post($post_errors = array())
 	}
 
 	// @todo These won't work if you're posting an event!
-	$context['can_notify'] = allowedTo('mark_any_notify');
+	$context['can_notify'] = !$context['user']['is_guest'];
 	$context['can_move'] = allowedTo('move_any');
 	$context['move'] = !empty($_REQUEST['move']);
 	$context['announce'] = !empty($_REQUEST['announce']);
@@ -1941,7 +1941,7 @@ function Post2()
 	}
 
 	// Turn notification on or off.  (note this just blows smoke if it's already on or off.)
-	if (!empty($_POST['notify']) && allowedTo('mark_any_notify'))
+	if (!empty($_POST['notify']) && !$context['user']['is_guest'])
 	{
 		$smcFunc['db_insert']('ignore',
 			'{db_prefix}log_notify',

+ 1 - 3
Sources/Profile-View.php

@@ -599,7 +599,7 @@ function showPosts($memID)
 			'timestamp' => forum_time(true, $row['poster_time']),
 			'id' => $row['id_msg'],
 			'can_reply' => false,
-			'can_mark_notify' => false,
+			'can_mark_notify' => !$context['user']['is_guest'],
 			'can_delete' => false,
 			'delete_possible' => ($row['id_first_msg'] != $row['id_msg'] || $row['id_last_msg'] == $row['id_msg']) && (empty($modSettings['edit_disable_time']) || $row['poster_time'] + $modSettings['edit_disable_time'] * 60 >= time()),
 			'approved' => $row['approved'],
@@ -623,7 +623,6 @@ function showPosts($memID)
 			),
 			'any' => array(
 				'post_reply_any' => 'can_reply',
-				'mark_any_notify' => 'can_mark_notify',
 			)
 		);
 	else
@@ -634,7 +633,6 @@ function showPosts($memID)
 			),
 			'any' => array(
 				'post_reply_any' => 'can_reply',
-				'mark_any_notify' => 'can_mark_notify',
 				'delete_any' => 'can_delete',
 			)
 		);

+ 1 - 2
Sources/Recent.php

@@ -352,7 +352,7 @@ function RecentPosts()
 			),
 			'message' => $row['body'],
 			'can_reply' => false,
-			'can_mark_notify' => false,
+			'can_mark_notify' => !$context['user']['is_guest'],
 			'can_delete' => false,
 			'delete_possible' => ($row['id_first_msg'] != $row['id_msg'] || $row['id_last_msg'] == $row['id_msg']) && (empty($modSettings['edit_disable_time']) || $row['poster_time'] + $modSettings['edit_disable_time'] * 60 >= time()),
 		);
@@ -371,7 +371,6 @@ function RecentPosts()
 		),
 		'any' => array(
 			'post_reply_any' => 'can_reply',
-			'mark_any_notify' => 'can_mark_notify',
 			'delete_any' => 'can_delete',
 		)
 	);

+ 2 - 2
Sources/Search.php

@@ -1727,7 +1727,7 @@ function PlushSearch2()
 	if (!empty($context['topics']))
 	{
 		// Create an array for the permissions.
-		$boards_can = boardsAllowedTo(array('post_reply_own', 'post_reply_any', 'mark_any_notify'), true, false);
+		$boards_can = boardsAllowedTo(array('post_reply_own', 'post_reply_any'), true, false);
 
 		// How's about some quick moderation?
 		if (!empty($options['display_quick_mod']))
@@ -2005,7 +2005,7 @@ function prepareSearchContext($reset = false)
 		'replies' => $message['num_replies'],
 		'can_reply' => in_array($message['id_board'], $boards_can['post_reply_any']) || in_array(0, $boards_can['post_reply_any']),
 		'can_quote' => (in_array($message['id_board'], $boards_can['post_reply_any']) || in_array(0, $boards_can['post_reply_any'])) && $quote_enabled,
-		'can_mark_notify' => in_array($message['id_board'], $boards_can['mark_any_notify']) || in_array(0, $boards_can['mark_any_notify']) && !$context['user']['is_guest'],
+		'can_mark_notify' => !$context['user']['is_guest'],
 		'first_post' => array(
 			'id' => $message['first_msg'],
 			'time' => timeformat($message['first_poster_time']),