Exemple #1
0
void selector()
{
	char request[255];
	char *queryString = NULL;

	request[0] = '\0';
	queryString = getenv("QUERY_STRING");
	if(queryString != NULL && queryString[0] != '\0')
	{
		if(sscanf(queryString, "page=%s", request) == 1)
			selectPage(request);
		else if(sscanf(queryString, "file=%s", request) == 1)
			selectFile(request);
		else if(sscanf(queryString, "option=delete&file=%s", request) == 1)
			deleteFile(request);
		else if(sscanf(queryString, "auth=%s", request) == 1)
			validAuth(request);
		else
		{
			fprintf(stderr, "ça merdouille sur la query string\n");
			selectPage("");
		}
	}
	else
	{
		fprintf(stderr, "Direction page principale");
		selectPage("");
	}
}
void ScrobbleConfigDlg::testLogin()
{
    m_testFeedbackLabel->setText(i18n("Validating login..."));
    Scrobbler *scrobbler = new Scrobbler(this);
    connect(scrobbler, SIGNAL(validAuth()), this, SLOT(validLogin()));
    connect(scrobbler, SIGNAL(invalidAuth()), this, SLOT(invalidLogin()));
    setEnabled(false);
    scrobbler->getAuthToken(m_usernameEdit->text(), m_passwordEdit->text());
}
void SessionServer::rlogin()
{
	if(!validHeader())
		return;
	char username[_MAXUNAMESIZE];
	char password[_MAXPSDSIZE];
	if(!readSBuf(username, _MAXUNAMESIZE))
		return;
	if(!readSBuf(password, _MAXPSDSIZE))
		return;
	int rrs;
	uidsize_t uid = validAuth(username, password);
	if(uid)
	{
		rrs = 0;
		status = SessionServer::LOOPING;
		userId = uid;
	}
	else
		rrs = err;
	writeSBuf((char*) &uid, sizeof(uid));
	if(rrs != 0)
		writeSBuf((char*) &rrs, sizeof(rrs));
}