Fixed access level bug.
This commit is contained in:
parent
a72b749fac
commit
9061e13e11
@ -80,19 +80,22 @@ loadSettings(szFilename[])
|
|||||||
if (!file_exists(szFilename)) return 0
|
if (!file_exists(szFilename)) return 0
|
||||||
|
|
||||||
new szText[256], szFlags[32], szAccess[32]
|
new szText[256], szFlags[32], szAccess[32]
|
||||||
new a, pos = 0
|
new a, pos = 0, iAccess
|
||||||
|
|
||||||
while ( g_aNum < MAX_ADMINS && read_file(szFilename,pos++,szText,255,a) )
|
while ( g_aNum < MAX_ADMINS && read_file(szFilename,pos++,szText,255,a) )
|
||||||
{
|
{
|
||||||
if ( szText[0] == ';' ) continue
|
if ( szText[0] == ';' ) continue
|
||||||
|
|
||||||
if ( parse(szText, g_aName[ g_aNum ] ,31,
|
if ( parse(szText, g_aName[ g_aNum ] ,31, g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 )
|
||||||
g_aPassword[ g_aNum ], 31, szAccess,31,szFlags,31 ) < 2 ) continue
|
continue
|
||||||
|
|
||||||
if ( (containi(szAccess,"z")==-1) && (containi(szAccess,"y")==-1) )
|
iAccess = read_flags(szAccess)
|
||||||
szAccess[strlen(szAccess)] = 'y'
|
|
||||||
|
|
||||||
g_aAccess[ g_aNum ] = read_flags( szAccess )
|
if (!(iAccess & ADMIN_USER) && !(iAccess & ADMIN_ADMIN)) {
|
||||||
|
iAccess |= ADMIN_ADMIN
|
||||||
|
}
|
||||||
|
|
||||||
|
g_aAccess[ g_aNum ] = iAccess
|
||||||
g_aFlags[ g_aNum ] = read_flags( szFlags )
|
g_aFlags[ g_aNum ] = read_flags( szFlags )
|
||||||
++g_aNum
|
++g_aNum
|
||||||
}
|
}
|
||||||
@ -184,8 +187,8 @@ getAccess(id,name[],authid[],ip[], password[])
|
|||||||
else {
|
else {
|
||||||
new defaccess[32]
|
new defaccess[32]
|
||||||
get_cvar_string("amx_default_access",defaccess,31)
|
get_cvar_string("amx_default_access",defaccess,31)
|
||||||
if (!defaccess[0])
|
if (!strlen(defaccess))
|
||||||
defaccess[0] = 'z'
|
copy(defaccess, 32, "z")
|
||||||
new idefaccess = read_flags(defaccess)
|
new idefaccess = read_flags(defaccess)
|
||||||
if (idefaccess){
|
if (idefaccess){
|
||||||
result |= 8
|
result |= 8
|
||||||
@ -212,7 +215,6 @@ accessUser( id, name[] = "" )
|
|||||||
|
|
||||||
#if !defined NO_STEAM
|
#if !defined NO_STEAM
|
||||||
client_cmd(id,g_cmdLoopback)
|
client_cmd(id,g_cmdLoopback)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
client_cmd(id,"echo ^"* You have no entry to the server...^";disconnect")
|
client_cmd(id,"echo ^"* You have no entry to the server...^";disconnect")
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user