help-gnu-radius
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnu-radius] problems getting rewrite hook right


From: Sergey Poznyakoff
Subject: Re: [Help-gnu-radius] problems getting rewrite hook right
Date: Mon, 23 Oct 2006 15:08:25 +0300

Hi Charles,

Long time no talk :))

> So it is rewriting the "%" to "@", but not doing the split...
> 
> Any suggestions?

Sure: gsub does not modify its third argument, instead it returns
the new string. So, your function should be:

string
domain_split(string name)
{
         integer a;

         %[User-Name] = gsub("%", "@", name);
         a = index(%[User-Name], '@');                          /* * */
         if (a != -1)
                 return substr(%[User-Name], a+1, -1);          /* * */
         else
                 return "bway.net";
         return "";
}

(lines, marked with /* * */ were changed)

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]