From 835d392f0c0470bc02b8b119bfb9904ad764e604 Mon Sep 17 00:00:00 2001 From: Uriel Date: Sat, 28 Feb 2009 13:27:16 +0000 Subject: [PATCH] Groups are now simply users with a /members file with one member per file. --- bin/aux/addwuser.rc | 6 ++++-- bin/werclib.rc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/aux/addwuser.rc b/bin/aux/addwuser.rc index d29e9b9..018bac0 100755 --- a/bin/aux/addwuser.rc +++ b/bin/aux/addwuser.rc @@ -26,6 +26,8 @@ mkdir etc/users/$user_name echo $user_pass > etc/users/$user_name/password if(! ~ $#user_groups 0) - for(g in $user_groups) - echo $user_name >> etc/groups/$g + for(g in $user_groups) { + mkdir -p etc/users/$g + echo $user_name >> etc/users/$g/members + } diff --git a/bin/werclib.rc b/bin/werclib.rc index 481b4a5..6659c9e 100644 --- a/bin/werclib.rc +++ b/bin/werclib.rc @@ -29,8 +29,8 @@ fn check_user { _status=$status if(! ~ $"_status '') _status=(Not logged in: $"_status) - if not if(! ~ $#* 0 && ! grep -s '^'^$logged_user^'$' etc/groups/$* etc/groups/admin) - _status=(User $logged_user not in groups $*) + if not if(! ~ $#* 0 && ! ~ $logged_user $* && ! grep -s '^'^$logged_user^'$' etc/users/$*/members etc/users/admin/members >[2]/dev/null) + _status=(User $logged_user not in: $*) status=$_status }