From: Alan T. DeKok Date: Fri, 29 Sep 2023 18:42:25 +0000 (-0400) Subject: note that %integer()... is no longer needed. Casting works fine X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a301b36cbd8e6c31647a99b3e8374b4dc43182ff;p=thirdparty%2Ffreeradius-server.git note that %integer()... is no longer needed. Casting works fine --- diff --git a/doc/antora/modules/installation/pages/upgrade.adoc b/doc/antora/modules/installation/pages/upgrade.adoc index cd17b7b60b6..da847eb97c8 100644 --- a/doc/antora/modules/installation/pages/upgrade.adoc +++ b/doc/antora/modules/installation/pages/upgrade.adoc @@ -698,8 +698,11 @@ postgresql). == Xlat expansions -The use of `%%` to escape `%` is no longer supported. Just use `%`, -and the parser is smart enough to figure things out. +Xlat expansions have been changed from syntax like `%{md5:...}` to `%md5(...)`. + +=== Removed expansions + +`%{integer:...}` has been removed. Just use a cast, such as `(integer) &Service-Type`. == New Modules diff --git a/doc/antora/modules/reference/pages/xlat/builtin.adoc b/doc/antora/modules/reference/pages/xlat/builtin.adoc index 8e7119ab5fb..ad6bbbf1eeb 100644 --- a/doc/antora/modules/reference/pages/xlat/builtin.adoc +++ b/doc/antora/modules/reference/pages/xlat/builtin.adoc @@ -37,42 +37,6 @@ The length of 192.168.0.2 is 4 .... ==== -=== %(integer:) - -Convert a value to an integer. - -In normal operation, `integer` attributes are printed using the name -given by a `VALUE` statement in a dictionary. Similarly, date -attributes are printed as dates, i.e., "January 1 2010. - -The `integer` expansion applies only to attributes which can be -converted to an integer. For all other inputs, it returns `0`. - -A common usage is to find the difference between two dates. - -For example, if a request contains `Service-Type = Login-User`, the -expansion of `%(integer:%{Service-Type})` will yield `1`, which is the -value associated with the `Login-User` name. Using -`%(integer:%{Event-Timestamp})` will return the event timestamp as an -unsigned 32-bit number. - -.Return: _string_ - -.Determining the integer value of an enumerated attribute -==== -[source,unlang] ----- -&control.Service-Type := Login-User -&reply.Reply-Message := "The value of Service-Type is %(integer:%{control.Service-Type})" ----- - -.Output - -``` -The value of Service-Type is 1 -``` -==== - === %{rand:} Generate random number from `0` to `-1`.