[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3376] trunk/scripts/login.pl



Revision: 3376
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3376&view=rev
Author:   einhverfr
Date:     2011-06-28 17:23:09 +0000 (Tue, 28 Jun 2011)

Log Message:
-----------
Adding doc strings for login.pl and removing some unused code.

Modified Paths:
--------------
    trunk/scripts/login.pl

Modified: trunk/scripts/login.pl
===================================================================
--- trunk/scripts/login.pl	2011-06-28 17:09:17 UTC (rev 3375)
+++ trunk/scripts/login.pl	2011-06-28 17:23:09 UTC (rev 3376)
@@ -1,15 +1,37 @@
 
+=pod
 
+=head1 NAME
+
+LedgerSMB:Scripts::login, LedgerSMB workflow scripts for managing drafts
+
+=head1 SYNOPSIS
+
+This script contains the request handlers for logging in and out of LedgerSMB.
+    
+=head1 METHODS
+        
+=over   
+        
+=cut
+
+
 package LedgerSMB::Scripts::login;
 our $VERSION = 1.0;
 
 use LedgerSMB::Locale;
-use LedgerSMB; # Required for now to integrate with menu module.
+use LedgerSMB; 
 use LedgerSMB::User;
 use LedgerSMB::Auth;
 use LedgerSMB::Sysconfig;
 use strict;
 
+=item __default (no action specified, do this)
+
+Displays the login screen.
+
+=cut
+
 sub __default {
    my ($request) = @_;
     my $locale;
@@ -29,8 +51,16 @@
     $template->render($request);
 }
 
-# Directly printing like this is made of fail.
+=item authenticate
 
+This routine checks for the authentication information and if successful
+sends either a 302 redirect or a 200 successful response.
+
+If unsuccessful sends a 401 if the username/password is bad, or a 454 error
+if the database does not exist.
+
+=cut
+
 sub authenticate {
     my ($request) = @_;
     if (!$request->{dbh}){
@@ -72,6 +102,12 @@
     }
 }
 
+=item login
+
+Logs in the user and displays the root document.
+
+=cut
+
 sub login {
     my ($request) = @_;
     
@@ -83,6 +119,14 @@
 
 }
 
+=item logout
+
+Logs the user out.  Handling of HTTP browser credentials is browser-specific.
+
+Firefox, Opera, and Internet Explorer are all supported.  Not sure about Chrome
+
+=cut
+
 sub logout {
     my ($request) = @_;
     @{$request->{scripts}} = 
@@ -106,23 +150,17 @@
     $template->render($request);
 }
 
-sub continue {
-    
-    my ($request) = @_;
-    
-    if ($request->{next} && $request->{password}) {
-                
-        $request->{user} = "admin";
-        
-        if (&authenticate($request)) {
-#            LedgerSMB::Handler::call_script();
-        }
-    }
-    else {
-        # well, wtf? This is kind of useless.
-        $request->error("Cannot continue to a Nonexistent page.");
-    }
-}
-    
 eval { do "scripts/custom/login.pl"};
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 LedgerSMB Core Team.  This file is licensed under the GNU 
+General Public License version 2, or at your option any later version.  Please
+see the included License.txt for details.
+
+=cut
+
+
 1;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.