1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010-2015 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2012 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
6 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
7 // Copyright (C) 2019-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
9 // This program is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU Affero General Public License as
11 // published by the Free Software Foundation, either version 3 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Affero General Public License for more details.
19 // You should have received a copy of the GNU Affero General Public License
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include "group_html_mail.h"
30 #include "nel/misc/xml_auto_ptr.h"
31 #include "../client_cfg.h"
32 #include "../user_entity.h"
33 #include "interface_manager.h"
35 // used for login cookie to be sent to the web server
36 #include "../net_manager.h"
39 using namespace NLMISC
;
42 // ***************************************************************************
43 NLMISC_REGISTER_OBJECT(CViewBase
, CGroupHTMLMail
, std::string
, "mail_html");
45 CGroupHTMLMail::CGroupHTMLMail(const TCtorParam
¶m
)
50 // ***************************************************************************
52 CGroupHTMLMail::~CGroupHTMLMail()
56 // ***************************************************************************
58 void CGroupHTMLMail::addHTTPGetParams (string
&url
, bool /*trustedDomain*/)
60 string user_name
= UserEntity
->getLoginName ();
61 url
+= ((url
.find('?') != string::npos
) ? "&" : "?") +
62 string("shard=") + toString(CharacterHomeSessionId
) +
63 string("&user_login=") + user_name
+ // FIXME: UrlEncode
64 string("&session_cookie=") + NetMngr
.getLoginCookie().toString() +
65 string("&lang=") + CI18N::getCurrentLanguageCode();
68 // ***************************************************************************
70 void CGroupHTMLMail::addHTTPPostParams (SFormFields
&formfields
, bool /*trustedDomain*/)
72 string user_name
= UserEntity
->getLoginName ();
73 formfields
.add("shard", toString(CharacterHomeSessionId
));
74 formfields
.add("user_login", user_name
); // FIXME: UrlEncode
75 formfields
.add("session_cookie", NetMngr
.getLoginCookie().toString());
76 formfields
.add("lang", CI18N::getCurrentLanguageCode());
79 // ***************************************************************************
81 string
CGroupHTMLMail::home () const
83 CInterfaceManager
*pIM
= CInterfaceManager::getInstance();
84 NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:MAIL_WAITING")->setValue32(0); // FIXME: How is this const?!
88 // ***************************************************************************
90 void CGroupHTMLMail::handle ()
92 // Do nothing if WebServer is not initialized
93 /* if (!WebServer.empty())
95 Home = WebServer+"mailbox.php";
96 CGroupHTML::handle ();
101 // ***************************************************************************