src/OwpUsers.inc.php
public function sanityCheck($redirect_url = "")
    {
        if ((int)self::userID()) {
            $query_sql = "
                SELECT COUNT(*)
                FROM tbl_users
                WHERE tbl_users.userID = " . (int)self::userID() . "
                LIMIT 1";

            $result = $this->OwpDBMySQLi->get_var($query_sql);

            if ((int)$result === 0) {
                $this->logOut();
                ob_clean();
                if (strlen($redirect_url)) {
                    header('Location: ' . $redirect_url);
                } else {
                    header('Location: ' . "http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER["SERVER_NAME"] . "/");
                }

                exit();
            }
        }//end if

    }
public function sanityCheck($redirect_url = "")
    {
        if ((int)self::userID()) {
            $query_sql = "
                SELECT COUNT(*)
                FROM tbl_users
                WHERE tbl_users.userID = " . (int)self::userID() . "
                LIMIT 1";

            $result = $this->OwpDBMySQLi->get_var($query_sql);

            if ((int)$result === 0) {
                $this->logOut();
                ob_clean();
                if (strlen($redirect_url)) {
                    header('Location: ' . $redirect_url);
                } else {
                    header('Location: ' . "http" . ($_SERVER['HTTPS'] ? "s" : "") . "://" . $_SERVER["SERVER_NAME"] . "/");
                }

                exit();
            }
        }//end if

    }
sanityCheck

@method sanityCheck() Validate that the user session still exists, if not redirect them
@access public

@param string $redirect_url
@throws Exception

@author  Brian Tafoya <btafoya@briantafoya.com>
@version 1.0