Skip to content

Commit

Permalink
Add user level icons for different logins
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Aug 17, 2019
1 parent 167589f commit c9d827d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
15 changes: 15 additions & 0 deletions authentic-init.pm
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,21 @@ sub get_user_level
return ($level, $has_virtualmin, $has_cloudmin);
}

sub get_user_icon
{
my $user_icon = 'fa2-user-cog';
if ($get_user_level eq '1') {
$user_icon = 'fa2-user-plus';
} elsif ($get_user_level eq '2') {
$user_icon = 'fa2-user-check';
} elsif ($get_user_level eq '3') {
$user_icon = 'fa2-user';
} elsif ($get_user_level eq '4') {
$user_icon = 'fa2-user-friends';
}
return $user_icon;
}

sub set_user_level
{
if ($get_user_level ne '0' && $get_user_level ne '1') {
Expand Down
13 changes: 6 additions & 7 deletions buttons.pm
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,13 @@ if (!$user_mode && $mode_status && $mode_status !~ /^\d+$/) {
my $user_title = get_button_tooltip($title_proc, undef, 'auto top', 1, undef, "aside .user-link");

if ($foreign_acl) {
print '<a' .
$user_title . ' class="menu-exclude-link" data-href="' . $gconfig{'webprefix'} . '/acl/edit_user.cgi" href="' .
$gconfig{'webprefix'} . '/acl/edit_user.cgi?user=' . (get_env('base_remote_user') eq "root" ? "root" : $remote_user) .
'"><i class="fa2 fa-fw fa2-user-tag vertical-align-baseline"></i>&nbsp;<span>' . $remote_user . '</span></a>';
print '<a' . $user_title . ' class="menu-exclude-link" data-href="' .
$gconfig{'webprefix'} . '/acl/edit_user.cgi" href="' . $gconfig{'webprefix'} . '/acl/edit_user.cgi?user=' .
(get_env('base_remote_user') eq "root" ? "root" : $remote_user) . '"><i class="fa2 fa-fw ' .
get_user_icon() . ' vertical-align-baseline"></i>&nbsp;<span>' . $remote_user . '</span></a>';
} else {
print '<a ' . $user_title .
' class="menu-exclude-link cursor-default"><i class="fa2 fa-fw fa2-user-tag vertical-align-baseline"></i>&nbsp;<span>'
. $remote_user . '</span></a>';
print '<a ' . $user_title . ' class="menu-exclude-link cursor-default"><i class="fa2 fa-fw ' .
get_user_icon() . ' vertical-align-baseline"></i>&nbsp;<span>' . $remote_user . '</span></a>';
}
print '</li>';

Expand Down
2 changes: 1 addition & 1 deletion theme.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
desc=Authentic Theme
longdesc=Webmin/Usermin/Virtualmin/Cloudmin theme based on Bootstrap and Font Awesome (https://github.com/authentic-theme/authentic-theme)
version=19.38
mversion=29
mversion=30
depends=1.910 1.760
webmin=1
usermin=1
Loading

0 comments on commit c9d827d

Please sign in to comment.