Menu

#635 maybe bug, in owl.lib.php, for multiple database usage

open
nobody
None
5
2009-08-11
2009-07-28
Holger
No

this posting is not meant as bug report, but rather a suggestion for some improvement.
We came across this issue, bcs we are using OWL with multiple databases. It is our impression, that OWL is not yet well tested when working with multiple databases ;-)
I can offer a draft code but it is not really sincerely tested, which please note.

We think the if statement in owl.lib.php; if (!$sess && !$loginname && !$login) is incomplete, and should rather look like this:

if (!$sess && !$loginname && !$login)
{
if (is_anonuser($default->anon_user, $disabled) )
{
if ($disabled != 1) $userid = $default->anon_user;
elseif ($_SERVER["PHP_SELF"] != $default->owl_root_url . "/register.php")
{
if (isset($fileid))
header("Location: " . $default->owl_root_url . "/index.php?login=1&fileid=$fileid&parent=$parent&currentdb=$default->owl_current_db");
elseif(isset($parent) and is_numeric($parent))
header("Location: " . $default->owl_root_url . "/index.php?login=1&parent=$parent&currentdb=$default->owl_current_db");
elseif (isset($_COOKIE["owl_dbid"]) and empty($_POST[currentdb]))
header("Location: " . $default->owl_root_url . "/index.php?login=1&currentdb=" . $_COOKIE["owl_dbid"]);
elseif (!isset($default->owl_current_db))
header("Location: " . $default->owl_root_url . "/index.php?login=1&currentdb=$default->owl_default_db");
else
header("Location: " . $default->owl_root_url . "/index.php?login=1&currentdb=$default->owl_current_db");
}
}
elseif ($_SERVER["PHP_SELF"] != $default->owl_root_url . "/register.php")
{
if (isset($fileid))
header("Location: " . $default->owl_root_url . "/index.php?login=1&failure=4&fileid=$fileid&parent=$parent&currentdb=$default->owl_current_db");
elseif( isset($parent) and is_numeric($parent))
header("Location: " . $default->owl_root_url . "/index.php?login=1&parent=$parent&currentdb=$default->owl_current_db");
elseif (isset($_COOKIE["owl_dbid"]) and empty($_POST[currentdb]))
header("Location: " . $default->owl_root_url . "/index.php?login=1&currentdb=" . $_COOKIE["owl_dbid"]);
elseif (!isset($default->owl_current_db))
header("Location: " . $default->owl_root_url . "/index.php?login=1&currentdb=$default->owl_default_db");
else
header("Location: " . $default->owl_root_url . "/index.php?login=1&currentdb=$default->owl_current_db");
}
}

It would be great to get your comments on this suggestion.

Also I am at this moment seeking for a solution that users simply login without selecting the repository out of all available databases, if the username is unique only for one database and not the others. If the username is valid for more than one database only those repositories shall only shown, where the username is valid. We want to have this, bcs the database name often include customer names, which shall be secret.

Discussion

  • Holger

    Holger - 2009-08-11

    sorry, I forgot to add the exit; in each if clause as per above.

     
  • Holger

    Holger - 2009-08-11
    • summary: maybe bug, in owl.lib.php, for multiple database usgae --> maybe bug, in owl.lib.php, for multiple database usage
     

Log in to post a comment.