mod_saslauth: Fix indentation
authorMatthew Wild <mwild1@gmail.com>
Wed, 5 Aug 2009 15:35:13 +0000 (16:35 +0100)
committerMatthew Wild <mwild1@gmail.com>
Wed, 5 Aug 2009 15:35:13 +0000 (16:35 +0100)
plugins/mod_saslauth.lua

index 9082d69d00d581ce12e3a2123e532d95f27015e5..485930317fa8a9ab15e5c3c10339066a568c61aa 100644 (file)
@@ -68,22 +68,22 @@ local function handle_status(session, status)
 end
 
 local function credentials_callback(mechanism, ...)
-  if mechanism == "PLAIN" then
-    local username, hostname, password = arg[1], arg[2], arg[3];
-    local response = usermanager_validate_credentials(hostname, username, password, mechanism)
-    if response == nil then return false
-    else return response end
-  elseif mechanism == "DIGEST-MD5" then
-    function func(x) return x; end
-    local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4];
-    local password = usermanager_get_password(node, domain)
-    if password then
-      if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
-      return func, md5(node..":"..realm..":"..password);
-    else
-      return func, nil;
-    end
-  end
+       if mechanism == "PLAIN" then
+               local username, hostname, password = arg[1], arg[2], arg[3];
+               local response = usermanager_validate_credentials(hostname, username, password, mechanism)
+               if response == nil then return false
+               else return response end
+       elseif mechanism == "DIGEST-MD5" then
+               function func(x) return x; end
+               local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4];
+               local password = usermanager_get_password(node, domain)
+               if password then
+                       if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
+                       return func, md5(node..":"..realm..":"..password);
+               else
+                       return func, nil;
+               end
+       end
 end
 
 local function sasl_handler(session, stanza)