Saves user addressing information.
966097
public function save()
    {
        parent::save();

        if ($this->_allowAdminEdit($this->getEditObjectId())) {
            $aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
            $oAdress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
            if (isset($aParams['oxaddress__oxid']) && $aParams['oxaddress__oxid'] == "-1") {
                $aParams['oxaddress__oxid'] = null;
            } else {
                $oAdress->load($aParams['oxaddress__oxid']);
            }

            $oAdress->assign($aParams);
            $oAdress->save();

            $this->sSavedOxid = $oAdress->getId();
        }
    }
480808
private function saveUserBillingAddress($delivery)
    {
                    
        
        // get billing address
        /** @var Address $billingAddress */
        $billingAddress = $this->manager->getRepository('EcommerceBundle:Address')->findOneBy(array(
            'actor' => $this->securityContext->getToken()->getUser(),
            'forBilling' => true
        ));

        
            
        // build new billing address when it does not exist
        if (is_null($billingAddress)) {
            $billingAddress = new Address();
            $billingAddress->setForBilling(true);
            $billingAddress->setActor($this->securityContext->getToken()->getUser());
        }

        
            
        $billingAddress->setContactPerson($delivery->getContactPerson());
        $billingAddress->setDni($delivery->getDni());
        $billingAddress->setAddressInfo($delivery->getAddressInfo());
        $billingAddress->setPhone($delivery->getPhone());
        $billingAddress->setPhone2($delivery->getPhone2());
        $billingAddress->setPreferredSchedule($delivery->getPreferredSchedule());
        $country = $this->manager->getRepository('CoreBundle:Country')->find('es');
        $billingAddress->setCountry($country);

        $this->manager->persist($billingAddress);
        $this->manager->flush();
      
    }
723007
def setup_user_email(request, user, addresses):
    
    from .models import EmailAddress

    assert not EmailAddress.objects.filter(user=user).exists()
    priority_addresses = []
    # Is there a stashed e-mail?
    adapter = get_adapter(request)
    stashed_email = adapter.unstash_verified_email(request)
    if stashed_email:
        priority_addresses.append(EmailAddress(user=user,
                                               email=stashed_email,
                                               primary=True,
                                               verified=True))
    email = user_email(user)
    if email:
        priority_addresses.append(EmailAddress(user=user,
                                               email=email,
                                               primary=True,
                                               verified=False))
    addresses, primary = cleanup_email_addresses(
        request,
        priority_addresses + addresses)
    for a in addresses:
        a.user = user
        a.save()
    EmailAddress.objects.fill_cache_for_user(user, addresses)
    if (primary and email and email.lower() != primary.email.lower()):
        user_email(user, primary.email)
        user.save()
    return primary
1013825
def mark_address(self, addr, size):
        """"""
        i = 0
        while i < size:
            self._register_map[addr] = True
            i += 1
456450
public function updateUserWithAmazonData()
    {
        $billingAddress = $this->getAmazonBillingAddress();

        if ($billingAddress !== null) {
            $oUser = $this->getUser();
            $oUser->assign($billingAddress);
            $oUser->save();
        }
    }
468494
def save_user_and_user_email(self, user, user_email):
        """"""
        if self.UserEmailClass:
            self.db_adapter.save_object(user_email)
        self.db_adapter.save_object(user)
