Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. === modified file 'plugins/Script/examples/access.lua'
  2. --- plugins/Script/examples/access.lua  2010-11-08 16:38:38 +0000
  3. +++ plugins/Script/examples/access.lua  2010-11-08 19:34:48 +0000
  4. @@ -190,6 +190,14 @@
  5.     value = 1
  6.  }
  7.  
  8. +settings.authenticatebynick = {
  9. +   alias = { authbynick = true },
  10. +
  11. +   help = "registered users authentication method, 1 = by nick/password only, 0 = by cid/password first",
  12. +
  13. +   value = 0
  14. +}
  15. +
  16.  settings.botcid = {
  17.     alias = { botid = true },
  18.  
  19. @@ -663,9 +671,11 @@
  20.     end
  21.  
  22.     if user.cid ~= cid then
  23. -       if users.cids[cid] then
  24. -           -- new cid taken...
  25. -           return false, "CID taken by another registered user"
  26. +       if settings.authenticatebynick.value == 0 then
  27. +           if users.cids[cid] then
  28. +               -- new cid taken...
  29. +               return false, "CID taken by another registered user"
  30. +           end
  31.         end
  32.  
  33.         if user.cid then
  34. @@ -1046,7 +1056,13 @@
  35.     local cid = c:getCID()
  36.     local nick = c:getField("NI")
  37.  
  38. -   local user = get_user_c(c)
  39. +   local user
  40. +   if settings.authenticatebynick.value == 1 then
  41. +       user = get_user(nil, nick)
  42. +   else
  43. +       user = get_user_c(c)
  44. +   end
  45. +  
  46.     if not user then
  47.         autil.dump(c, adchpp.AdcCommand_ERROR_PROTOCOL_GENERIC, "Can't find you now")
  48.         return false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement