NetSurf
Data Structures | Functions
login.c File Reference

This is The win32 API basic authentication login dialog implementation. More...

#include <stdio.h>
#include "utils/config.h"
#include <windows.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsurl.h"
#include "desktop/version.h"
#include "windows/gui.h"
#include "windows/window.h"
#include "windows/login.h"
#include "windows/resourceid.h"
#include "windbg.h"
Include dependency graph for login.c:

Go to the source code of this file.

Data Structures

struct  login_ctx
 

Functions

static nserror free_loginctx (struct login_ctx *ctx)
 free login dialog context More...
 
static nserror get_login_description (struct nsurl *url, const char *realm, char **out_str)
 generate the description of the login request More...
 
static BOOL login_dialog_init (HWND hwndDlg, WPARAM wParam, LPARAM lParam)
 win32 login dialog initialisation handler More...
 
static BOOL login_dialog_ok (HWND hwndDlg, struct login_ctx *ctx)
 win32 login dialog ok handler More...
 
static BOOL login_dialog_cancel (HWND hwndDlg, struct login_ctx *ctx)
 win32 login dialog cancel handler More...
 
static BOOL CALLBACK login_dialog_callback (HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
 win32 API callback for login dialog More...
 
nserror nsw32_401login (nsurl *url, const char *realm, const char *username, const char *password, nserror(*cb)(const char *username, const char *password, void *cbctx), void *cbctx)
 Request credentials for http login. More...
 

Detailed Description

This is The win32 API basic authentication login dialog implementation.

Definition in file login.c.

Function Documentation

◆ free_loginctx()

static nserror free_loginctx ( struct login_ctx ctx)
static

free login dialog context

Definition at line 55 of file login.c.

References login_ctx::description, NSERROR_OK, login_ctx::password, and login_ctx::username.

Referenced by login_dialog_cancel(), login_dialog_ok(), and nsw32_401login().

Here is the caller graph for this function:

◆ get_login_description()

static nserror get_login_description ( struct nsurl url,
const char *  realm,
char **  out_str 
)
static

generate the description of the login request

Definition at line 70 of file login.c.

References NSERROR_NOMEM, NSERROR_OK, nsurl_get(), NSURL_HOST, and NSURL_SCHEME.

Referenced by nsw32_401login().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ login_dialog_callback()

static BOOL CALLBACK login_dialog_callback ( HWND  hwndDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

win32 API callback for login dialog

Definition at line 220 of file login.c.

References LOG_WIN_MSG, login_dialog_cancel(), login_dialog_init(), and login_dialog_ok().

Referenced by nsw32_401login().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ login_dialog_cancel()

static BOOL login_dialog_cancel ( HWND  hwndDlg,
struct login_ctx ctx 
)
static

win32 login dialog cancel handler

Definition at line 200 of file login.c.

References login_ctx::cb, login_ctx::cbctx, free_loginctx(), NSLOG, and nsw32_del_dialog().

Referenced by login_dialog_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ login_dialog_init()

static BOOL login_dialog_init ( HWND  hwndDlg,
WPARAM  wParam,
LPARAM  lParam 
)
static

win32 login dialog initialisation handler

Definition at line 104 of file login.c.

References login_ctx::description, IDC_LOGIN_DESCRIPTION, IDC_LOGIN_PASSWORD, IDC_LOGIN_USERNAME, login_ctx::password, and login_ctx::username.

Referenced by login_dialog_callback().

Here is the caller graph for this function:

◆ login_dialog_ok()

static BOOL login_dialog_ok ( HWND  hwndDlg,
struct login_ctx ctx 
)
static

win32 login dialog ok handler

Definition at line 162 of file login.c.

References login_ctx::cb, login_ctx::cbctx, free_loginctx(), IDC_LOGIN_PASSWORD, IDC_LOGIN_USERNAME, NSLOG, nsw32_del_dialog(), login_ctx::password, and login_ctx::username.

Referenced by login_dialog_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsw32_401login()

nserror nsw32_401login ( nsurl url,
const char *  realm,
const char *  username,
const char *  password,
nserror(*)(const char *username, const char *password, void *cbctx)  cb,
void *  cbctx 
)

Request credentials for http login.

login window request.

Definition at line 250 of file login.c.

References login_ctx::cb, login_ctx::cbctx, login_ctx::description, free_loginctx(), get_login_description(), IDD_LOGIN, login_dialog_callback(), gui_window::main, NSERROR_INIT_FAILED, NSERROR_NOMEM, NSERROR_OK, nsw32_add_dialog(), nsws_get_gui_window(), login_ctx::password, and login_ctx::username.

Here is the call graph for this function: