forked from webmin/authentic-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buttons.cgi
executable file
·84 lines (76 loc) · 2.52 KB
/
buttons.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/perl
#
# Authentic Theme 14.02 (https://github.com/qooob/authentic-theme)
# Copyright 2015 Ilia Rostovtsev <[email protected]>
# Licensed under MIT (https://github.com/qooob/authentic-theme/blob/master/LICENSE)
#
$user = $remote_user;
if ( __settings('settings_sysinfo_link_mini') ne 'false' ) {
print '<li class="user-link">';
print '<a target="page" href="'
. $gconfig{'webprefix'}
. '/sysinfo.cgi"><i class="fa fa-fw fa-info"></i></a>';
print '</li>';
}
print '<li class="user-link">';
if ( &foreign_available("acl") ) {
print '<a target="page" data-href="'
. $gconfig{'webprefix'}
. '/acl/edit_user.cgi" href="'
. $gconfig{'webprefix'}
. '/acl/edit_user.cgi?user='
. $user
. '"><i class="fa fa-fw fa-user"></i> '
. $user . '</a>';
}
else {
print
'<a style="pointer-events: none;"><i class="fa fa-fw fa-user"></i> '
. $user . '</a>';
}
print '</li>';
&get_miniserv_config( \%miniserv );
if ( $miniserv{'logout'}
&& !$ENV{'SSL_USER'}
&& !$ENV{'LOCAL_USER'}
&& $ENV{'HTTP_USER_AGENT'} !~ /webmin/i )
{
print '<li class="user-link __logout-link">';
if ($main::session_id) {
print '<a href="'
. $gconfig{'webprefix'}
. '/session_login.cgi?logout=1"><i class="fa fa-fw fa-sign-out text-danger"></i></a>';
}
else {
print '<a href="'
. $gconfig{'webprefix'}
. '/switch_user.cgi"><i class="fa fa-fw fa-exchange text-danger"></i></a>';
}
print '</li>';
}
if ( -r "$root_directory/virtual-server/edit_lang.cgi"
&& __settings('settings_leftmenu_button_language') eq 'true'
&& ( $is_virtualmin != -1
|| $is_cloudmin != -1
|| $in{'xhr-buttons-type'} eq '1' )
)
{
print '<li class="user-link">
<a target="page" href="'
. $gconfig{'webprefix'}
. '/virtual-server/edit_lang.cgi">
<i class="fa fa-fw fa-globe"></i>
</a>
</li>';
}
elsif ( &foreign_available("change-user")
&& __settings('settings_leftmenu_button_language') eq 'true' )
{
print '<li class="user-link"><a target="page" href="'
. $gconfig{'webprefix'}
. '/change-user"><i class="fa fa-fw fa-globe"></i></a></li>';
}
if ( __settings('settings_leftmenu_button_refresh') ne 'false' ) {
print
'<li class="user-link"><a data-refresh="true" style="cursor: pointer"><i class="fa fa-fw fa-refresh"></i></a></li>';
}