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

SF.net SVN: ledger-smb:[2828] trunk



Revision: 2828
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2828&view=rev
Author:   einhverfr
Date:     2009-12-15 20:55:06 +0000 (Tue, 15 Dec 2009)

Log Message:
-----------
Provisional handling of database not found errors separate from auth prompts

Modified Paths:
--------------
    trunk/INSTALL
    trunk/LedgerSMB/Auth/DB.pm
    trunk/LedgerSMB.pm
    trunk/UI/login.html
    trunk/UI/login.js
    trunk/dists/source/build.sh
    trunk/scripts/login.pl

Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/INSTALL	2009-12-15 20:55:06 UTC (rev 2828)
@@ -118,6 +118,11 @@
 $ perl -v | grep v5.
 This is perl, v5.8.8 built for i686-linux
 
+Using the Makefile.PL requires Module::Install. If you do not have 
+Module::Install loaded on your system, you can install it using:
+
+# cpan Module::Install
+
 Run Makefile.PL to check for LedgerSMB's Perl dependencies. The output should be
 similar to the following:
 

Modified: trunk/LedgerSMB/Auth/DB.pm
===================================================================
--- trunk/LedgerSMB/Auth/DB.pm	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/LedgerSMB/Auth/DB.pm	2009-12-15 20:55:06 UTC (rev 2828)
@@ -214,7 +214,10 @@
                   others  => {}},
         '401' => {status  => '401 Unauthorized', 
                   message => 'Please enter your credentials', 
-                  others  => {'WWW-Authenticate' => "Basic realm=\"LedgerSMB\""}}
+                  others  => {'WWW-Authenticate' => "Basic realm=\"LedgerSMB\""}
+                 },
+        '454' => {status  => '454 Database Does Not Exist',
+                  message => 'Database Does Not Exist' },
     };
     # Ordinarily I would use $cgi->header to generate the headers
     # but this doesn't seem to be working.  Although it is generally desirable

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/LedgerSMB.pm	2009-12-15 20:55:06 UTC (rev 2828)
@@ -744,6 +744,9 @@
 
     if (($self->{script} eq 'login.pl') && ($self->{action} eq 
         'authenticate')){
+        if (!$dbh){
+            $self->{_auth_error} = $DBI::errstr;
+        }
 
         return;
     }

Modified: trunk/UI/login.html
===================================================================
--- trunk/UI/login.html	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/UI/login.html	2009-12-15 20:55:06 UTC (rev 2828)
@@ -52,7 +52,6 @@
 			</div>
 		</div></div>
 		</form>
-		<p><a href="admin.pl"><?lsmb text('Administrative login') ?></a></p>
 	</center>
 </body>
 </html>

Modified: trunk/UI/login.js
===================================================================
--- trunk/UI/login.js	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/UI/login.js	2009-12-15 20:55:06 UTC (rev 2828)
@@ -18,7 +18,11 @@
 		username, password);
 	http.send("");
         if (http.status != 200){
-		alert("Access Denied:  Bad username/Password");
+                if (http.status != '454'){
+  		     alert("Access Denied:  Bad username/Password");
+                } else {
+                     alert('Company does not exist.');
+                }
 		return false;
 	}
 	document.location = document.login.action + "?action=login&company="+

Modified: trunk/dists/source/build.sh
===================================================================
--- trunk/dists/source/build.sh	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/dists/source/build.sh	2009-12-15 20:55:06 UTC (rev 2828)
@@ -2,7 +2,7 @@
 
 # Simple script to prepare for release
 
-version="1.3.0_milestone_3";
+version="1.3.0_beta_1";
 build_d="../release";
 
 if test -d $build_d/ledgersmb; then

Modified: trunk/scripts/login.pl
===================================================================
--- trunk/scripts/login.pl	2009-12-15 20:50:57 UTC (rev 2827)
+++ trunk/scripts/login.pl	2009-12-15 20:55:06 UTC (rev 2828)
@@ -53,7 +53,7 @@
 	    print "\n";
 	    exit;	    
     }
-    elsif ($request->{dbh} || $request->{log_out}){
+    elsif ($request->{dbh} and !$request->{log_out}){
         print "Content-Type: text/html\n";
         print "Set-Cookie: ${LedgerSMB::Sysconfig::cookie_name}=Login; path=$path\n";
 	    print "Status: 200 Success\n\n";
@@ -61,10 +61,15 @@
             exit;
         }
     }
-    else {	
-        print "WWW-Authenticate: Basic realm=\"LedgerSMB\"\n";
-        print "Status: 401 Unauthorized\n\n";
+    else {
+        if ($request->{_auth_error} =~/database/i){
+            print "Status: 454 Database Does Not Exist\n\n";
+            print "No message here";
+        } else {
+            print "WWW-Authenticate: Basic realm=\"LedgerSMB\"\n";
+            print "Status: 401 Unauthorized\n\n";
 	    print "Please enter your credentials.\n";
+        } 
         exit; 
     }
 }


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