Пример #1
0
 $cellular = smart_addslashes($_POST["cellular"]);
 $country = smart_addslashes($_POST["country"]);
 $state = smart_addslashes($_POST["state"]);
 $city = smart_addslashes($_POST["city"]);
 $zip = smart_addslashes($_POST["zip"]);
 $address = smart_addslashes($_POST["address"]);
 $department = smart_addslashes($_POST["department"]);
 $function = smart_addslashes($_POST["function"]);
 $comment = smart_addslashes($_POST["comment"]);
 if ($first_name == '' && $last_name == '') {
     $feedback = "<p class=\"Error\">" . $error_missing_field . "</p>";
 } else {
     $company_name = isset($_POST['company_name']) ? smart_addslashes(trim($_POST['company_name'])) : '';
     if (isset($_POST['company_name']) && $company_name == '') {
         $company_id = 0;
     } elseif ($company_name != '' && !($new_company_id = $ab->get_company_id_by_name($company_name, $addressbook_id))) {
         $acl_read = $GO_SECURITY->get_new_acl('company read');
         $acl_write = $GO_SECURITY->get_new_acl('company write');
         if ($acl_read > 0 && $acl_write > 0 && ($company_id = $ab->add_company($addressbook_id, $GO_SECURITY->user_id, $company_name, '', '', '', '', '', '', '', '', '', '', '', '', '', '', $acl_read, $acl_write, 0))) {
             if ($addressbook = $ab->get_addressbook($addressbook_id)) {
                 $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read);
                 $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write);
             }
         } else {
             $GO_SECURITY->delete_acl($acl_read);
             $GO_SECURITY->delete_acl($acl_write);
             $feedback = "<p class=\"Error\">" . $strSaveError . "</p>";
         }
     } elseif (isset($new_company_id) && $new_company_id != $company_id) {
         $company_id = $new_company_id;
     }
Пример #2
0
         $fax = isset($record[$_POST['fax']]) ? addslashes(trim($record[$_POST['fax']])) : '';
         $work_fax = isset($record[$_POST['work_fax']]) ? addslashes(trim($record[$_POST['work_fax']])) : '';
         $cellular = isset($record[$_POST['cellular']]) ? addslashes(trim($record[$_POST['cellular']])) : '';
         $country = isset($record[$_POST['country']]) ? addslashes(trim($record[$_POST['country']])) : '';
         $state = isset($record[$_POST['state']]) ? addslashes(trim($record[$_POST['state']])) : '';
         $city = isset($record[$_POST['city']]) ? addslashes(trim($record[$_POST['city']])) : '';
         $zip = isset($record[$_POST['zip']]) ? addslashes(trim($record[$_POST['zip']])) : '';
         $address = isset($record[$_POST['address']]) ? addslashes(trim($record[$_POST['address']])) : '';
         $company_name = isset($record[$_POST['company_name']]) ? addslashes(trim($record[$_POST['company_name']])) : '';
         $department = isset($record[$_POST['department']]) ? addslashes(trim($record[$_POST['department']])) : '';
         $function = isset($record[$_POST['function']]) ? addslashes(trim($record[$_POST['function']])) : '';
         $acl_read = $GO_SECURITY->get_new_acl('contact read');
         $acl_write = $GO_SECURITY->get_new_acl('contact write');
         if ($acl_read > 0 && $acl_write > 0) {
             if ($company_name != '') {
                 $company_id = $ab->get_company_id_by_name($company_name, $_POST['addressbook_id']);
             } else {
                 $company_id = 0;
             }
             if ($ab->add_contact("", $GO_SECURITY->user_id, $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $initials, $title, $sex, $birthday, $email, $work_phone, $home_phone, $fax, $cellular, $country, $state, $city, $zip, $address, $company_id, $work_fax, $department, $function, '', $group_id, '', $acl_read, $acl_write)) {
                 $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read);
                 $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write);
             } else {
                 $GO_SECURITY->delete_acl($acl_read);
                 $GO_SECURITY->delete_acl($acl_write);
             }
         }
     }
 } else {
     if (isset($record[$_POST['name']]) && $record[$_POST['name']] != '') {
         $name = addslashes(trim($record[$_POST['name']]));