src/OwpUsers.inc.php
private function userLoginCore($where_statement)
    {
        if (isset($_SESSION["userData"])) {
            unset($_SESSION["userData"]);
        }

        $get_user_info_row = $this->get_user_info_row($where_statement);

        if ($get_user_info_row) {
            $statusInfo = (array)$this->OwpDBMySQLi->get_row(
                "
                SELECT * FROM tbl_users_status
                WHERE tbl_users_status.statusID = " . (int)$get_user_info_row["statusID"] . "
                LIMIT 1", ARRAY_A
            );

            if (!$statusInfo) {
                throw new OwpUserException("Invalid user status ID.", 911);
            }

            if ((int)$statusInfo["canLogin"] == 0) {
                throw new OwpUserException("Your account " . $statusInfo["status_label"], $statusInfo["statusID"]);
            }

            $_SESSION["userData"] = $get_user_info_row;

            try {
                $this->updateLoginCount((int)$get_user_info_row["userID"]);
            } catch (Exception $e) {
                throw new OwpUserException("Login count update failed.", 911);
            }

            // Execute owpUDF_On_userLoginCore user defined function
            if (function_exists("owpUDF_On_userLoginCore")) {
                owpUDF_On_userLoginCore(array("userID" => (int)$get_user_info_row["userID"], "db" => $this->OwpDBMySQLi));
            }

            return true;
        } else {
            return false;
        }//end if

    }
private function userLoginCore($where_statement)
    {
        if (isset($_SESSION["userData"])) {
            unset($_SESSION["userData"]);
        }

        $get_user_info_row = $this->get_user_info_row($where_statement);

        if ($get_user_info_row) {
            $statusInfo = (array)$this->OwpDBMySQLi->get_row(
                "
                SELECT * FROM tbl_users_status
                WHERE tbl_users_status.statusID = " . (int)$get_user_info_row["statusID"] . "
                LIMIT 1", ARRAY_A
            );

            if (!$statusInfo) {
                throw new OwpUserException("Invalid user status ID.", 911);
            }

            if ((int)$statusInfo["canLogin"] == 0) {
                throw new OwpUserException("Your account " . $statusInfo["status_label"], $statusInfo["statusID"]);
            }

            $_SESSION["userData"] = $get_user_info_row;

            try {
                $this->updateLoginCount((int)$get_user_info_row["userID"]);
            } catch (Exception $e) {
                throw new OwpUserException("Login count update failed.", 911);
            }

            // Execute owpUDF_On_userLoginCore user defined function
            if (function_exists("owpUDF_On_userLoginCore")) {
                owpUDF_On_userLoginCore(array("userID" => (int)$get_user_info_row["userID"], "db" => $this->OwpDBMySQLi));
            }

            return true;
        } else {
            return false;
        }//end if

    }
userLoginCore

@method userLoginCore($where_statement) The core query method
@access private
@return boolean
@param  string $where_statement Where statement to be using within the user row query
@throws OwpUserException OwpUserException custom status handling

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