779065
private function action_save()
    {
        $mbox  = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true)); // UTF7-IMAP
        $user  = trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST));
        $acl   = trim(rcube_utils::get_input_value('_acl', rcube_utils::INPUT_POST));
        $oldid = trim(rcube_utils::get_input_value('_old', rcube_utils::INPUT_POST));

        $acl    = array_intersect(str_split($acl), $this->rights_supported());
        $users  = $oldid ? array($user) : explode(',', $user);
        $result = 0;

        foreach ($users as $user) {
            $user   = trim($user);
            $prefix = $this->rc->config->get('acl_groups') ? $this->rc->config->get('acl_group_prefix') : '';

            if ($prefix && strpos($user, $prefix) === 0) {
                $username = $user;
            }
            else if (!empty($this->specials) && in_array($user, $this->specials)) {
                $username = $this->gettext($user);
            }
            else if (!empty($user)) {
                if (!strpos($user, '@') && ($realm = $this->get_realm())) {
                    $user .= '@' . rcube_utils::idn_to_ascii(preg_replace('/^@/', '', $realm));
                }

                // Make sure it's valid email address to prevent from "disappearing folder"
                // issue in Cyrus IMAP e.g. when the acl user identifier contains spaces inside.
                if (strpos($user, '@') && !rcube_utils::check_email($user, false)) {
                    $user = null;
                }

                $username = $user;
            }

            if (!$acl || !$user || !strlen($mbox)) {
                continue;
            }

            $user     = $this->mod_login($user);
            $username = $this->mod_login($username);

            if ($user != $_SESSION['username'] && $username != $_SESSION['username']) {
                if ($this->rc->storage->set_acl($mbox, $user, $acl)) {
                    $ret = array('id' => rcube_utils::html_identifier($user),
                         'username' => $username, 'acl' => implode($acl), 'old' => $oldid);
                    $this->rc->output->command('acl_update', $ret);
                    $result++;
                }
            }
        }

        if ($result) {
            $this->rc->output->show_message($oldid ? 'acl.updatesuccess' : 'acl.createsuccess', 'confirmation');
        }
        else {
            $this->rc->output->show_message($oldid ? 'acl.updateerror' : 'acl.createerror', 'error');
        }
    }
43340
public function AddressForm()
    {
        $personal_fields = CompositeField::create(
            HeaderField::create('PersonalHeader', _t('Checkout.PersonalDetails', 'Personal Details'), 2),
            TextField::create('FirstName', _t('Checkout.FirstName', 'First Name(s)')),
            TextField::create('Surname', _t('Checkout.Surname', 'Surname')),
            CheckboxField::create('Default', _t('Checkout.DefaultAddress', 'Default Address?'))
                ->setRightTitle(_t('Checkout.Optional', 'Optional'))
        )->setName("PersonalFields")
        ->addExtraClass('unit')
        ->addExtraClass('size1of2')
        ->addExtraClass('unit-50');

        $address_fields = CompositeField::create(
            HeaderField::create('AddressHeader', _t('Checkout.Address', 'Address'), 2),
            TextField::create('Address1', _t('Checkout.Address1', 'Address Line 1')),
            TextField::create('Address2', _t('Checkout.Address2', 'Address Line 2'))
                ->setRightTitle(_t('Checkout.Optional', 'Optional')),
            TextField::create('City', _t('Checkout.City', 'City')),
            TextField::create('PostCode', _t('Checkout.PostCode', 'Post Code')),
            CountryDropdownField::create(
                'Country',
                _t('Checkout.Country','Country')
            )->setAttribute("class",'countrydropdown dropdown')
        )->setName("AddressFields")
        ->addExtraClass('unit')
        ->addExtraClass('size1of2')
        ->addExtraClass('unit-50');

        $fields= FieldList::create(
            HiddenField::create("ID"),
            HiddenField::create("OwnerID"),
            CompositeField::create(
                $personal_fields,
                $address_fields
            )->setName("DeliveryFields")
            ->addExtraClass('line')
            ->addExtraClass('units-row')
        );

        $actions = FieldList::create(
            LiteralField::create(
                'BackButton',
                '<a href="' . $this->owner->Link('addresses') . '" class="btn btn-red">' . _t('Checkout.Cancel', 'Cancel') . '</a>'
            ),

            FormAction::create('doSaveAddress', _t('Checkout.Add', 'Add'))
                ->addExtraClass('btn')
                ->addExtraClass('btn-green')
        );

        $validator = RequiredFields::create(array(
            'FirstName',
            'Surname',
            'Address1',
            'City',
            'PostCode',
            'Country',
        ));

        $form = Form::create($this->owner, "AddressForm", $fields, $actions, $validator);

        return $form;
    }
928219
public void setAdminAddress(@CheckForNull String adminAddress) {
        String address = Util.nullify(adminAddress);
        if(address != null && address.startsWith("\"") && address.endsWith("\"")) {
            // some users apparently quote the whole thing. Don't know why
            // anyone does this, but it's a machine's job to forgive human mistake
            address = address.substring(1,address.length()-1);
        }
        this.adminAddress = address;
        save();
    }
