Coder Social home page Coder Social logo

Virtualmin repository about webmin HOT 3 CLOSED

webmin avatar webmin commented on June 12, 2024
Virtualmin repository

from webmin.

Comments (3)

jcameron avatar jcameron commented on June 12, 2024

We have a separate private repo for Virtualmin, but I could grant you access if you like?

from webmin.

manfer avatar manfer commented on June 12, 2024

I just explain it here because I can't be totally sure if it is part of virtualmin or not. The problem is related to the virtualmin mobile theme that has not implemented the new two-factor authentication field. To solve the issue you only have to edit the file session_login.cgi in virtual-server-mobile folder to add the two-factor authentication field and the corresponding error check.

#!/usr/bin/perl
# Show a simple login form for mobile browsers

$pragma_no_cache = 1;
require 'virtual-server-mobile/virtual-server-mobile-lib.pl';

# Set testing cookie
&ReadParse();
$sec = uc($ENV{'HTTPS'}) eq 'ON' ? "; secure" : "";
&get_miniserv_config(\%miniserv);
$sidname = $miniserv{'sidname'} || "sid";
print "Set-Cookie: banner=0; path=/$sec\r\n" if ($gconfig{'loginbanner'});
print "Set-Cookie: $sidname=x; path=/$sec\r\n" if ($in{'logout'});
print "Set-Cookie: testing=1; path=/$sec\r\n";

# Page title
$title = &theme_use_iui() ? $text{'session_header'} : undef;
&ui_print_unbuffered_header(undef, $title, undef, undef, undef, 1, 1, undef,
        undef, "onLoad='document.forms[0].pass.value = \"\"; ".
               "document.forms[0].user.focus()'");

# Show any error message
if (defined($in{'failed'})) {
        if ($in{'twofactor_msg'}) {
                print &ui_subheading(&text('session_twofailed',
                    &html_escape($in{'twofactor_msg'})));
                }
        else {
                print &ui_subheading($text{'session_failed'});
                }
        }
elsif ($in{'logout'}) {
        print &ui_subheading($text{'session_logout'});
        }
elsif ($in{'timed_out'}) {
        print &ui_subheading(&text('session_timed_out',
                                   int($in{'timed_out'}/60)));
        }

print "$text{'session_prefix'}\n";
print &ui_form_start("$gconfig{'webprefix'}/session_login.cgi", "post");
print &ui_hidden("page", $in{'page'});

# Start of table for form
print &ui_table_start(&theme_use_iui() ? undef : $text{'session_header'},
        undef, 2);

if ($gconfig{'realname'}) {
        $host = &get_display_hostname();
        }
else {
        $host = $ENV{'HTTP_HOST'};
        $host =~ s/:\d+//g;
        $host = &html_escape($host);
        }
print &ui_table_row(undef,
      &text($gconfig{'nohostname'} ? 'session_mesg2' : 'session_mesg',
            "<tt>$host</tt>"), 2);

print &ui_table_row($text{'session_user'},
        &ui_textbox("user", $in{'failed'}, 20));

print &ui_table_row($text{'session_pass'},
        &ui_password("pass", undef, 20));

if ($miniserv{'twofactor_provider'}) {
        print &ui_table_row($text{'session_twofactor'},
                &ui_textbox("twofactor", undef, 20, 0, undef,
                        "autocomplete=off"));
        }

print &ui_table_row(" ",
        &ui_checkbox("save", 1, $text{'session_save'}, 1));

print &ui_table_end();
print &ui_form_end([ [ undef, $text{'session_login'} ] ]);

print "$text{'session_postfix'}\n";

&ui_print_footer();

Maybe you have already found that issue and solved it though it is not available in the downloadable mobile theme in webmin site. Besides this needs review because maybe I miss something else.

from webmin.

jcameron avatar jcameron commented on June 12, 2024

Thanks for pointing this out - the next release of the mobile theme will add the missing field.

from webmin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.