Skip to content

Commit 15fee46

Browse files
authored
Merge pull request #82 from topcoder-platform/issues-527
Issues-527: Made tcadmin handle unclickable
2 parents c617f6c + 8428acc commit 15fee46

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Topcoder/class.topcoder.plugin.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,10 @@ private static function topcoderUserTopcoderCache($userFields) {
18921892
return $cached;
18931893
}
18941894

1895+
public static function isUnclickableUser($userName) {
1896+
return strtolower($userName) == 'tcadmin';
1897+
}
1898+
18951899
public static function log($message, $data = []) {
18961900
if (c('Vanilla.SSO.Debug') || c('Debug')) {
18971901
Logger::event(
@@ -2046,7 +2050,8 @@ function userPhoto($user, $options = []) {
20462050

20472051
$isTopcoderAdmin = val('IsAdmin', $topcoderProfile);
20482052
$photoUrl = isset($photoUrl) && !empty(trim($photoUrl)) ? $photoUrl: UserModel::getDefaultAvatarUrl();
2049-
$href = (val('NoLink', $options)) ? '' : ' href="'.url($userLink).'"';
2053+
$isUnlickableUser = TopcoderPlugin::isUnclickableUser($name);
2054+
$href = (val('NoLink', $options)) || $isUnlickableUser ? '' : ' href="'.url($userLink).'"';
20502055

20512056
Gdn::controller()->EventArguments['User'] = $user;
20522057
Gdn::controller()->EventArguments['Title'] =& $title;
@@ -2136,7 +2141,8 @@ function userAnchor($user, $cssClass = null, $options = null) {
21362141
}
21372142

21382143
// Go to Topcoder user profile link instead of Vanilla profile link
2139-
$userUrl = topcoderUserUrl($user, $px);
2144+
$isUnlickableUser = TopcoderPlugin::isUnclickableUser($name);
2145+
$userUrl = $isUnlickableUser? '#' : topcoderUserUrl($user, $px);
21402146

21412147
$topcoderProfile = TopcoderPlugin::getTopcoderUser($userID);
21422148
$topcoderRating = val('Rating',$topcoderProfile, false);
@@ -2150,6 +2156,11 @@ function userAnchor($user, $cssClass = null, $options = null) {
21502156
$attributes['class'] = $attributes['class'].' '. 'topcoderAdmin' ;
21512157
}
21522158

2159+
if($isUnlickableUser) {
2160+
$attributes['class'] = $attributes['class'].' '. 'disabledLink' ;
2161+
}
2162+
2163+
21532164
Gdn::controller()->EventArguments['User'] = $user;
21542165
Gdn::controller()->EventArguments['IsTopcoderAdmin'] =$isTopcoderAdmin;
21552166
Gdn::controller()->EventArguments['Text'] =& $text;

Topcoder/design/topcoder.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,8 @@ a:hover span.challengeRoles {
159159
font-weight: 500 !important;
160160
line-height: 38px !important;
161161
text-transform: uppercase !important;
162+
}
163+
164+
.disabledLink {
165+
pointer-events:none
162166
}

0 commit comments

Comments
 (0)