524238
def append_user_information(ui)
      # USER INFORMATION:
      # User information item type (1 byte)
      @outgoing.encode_last(ITEM_USER_INFORMATION, "HEX")
      # Reserved (1 byte)
      @outgoing.encode_last("00", "HEX")
      # Encode the user information item values so we can determine the remaining length of this section:
      values = Array.new
      ui.each_index do |i|
        values << @outgoing.encode(ui[i][2], ui[i][1])
      end
      # User information item length (2 bytes)
      items_length = 4*ui.length + values.join.length
      @outgoing.encode_last(items_length, "US")
      # SUB-ITEMS:
      ui.each_index do |i|
        # UI item type (1 byte)
        @outgoing.encode_last(ui[i][0], "HEX")
        # Reserved (1 byte)
        @outgoing.encode_last("00", "HEX")
        # UI item length (2 bytes)
        @outgoing.encode_last(values[i].length, "US")
        # UI value (4 bytes)
        @outgoing.add_last(values[i])
      end
    end
931917
function (details) {
    this.id = details.id;
    this.address = details.address;
    this.type = details.type;
    this.ipVersion = details.ipVersion;
  }
1119937
def save_device_info(self):
        """"""
        if self._workdir is not None:
            devices = []
            for addr in self._devices:
                device = self._devices.get(addr)
                if not device.address.is_x10:
                    aldb = {}
                    for mem in device.aldb:
                        rec = device.aldb[mem]
                        if rec:
                            aldbRec = {'memory': mem,
                                       'control_flags': rec.control_flags.byte,
                                       'group': rec.group,
                                       'address': rec.address.id,
                                       'data1': rec.data1,
                                       'data2': rec.data2,
                                       'data3': rec.data3}
                            aldb[mem] = aldbRec
                    deviceInfo = {'address': device.address.id,
                                  'cat': device.cat,
                                  'subcat': device.subcat,
                                  'product_key': device.product_key,
                                  'aldb_status': device.aldb.status.value,
                                  'aldb': aldb}
                    devices.append(deviceInfo)
            asyncio.ensure_future(self._write_saved_device_info(devices),
                                  loop=self._loop)
932488
def _add_saved_device_info(self, **kwarg):
        """"""
        addr = kwarg.get('address')
        _LOGGER.debug('Found saved device with address %s', addr)
        self._saved_devices[addr] = kwarg
1243624
function(result){

      var data = {},
        geometry = result.geometry,
        viewport = geometry.viewport,
        bounds = geometry.bounds;

      // Create a simplified version of the address components.
      $.each(result.address_components, function(index, object){
        var name = object.types[0];

        $.each(object.types, function(index, name){
          data[name] = object.long_name;
          data[name + "_short"] = object.short_name;
        });
      });

      // Add properties of the places details.
      $.each(placesDetails, function(index, key){
        data[key] = result[key];
      });

      // Add infos about the address and geometry.
      $.extend(data, {
        formatted_address: result.formatted_address,
        location_type: geometry.location_type || "PLACES",
        viewport: viewport,
        bounds: bounds,
        location: geometry.location,
        lat: geometry.location.lat(),
        lng: geometry.location.lng()
      });

      // Set the values for all details.
      $.each(this.details, $.proxy(function(key, $detail){
        var value = data[key];
        this.setDetail($detail, value);
      }, this));

      this.data = data;
    }
314095
public function listAccountAddress($user_id)
    {
        $this->setUserAccountAddress($user_id);
        $this->actionAccountAddress();
        $this->setTitleListAccountAddress();
        $this->setBreadcrumbListAccountAddress();

        $this->setData('user', $this->data_user);
        $this->setData('addresses', $this->getListAccountAddress());

        $this->outputListAccountAddress();
    }
942049
function () {
    const oThis = this;

    // Add comment to ENV
    fileManager.append(setupConfig.env_vars_file, "\n# Addresses");

    for (var account in setupConfig.addresses) {
      oThis._scanAndPopulateEnvVars(setupConfig.addresses[account]);
    }
  }
719179
def onelineaddress(self, address, **kwargs):
        '''
        '''
        fields = {
            'address': address,
        }

        return self._fetch('onelineaddress', fields, **kwargs)