Ejemplo n.º 1
0
}
if (!isset($GLOBALS['OS_WIN'])) {
    $GLOBALS['OS_WIN'] = stristr(PHP_OS, 'WIN') !== false;
}
if (w2PgetConfig('activate_external_user_creation') != 'true') {
    die('You should not access this file directly');
}
$username = w2PgetParam($_POST, 'user_username', 0);
$contactListByUsername = CContact::getContactByUsername($username);
if ($contactListByUsername != 'User Not Found') {
    error_reporting(0);
    echo "<script language='javascript'>\n          alert('The username you selected already exists, please select another or if that user name is yours request the password recovery through the dedicated link.');\n          history.go(-2);\n        </script>";
    die;
}
$email = w2PgetParam($_POST, 'contact_email', 0);
$contactListByEmail = CContact::getContactByEmail($email);
if ($contactListByEmail != 'User Not Found') {
    error_reporting(0);
    echo "<script language='javascript'>\n          alert('The email you selected already exists, please select another or if that email is yours request the password recovery through the dedicated link.');\n          history.go(-2);\n        </script>";
    die;
}
$user = new CUser();
if (!$user->bind($_POST)) {
    $AppUI->setMsg($user->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
$contact = new CContact();
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}