[isf-wifidog] Pre-paid users

Benoit Grégoire bock at step.polymtl.ca
Dim 10 Déc 23:57:51 EST 2006


On Sunday 10 December 2006 22:02, Raphael Alla wrote:
> Hi,
>
> I am currently planning to use wifidog in a context where users purchase
> pre-paid credit, either in time or in data. When they are connected they
> use their credit and then when their credit has expired, they get logged
> off.
>
> I am currently writing an Authenticator class, which is relatively
> straightforward. The auth/index.php file however does not have the
> capability to check whether the acctUpdate function returns a true value or
> not.

Humm, you're right.  While this will probably change in the future, the way to 
fix this for now is to modify the base Authenticator class to have acctUpdate 
return one of the "ACCOUNT_STATUS" constants, and take an additional output 
parameter which will contain the returned error message (if applicable).

> All my code is GPL and I am more than happy to contribute the changes back
> to the list once done.

Excellent, welcome!

> Some questions:
>
>    - what are the rules to submit patches to the list?

Usually, the way to sent significant patches is as an attachements to a trac 
ticket.  Note that this is in no way meant to discurrage discussing a patch 
on the list.
 
>    - i need additional fields for users. Would it be better to store
>    those in the user table by altering it or would it be better to create a
> new table that can be used by my extension only. The second option has the
> benefits that users can install the extra table only when they require and
> maintains compatibility with the code coming from cvs

It really depends on what the fields are and do.  There is a sizeable amount 
of design on how connections are to be limited (time, bandwith) which is a 
completely generic problem.  Depending on the fields the answer will be one 
or more of either:
-Extend the connections table
-Extend the users table
-Create a table specifically for your authenticator,  linked to the users 
table
-Use a Key-Value-Pair style system.

Try to catch me on IRC, or send your proposed fields here for discussion.
-- 
Benoit Grégoire
Technologies Coeus inc.
-------------- section suivante --------------
Une pièce jointe non texte a été nettoyée...
Nom: non disponible
Type: application/pgp-signature
Taille: 189 octets
Desc: non disponible
Url: http://listes.ilesansfil.org/pipermail/wifidog/attachments/20061210/863da3df/attachment.pgp


Plus d'informations sur la liste de diffusion WiFiDog