diff options
author | Arun Persaud <arun@nubati.net> | 2007-12-16 23:50:35 +0100 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2007-12-16 23:57:06 +0100 |
commit | acf6c5f97944366952e6b373a4d59cecd08b658e (patch) | |
tree | 2d1195259980d4535b864a18c261fc28c9ddced4 /output.php | |
parent | 4bf0b36ac7341753904f82dbc6b90cae59dc2b53 (diff) | |
download | e-DoKo-acf6c5f97944366952e6b373a4d59cecd08b658e.tar.gz e-DoKo-acf6c5f97944366952e6b373a4d59cecd08b658e.tar.bz2 e-DoKo-acf6c5f97944366952e6b373a4d59cecd08b658e.zip |
LAYOUT: last login and logout text where displayed incorrectly sometimes
in a previous commit I moved those tings to the output_header function.
Turns out you can't do that, so here is the fix.
Diffstat (limited to 'output.php')
-rw-r--r-- | output.php | 41 |
1 files changed, 20 insertions, 21 deletions
@@ -334,26 +334,6 @@ function output_header() <h1> Welcome to E-Doko <sup style="color:#888;">(beta)</sup> </h1> </div> <?php - if(isset($_SESSION["name"])) - { - $name = $_SESSION["name"]; - - /* logout info */ - echo "<div class=\"status\">\n"; - echo $name; - echo " <a href=\"index.php?logout=1\">logout</a>\n"; - echo "</div>"; - - /* last logon time */ - $myid = DB_get_userid_by_name($name); - $zone = DB_get_user_timezone($myid); - date_default_timezone_set($zone); - - $time = DB_get_user_timestamp($myid); - $unixtime = strtotime($time); - - echo "<div class=\"lastlogin\">last login: ".date("r",$unixtime)."</div>"; - }; echo "<div class=\"main\">"; return; @@ -384,9 +364,28 @@ function output_footer() return; } -function output_status($name) +function output_status() { + if(isset($_SESSION["name"])) + { + $name = $_SESSION["name"]; + + /* logout info */ + echo "<div class=\"status\">\n"; + echo $name; + echo " <a href=\"index.php?logout=1\">logout</a>\n"; + echo "</div>"; + /* last logon time */ + $myid = DB_get_userid_by_name($name); + $zone = DB_get_user_timezone($myid); + date_default_timezone_set($zone); + + $time = DB_get_user_timestamp($myid); + $unixtime = strtotime($time); + + echo "<div class=\"lastlogin\">last login: ".date("r",$unixtime)."</div>"; + }; return; } |