[isf-wifidog] Fwd: Can create users to local database manually?
Menil Jean-Philippe
Jean-Philippe.Menil at univ-nantes.fr
Mar 17 Mar 03:54:11 EDT 2009
Darren Yang a écrit :
> Hi Andrew,
>
> Very appreciate for your assistance, the manual_useradd.php is working
> well. : )
>
> But reverse the issue, are there any solution can delete users manually ?
>
> Thanks and Regards,
> Pigsign
>
>
>
>
> 2009/3/17 <andrewhodel at gmail.com>:
>> I wrote some code to achieve this a year or so ago, not very pretty but it
>> works for what you are trying to do.
>>
>> http://dev.wifidog.org/wiki/doc/developer/ClosedNetwork
>>
>> Make sure that you are using manual_useradd.2.php, not manual_useradd.php
>>
>> I don't have permission on the wiki to remove the original.
>>
>> Once you set everything up (quick and easy) you can just go to
>> /manual_useradd.php and add users manually on the auth server. If you have
>> any questions on how to get it working feel free to ask.
>>
>>
>>
>> Regards,
>> Andrew Hodel
>>
>> On Mar 16, 2009 8:24pm, Darren Yang <pigsign.pykota at gmail.com> wrote:
>>> Hi,
>>>
>>>
>>>
>>> I search WiFidog wiki document and mailing list archive, but didn't
>>>
>>> find any information about manually create users to local database.
>>>
>>> Because my users would not totally exceed 10, so I don't want to bulid
>>>
>>> another Radius or LDAP service.
>>>
>>>
>>>
>>> Anyone have ideas about this ?
>>>
>>>
>>>
>>> Thanks,
>>>
>>>
>>>
>>> Pigsign
>>>
>>> _______________________________________________
>>>
>>> WiFiDog mailing list
>>>
>>> WiFiDog at listes.ilesansfil.org
>>>
>>> http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog
>>>
> _______________________________________________
> WiFiDog mailing list
> WiFiDog at listes.ilesansfil.org
> http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog
Hi,
you can manually delete user with sql commands:
su - postgres
psql -U wifidog -h localhost wifidog
La suppression d'un utilisateur peut se faire au moyen de la requête SQL :
DELETE FROM users WHERE username = 'toto';
(en remplaçant toto par le nom de l'utilisateur).
Vous obtiendrez sans doute un message d'erreur du type
ERROR: update or delete on "users" violates foreign key constraint
"fk_users" on "connections"
DETAIL: Key (user_id)=(ec65bcbdc6c0181b6a1a399d1944745f) is still
referenced from table "connections".
il faut alors supprimer la ligne correspondante dans la table connections :
DELETE FROM connections WHERE user_id = 'ec65bcbdc6c0181b6a1a399d1944745f';
en remplaçant ec65bcbdc6c0181b6a1a399d1944745f par l'identifiant indiqué
dans le message d'erreur.
Pour supprimer tous les comptes non validés :
delete from connections where user_id in (select user_id from users
where account_status='5');
delete from users where account_status='5';
And you can use:
select * from users where username ='toto';
to know the user_id
Hope this help.
--
Menil Jean-Philippe
DSI de l'Université de Nantes
tél: 02 51 12 53 92
Fax: 02 51 12 58 60
Jean-Philippe.Menil at univ-nantes.fr
Plus d'informations sur la liste de diffusion WiFiDog