forked from webmin/authentic-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassword_form.cgi
executable file
·104 lines (87 loc) · 3.76 KB
/
password_form.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/perl
#
# Authentic Theme 18.49 (https://github.com/qooob/authentic-theme)
# Copyright 2014-2017 Ilia Rostovtsev <[email protected]>
# Licensed under MIT (https://github.com/qooob/authentic-theme/blob/18/LICENSE)
#
do "authentic-theme/authentic-lib.pm";
$pragma_no_cache = 1;
$ENV{'MINISERV_INTERNAL'} || die "Can only be called by miniserv.pl";
$charset = &get_charset();
&PrintHeader($charset);
print '<!DOCTYPE HTML>', "\n";
print '<html data-background-style="' . $__settings{'settings_background_color'} . '" class="session_login">',
"\n";
embed_login_head();
print '<body class="session_login" data-style="' . get_filters('content') . '">' . "\n";
print '<div class="container session_login">' . "\n";
if ( $in{'expired'} == 2 ) {
print '<div class="alert alert-info">' . "\n";
print '<i class ="fa fa-exclamation-triangle"></i> ' . $text{'password_temp'} . '' . "\n";
print '</div>' . "\n";
}
else {
print '<div class="alert alert-info">' . "\n";
print '<i class ="fa fa-exclamation-triangle"></i> ' . $text{'password_expired'} . '' . "\n";
print '</div>' . "\n";
}
# Start of the form
print "$text{'password_prefix'}\n";
print '<form method="post" target="_top" action="'
. $gconfig{'webprefix'}
. '/password_change.cgi" class="form-signin session_login clearfix" role="form" onsubmit="spinner()">'
. "\n";
print ui_hidden( "user", $in{'user'} );
print ui_hidden( "pam", $in{'pam'} );
print ui_hidden( "expired", $in{'expired'} );
print '<i class="wbm-webmin"></i><h2 class="form-signin-heading">
<span>'
. ( &get_product_name() eq 'webmin'
? $Atext{'theme_xhred_titles_wm'}
: $Atext{'theme_xhred_titles_um'}
) . '</span></h2>' . "\n";
#Process logo
embed_logo();
# Login message
if ( $gconfig{'realname'} ) {
$host = &get_display_hostname();
}
else {
$host = get_env('server_name');
$host =~ s/:\d+//g;
$host = &html_escape($host);
}
print '<p class="form-signin-paragraph">'
. Atext('theme_new_password_header')
. ' <em><strong>'
. $in{'user'}
. '</strong></em></p>' . "\n";
print '<div class="input-group form-group">' . "\n";
print '<span class="input-group-addon"><i class="fa fa-fw fa-key"></i></span>' . "\n";
print '<input type="password" class="form-control session_login" name="old" autocomplete="off" placeholder="'
. Atext('password_old')
. '" autocomplete="off">' . "\n";
print '</div>' . "\n";
print '<div class="input-group form-group">' . "\n";
print '<span class="input-group-addon"><i class="fa fa-fw fa-key-plus"></i></span>' . "\n";
print '<input type="password" class="form-control session_login" name="new1" autocomplete="off" placeholder="'
. Atext('password_new1')
. '" autocomplete="off">' . "\n";
print '</div>' . "\n";
print '<div class="input-group form-group">' . "\n";
print '<span class="input-group-addon"><i class="fa fa-fw fa-key-plus"></i></span>' . "\n";
print '<input type="password" class="form-control session_login" name="new2" autocomplete="off" placeholder="'
. Atext('password_new2')
. '" autocomplete="off">' . "\n";
print '</div>' . "\n";
print '<div class="form-group">';
print
'<button class="btn btn-primary" type="submit" style="margin-top: 0 !important; width: 100%"><i class="fa fa-unlock"></i> '
. &Atext('password_ok')
. '</button>' . "\n";
print
'<script>function spinner(){var x=$(".fa.fa-unlock"),s =\'<span class="cspinner_container" style="position: absolute; width: 18px; height: 14px; display: inline-block;"><span class="cspinner" style="margin-top: 2px; margin-left: -22px;"><span class="cspinner-icon white small"></span></span></span>\';x.addClass("invisible").after(s);x.parent(".btn").addClass("disabled")}</script>';
print '</div>';
print '</form>' . "\n";
print "$text{'password_postfix'}\n";
&footer();