Show
Ignore:
Timestamp:
08/24/10 21:31:46 (21 months ago)
Author:
Antti-Juhani Kaijanaho <antti-juhani@…>
Children:
7eb42bed950e3f81ef9f0d39432e07c55f12cc22
Parents:
ec0da3f87768820f9ca9e8065c7998e9d825bd4c
git-committer:
Antti-Juhani Kaijanaho <antti-juhani@…> (08/24/10 21:31:46)
Message:

[http::request] Cleanup

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • http/authn.cc

    rcc0a570 r751fac6  
    11/*  This file is part of Alue, the multiprotocol Internet discussion daemon 
    22 
    3     Copyright © 2009 Antti-Juhani Kaijanaho 
     3    Copyright © 2009, 2010 Antti-Juhani Kaijanaho 
    44 
    55    Alue is free software: you can redistribute it and/or modify it 
     
    9393        authn::tlate_value(boost::shared_ptr<request> req) 
    9494        { 
    95                 std::multimap<std::string,std::string> fb =  
    96                         req->get_form_data(); 
    9795                std::string ruri = req->get_path(); 
    98                 std::string query = req->get_query_or_body(); 
     96                std::string query = req->get_form_as_query(); 
    9997                if (!query.empty()) ruri += "?" + query; 
    10098                tlate::value::ptr rv(new authn_value(req->get_user(), 
    101                                                      lookup 
    102                                                      (fb, "user.authn.message"), 
     99                                                     req->get_form_field 
     100                                                     ("user.authn.message"), 
    103101                                                     ruri)); 
    104102                return rv; 
     
    108106                (boost::shared_ptr<request> req, response::factory rf) 
    109107        { 
    110                 std::multimap<std::string,std::string> fb = 
    111                         req->get_form_data(); 
    112                 ::uri redir = lookup(fb, "redirect"); 
     108                ::uri redir = req->get_form_field("redirect"); 
    113109 
    114110                std::string msg_name = "user.authn.message"; 
    115111                 
    116                 if (req->get_path() == "/login" && fb.find("login") != fb.end()) 
     112                if (req->get_path() == "/login" && req->has_form_field("login")) 
    117113                { 
    118                         std::string user = lookup(fb, "userid"); 
    119                         std::string pass = lookup(fb, "passwd"); 
     114                        std::string user = req->get_form_field("userid"); 
     115                        std::string pass = req->get_form_field("passwd"); 
    120116                        boost::shared_ptr<session> sess(new session()); 
    121117                        sess->authenticate(cb.dbase().lookup_user(user), pass);