示例#1
0
         $mandatory['AFFILIATE_NAME'] = 'Handler name';
         $mandatory['AFFILIATE_DESCRIPTION'] = 'Handler phone';
         $mandatory['AFFILIATE_EMAIL'] = 'Handler email';
     }
     list($check, $errors, $error_fields) = forms_check_mandatory($mandatory, $_POST);
     if ($check) {
         try {
             person_update_ltd($_SESSION['user']['PARTY_ID'], $_POST['FIRST_NAME'], $_POST['LAST_NAME'], '', '', '');
             users_update_login($_SESSION['user']['PARTY_ID'], $_POST['USER_LOGIN_ID'], $_POST['CURRENT_PASSWORD']);
             if (isset($_SESSION['FAKE_LOGIN']) && $_SESSION['FAKE_LOGIN']) {
                 person_affiliate_update($_SESSION['user']['PARTY_ID'], $_POST['AFFILIATE_NAME'], $_POST['AFFILIATE_DESCRIPTION'], $_POST['AFFILIATE_EMAIL']);
             }
             // Saving contacts
             contact_delete($_SESSION['user']['PARTY_ID'], COMPANY_CONTACT);
             contact_delete($_SESSION['user']['PARTY_ID'], CONTACT_PERSON_CONTACT);
             contact_delete($_SESSION['user']['PARTY_ID'], ORDER_CONTACTS);
             contact_add($_SESSION['user']['PARTY_ID'], COMPANY_CONTACT, array(CNT_ATTR_NAME => $_POST['NAME'], CNT_ATTR_STREET => $_POST['STREET'], CNT_ATTR_POSTAL => $_POST['POSTAL'], CNT_ATTR_CITY => $_POST['CITY'], CNT_ATTR_COUNTRY => $_POST['COUNTRY'], CNT_ATTR_PHONE => $_POST['PHONE']));
             contact_add($_SESSION['user']['PARTY_ID'], CONTACT_PERSON_CONTACT, array(CNT_ATTR_EMAIL => $_POST['CONTACT_EMAIL'], CNT_ATTR_PHONE => $_POST['CONTACT_PHONE']));
             contact_add($_SESSION['user']['PARTY_ID'], ORDER_CONTACTS, array(CNT_ATTR_EMAIL => $_POST['ORDER_EMAIL'], CNT_ATTR_FTP_ADDR => $_POST['ORDER_FTP_ADDRESS'], CNT_ATTR_FTP_USER => $_POST['ORDER_FTP_USER'], CNT_ATTR_FTP_PASS => $_POST['ORDER_FTP_PASS']));
             $success[] = 'Your profile has been updated';
         } catch (Exception $e) {
             $errors[] = $e->getMessage();
         }
     }
 }
 // Getting clients data
 $customer = person_get($_SESSION['user']['PARTY_ID']);
 $user_login = users_get_login($_SESSION['user']['PARTY_ID']);
 $affiliate = person_affiliate_get($_SESSION['user']['PARTY_ID']);
 $contacts = contact_mech_get($_SESSION['user']['PARTY_ID'], COMPANY_CONTACT);
 $contact_attributes = array();
示例#2
0
                    break;
                case "message_info":
                    $value = message_info($_GET["msg_id"]);
                    break;
                    //case "message_get":
                    // $value = message($_GET["msg_id"]);
                    //  break;
            }
        } else {
            if (isset($_DELETE["action"])) {
                switch ($_DELETE["action"]) {
                    case "user_delete":
                        $value = user_delete($_DELETE["user_id"]);
                        break;
                    case "contact_delete":
                        $value = contact_delete($_POST["contact_id"]);
                        break;
                    case "message_distro_delete":
                        $value = message_distro_delete($_DELETE["user_id_target"], $_DELETE["msg_id"]);
                        break;
                        //case "message_delete":
                        //  $value = message_delete($_DELETE["msg_id"]);
                        //  break;
                }
            } else {
                $value = "Invalid request";
            }
        }
    }
}
//$value = array("action" => "unknown","method" => "none");
示例#3
0
/**
 * Handle contact delete request.
 *
 * @return The url to display on completion.
 */
function command_contact_delete()
{
    // Verify permissions
    if (!user_access('contact_delete')) {
        error_register('Permission denied: contact_delete');
        return crm_url('contacts');
    }
    contact_delete($_POST['cid']);
    return crm_url('contacts');
}