Go to the source code of this file.
Data Structures | |
| struct | Access |
| struct | AccessFlag |
Defines | |
| #define | ACC_FLAG_USER "u" |
| #define | ACC_FLAG_OPER "o" |
| #define | ACC_FLAG_ACCESS "a" |
| #define | ACC_FLAG_MODULE "m" |
| #define | ACC_FLAG_LIST "l" |
| #define | ACC_FLAG_JOIN "j" |
| #define | ACC_FLAG_SET "s" |
| #define | ACC_FLAG_DIE "D" |
| #define | ACC_FLAG_DEBUG "d" |
| #define | ACC_FLAG_REHASH "r" |
| #define | ACC_ROOT "oamljsDdr" |
| #define | ACC_ADMN "roalmjsd" |
| #define | ACC_OPER "oal" |
| #define | ACC_USER "u" |
| #define | ACC_STAFF "osljr" |
Functions | |
| int | DestAccList () |
| int | check_access (User *u, char *level) |
| Access * | new_access (char *) |
| Access * | access_exists (char *) |
| int | set_access_flag (Access *, char *) |
| int | add_access_host (Access *, char *) |
| Access * | find_access (User *) |
| void | refresh_access (void) |
| int | setAccess (User *u) |
| AccessFlag * | find_flag_byvalue (int) |
| AccessFlag * | find_access_flag (char *) |
| int | add_access_flag (char *, char *) |
| void | init_access (void) |
| int | del_acces_flag (char *) |
| void | build_access_list () |
Variables | |
| dlink_list | accesslist |
| dlink_list | access_flags |
| #define ACC_ADMN "roalmjsd" |
Definition at line 29 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_ACCESS "a" |
Definition at line 19 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_DEBUG "d" |
Definition at line 25 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_DIE "D" |
Definition at line 24 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_JOIN "j" |
Definition at line 22 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_LIST "l" |
Definition at line 21 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_MODULE "m" |
Definition at line 20 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_OPER "o" |
Definition at line 18 of file access.h.
Referenced by init_access(), and setAccess().
| #define ACC_FLAG_REHASH "r" |
Definition at line 26 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_SET "s" |
Definition at line 23 of file access.h.
Referenced by init_access().
| #define ACC_FLAG_USER "u" |
Definition at line 17 of file access.h.
Referenced by setAccess().
| #define ACC_OPER "oal" |
Definition at line 30 of file access.h.
Referenced by init_access().
| #define ACC_ROOT "oamljsDdr" |
Definition at line 28 of file access.h.
Referenced by init_access().
| #define ACC_STAFF "osljr" |
Definition at line 32 of file access.h.
Referenced by init_access().
| #define ACC_USER "u" |
Definition at line 31 of file access.h.
Referenced by Module_Init(), new_access(), and set_access_flag().
| Access* access_exists | ( | char * | ) |
Definition at line 173 of file access.c.
References accesslist, DLINK_FOREACH, and Access::name.
Referenced by new_access().
| int add_access_flag | ( | char * | , | |
| char * | ||||
| ) |
Definition at line 405 of file access.c.
References access_flags, alog(), dlink_add_tail(), dlink_create(), find_access_flag(), AccessFlag::flag, LOG_DEBUG, AccessFlag::name, and strlcpy().
Referenced by init_access().
| int add_access_host | ( | Access * | , | |
| char * | ||||
| ) |
Definition at line 220 of file access.c.
References alog(), dlink_add_tail(), dlink_create(), DLINK_FOREACH, Access::hosts, LOG_DEBUG, and Access::name.
Referenced by build_access_list().
| void build_access_list | ( | ) |
Definition at line 455 of file access.c.
References add_access_host(), DLINK_FOREACH_SAFE, get_config_base(), HASH, HASH_B, ConfBase::map, new_access(), and set_access_flag().
Referenced by evh_access_rehash(), and init_access().
| int check_access | ( | User * | u, | |
| char * | level | |||
| ) |
Check a users access against the specified level.
| u | A pointer to the user structure which we are checking against. | |
| level | The level to check for. |
Definition at line 110 of file access.c.
Referenced by do_cmd().
| int del_acces_flag | ( | char * | ) |
Definition at line 533 of file access.c.
References dlink_find_delete(), dlink_free(), find_access_flag(), and userlist.
| int DestAccList | ( | ) |
Destroy all entries within the access list.
Definition at line 324 of file access.c.
References accesslist, dlink_find_delete(), DLINK_FOREACH_SAFE, dlink_free(), host, and Access::hosts.
Referenced by AtExit(), and evh_access_rehash().
| Access* find_access | ( | User * | u | ) |
find_access() - Find the FIRST matching access access list entry for the given user and return the access list entry.
| u | - Pointer to the user struct that we are checking with. |
Definition at line 50 of file access.c.
References accesslist, DLINK_FOREACH, host, Access::hosts, and match_wild().
Referenced by setAccess().
| AccessFlag* find_access_flag | ( | char * | name | ) |
Return an access flag, both by name or by value
| name | string Name or value of the flag we are looking for |
Definition at line 487 of file access.c.
References access_flags, alog(), DLINK_FOREACH, AccessFlag::flag, LOG_DEBUG, LOG_DEBUG2, and AccessFlag::name.
Referenced by add_access_flag(), del_acces_flag(), and set_access_flag().
| AccessFlag* find_flag_byvalue | ( | int | ) |
Definition at line 512 of file access.c.
References access_flags, DLINK_FOREACH, and AccessFlag::flag.
Referenced by set_access_flag().
| void init_access | ( | void | ) |
Definition at line 431 of file access.c.
References ACC_ADMN, ACC_FLAG_ACCESS, ACC_FLAG_DEBUG, ACC_FLAG_DIE, ACC_FLAG_JOIN, ACC_FLAG_LIST, ACC_FLAG_MODULE, ACC_FLAG_OPER, ACC_FLAG_REHASH, ACC_FLAG_SET, ACC_OPER, ACC_ROOT, ACC_STAFF, add_access_flag(), AddEvent, build_access_list(), and evh_access_rehash().
Referenced by main().
| Access* new_access | ( | char * | ) |
Definition at line 190 of file access.c.
References ACC_USER, access_exists(), accesslist, alog(), Access::cname, dlink_add_tail(), dlink_create(), Access::flags, Access::hosts, LOG_DEBUG, Access::name, and strlcpy().
Referenced by build_access_list().
| void refresh_access | ( | void | ) |
refresh_access() - Crawls our user list and checks access on each entries host.
Crawling this big of a list is rediculous... i think we should keep a master list somewere -Twitch
if there not an OPER or they are a SERVICE they have no access. so skip that entry :) this should give us back some speed and proformance here. Esp on networks with more Services and Users then IRCops (Which should be all of them imo)
Definition at line 373 of file access.c.
References CfgSettings, DLINK_FOREACH, Conf::operonly, setAccess(), and userlist.
Referenced by evh_access_rehash().
| int set_access_flag | ( | Access * | a, | |
| char * | flags | |||
| ) |
Use pointer logic in the future
Definition at line 250 of file access.c.
References ACC_USER, alog(), find_access_flag(), find_flag_byvalue(), AccessFlag::flag, Access::flags, LOG_DEBUG, Access::name, and strlcat().
Referenced by build_access_list().
| int setAccess | ( | User * | u | ) |
setAccess() - finds then sets or removes access for a user, this will set the first matching access level on a user, as provided ' by find_access().
| u | - The user struct we are working with |
Definition at line 146 of file access.c.
References ACC_FLAG_OPER, ACC_FLAG_USER, CfgSettings, find_access(), Access::flags, Conf::operonly, and strlcpy().
Referenced by AddUser(), read_usermode_string(), and refresh_access().
| dlink_list access_flags |
Definition at line 74 of file access.h.
Referenced by add_access_flag(), find_access_flag(), find_flag_byvalue(), and init_lists().
| dlink_list accesslist |
Definition at line 73 of file access.h.
Referenced by access_exists(), DestAccList(), find_access(), init_lists(), and new_access().
1.6.3