aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:23 -0500
committerJacek Antonelli2008-08-15 23:45:23 -0500
commit486c4774ab4a707d69c1b48cdc048af1369084db (patch)
tree2a206a7e32a9a7efb98d585798a9fa18baeaf171 /linden/indra/newview/llpanellogin.cpp
parentSecond Life viewer sources 1.18.6.1-RC (diff)
downloadmeta-impy-486c4774ab4a707d69c1b48cdc048af1369084db.zip
meta-impy-486c4774ab4a707d69c1b48cdc048af1369084db.tar.gz
meta-impy-486c4774ab4a707d69c1b48cdc048af1369084db.tar.bz2
meta-impy-486c4774ab4a707d69c1b48cdc048af1369084db.tar.xz
Second Life viewer sources 1.18.6.2-RC
Diffstat (limited to 'linden/indra/newview/llpanellogin.cpp')
-rw-r--r--linden/indra/newview/llpanellogin.cpp91
1 files changed, 57 insertions, 34 deletions
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index c7f10fd..e604493 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -148,7 +148,34 @@ void LLLoginHandler::parse(const LLSD& queryMap)
148 { 148 {
149 gGridChoice = GRID_INFO_UMA; 149 gGridChoice = GRID_INFO_UMA;
150 } 150 }
151 151 else if (queryMap["grid"].asString() == "mohini")
152 {
153 gGridChoice = GRID_INFO_MOHINI;
154 }
155 else if (queryMap["grid"].asString() == "yami")
156 {
157 gGridChoice = GRID_INFO_YAMI;
158 }
159 else if (queryMap["grid"].asString() == "nandi")
160 {
161 gGridChoice = GRID_INFO_NANDI;
162 }
163 else if (queryMap["grid"].asString() == "mitra")
164 {
165 gGridChoice = GRID_INFO_MITRA;
166 }
167 else if (queryMap["grid"].asString() == "radha")
168 {
169 gGridChoice = GRID_INFO_RADHA;
170 }
171 else if (queryMap["grid"].asString() == "ravi")
172 {
173 gGridChoice = GRID_INFO_RAVI;
174 }
175 else if (queryMap["grid"].asString() == "aruna")
176 {
177 gGridChoice = GRID_INFO_ARUNA;
178 }
152#if !LL_RELEASE_FOR_DOWNLOAD 179#if !LL_RELEASE_FOR_DOWNLOAD
153 if (gGridChoice > GRID_INFO_NONE && gGridChoice < GRID_INFO_LOCAL) 180 if (gGridChoice > GRID_INFO_NONE && gGridChoice < GRID_INFO_LOCAL)
154 { 181 {
@@ -156,8 +183,11 @@ void LLLoginHandler::parse(const LLSD& queryMap)
156 } 183 }
157#endif 184#endif
158 185
159 snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); /* Flawfinder: ignore */ 186 if (LLAppViewer::instance()->getLoginURIs().size() == 0)
160 LLAppViewer::instance()->resetURIs(); 187 {
188 snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); /* Flawfinder: ignore */
189 LLAppViewer::instance()->resetURIs();
190 }
161 191
162 LLString startLocation = queryMap["location"].asString(); 192 LLString startLocation = queryMap["location"].asString();
163 193
@@ -316,16 +346,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
316 346
317 // don't make it a tab stop until SL-27594 is fixed 347 // don't make it a tab stop until SL-27594 is fixed
318 web_browser->setTabStop(FALSE); 348 web_browser->setTabStop(FALSE);
319 349 web_browser->navigateToLocalPage( "loading", "loading.html" );
320 // painfully build the path to the loading screen
321 std::string loading_path( gDirUtilp->getExpandedFilename( LL_PATH_SKINS, "" ) );
322 loading_path.append( gDirUtilp->getDirDelimiter() );
323 loading_path.append( "html" );
324 loading_path.append( gDirUtilp->getDirDelimiter() );
325 loading_path.append( "loading" );
326 loading_path.append( gDirUtilp->getDirDelimiter() );
327 loading_path.append( "loading.html" );
328 web_browser->navigateTo( loading_path.c_str() );
329 350
330 // make links open in external browser 351 // make links open in external browser
331 web_browser->setOpenInExternalBrowser( true ); 352 web_browser->setOpenInExternalBrowser( true );
@@ -339,7 +360,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
339 360
340 // kick off a request to grab the url manually 361 // kick off a request to grab the url manually
341 gResponsePtr = LLIamHereLogin::build( this ); 362 gResponsePtr = LLIamHereLogin::build( this );
342 LLHTTPClient::head( childGetValue( "real_url" ).asString(), gResponsePtr ); 363 std::string login_page = LLAppViewer::instance()->getLoginPage();
364 if (login_page.empty())
365 {
366 login_page = childGetValue( "real_url" ).asString();
367 }
368 LLHTTPClient::head( login_page, gResponsePtr );
343 }; 369 };
344 #else 370 #else
345 mHtmlAvailable = FALSE; 371 mHtmlAvailable = FALSE;
@@ -367,16 +393,8 @@ void LLPanelLogin::setSiteIsAlive( bool alive )
367 // the site is not available (missing page, server down, other badness) 393 // the site is not available (missing page, server down, other badness)
368 { 394 {
369 if ( web_browser ) 395 if ( web_browser )
370 { 396 {
371 // painfully build the path to the loading screen 397 web_browser->navigateToLocalPage( "loading-error" , "index.html" );
372 std::string loading_path( gDirUtilp->getExpandedFilename( LL_PATH_SKINS, "" ) );
373 loading_path.append( gDirUtilp->getDirDelimiter() );
374 loading_path.append( "html" );
375 loading_path.append( gDirUtilp->getDirDelimiter() );
376 loading_path.append( "loading-error" );
377 loading_path.append( gDirUtilp->getDirDelimiter() );
378 loading_path.append( "index.html" );
379 web_browser->navigateTo( loading_path.c_str() );
380 398
381 // mark as available 399 // mark as available
382 mHtmlAvailable = TRUE; 400 mHtmlAvailable = TRUE;
@@ -405,13 +423,6 @@ void LLPanelLogin::draw()
405{ 423{
406 if (!getVisible()) return; 424 if (!getVisible()) return;
407 425
408 BOOL target_fullscreen;
409 S32 target_width;
410 S32 target_height;
411 gViewerWindow->getTargetWindow(target_fullscreen, target_width, target_height);
412
413 childSetVisible("full_screen_text", target_fullscreen);
414
415 glPushMatrix(); 426 glPushMatrix();
416 { 427 {
417 F32 image_aspect = 1.333333f; 428 F32 image_aspect = 1.333333f;
@@ -622,12 +633,23 @@ void LLPanelLogin::loadLoginPage()
622 char* curl_channel = curl_escape(gChannelName.c_str(), 0); 633 char* curl_channel = curl_escape(gChannelName.c_str(), 0);
623 char* curl_version = curl_escape(version.c_str(), 0); 634 char* curl_version = curl_escape(version.c_str(), 0);
624 635
636 std::string login_page = LLAppViewer::instance()->getLoginPage();
637 if (login_page.empty())
638 {
639 login_page = sInstance->childGetValue( "real_url" ).asString();
640 }
625 641
626 oStr << sInstance->childGetValue( "real_url" ).asString() << "&firstname=" << firstname << 642 // Use the right delimeter depending on how LLURI parses the URL
643 LLURI login_page_uri = LLURI(login_page);
644 std::string first_query_delimiter = "&";
645 if (login_page_uri.queryMap().size() == 0)
646 {
647 first_query_delimiter = "?";
648 }
649 oStr << login_page << first_query_delimiter << "firstname=" << firstname <<
627 "&lastname=" << lastname << "&location=" << location << "&region=" << curl_region << 650 "&lastname=" << lastname << "&location=" << location << "&region=" << curl_region <<
628 "&grid=" << gGridInfo[gGridChoice].mLabel << "&channel=" << curl_channel << 651 "&grid=" << gGridInfo[gGridChoice].mLabel << "&channel=" << curl_channel <<
629 "&version=" << curl_version; 652 "&version=" << curl_version;
630
631 653
632 curl_free(curl_region); 654 curl_free(curl_region);
633 curl_free(curl_channel); 655 curl_free(curl_channel);
@@ -684,7 +706,8 @@ void LLPanelLogin::onNavigateComplete( const EventType& eventIn )
684 ** sets the initial focus in a real web browser is not working inside 706 ** sets the initial focus in a real web browser is not working inside
685 ** the viewer, so this is an UGLY HACK WORKAROUND for now. 707 ** the viewer, so this is an UGLY HACK WORKAROUND for now.
686 */ 708 */
687 web_browser->handleKey(KEY_TAB, MASK_NONE, false); 709 // Commented out as it's not reliable
710 //web_browser->handleKey(KEY_TAB, MASK_NONE, false);
688 } 711 }
689} 712}
690#endif 713#endif