Hi Ina, The quick and easy way of making your prepaid system work is to alter the file "auth.c" in XTRadius. To alter the authentication, look at the function "rad_check_password", line 250. There is a switch statement that determines the type of authentication you need to perform. Replace the code that authenticates the username/password with your own logic. You will have to link XTRadius with pqlib or the mysql libraries if you plan on using an RDBMS to hold your user profiles.
To set the maximum connect time, look at line 740 (auth.c) which is located inside the function "rad_authenticate". This is where XTRadius sets the maximum connection time based on a schedule. The schedule is determined through the settings file wherein a user is assigned start and stop date/times for connection. For example, user Juan is allowed to connect between 7:00 to 8:00 PM. If Juan connects at 7:30PM, the existing code will figure out that 30 minutes is the maximum connection time and will set the session time to 30 minutes. In your case, you can simply bypass this logic and set the session time to whatever remaining time your autheticated user has left. Finally, if you decide to use MYSQL, there is another file called accounting.c that will automatically log connection time (start and stop) for all users which you can use for reporting/tracking purposes. It is very simple, but at least, you don;t have to re-invent the wheel. HTH. From, Carlos Yu CYWare ----- Original Message ----- From: "Ina Patricia Lopez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 26, 2002 1:59 PM Subject: [plug] pre-paid like and xtradius > hi! > im using xtradius and my users are authenticating at /etc/passwd. > i want to have some users with fixed amount of time (pre-paid like) to > be online. is it possible with xtradius? > > i come across quick-r. is it for free? > > thanks, > ina > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > _ > Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph > To leave: send "unsubscribe" in the body to [EMAIL PROTECTED] > > Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph > > To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED] > _ Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph To leave: send "unsubscribe" in the body to [EMAIL PROTECTED] Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED]
