Ejemplo n.º 1
0
$employer = new Employer($id, $sid);
if (!$employer->isActive()) {
    $_SESSION['yel']['employer']['hash'] = "";
    $response['errors'] = array('error' => 'The provided credentials are marked as inactive or suspended.&nbsp;<br/>&nbsp;Please contact your account manager for further assistance.');
    echo $xml_dom->get_xml_from_array($response);
    exit;
    //redirect_to('login.php?invalid=1');
}
if (!$employer->isRegistered($hash)) {
    $_SESSION['yel']['employer']['hash'] = "";
    $response['errors'] = array('error' => 'The provided credentials are invalid. Please try again.');
    echo $xml_dom->get_xml_from_array($response);
    exit;
    //redirect_to('login.php?invalid=1');
}
if (!$employer->setSessionWith($hash)) {
    $_SESSION['yel']['employer']['hash'] = "";
    $response['errors'] = array('error' => 'bad_login');
    echo $xml_dom->get_xml_from_array($response);
    exit;
    //redirect_to('../errors/failed_login.php?dir=employers');
}
// is new?
$response['login'] = array('status' => 'ok');
if ($employer->isNew()) {
    $response['login']['is_new'] = '1';
} else {
    $response['login']['is_new'] = '0';
}
echo $xml_dom->get_xml_from_array($response);
//redirect_to('home.php');