Hi, I'm trying to update NAS-Port in the MySQL database after the user logs in, using the postauth_query query. The query I tried looks like this: postauth_query = "UPDATE radcheck SET radcheck.value='%{NAS-Port}' \ WHERE radcheck.username = '%{User-Name}' \ and radcheck.attribute='NAS-Port'" Before putting this line, I've inserted a line for each user in radcheck with the contents being ('username', NAS-Port, =*,<empty for the value field>). I'm using the '=*' operator just for the tests. I intend to change that later to '=='. I've uncommented the 'sql' line in the post-authentication section in the config line, but nothing is happening in the database. I've tried to change the 'postauth_table' entry in sql.conf to "radcheck", but still nothing. If I put the postauth_query query back to it's original value (and the entry in sql.conf too), it works fine, inserting one entry after each login. Did I do something wrong, or is my idea for updating the NAS-Port just insane? Should I go for unlang instead? Thanks, Roberto -- ----------------------------------------------------- Marcos Roberto Greiner Os otimistas acham que estamos no melhor dos mundos Os pessimistas tem medo de que isto seja verdade Murphy -----------------------------------------------------
The query I tried looks like this:
postauth_query = "UPDATE radcheck SET radcheck.value='%{NAS-Port}' \ WHERE radcheck.username = '%{User-Name}' \ and radcheck.attribute='NAS-Port'"
More important is how does it look in the debug. Is it used? You should change the op in the same time. Ivan Kalik Kalik Informatika ISP
tnt@kalik.net wrote:
The query I tried looks like this:
postauth_query = "UPDATE radcheck SET radcheck.value='%{NAS-Port}' \ WHERE radcheck.username = '%{User-Name}' \ and radcheck.attribute='NAS-Port'"
More important is how does it look in the debug. Is it used? You should
Of course. If I had done this in first place, I would have seen my mistake. I'm using <%{User-Name}> in the query, but I'm also using domains, so the query ended up like ....WHERE radcheck.username = 'name@domain'. Of course, there is no such user, so no update was done. I'm using <%{Stripped-User-Name}> now, and it worked fine.
change the op in the same time.
Yes, that's exactly what I intended to do. ^_^ Thanks a lot for the help, Roberto -- ----------------------------------------------------- Marcos Roberto Greiner Os otimistas acham que estamos no melhor dos mundos Os pessimistas tem medo de que isto seja verdade Murphy -----------------------------------------------------
participants (3)
-
rgreiner -
tnt@kalik.net -
VOIP Expert