Ejemplo n.º 1
0
} elseif ($_SESSION["uid"] != "") {
    $uid = $_SESSION["uid"];
    $utype = 1;
} else {
    $uid = -1;
    $utype = 0;
}
require_once "includes/chat/chatSession.php";
if ($utype != 2) {
    if (!isset($_SESSION["chat_session"])) {
        header("Location: start_session.php?error=invalid");
    }
    $chat_sess = new chatSession();
    $chat_sess->useSession($_SESSION["chat_session"]);
    if ($chat_sess->getUID() != $_SESSION["uid"] && isset($_SESSION["uid"])) {
        $chat_sess->setUID($_SESSION["uid"]);
    }
    if (eregi("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$", $chat_sess->getEmail())) {
        $emailValid = true;
    } else {
        $emailValid = false;
    }
    if (!isset($_SESSION["uid"]) && $chat_sess->getName() == "") {
        header("Location: start_session.php?error=user&user="******"uid"]) && !$emailValid) {
        header("Location: start_session.php?error=user&email=" . $chat_sess->getEmail());
    }
} else {
    $chat_sess = new chatSession();
    $secret = $_GET["secret"];
    if ($_GET["session"] == "") {