diff --git a/core/smn_admin.cpp b/core/smn_admin.cpp index 4f6e3ed6..fa8c0c21 100644 --- a/core/smn_admin.cpp +++ b/core/smn_admin.cpp @@ -423,6 +423,15 @@ static cell_t CanAdminTarget(IPluginContext *pContext, const cell_t *params) 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) { {"DumpAdminCache", DumpAdminCache}, @@ -460,6 +469,7 @@ REGISTER_NATIVES(adminNatives) {"FlagArrayToBits", FlagArrayToBits}, {"FlagBitsToArray", FlagBitsToArray}, {"CanAdminTarget", CanAdminTarget}, + {"CreateAuthMethod", CreateAuthMethod}, /* -------------------------------------------------- */ {NULL, NULL}, }; diff --git a/core/smn_functions.cpp b/core/smn_functions.cpp index e31b9c0a..679a8678 100644 --- a/core/smn_functions.cpp +++ b/core/smn_functions.cpp @@ -1,15 +1,15 @@ /** -* =============================================================== -* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. -* =============================================================== -* -* This file is not open source and may not be copied without explicit -* written permission of AlliedModders LLC. This file may not be redistributed -* in whole or significant part. -* For information, see LICENSE.txt or http://www.sourcemod.net/license.php -* -* Version: $Id$ -*/ + * =============================================================== + * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. + * =============================================================== + * + * This file is not open source and may not be copied without explicit + * written permission of AlliedModders LLC. This file may not be redistributed + * in whole or significant part. + * For information, see LICENSE.txt or http://www.sourcemod.net/license.php + * + * Version: $Id$ + */ #include "sm_globals.h" #include "PluginSys.h" diff --git a/plugins/include/admin.inc b/plugins/include/admin.inc index 0e8596e9..0fbea006 100644 --- a/plugins/include/admin.inc +++ b/plugins/include/admin.inc @@ -489,6 +489,15 @@ native FlagBitsToArray(bits, AdminFlag:array[], maxSize) =0; */ 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. *