added auth ident type creation

fixed some spacing issues

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40652
This commit is contained in:
David Anderson 2007-03-19 01:29:29 +00:00
parent ee8780966d
commit c6375166a1
3 changed files with 30 additions and 11 deletions

View File

@ -423,6 +423,15 @@ static cell_t CanAdminTarget(IPluginContext *pContext, const cell_t *params)
return g_Admins.CanAdminTarget(params[1], params[2]) ? 1 : 0; return g_Admins.CanAdminTarget(params[1], params[2]) ? 1 : 0;
} }
static cell_t CreateAuthMethod(IPluginContext *pContext, const cell_t *params)
{
char *name;
pContext->LocalToString(params[1], &name);
g_Admins.RegisterAuthIdentType(name);
return 1;
}
REGISTER_NATIVES(adminNatives) REGISTER_NATIVES(adminNatives)
{ {
{"DumpAdminCache", DumpAdminCache}, {"DumpAdminCache", DumpAdminCache},
@ -460,6 +469,7 @@ REGISTER_NATIVES(adminNatives)
{"FlagArrayToBits", FlagArrayToBits}, {"FlagArrayToBits", FlagArrayToBits},
{"FlagBitsToArray", FlagBitsToArray}, {"FlagBitsToArray", FlagBitsToArray},
{"CanAdminTarget", CanAdminTarget}, {"CanAdminTarget", CanAdminTarget},
{"CreateAuthMethod", CreateAuthMethod},
/* -------------------------------------------------- */ /* -------------------------------------------------- */
{NULL, NULL}, {NULL, NULL},
}; };

View File

@ -489,6 +489,15 @@ native FlagBitsToArray(bits, AdminFlag:array[], maxSize) =0;
*/ */
native CanAdminTarget(AdminId:admin, AdminId:target); native CanAdminTarget(AdminId:admin, AdminId:target);
/**
* Creates an admin auth method. This does not need to be called more than once
* per method, ever.
*
* @param method Name of the authentication method.
* @return True on success, false on failure.
*/
native bool:CreateAuthMethod(const String:method[]);
/** /**
* Converts a flag to its single bit. * Converts a flag to its single bit.
* *