/* File "user.c" copyright (c) 2001 by Collin Lally of Polytech Industres. This file is covered under the GNU General Public License and is free to the public. You may modify and/or redistribute this software provided that it remains under the GPL and that the end-product is free to the public.
*/

#include "user.h"
#include "video.h"
#include "tree.h"
#include "string.h"

set_passwd(uid)
int *uid;
{
	if(uid == 0){
		check_perm(login.current_uid);
		if(login.cuid_perm == 10){
			kprint(login.current_uid);
			kprint("Type password:\t");
			s = gets();
			(char*)s = &user0->u_passwd[(int*)uid];
		}else{
			kprint("Access denied\n");
		};
	}else{
		kprint("Type password:\t");
		s = gets();
		(char*)s = &user0->u_passwd[(int*)uid];
	};
};

add_user(u_name, uid, passwd)
char *u_name;
int *uid;
char *passwd;
{
	if(uid >= MAX_USERS){
		kprint("error: uid exceeds maximum number of users\n");
		add_user(u_name, uid, passwd);
	};
	(char*)u_name = &user0->u_name[(int*)uid];
	(int*)uid = &user0->users[(int*)uid];