Skip to content

Commit 772cdee

Browse files
committed
Added some help UI for first-launches
Signed-off-by: difegue <sugoi@cock.li>
1 parent a0839eb commit 772cdee

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

index.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242

4343
my $out;
4444

45+
#Checking if the user still has the default password enabled
46+
my $passcheck = (&get_password eq "kamimamita");
47+
4548
$tt->process(
4649
"index.tmpl",
4750
{
@@ -51,6 +54,7 @@
5154
motd => &get_motd,
5255
cssdrop => &printCssDropdown(1),
5356
tableJSON => decode_utf8($table),
57+
usingdefpass => $passcheck,
5458
},
5559
\$out,
5660
) or die $tt->error;

templates/index.tmpl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
<link type="image/png" rel="icon" href="./img/favicon.ico" />
99
<link rel="stylesheet" type="text/css" href="./styles/lrr.css" />
1010
<link rel="stylesheet" type="text/css" href="./bower_components/font-awesome/css/font-awesome.min.css" />
11+
<link rel="stylesheet" type="text/css" href="./bower_components/jquery-toast-plugin/dist/jquery.toast.min.css" />
1112

1213
<script src="./bower_components/jquery/dist/jquery.min.js" type="text/JAVASCRIPT"></script>
1314
<script src="./bower_components/datatables/media/js/jquery.dataTables.min.js" type="text/JAVASCRIPT"></script>
1415
<script src="./bower_components/dropit/dropit.js" type="text/JAVASCRIPT"></script>
16+
<script src="./bower_components/jquery-toast-plugin/dist/jquery.toast.min.js" type="text/JAVASCRIPT"></script>
1517
<script src="./js/ajax.js" type="text/JAVASCRIPT"></script>
1618
<script src="./js/index.js" type="text/JAVASCRIPT"></script>
1719
<script src="./js/css.js" type="text/JAVASCRIPT"></script>
@@ -93,7 +95,19 @@
9395
//Init thumbnail hover
9496
showtrail('img/noThumb.png');
9597

96-
archiveJSON = [% tableJSON %]
98+
archiveJSON = [% tableJSON %];
99+
100+
[% IF usingdefpass %]
101+
102+
//If the json has the "default password" flag, flash a friendly notification inviting the user to change his password
103+
$.toast({
104+
heading: 'You\'re using the default password and that\'s super baka of you',
105+
text: '<a href="login.pl">Login</a> with password "kamimamita" and change that shit ASAP before the UnderNet gets you.<br/>Why not check the configuration options afterwards, while you\'re at it? ',
106+
hideAfter: false,
107+
position: 'top-left',
108+
icon: 'error'
109+
});
110+
[% END %]
97111

98112
</script>
99113

0 commit comments

Comments
 (0)