1
0

Changed how Lua handles the (Post)Params in the HTTPRequest of a WebPlugin

It should now be theoretically possible to upload files through WebAdmin

git-svn-id: http://mc-server.googlecode.com/svn/trunk@203 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth
2012-01-31 20:56:42 +00:00
parent 59e740035e
commit 968f41ba51
12 changed files with 444 additions and 117 deletions

View File

@@ -136,10 +136,22 @@ void cWebAdmin::Request_Handler(webserver::http_request* r)
HTTPRequest Request;
Request.Username = r->username_;
Request.Method = r->method_;
Request.Params = new cStringMap(r->params_);
Request.PostParams = new cStringMap(r->params_post_);
Request.Params = r->params_;
Request.PostParams = r->params_post_;
Request.Path = r->path_;
for( unsigned int i = 0; i < r->multipart_formdata_.size(); ++i )
{
webserver::formdata& fd = r->multipart_formdata_[i];
HTTPFormData HTTPfd;//( fd.value_ );
HTTPfd.Value = fd.value_;
HTTPfd.Type = fd.content_type_;
HTTPfd.Name = fd.name_;
LOGINFO("Form data name: %s", fd.name_.c_str() );
Request.FormData[ fd.name_ ] = HTTPfd;
}
if( Split.size() > 1 )
{
for( PluginList::iterator itr = WebAdmin->m_Plugins.begin(); itr != WebAdmin->m_Plugins.end(); ++itr )
@@ -159,9 +171,6 @@ void cWebAdmin::Request_Handler(webserver::http_request* r)
}
}
delete Request.Params;
delete Request.PostParams;
if( FoundPlugin.empty() ) // Default page
{
Content.clear();