<?php

if (core::ifPost("from") and core::getPost("from") == "login") {
    $return = array();
    if ($_SERVER['HTTP_HOST'] == DOMAIN_EVENTS) {
        if (event::connectSalarie(core::getPost())) {
            $return["success"] = TRUE;
        } else {
            $return["success"] = FALSE;
        }
    } else {
        if (user::connect(core::getPost())) {
            $return["success"] = TRUE;
        } else {
            $return["success"] = FALSE;
        }
    }
    echo json_encode($return);
    exit();
}