Returns the main address.

@return mixed
@VirtualProperty
@SerializedName("mainAddress")
@Groups({"fullAccount", "partialAccount"})
163032
public function getMainAddress()
    {
        $accountAddresses = $this->entity->getAccountAddresses();

        if (!is_null($accountAddresses)) {
            /** @var AccountAddressEntity $accountAddress */
            foreach ($accountAddresses as $accountAddress) {
                if ($accountAddress->getMain()) {
                    return $accountAddress->getAddress();
                }
            }
        }

        return;
    }
471384
public function getAddress() : ?array
     {
        $rtn = $this->data['address'];

        $rtn = json_decode($rtn, true);

        if ($rtn === false) {
            $rtn = null;
        }

        return $rtn;
     }
875290
public static function currentIpAddress() {

    //
    // Just get the headers if we can or else use the SERVER global
    //
    if (function_exists('apache_request_headers')) {
      $headers = apache_request_headers();
    } else {
      $headers = $_SERVER;
    }

    //
    // Get the forwarded IP if it exists
    //
    if (
      array_key_exists('X-Forwarded-For', $headers) &&
      filter_var($headers['X-Forwarded-For'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)
    ) {
      $the_ip = $headers['X-Forwarded-For'];
    }

    elseif (
      array_key_exists('HTTP_X_FORWARDED_FOR', $headers ) &&
      filter_var($headers['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)
    ) {
      $the_ip = $headers['HTTP_X_FORWARDED_FOR'];
    }

    else {
      $the_ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
    }

    return $the_ip;
  }
39173
private function getAddressInterest(){
		$address = array();
		$requete ="
				SELECT a.idHistoriqueAdresse , a.nom , i.idHistoriqueAdresse
				FROM historiqueAdresse a
				LEFT JOIN _interetAdresse i on i.idHistoriqueAdresse = a.idHistoriqueAdresse
				WHERE i.idUtilisateur  = ".$this->userId."
						";
		$res = $this->connexionBdd->requete($requete);
		while ($fetch = mysql_fetch_assoc($res)) {
			$address[]=$fetch['nom'];
		}
		return $address;
	}
338985
protected function GetUserAddressData()
    {
        $aUserAddressData = array();
        $oActiveUser = TdbDataExtranetUser::GetInstance();
        if ($oActiveUser) {
            $oBillingAddress = $oActiveUser->GetBillingAddress();
            if ($oBillingAddress) {
                $aUserAddressData['addr_street'] = $oBillingAddress->fieldStreet.' '.$oBillingAddress->fieldStreetnr;
                $aUserAddressData['addr_zip'] = $oBillingAddress->fieldPostalcode;
                $aUserAddressData['addr_city'] = $oBillingAddress->fieldCity;
                $aUserAddressData['addr_country'] = $this->GetBillingCountryISOCode($oBillingAddress);
                $aUserAddressData['addr_email'] = $oActiveUser->fieldName;
            }
        }

        return $aUserAddressData;
    }
392093
public function getInputsAddresses()
    {
        $addresses = array();
        foreach ($this->getTx()->getInputs() as $txInput) {
            $inputAddresses = $txInput->getAddresses();
            if (is_array($inputAddresses)) {
                $addresses = array_merge($addresses, $inputAddresses);
            }
        }
        return $addresses;
    }
957998
protected function GetUserAddressData()
    {
        $aUserAddressData = parent::GetUserAddressData();
        $oActiveUser = TdbDataExtranetUser::GetInstance();
        if ($oActiveUser) {
            $oBillingAddress = $oActiveUser->GetBillingAddress();
            if ($oBillingAddress) {
                $aUserAddressData['addr_name'] = $oBillingAddress->fieldFirstname.' '.$oBillingAddress->fieldLastname;
            }
        }

        return $aUserAddressData;
    }
624714
public function getIpAddress(): string
    {
        if ($this->ip !== null) {
            return $this->ip;
        }
        $keys = [
            'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP',
            'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR'
        ];
        foreach ($keys as $key) {
            if (array_key_exists($key, $_SERVER) === true) {
                foreach (explode(',', $_SERVER[$key]) as $ip) {
                    if ($this->validateIp($ip = trim($ip))) {
                        return $ip;
                    }
                }
            }
        }
        return '127.0.0.1';
    }
205744
public function getMainUser()
    {
        $currentUser = $this->getUser();

        if ($this->_mainUser === null && $currentUser->getIsGuest() === false) {
            $session = Yii::$app->getSession();
            if ($session->has('main_user')) {
                $mainUserId = $session->get('main_user');
                $mainIdentity = call_user_func([$currentUser->identityClass, 'findIdentity'], $mainUserId);
            } else {
                $mainIdentity = $currentUser->identity;
            }

            $mainUser = clone $currentUser;
            $mainUser->setIdentity($mainIdentity);
            $this->_mainUser = $mainUser;
        }

        return $this->_mainUser;
    }
571212
private function createAddressUrl()
	{
		$urlVariables = [
			'language' => $this->locale,
		];

		if(count($this->isos)) {
			$urlVariables['components'] = 'country:'.implode(',', $this->isos);
		}

		// if true it will always be the final stage in getting the address
		if($this->returnLocationData['latitude'] && $this->returnLocationData['longitude']) {
			$urlVariables['latlng'] = $this->returnLocationData['latitude'].','.$this->returnLocationData['longitude'];
			return $this->buildUrl($urlVariables);
		}

		if($this->returnLocationData['city'] && $this->returnLocationData['country']) {
			$urlVariables['address'] = $this->returnLocationData['city'].', '.$this->returnLocationData['country'];
			return $this->buildUrl($urlVariables);
		}

		if($this->returnLocationData['postal_code']) {
			$urlVariables['address'] = $this->returnLocationData['postal_code'].(($this->returnLocationData['street_number']) ? ' '.$this->returnLocationData['street_number'] : '');
			return $this->buildUrl($urlVariables);
		}


	}
1272146
static public function getAddress()
    {
        foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_X_CLIENT_IP', 'HTTP_X_CLUSTER_CLIENT_IP', 'REMOTE_ADDR') as $header) {
            if (!isset($_SERVER[$header]) || ($spoof = $_SERVER[$header]) === null) {
                continue;
            }
            sscanf($spoof, '%[^,]', $spoof);
            if (!filter_var($spoof, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
                $spoof = null;
            } else {
                return $spoof;
            }
        }
        return '0.0.0.0';
    }
855403
public function getNbAddresses(): string
    {
        if ($this->nb_addresses === null) {
            $this->nb_addresses = gmp_strval(gmp_pow(2, $this->getMaxPrefix() - $this->prefix));
        }

        return $this->nb_addresses;
    }
485587
public function getPrimaryProperty()
    {
        foreach ($this->properties as $property) {

            if ($property->hasOption(Entity\Reflection\Property\Option\Primary::KEY)) {
                return $property;
            }
        }
        throw new \Exception(
            "Primary property not defined in " . $this->className . "!"
        );
    }
61522
public function getAddressInfo()
    {
        $address = new Address();

        $address->setAddress($this->getAddress());
        $address->setPostalCode($this->getPostalCode());
        $address->setCity($this->getCity());
        if(!is_null($this->getState()))$address->setState($this->getState());
        $address->setCountry($this->getCountry());

        return $address;
    }
1329698
public function getFromAddress()
    {
        // get sender address
        $headers = $this->message->headers();
        $from    = rcube_mime::decode_address_list($headers['From'], 1, false, null, true);
        $from    = $from[1];

        return $from;
    }
238519
public byte[] getAddress() {    
        byte[] addr = new byte[4];

        addr[0] = (byte)(( address >>> 24 ) & 0xFF );
        addr[1] = (byte)(( address >>> 16 ) & 0xFF );
        addr[2] = (byte)(( address >>> 8 ) & 0xFF );
        addr[3] = (byte)( address & 0xFF );
        return addr;
    }
60131
public function editaddress()
    {
        $member = Security::getCurrentUser();
        $id = $this->getOwner()->request->param("ID");
        $address = ContactLocation::get()->byID($id);

        if ($address && $address->canEdit($member)) {
            $form = $this->AddressForm();
            $form->loadDataFrom($address);
            $form
                ->Actions()
                ->dataFieldByName("action_doSaveAddress")
                ->setTitle(_t("SilverCommerce\ContactAdmin.Save", "Save"));

            $this
                ->getOwner()
                ->customise([
                    "Title" => _t(
                        "SilverCommerce\ContactAdmin.EditAddress",
                        "Edit Address"
                    ),
                    "MenuTitle" => _t(
                        "SilverCommerce\ContactAdmin.EditAddress",
                        "Edit Address"
                    ),
                    "Form" => $form
                ]);

            $this->getOwner()->extend("updateEditAddress");
            
            return $this
                ->getOwner()
                ->renderWith([
                    'AccountController_editaddress',
                    AccountController::class . '_editaddress',
                    'AccountController',
                    AccountController::class,
                    'Page'
                ]);
        } else {
            return $this->getOwner()->httpError(404);
        }
    }