summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2025-02-14 09:17:24 +0100
committerGravatar default2025-02-14 09:17:24 +0100
commit26d0f5cbc3e07ecec2418b3377d3597c610e5a70 (patch)
treeb722ef5230f2b1c3589fa6c8df78e3a12d920c05 /html.c
parentMerge branch 'master' of comam.es:git/snac2 (diff)
downloadpenes-snac2-26d0f5cbc3e07ecec2418b3377d3597c610e5a70.tar.gz
penes-snac2-26d0f5cbc3e07ecec2418b3377d3597c610e5a70.tar.xz
penes-snac2-26d0f5cbc3e07ecec2418b3377d3597c610e5a70.zip
Some variable renaming.
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/html.c b/html.c
index 42b9b48..94e55fd 100644
--- a/html.c
+++ b/html.c
@@ -17,7 +17,7 @@
17 17
18#include "snac.h" 18#include "snac.h"
19 19
20int login(snac *snac, const xs_dict *headers) 20int login(snac *user, const xs_dict *headers)
21/* tries a login */ 21/* tries a login */
22{ 22{
23 int logged_in = 0; 23 int logged_in = 0;
@@ -31,23 +31,23 @@ int login(snac *snac, const xs_dict *headers)
31 xs *l1 = xs_split_n(s2, ":", 1); 31 xs *l1 = xs_split_n(s2, ":", 1);
32 32
33 if (xs_list_len(l1) == 2) { 33 if (xs_list_len(l1) == 2) {
34 const char *user = xs_list_get(l1, 0); 34 const char *uid = xs_list_get(l1, 0);
35 const char *pwd = xs_list_get(l1, 1); 35 const char *pwd = xs_list_get(l1, 1);
36 const char *addr = xs_or(xs_dict_get(headers, "remote-addr"), 36 const char *addr = xs_or(xs_dict_get(headers, "remote-addr"),
37 xs_dict_get(headers, "x-forwarded-for")); 37 xs_dict_get(headers, "x-forwarded-for"));
38 38
39 if (badlogin_check(user, addr)) { 39 if (badlogin_check(uid, addr)) {
40 logged_in = check_password(user, pwd, 40 logged_in = check_password(uid, pwd,
41 xs_dict_get(snac->config, "passwd")); 41 xs_dict_get(user->config, "passwd"));
42 42
43 if (!logged_in) 43 if (!logged_in)
44 badlogin_inc(user, addr); 44 badlogin_inc(uid, addr);
45 } 45 }
46 } 46 }
47 } 47 }
48 48
49 if (logged_in) 49 if (logged_in)
50 lastlog_write(snac, "web"); 50 lastlog_write(user, "web");
51 51
52 return logged_in; 52 return logged_in;
53} 53}