]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove '&' from sqlcounter configuration and source
authorAlan T. DeKok <aland@freeradius.org>
Thu, 6 Mar 2025 14:18:31 +0000 (09:18 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 6 Mar 2025 16:39:08 +0000 (11:39 -0500)
doc/antora/modules/reference/pages/raddb/mods-available/sqlcounter.adoc
raddb/mods-available/sqlcounter
src/modules/rlm_sqlcounter/rlm_sqlcounter.c

index f5291564ec6aaa1511d4cbae800db0cc6573731c..05c827246f697e415ae4161d037d59920c3c81bf 100644 (file)
@@ -67,14 +67,14 @@ from the database.
 reset_period_start_name::  The name of the attribute which is used to store the
 time that the current reset period started.
 
-The default is `&control.${.:instance}-Reset-Start`
+The default is `control.${.:instance}-Reset-Start`
 
 Note because we are counting seconds, this attribute is of type `uint64`, and not `date`.
 
 reset_period_end_name::  The name of the attribute which is used to store the
 time that the current reset period will end.
 
-The default is `&control.${.:instance}-Reset-End`
+The default is `control.${.:instance}-Reset-End`
 
 Note because we are counting seconds, this attribute is of type `uint64`, and not `date`.
 
@@ -87,7 +87,7 @@ After the sqlcounter module has run, the counter attribute will exist.
 check_name:: Name of the attribute containing the limit to compare the counter to.
 
 reply_name:: Name of the attribute to populate with the remaining session time.
-e.g. `&reply.Session-Timeout`.  If the attribute already exists and contains
+e.g. `reply.Session-Timeout`.  If the attribute already exists and contains
 a lower value, then it will not be updated.
 
 reply_message_name:: Name of the attribute into which a message should be placed
@@ -146,51 +146,51 @@ NOTE: You may need to edit `raddb/dictionary` to add the `Expire-After` attribut
 #      sqlcounter <name> {
 #      sql_module_instance = sql_foo
 #      reset = 12h
-#      key = "%{&Stripped-User-Name || &User-Name}"
-#      if (&control.Daily-Session-Time > 3600) {
-#               &Reply-Message := "You've used up more than one hour today"
+#      key = "%{Stripped-User-Name || User-Name}"
+#      if (control.Daily-Session-Time > 3600) {
+#               Reply-Message := "You've used up more than one hour today"
 #               reject
 #      }
 sqlcounter dailycounter {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
-#      reset_period_start_name = &control.${.:instance}-Reset-Start
-#      reset_period_end_name = &control.${.:instance}-Reset-End
-       counter_name = &control.Daily-Session-Time
-       check_name = &control.Max-Daily-Session
-       reply_name = &reply.Session-Timeout
+#      reset_period_start_name = control.${.:instance}-Reset-Start
+#      reset_period_end_name = control.${.:instance}-Reset-End
+       counter_name = control.Daily-Session-Time
+       check_name = control.Max-Daily-Session
+       reply_name = reply.Session-Timeout
        auto_extend = yes
-       key = "%{&Stripped-User-Name || &User-Name}"
-       reply_message_name = &Reply-Message
+       key = "%{Stripped-User-Name || User-Name}"
+       reply_message_name = Reply-Message
        reset = daily
        $INCLUDE ${modconfdir}/sql/counter/${dialect}/${.:instance}.conf
 }
 sqlcounter monthlycounter {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
-       counter_name = &Monthly-Session-Time
-       check_name = &control.Max-Monthly-Session
-       reply_name = &reply.Session-Timeout
+       counter_name = Monthly-Session-Time
+       check_name = control.Max-Monthly-Session
+       reply_name = reply.Session-Timeout
        auto_extend = yes
-       key = &User-Name
+       key = User-Name
        reset = monthly
        $INCLUDE ${modconfdir}/sql/counter/${dialect}/${.:instance}.conf
 }
 sqlcounter noresetcounter {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
-       counter_name = &Max-All-Session-Time
-       check_name = &control.Max-All-Session
-       key = &User-Name
+       counter_name = Max-All-Session-Time
+       check_name = control.Max-All-Session
+       key = User-Name
        reset = never
        $INCLUDE ${modconfdir}/sql/counter/${dialect}/${.:instance}.conf
 }
 sqlcounter expire_on_login {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
-       counter_name = &Expire-After-Initial-Login
-       check_name = &control.Expire-After
-       key = &User-Name
+       counter_name = Expire-After-Initial-Login
+       check_name = control.Expire-After
+       key = User-Name
        reset = never
        $INCLUDE ${modconfdir}/sql/counter/${dialect}/${.:instance}.conf
 }
index 576a7c6dfaecb4394183e0049b868b36552c0488..c30ee5db194f464da9f6a5e528870245b63d1917 100644 (file)
 #  The `query` parameter specifies the SQL query used to get the current Counter value
 #  from the database.
 #
-#      key = "%{&Stripped-User-Name || &User-Name}"
+#      key = "%{Stripped-User-Name || User-Name}"
 #
 #  reset_period_start_name::  The name of the attribute which is used to store the
 #  time that the current reset period started.
 #
-#  The default is `&control.${.:instance}-Reset-Start`
+#  The default is `control.${.:instance}-Reset-Start`
 #
 #  Note because we are counting seconds, this attribute is of type `uint64`, and not `date`.
 #
 #  reset_period_end_name::  The name of the attribute which is used to store the
 #  time that the current reset period will end.
 #
-#  The default is `&control.${.:instance}-Reset-End`
+#  The default is `control.${.:instance}-Reset-End`
 #
 #  Note because we are counting seconds, this attribute is of type `uint64`, and not `date`.
 #
 #
 #  After the sqlcounter module has run, the counter attribute will exist.
 #
-#      if (&control.Daily-Session-Time > 3600) {
-#               &Reply-Message := "You've used up more than one hour today"
+#      if (control.Daily-Session-Time > 3600) {
+#               Reply-Message := "You've used up more than one hour today"
 #               reject
 #      }
 #
 #  check_name:: Name of the attribute containing the limit to compare the counter to.
 #
 #  reply_name:: Name of the attribute to populate with the remaining session time.
-#  e.g. `&reply.Session-Timeout`.  If the attribute already exists and contains
+#  e.g. `reply.Session-Timeout`.  If the attribute already exists and contains
 #  a lower value, then it will not be updated.
 #
 #  reply_message_name:: Name of the attribute into which a message should be placed
@@ -125,14 +125,14 @@ sqlcounter dailycounter {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
 
-#      reset_period_start_name = &control.${.:instance}-Reset-Start
-#      reset_period_end_name = &control.${.:instance}-Reset-End
-       counter_name = &control.Daily-Session-Time
-       check_name = &control.Max-Daily-Session
-       reply_name = &reply.Session-Timeout
+#      reset_period_start_name = control.${.:instance}-Reset-Start
+#      reset_period_end_name = control.${.:instance}-Reset-End
+       counter_name = control.Daily-Session-Time
+       check_name = control.Max-Daily-Session
+       reply_name = reply.Session-Timeout
        auto_extend = yes
-       key = "%{&Stripped-User-Name || &User-Name}"
-       reply_message_name = &Reply-Message
+       key = "%{Stripped-User-Name || User-Name}"
+       reply_message_name = Reply-Message
 
        reset = daily
 
@@ -146,11 +146,11 @@ sqlcounter monthlycounter {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
 
-       counter_name = &Monthly-Session-Time
-       check_name = &control.Max-Monthly-Session
-       reply_name = &reply.Session-Timeout
+       counter_name = Monthly-Session-Time
+       check_name = control.Max-Monthly-Session
+       reply_name = reply.Session-Timeout
        auto_extend = yes
-       key = &User-Name
+       key = User-Name
 
        reset = monthly
 
@@ -164,9 +164,9 @@ sqlcounter noresetcounter {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
 
-       counter_name = &Max-All-Session-Time
-       check_name = &control.Max-All-Session
-       key = &User-Name
+       counter_name = Max-All-Session-Time
+       check_name = control.Max-All-Session
+       key = User-Name
 
        reset = never
 
@@ -185,9 +185,9 @@ sqlcounter expire_on_login {
        sql_module_instance = sql
        dialect = ${modules.sql.dialect}
 
-       counter_name = &Expire-After-Initial-Login
-       check_name = &control.Expire-After
-       key = &User-Name
+       counter_name = Expire-After-Initial-Login
+       check_name = control.Expire-After
+       key = User-Name
 
        reset = never
 
index e4e75b347d9fe195b8e689f1205986d82395d9d0..bead038b6e4894949a7cfc719a589e9da6d6481c 100644 (file)
@@ -61,8 +61,8 @@ RCSID("$Id$")
  *     be used as the instance handle.
  */
 typedef struct {
-       tmpl_t  *start_attr;            //!< &control.${.:instance}-Start
-       tmpl_t  *end_attr;              //!< &control.${.:instance}-End
+       tmpl_t  *start_attr;            //!< control.${.:instance}-Start
+       tmpl_t  *end_attr;              //!< control.${.:instance}-End
 
        tmpl_t  *counter_attr;          //!< Daily-Session-Time.
        tmpl_t  *limit_attr;            //!< Max-Daily-Session.
@@ -88,12 +88,12 @@ static const conf_parser_t module_config[] = {
        { FR_CONF_OFFSET_FLAGS("auto_extend", CONF_FLAG_OK_MISSING, rlm_sqlcounter_t, auto_extend) },
        { FR_CONF_OFFSET_FLAGS("utc", CONF_FLAG_OK_MISSING, rlm_sqlcounter_t, utc) },
 
-       { FR_CONF_OFFSET_FLAGS("key", CONF_FLAG_NOT_EMPTY, rlm_sqlcounter_t, key), .dflt = "%{%{Stripped-User-Name} || %{User-Name}}", .quote = T_DOUBLE_QUOTED_STRING },
+       { FR_CONF_OFFSET_FLAGS("key", CONF_FLAG_NOT_EMPTY, rlm_sqlcounter_t, key), .dflt = "%{Stripped-User-Name || User-Name}", .quote = T_DOUBLE_QUOTED_STRING },
 
        { FR_CONF_OFFSET_FLAGS("reset_period_start_name", CONF_FLAG_ATTRIBUTE, rlm_sqlcounter_t, start_attr),
-         .dflt = "&control.${.:instance}-Reset-Start", .quote = T_BARE_WORD },
+         .dflt = "control.${.:instance}-Reset-Start", .quote = T_BARE_WORD },
        { FR_CONF_OFFSET_FLAGS("reset_period_end_name", CONF_FLAG_ATTRIBUTE, rlm_sqlcounter_t, end_attr),
-         .dflt = "&control.${.:instance}-Reset-End", .quote = T_BARE_WORD },
+         .dflt = "control.${.:instance}-Reset-End", .quote = T_BARE_WORD },
 
        /* Attribute to write counter value to*/
        { FR_CONF_OFFSET_FLAGS("counter_name", CONF_FLAG_ATTRIBUTE | CONF_FLAG_REQUIRED, rlm_sqlcounter_t, counter_attr) },