Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:56:37+00:00 2026-05-23T11:56:37+00:00

In this tutorial he creates a custom login form, just to show how it

  • 0

In this tutorial he creates a custom login form, just to show how it is done. Please search for

How do I remove the custom login and fall back to the default?

To code looks like this

sub cgiapp_init {
    my $self = shift;
    my %CFG = $self->cfg;

    # ...

    $self->authen->config(
    DRIVER => [ 'Authen::Simple::LDAP',
            host   => '',
            basedn => '',
    ],

    STORE => 'Session',
    LOGOUT_RUNMODE       => 'logout',
    LOGIN_RUNMODE        => 'login',
    POST_LOGIN_RUNMODE   => 'okay',

    RENDER_LOGIN         => \&my_login_form,
    );

    $self->authen->protected_runmodes(
    'mustlogin',
    );
}

sub login : Runmode {
    my $self   = shift;
    my $url = $self->query->url;

    my $user = $self->authen->username;
    if ($user) {
    my $message = "User $user is already logged in!";
    my $template = $self->load_tmpl('default.html');
    $template->param(MESSAGE => $message);
    $template->param(MYURL => $url);
    return $template->output;
    } else {
    my $url = $self->query->self_url;
    unless ($url =~ /^https/) {
        $url =~ s/^http/https/;
        return $self->redirect($url);
    }
    return $self->my_login_form;
    }
}

Update

Here is mentions that CGI::Application have a default login that looks better than his.

Line 159 specifies a subroutine to use
to generate a login form. Note that
the Authentication plugin comes with a
default form that you can use. I’m
including this one just to demonstrate
how to go about creating one of your
own, in case you really want to. The
default one actually looks much better
than mine, so you might wish to
comment out line 159!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:56:38+00:00Added an answer on May 23, 2026 at 11:56 am

    I’m the author of that tutorial. Sorry for the confusion!
    What I should have said is “comment out lines 157, 158, and 159 of Login.pm”.
    To use the default form that’s built in to the CGI::Application::Plugin::Authentication module, you don’t need to specify LOGIN_RUNMODE, POST_LOGIN_RUNMODE, or RENDER_LOGIN.
    Those are all provided just to help you customize your login page. I included a customized
    version in the tutorial thinking that most people would need to know how to do so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
In this tutorial I am reading , Dave Ward creates a page that shows
ajax tutorial on w3school at http://www.w3schools.com/ajax/ajax_database.asp In this function (function GetXmlHttpObject()), it creates a
I am following this tutorial, I'm using netbeans 6.5.1 http://www.netbeans.org/kb/docs/java/gui-db-custom.html When I get to
I'm following this tutorial to create custom Wordpress options the function within theme/functions/admin-menu.php which
I've been following this tutorial to create my own custom project type and for
I am following this tutorial on how to create custom spinners. Near the begining
I created custom django-admin command. I use this tutorial Writing custom django-admin commands For
Following this tutorial and this question , I attempted to create a custom UIViewController
I'm writing a custom camera application which follow this tutorial: http://marakana.com/forums/android/examples/39.html Now I'm able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.