-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuserattrib.h
161 lines (132 loc) · 4.56 KB
/
userattrib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
* File: userattrib.h
* Author: Will Flores
* Usage: Implemented by userattrib.c
* Description: This file specifies structs, typedefs, and function prototypes
* that create and manipulate the records for the importation program.
* Environment: Windows 7, 64 bit build
* Notes:
* Revisions: NONE
* Created on January 18, 2012
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef USERATTRIB_H
#define USERATTRIB_H
/* Definition of return values for functions */
#define FAIL 0
#define SUCCESS 1
/* The specification of the User type */
typedef struct userBin * User;
/* User linked list node */
struct userNode {
User user; /* User's information */
struct userNode * prev; /* Previous user */
struct userNode * next; /* Next user */
};
/* linked list of users */
typedef struct userNode * userList;
/* The implementation of the locations */
typedef struct location * Location;
/* Location linked list node */
struct locNode{
Location loc;
struct locNode * next;
};
/* linked list of locations */
typedef struct locNode * locList;
/* The implementation of the particulars for files in the future */
typedef struct particulars * Particulars;
/* Active Directory linked list */
typedef struct ADlist * ADList;
/*
* FUNCTIONS
*/
/* create a new user and add to master list;
* if another user with the same username exists
* don't create it and return NULL
*/
User addOneUser(char ** properties);
/* get list of all Users */
userList allUsers();
/* A NEW User list is going to be generated since the user interface will
* delete this list when it's done using it.
*/
/* query functionality -- finds all Users in the Global
* user list that match the search critieria.
*
* Any of these parameters can be NULL, which means that
* the value is a wildcard.
*/
userList findUsers();
/* A NEW User list is going to be generated since the user interface will
* delete this list when it's done using it.
*/
/* create a bunch of users from a csv file stream
*/
userList batchImport(const char * fileStream);
Location findLocation(const char * place, const locList locs);
Particulars createMasterParticulars(void);
ADList createMasterADList(void);
/* getSettings: will take in a file and set the appropriate attributes
* for the users to be imported in the program. Prints an error message
* and returns 0 if settings importation fails or is halted. The
* function returns 1 on success.
*/
int getSettings(const char * file, const char * prog);
/*int errorCheck (ADList, Location, Particulars);*/
int appendToMasterLocList(Location place, locList * Master);
int appendToMasterUsers(User person, userList * Master);
int exportUsers(userList users, const char * file);
int getuserCount(void);
userList getMasterUserList(void);
userList deleteOneUser(userList users);
int deleteAllUsers(userList users);
/* ACCESSOR FUNCTIONS */
char * dispFirstName(User person);
char * dispMiddleName(User person);
char * dispLastName(User person);
char * dispPrefferedName(User person);
char * dispInitials(User person);
char * dispUserName(User person);
char * dispEmail(User person);
char * dispTitle(User person);
char * dispDept(User person);
char * dispPassword(User person);
char * dispMod(User person);
char * dispManager(User person);
char * dispDesc(User person);
/* office */
char * dispPlace(Location loc);
char * dispOfficeName(User person);
char * dispStreetAddr(User person);
char * dispCity(User person);
char * dispState(User person);
char * dispZip(User person);
char * dispCountry(User person);
/* AD attributes */
char * dispScriptPath(User person);
char * dispHomeDrive(User person);
char * dispProfilePath(User person);
char * dispHomeDir(User person);
char * dispUPN(User person);
char * dispCompanyName(void);
char * changeUserName(const char * username, User person);
char * changeFirstName(const char * firstname, User person);
char * changeLastName(const char * lastname, User person);
char * changeMiddleName(const char * middlename, User person);
char * changeInitials(const char * initials, User person);
char * changeTitle(const char * title, User person);
char * changeDepartment(const char * department, User person);
char * changePreferredName(const char * prefname, User person);
Location changeOfficeName(const char * officename, User person);
char * changeEmail(const char * email, User person);
char * changePassword(const char * password, User person);
char * changeHomeDirectory(const char * username, User person);
char * changeProfilePath(const char * username, User person);
char * changeMod(const char * mod, User person);
#endif /* USERATTRIB_H */
#ifdef __cplusplus
}
#endif