예제 #1
0
파일: HTDialog.c 프로젝트: ChatanW/WebDaM
/*	Username and password
**	---------------------
**	Prompt Username and password as an atomic operation
*/
PUBLIC BOOL HTPromptUsernameAndPassword (HTRequest * request, HTAlertOpcode op,
					 int msgnum, const char * dfault,
					 void * input, HTAlertPar * reply)
{
    BOOL status = HTPrompt(request, op, msgnum, dfault, input, reply);
    return status ?
	HTPromptPassword(request, op, HT_MSG_PW, dfault, input, reply) : NO;
}
예제 #2
0
파일: HTLine.c 프로젝트: svagionitis/libwww
PRIVATE BOOL PromptUsernameAndPassword (HTRequest * request, HTAlertOpcode op,
					int msgnum, const char * dfault,
					void * input, HTAlertPar * reply)
{
    ComLine * cl = (ComLine *) HTRequest_context(request);
    char * realm = (char *) input;
    if (request && cl) {

	/*
	**  If we have a realm then check that it matches the realm
	**  that we got from the server.
	*/
	if (realm && cl->realm && !strcmp(cl->realm, realm)) {
	    HTAlert_setReplyMessage(reply, cl->user ? cl->user : "");
	    HTAlert_setReplySecret(reply, cl->password ? cl->password : "");
	    return YES;
	} else {
	    BOOL status = HTPrompt(request, op, msgnum, dfault, input, reply);
	    return status ?
		HTPromptPassword(request, op, HT_MSG_PW, dfault, input, reply) : NO;
	}
    }
    return NO;
}