Updated registration form and login stuff
This commit is contained in:
@@ -68,7 +68,7 @@ class Partnerexpo_Core_Integration_Comment_Form {
|
||||
return;
|
||||
}
|
||||
|
||||
$user_exists = $this->client->get('Contact', ['Email' => $data['email']]);
|
||||
$user_exists = $this->client->get('Contact', ['Email' => $data['email'], 'Deleted' => 0]);
|
||||
if ( ! is_array($user_exists) ) {
|
||||
Logger::log(__("Kontakt létezésének lekérése sikertelen!", "partnerexpo-core"), [$com_id_text => $comment_id, 'email' => $data['email'], $error_text => $this->client->getLastError()]);
|
||||
return;
|
||||
@@ -76,6 +76,7 @@ class Partnerexpo_Core_Integration_Comment_Form {
|
||||
|
||||
$user_id = 0;
|
||||
$has_company = true;
|
||||
$comp_id = 0;
|
||||
|
||||
if ($user_exists['Count'] == 0) {
|
||||
$new_contact = $this->client->put('Contact', [
|
||||
@@ -94,14 +95,16 @@ class Partnerexpo_Core_Integration_Comment_Form {
|
||||
} else {
|
||||
$user_id = array_key_first($user_exists['Results']);
|
||||
$existing_contact = $this->client->get('Contact/'.$user_id);
|
||||
if ( ! is_array($existing_contact) || ! isset($existing_contact['id']) ) {
|
||||
if ( ! is_array($existing_contact) || ! isset($existing_contact['Id']) ) {
|
||||
Logger::log(__("Kontakt adatok lekérése sikertelen!", "partnerexpo-core"), [$com_id_text => $comment_id, 'contact_id' => $user_id, $error_text => $this->client->getLastError()]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($existing_contact['BusinessId']) || empty($existing_contact['BusinessId'])) {
|
||||
$has_company = false;
|
||||
} else {
|
||||
$comp_id = $existing_contact['BusinessId'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( ! $user_id ) {
|
||||
@@ -110,14 +113,12 @@ class Partnerexpo_Core_Integration_Comment_Form {
|
||||
}
|
||||
|
||||
if ( ! $has_company ) {
|
||||
$comp_exists = $this->client->get('Contact', ['Name' => $data['company'], 'Type' => 'Business']);
|
||||
if ( ! is_array($user_exists) ) {
|
||||
$comp_exists = $this->client->get('Contact', ['Name' => $data['company'], 'Type' => 'Business', 'Deleted' => 0]);
|
||||
if ( ! is_array($comp_exists.,.) ) {
|
||||
Logger::log(__("Kontakt létezésének lekérése sikertelen!", "partnerexpo-core"), [$com_id_text => $comment_id, 'email' => $data['email'], $error_text => $this->client->getLastError()]);
|
||||
return;
|
||||
}
|
||||
|
||||
$comp_id = 0;
|
||||
|
||||
if ($comp_exists['Count'] == 0) {
|
||||
$new_comp = $this->client->put('Contact', [
|
||||
'Name' => $data['company'],
|
||||
@@ -143,7 +144,8 @@ class Partnerexpo_Core_Integration_Comment_Form {
|
||||
return;
|
||||
}
|
||||
|
||||
$card_exists = $this->client->get('Project', ['CategoryId' => $category_id, 'ContactId' => $user_id]);
|
||||
|
||||
$card_exists = $this->client->get('Project', ['CategoryId' => $category_id, 'ContactId' => $user_id, 'Deleted' => 0]);
|
||||
if ( ! is_array($card_exists) ) {
|
||||
Logger::log(__("Adatlap adatok lekérése sikertelen:", "partnerexpo-core"), [$com_id_text => $comment_id, 'contact_id' => $user_id, $error_text => $this->client->getLastError()]);
|
||||
return;
|
||||
@@ -193,6 +195,7 @@ class Partnerexpo_Core_Integration_Comment_Form {
|
||||
Logger::log(__("Teendő létrehozása sikertelen létező adatlap esetén!", "partnerexpo-core"), [$com_id_text => $comment_id, 'project_id' => $card_id, $error_text => $this->client->getLastError()]);
|
||||
}
|
||||
}
|
||||
|
||||
} catch ( Exception $e ) {
|
||||
Logger::log(__("Ismeretlen hiba történt a szinkronizálás során!", "partnerexpo-core"), [$com_id_text => $comment_id, 'exception' => $e->getMessage()]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user