Merged last changes from stable.
[fa-stable.git] / includes / current_user.inc
index ae0a4d753dcf152924a014a28d8520c7b2c90bf7..7d80febbe3b4f02f8f1acb00a5bd1a8d6f3d1903 100644 (file)
@@ -22,6 +22,7 @@ class current_user
        var $loginname;
        var $username;
        var $name;
+       var $email;
        var $company; // user's company
        var $pos;
        var $access;
@@ -130,6 +131,7 @@ class current_user
                    $this->username = $this->loginname;
                    $this->prefs = new user_prefs($myrow);
                    $this->user = @$myrow["id"];
+                $this->email = @$myrow["email"];
                        update_user_visitdate($this->username);
                        $this->logged = true;
                                $this->last_act = time();
@@ -631,6 +633,14 @@ function array_search_key($needle, $haystack, $valuekey=null)
        return @$keys[0];
 }
 
+// Recalculate report columns if orientation is landscape.
+function recalculate_cols(&$cols)
+{
+       $factor = (user_pagesize() == "A4" ? 1.4 : 1.3);
+       foreach($cols as $key => $col)
+               $cols[$key] = intval($col * $factor); 
+}
+
 function flush_dir($path, $wipe = false) 
 {
        $dir = opendir($path);