summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB.pm2
-rwxr-xr-xLedgerSMB/Session/DB.pm4
-rw-r--r--UI/login.js3
-rw-r--r--UI/menu/expanding.css11
-rw-r--r--UI/menu/expanding.html60
-rw-r--r--scripts/login.pl5
-rw-r--r--scripts/menu.pl1
7 files changed, 45 insertions, 41 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index b754e8d0..f0e11c11 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -193,7 +193,7 @@ sub new {
$self->_db_init;
if ($self->is_run_mode('cgi', 'mod_perl')) {
- #check for valid session unless this is an iniital authentication
+ #check for valid session unless this is an inital authentication
#request -- CT
if (!Session::session_check( $cookie{"LedgerSMB"}, $self) ) {
$self->_get_password("Session Expired");
diff --git a/LedgerSMB/Session/DB.pm b/LedgerSMB/Session/DB.pm
index 06385a8f..98694774 100755
--- a/LedgerSMB/Session/DB.pm
+++ b/LedgerSMB/Session/DB.pm
@@ -34,12 +34,13 @@ use strict;
sub session_check {
use Time::HiRes qw(gettimeofday);
my ( $cookie, $form ) = @_;
-
+ print STFERR "Checking Session\n";
my $path = ($ENV{SCRIPT_NAME});
$path =~ s|[^/]*$||;
if ($cookie eq 'Login'){
+ print STDERR "creating session\n";
return session_create($form);
}
my $timeout;
@@ -179,7 +180,6 @@ sub session_create {
if ( !$lsmb->{timeout} ) {
$lsmb->{timeout} = 86400;
}
- print STDERR "Breakpoint\n";
$deleteExisting->execute( $login)
|| $lsmb->dberror(
__FILE__ . ':' . __LINE__ . ': Delete from session: ' );
diff --git a/UI/login.js b/UI/login.js
index cf261624..fd421e26 100644
--- a/UI/login.js
+++ b/UI/login.js
@@ -13,7 +13,8 @@ function submit_form() {
var http = get_http_request_object();
var username = document.login.login.value;
var password = document.login.password.value;
- http.open("get", 'login.pl?action=authenticate', false,
+ http.open("get", 'login.pl?action=authenticate&company='
+ + document.login.company.value, false,
username, password);
http.send("");
alert(http.status);
diff --git a/UI/menu/expanding.css b/UI/menu/expanding.css
index c3b30db9..3a1ba2fe 100644
--- a/UI/menu/expanding.css
+++ b/UI/menu/expanding.css
@@ -1,11 +1,10 @@
-div.submenu {
- display: none;
+li.menu_closed {
}
-A.Menu_Closed:before {
- content: '+';
+li.menu_closed > ul {
+ display: none;
}
-A.Menu_Open:before {
- content: '-';
+li.menu_open > ul {
+ display: block;
}
diff --git a/UI/menu/expanding.html b/UI/menu/expanding.html
index 76a53b71..bec01754 100644
--- a/UI/menu/expanding.html
+++ b/UI/menu/expanding.html
@@ -7,8 +7,16 @@
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
- <link rel="stylesheet" href="UI/menu/expanding.css" type="text/css" title="LedgerSMB stylesheet" />
- <link rel="stylesheet" href="css/<?lsmb stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
+ <!--
+ Please note that the below style tag is NOT in line with
+ how we do things. However, it seems necessary in order to work
+ around a Firefox bug in the the application of the styles.
+ - CT
+ -->
+ <style type="text/css" media="all">
+ @import url("UI/menu/expanding.css");
+ @import url("css/<?lsmb stylesheet ?>");
+ </style>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
@@ -17,23 +25,16 @@
<script type="text/javascript">
function SwitchMenu(id) {
- var obj = "sub_" + id;
+ var obj = "menu_" + id;
if (document.getElementById) {
var element = document.getElementById(obj);
- if (element.style.display == "block") {
- element.style.display = "none";
-
- } else {
- element.style.display = "block"; //display the block of info
- }
- obj = 'a_' + id;
element = document.getElementById(obj);
- if (element.className == 'Menu_Open'){
+ if (element.className == 'menu_open'){
element.className
- = 'Menu_Closed';
+ = 'menu_closed';
} else {
- element.className = 'Menu_Open';
+ element.className = 'menu_open';
}
return false;
}
@@ -47,21 +48,30 @@
<body class="menu">
<img class="cornderlogo" src="images/ledgersmb_small.png" width="100" height="50" border="1" alt="LedgerSMB" />
+ <ul id="top_menu" class="menu_open">
+ <?lsmb old_level = 0 ?>
<?lsmb FOREACH item = menu_items ?>
<?lsmb href = "" ?>
+ <!-- <?lsmb item.level ?> :: <?lsmb old_level ?> -->
<?lsmb WHILE item.level < old_level ?>
- </div><?lsmb old_level = old_level - 1 ?>
+ </li></ul><?lsmb old_level = old_level - 1 ?>
<?lsmb END ?>
- <div class="Menu" id="menu_<?lsmb item.id ?>">
+ <?lsmb IF old_level > 0 && item.level <= old_level ?></li><?lsmb END ?>
+ <?lsmb old_level = item.level ?>
+ <li id="menu_<?lsmb item.id ?>"
+ class = "<?lsmb IF (item.menu && item.open)
+ ?>menu_open<?lsmb ELSIF item.menu
+ ?>menu_closed<?lsmb
+ ELSE ?>menu_item<?lsmb END ?>">
<a href="<?lsmb IF item.module ?><?lsmb item.module
?><?lsmb ELSE ?>menu.pl<?lsmb END
?>?login=<?lsmb login
- ?>&<?lsmb FOREACH arg IN item.args
+ ?>&amp;<?lsmb FOREACH arg IN item.args
?><?lsmb arg
- ?>&<?lsmb END
+ ?>&amp;<?lsmb END
?><?lsmb IF item.menu
?>id=<?lsmb item.id
- ?>&open=<?lsmb open
+ ?>&amp;open=<?lsmb open
?><?lsmb END ?>"
<?lsmb IF (item.module != 'menu.pl') &&
('login.pl' != item.module) ?>
@@ -75,21 +85,15 @@
('New Menu' != item.label) ?>
onclick="return SwitchMenu('<?lsmb item.id ?>')"
<?lsmb END ?>
- class = "<?lsmb IF (item.menu && item.open)
- ?>Menu_Open<?lsmb ELSIF item.menu
- ?>Menu_Closed<?lsmb
- ELSE ?>Menu_Item<?lsmb END ?>"
id = "a_<?lsmb item.id ?>"
><?lsmb text(item.label) ?></a>
- </div>
<?lsmb IF item.menu && (item.label != 'New Window') ?>
- <div id="sub_<?lsmb item.id ?>" class="submenu"
- <?lsmb IF item.open ?>
- style="display: block"
- <?lsmb END ?>>
+ <ul id="sub_<?lsmb item.id ?>" class="submenu">
<?lsmb END ?>
- <?lsmb old_level = item.level ?>
<?lsmb END ?>
+ <?lsmb WHILE 0 < old_level ?>
+ </li></ul><?lsmb old_level = old_level - 1 ?>
+ <?lsmb END ?>
</body>
diff --git a/scripts/login.pl b/scripts/login.pl
index 30a6eed3..c51b3fbd 100644
--- a/scripts/login.pl
+++ b/scripts/login.pl
@@ -25,14 +25,15 @@ sub __default {
sub authenticate {
my ($request) = @_;
if (!$request->{dbh}){
- $request->{company} = 'ledgersmb-taxtest';
+ if (!$request->{company}){
+ $request->{company} = $LedgerSMB::Sysconfig::default_db;
+ }
$request->_db_init;
}
my $path = $ENV{SCRIPT_NAME};
$path =~ s|[^/]*$||;
if ($request->{dbh} || $request->{log_out}){
print "Content-Type: text/html\n";
-## print "Set-Cookie: LedgerSMB=Login;\n";
print "Set-Cookie: LedgerSMB=Login; path=$path\n";
print "Status: 200 Success\n\n";
if ($request->{log_out}){
diff --git a/scripts/menu.pl b/scripts/menu.pl
index ad362c1c..f873398f 100644
--- a/scripts/menu.pl
+++ b/scripts/menu.pl
@@ -105,7 +105,6 @@ there nodes which are supposed to be open are marked.
sub expanding_menu {
my ($request) = @_;
- print STDERR 'Breakpoint\n';
if ($request->{'open'} !~ s/:$request->{id}:/:/){
$request->{'open'} .= ":$request->{id}:";
}