Pārlūkot izejas kodu

Apply the newly created permission

Signed-off-by: Suki <[email protected]>
Suki 11 gadi atpakaļ
vecāks
revīzija
3213da9c7c
2 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 2 0
      Sources/ManagePermissions.php
  2. 2 2
      Sources/Profile-Modify.php

+ 2 - 0
Sources/ManagePermissions.php

@@ -1130,6 +1130,7 @@ function setPermissionLevel($level, $group, $profile = 'null')
 		'profile_other_own',
 		'profile_password_own',
 		'profile_server_avatar',
+		'profile_displayed_name',
 		'profile_upload_avatar',
 		'profile_remote_avatar',
 		'profile_remove_own',
@@ -2251,6 +2252,7 @@ function loadIllegalGuestPermissions()
 		'profile_other',
 		'profile_password',
 		'profile_title',
+		'profile_displayed_name',
 		'profile_remove',
 		'profile_server_avatar',
 		'profile_upload_avatar',

+ 2 - 2
Sources/Profile-Modify.php

@@ -476,13 +476,13 @@ function loadProfileFields($force_reload = false)
 			'),
 		),
 		'real_name' => array(
-			'type' => allowedTo('moderate_forum') ? 'text' : 'label',
+			'type' => allowedTo('profile_displayed_name_own') || allowedTo('profile_displayed_name_any') || allowedTo('moderate_forum') ? 'text' : 'label',
 			'label' => $txt['name'],
 			'subtext' => $txt['display_name_desc'],
 			'log_change' => true,
 			'input_attr' => array('maxlength="60"'),
 			'permission' => 'profile_displayed_name',
-			'enabled' => allowedTo('moderate_forum'),
+			'enabled' => allowedTo('profile_displayed_name_own') || allowedTo('profile_displayed_name_any') || allowedTo('moderate_forum'),
 			'input_validate' => create_function('&$value', '
 				global $context, $smcFunc, $sourcedir, $cur_profile;