diff options
author | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-01-11 16:50:38 +0100 |
---|---|---|
committer | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-01-11 17:37:43 +0100 |
commit | f61fd89844316c9569427b2f0f09d71d3ff1ce07 (patch) | |
tree | 9cbdef51fc0bacfacc66aa1bfb38c8d21fcc5ca7 /Users | |
parent | d06c5f6c7ca7a324eb6bd88ac4931d822ed38997 (diff) |
Return new user struct when creating user
Clients need to know what values were chosen for fields left blank. This also allows us to return NULL in case of failure, which provides error checking.
Diffstat (limited to 'Users')
-rw-r--r-- | Users/Users.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Users/Users.pm b/Users/Users.pm index f924d83..ff5726c 100644 --- a/Users/Users.pm +++ b/Users/Users.pm @@ -625,6 +625,10 @@ sub add_user &change_user_chfn ($$user[$LOGIN], undef, $$user[$COMMENT]); &set_passwd ($$user[$LOGIN], $$user[$PASSWD]); + + # Return the new user with default values filled. + # Returns NULL if user doesn't exist, which means failure. + return &get_user ($$user[$LOGIN]); } sub change_user |