All mysql_-statments replaced by their corresponding mysqli_-statements
[cacert-devel.git] / includes / loggedin.php
index c14f8c2..5bf157a 100644 (file)
@@ -44,7 +44,7 @@
                        //session_unregister($key);
                }
 
-               $_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($uid)."'"));
+               $_SESSION['profile'] = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], "select * from `users` where `id`='".intval($uid)."'"));
                if($_SESSION['profile']['locked'] == 0)
                        $_SESSION['profile']['loggedin'] = 1;
                else
@@ -70,7 +70,7 @@
                                //session_unregister($key);
                        }
 
-                       $_SESSION['profile'] = mysql_fetch_assoc(mysql_query(
+                       $_SESSION['profile'] = mysqli_fetch_assoc(mysqli_query($_SESSION['mconn'], 
                                        "select * from `users` where `id`='".intval($user_id)."'"));
                        if($_SESSION['profile']['locked'] == 0)
                                $_SESSION['profile']['loggedin'] = 1;
        if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] > 0)
        {
                $query = "select sum(`points`) as `total` from `notary` where `to`='".intval($_SESSION['profile']['id'])."' and `deleted` = 0 group by `to`";
-               $res = mysql_query($query);
-               $row = mysql_fetch_assoc($res);
+               $res = mysqli_query($_SESSION['mconn'], $query);
+               $row = mysqli_fetch_assoc($res);
                $_SESSION['profile']['points'] = $row['total'];
 
                if($_SESSION['profile']['language'] == "")
                {
                        $query = "update `users` set `language`='".L10n::get_translation()."'
                                                        where `id`='".intval($_SESSION['profile']['id'])."'";
-                       mysql_query($query);
+                       mysqli_query($_SESSION['mconn'], $query);
                } else {
                        L10n::set_translation($_SESSION['profile']['language']);
                        L10n::init_gettext();