mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15886] No profile url for BOTS group
PHPBB3-15886
This commit is contained in:
parent
f023dd590f
commit
f6c93a81d3
2 changed files with 9 additions and 6 deletions
|
@ -109,6 +109,8 @@ class helper
|
||||||
*/
|
*/
|
||||||
public function get_name_string($mode, $group_id, $group_name, $group_colour = '', $custom_profile_url = false)
|
public function get_name_string($mode, $group_id, $group_name, $group_colour = '', $custom_profile_url = false)
|
||||||
{
|
{
|
||||||
|
$s_is_bots = ($group_name === 'BOTS');
|
||||||
|
|
||||||
// This switch makes sure we only run code required for the mode
|
// This switch makes sure we only run code required for the mode
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +119,7 @@ class helper
|
||||||
case 'colour':
|
case 'colour':
|
||||||
|
|
||||||
// Build correct group colour
|
// Build correct group colour
|
||||||
$group_colour = ($group_colour) ? '#' . $group_colour : '';
|
$group_colour = $group_colour ? '#' . $group_colour : '';
|
||||||
|
|
||||||
// Return colour
|
// Return colour
|
||||||
if ($mode === 'colour')
|
if ($mode === 'colour')
|
||||||
|
@ -146,7 +148,7 @@ class helper
|
||||||
|
|
||||||
// Build correct profile url - only show if not anonymous and permission to view profile if registered user
|
// Build correct profile url - only show if not anonymous and permission to view profile if registered user
|
||||||
// For anonymous the link leads to a login page.
|
// For anonymous the link leads to a login page.
|
||||||
if ($group_id && ($this->user->data['user_id'] == ANONYMOUS || $this->auth->acl_get('u_viewprofile')))
|
if ($group_id && !$s_is_bots && ($this->user->data['user_id'] == ANONYMOUS || $this->auth->acl_get('u_viewprofile')))
|
||||||
{
|
{
|
||||||
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&g=' . (int) $group_id : str_replace(array('={GROUP_ID}', '=%7BGROUP_ID%7D'), '=' . (int) $group_id, $this->name_strings['base_url']);
|
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&g=' . (int) $group_id : str_replace(array('={GROUP_ID}', '=%7BGROUP_ID%7D'), '=' . (int) $group_id, $this->name_strings['base_url']);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +169,7 @@ class helper
|
||||||
|
|
||||||
if (!isset($group_name_string))
|
if (!isset($group_name_string))
|
||||||
{
|
{
|
||||||
if (($mode === 'full' && empty($profile_url)) || $mode === 'no_profile')
|
if (($mode === 'full' && empty($profile_url)) || $mode === 'no_profile' || $s_is_bots)
|
||||||
{
|
{
|
||||||
$group_name_string = str_replace(array('{GROUP_COLOUR}', '{GROUP_NAME}'), array($group_colour, $group_name), (!$group_colour) ? $this->name_strings['tpl_noprofile'] : $this->name_strings['tpl_noprofile_colour']);
|
$group_name_string = str_replace(array('{GROUP_COLOUR}', '{GROUP_NAME}'), array($group_colour, $group_name), (!$group_colour) ? $this->name_strings['tpl_noprofile'] : $this->name_strings['tpl_noprofile_colour']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class phpbb_group_helper_get_name_string_test extends phpbb_group_helper_test_ca
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
// Should be fine
|
// Should be fine
|
||||||
array(0, 'Bots', 'AA0000', false, 'Bots'),
|
array(0, 'BOTS', 'AA0000', false, 'Bots'),
|
||||||
array(1, 'new_group', '', false, 'Some new group'),
|
array(1, 'new_group', '', false, 'Some new group'),
|
||||||
array(2, 'group_with_ümlauts', '', 'http://www.example.org/group.php?mode=show', 'Should work'),
|
array(2, 'group_with_ümlauts', '', 'http://www.example.org/group.php?mode=show', 'Should work'),
|
||||||
|
|
||||||
|
@ -80,7 +80,8 @@ class phpbb_group_helper_get_name_string_test extends phpbb_group_helper_test_ca
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
array(0, 'Bots', '000000', false, '<span class="username-coloured" style="color: #000000;">Bots</span>'),
|
array(0, 'BOTS', '000000', false, '<span class="username-coloured" style="color: #000000;">Bots</span>'),
|
||||||
|
array(1, 'BOTS', '111111', false, '<span class="username-coloured" style="color: #111111;">Bots</span>'),
|
||||||
array(7, 'new_group', 'FFA500', false, '<a class="username-coloured" href="' . $phpbb_root_path . 'memberlist.' . $phpEx . '?mode=group&g=7" style="color: #FFA500;">Some new group</a>'),
|
array(7, 'new_group', 'FFA500', false, '<a class="username-coloured" href="' . $phpbb_root_path . 'memberlist.' . $phpEx . '?mode=group&g=7" style="color: #FFA500;">Some new group</a>'),
|
||||||
array(14, 'Awesome group', '', 'http://www.example.org/group.php?mode=show', '<a class="username" href="http://www.example.org/group.php?mode=show&g=14">Awesome group</a>'),
|
array(14, 'Awesome group', '', 'http://www.example.org/group.php?mode=show', '<a class="username" href="http://www.example.org/group.php?mode=show&g=14">Awesome group</a>'),
|
||||||
);
|
);
|
||||||
|
@ -97,7 +98,7 @@ class phpbb_group_helper_get_name_string_test extends phpbb_group_helper_test_ca
|
||||||
public function get_name_string_no_profile_data()
|
public function get_name_string_no_profile_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(0, 'Bots', '000000', false, '<span class="username-coloured" style="color: #000000;">Bots</span>'),
|
array(0, 'BOTS', '000000', false, '<span class="username-coloured" style="color: #000000;">Bots</span>'),
|
||||||
array(1, 'new_group', '', false, '<span class="username">Some new group</span>'),
|
array(1, 'new_group', '', false, '<span class="username">Some new group</span>'),
|
||||||
arraY(2, 'not_uppercase', 'FF0000', false, '<span class="username-coloured" style="color: #FF0000;">not_uppercase</span>'),
|
arraY(2, 'not_uppercase', 'FF0000', false, '<span class="username-coloured" style="color: #FF0000;">not_uppercase</span>'),
|
||||||
array(5, 'Awesome group', '', 'http://www.example.org/group.php?mode=show', '<span class="username">Awesome group</span>'),
|
array(5, 'Awesome group', '', 'http://www.example.org/group.php?mode=show', '<span class="username">Awesome group</span>'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue