Ejemplo n.º 1
0
 $cvSubtypeID = $_GET['CvSubtype'] + 0;
 $contactValue = $_GET['contactValue'];
 $contactProfileObjectID = $_GET['profileObjectId'] + 0;
 $contactUseID = $_GET['contactUseId'] + 0;
 $priorityID = $_GET['priority'] + 0;
 $dpoEmail = $_GET['dpoEmail'] + 0;
 $dptEmail = $_GET['dptEmail'] + 0;
 $dpoPhone = $_GET['dpoPhone'] + 0;
 $dptPhone = $_GET['dptPhone'] + 0;
 // We have the particulars.  We need to verify that the owner name is new.  If
 // it is not, we will retrieve the OwnerNameID from the database to be used with
 // the contact value.
 $contactManager = new ContactManager($domainID, $userID);
 $cvTypes = $contactManager->GetContactValueTypes();
 $priority = new Priority();
 $priority->Get($priorityID);
 /*
 echo '$dpoEmail=\'',$dpoEmail,"'<br>\n";
 echo '$cvTypes[$cvTypeID]->name()=\'', $cvTypes[$cvTypeID]->name(), "'<br>\n";
 echo '$priority->level()=\'', $priority->level(), "'<br>\n";
 */
 // mcb 2010.06.03
 // need to identify to which profile the error message belongs.
 if ($dpoEmail && $cvTypes[$cvTypeID]->name() == "email" && $priority->level() == 1) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a primary email contact to this profile before lowering the priority of the existing primary email contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dptEmail && $cvTypes[$cvTypeID]->name() == "email" && $priority->level() == 2) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a secondary email contact to this profile before lowering the priority of the existing secondary email contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dpoPhone && $cvTypes[$cvTypeID]->name() == "phone" && $priority->level() == 1) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a primary phone contact to this profile before lowering the priority of the existing primary phone contact.</div><br />' . "\n";