aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstartup.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llstartup.cpp330
1 files changed, 221 insertions, 109 deletions
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 73aa9ba..66849b1 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -76,12 +76,12 @@
76#include "llstring.h" 76#include "llstring.h"
77#include "lluserrelations.h" 77#include "lluserrelations.h"
78#include "llvfs.h" 78#include "llvfs.h"
79#include "llxorcipher.h" // saved password, MAC address
80#include "message.h" 79#include "message.h"
81#include "v3math.h" 80#include "v3math.h"
82 81
83#include "llagent.h" 82#include "llagent.h"
84#include "llagentpilot.h" 83#include "llagentpilot.h"
84#include "llfloateravatarlist.h"
85#include "llfloateravatarpicker.h" 85#include "llfloateravatarpicker.h"
86#include "llcallbacklist.h" 86#include "llcallbacklist.h"
87#include "llcallingcard.h" 87#include "llcallingcard.h"
@@ -189,6 +189,7 @@
189#include "llwlparammanager.h" 189#include "llwlparammanager.h"
190#include "llwaterparammanager.h" 190#include "llwaterparammanager.h"
191#include "llagentlanguage.h" 191#include "llagentlanguage.h"
192#include "llsocks5.h"
192#include "viewerversion.h" 193#include "viewerversion.h"
193 194
194#include "lgghunspell_wrapper.h" 195#include "lgghunspell_wrapper.h"
@@ -260,7 +261,6 @@ bool LLStartUp::sLoginFailed = false;
260 261
261void login_show(); 262void login_show();
262void login_callback(S32 option, void* userdata); 263void login_callback(S32 option, void* userdata);
263bool is_hex_string(U8* str, S32 len);
264void show_first_run_dialog(); 264void show_first_run_dialog();
265bool first_run_dialog_callback(const LLSD& notification, const LLSD& response); 265bool first_run_dialog_callback(const LLSD& notification, const LLSD& response);
266void set_startup_status(const F32 frac, const std::string& string, const std::string& msg); 266void set_startup_status(const F32 frac, const std::string& string, const std::string& msg);
@@ -635,6 +635,15 @@ bool idle_startup()
635 LL_INFOS("AppInit") << "Message System Initialized." << LL_ENDL; 635 LL_INFOS("AppInit") << "Message System Initialized." << LL_ENDL;
636 636
637 //------------------------------------------------- 637 //-------------------------------------------------
638 // Init the socks 5 proxy and open the control TCP
639 // connection if the user is using SOCKS5
640 // We need to do this early incase the user is using
641 // socks for http so we get the login screen via socks
642 //-------------------------------------------------
643
644 LLStartUp::handleSocksProxy(false);
645
646 //-------------------------------------------------
638 // Init audio, which may be needed for prefs dialog 647 // Init audio, which may be needed for prefs dialog
639 // or audio cues in connection UI. 648 // or audio cues in connection UI.
640 //------------------------------------------------- 649 //-------------------------------------------------
@@ -739,12 +748,13 @@ bool idle_startup()
739#endif 748#endif
740 gSavedSettings.setBOOL("AutoLogin", TRUE); 749 gSavedSettings.setBOOL("AutoLogin", TRUE);
741 } 750 }
742 else if (gSavedSettings.getBOOL("AutoLogin")) 751 else if (gSavedSettings.getBOOL("AutoLogin") && gHippoGridManager)
743 { 752 {
744 firstname = gSavedSettings.getString("FirstName"); 753 // at this point, getCurrentGrid is the last logged in grid. Should we create a new entry for this? -- MC
745 lastname = gSavedSettings.getString("LastName"); 754 firstname = gHippoGridManager->getCurrentGrid()->getFirstName();
746 password = LLStartUp::loadPasswordFromDisk(); 755 lastname = gHippoGridManager->getCurrentGrid()->getLastName();
747 gSavedSettings.setBOOL("RememberPassword", TRUE); 756 password = gHippoGridManager->getCurrentGrid()->getPassword();
757 gSavedSettings.setBOOL("RememberPassword", TRUE); // why do we do this, anyway? -- MC
748 758
749#ifdef USE_VIEWER_AUTH 759#ifdef USE_VIEWER_AUTH
750 show_connect_box = true; 760 show_connect_box = true;
@@ -755,9 +765,7 @@ bool idle_startup()
755 else 765 else
756 { 766 {
757 // if not automatically logging in, display login dialog 767 // if not automatically logging in, display login dialog
758 firstname = gSavedSettings.getString("FirstName"); 768 // name and password are now handled in STATE_LOGIN_SHOW when the login screen's shown -- MC
759 lastname = gSavedSettings.getString("LastName");
760 password = LLStartUp::loadPasswordFromDisk();
761 show_connect_box = true; 769 show_connect_box = true;
762 } 770 }
763 771
@@ -791,7 +799,7 @@ bool idle_startup()
791 799
792 timeout_count = 0; 800 timeout_count = 0;
793 801
794 if(LLStartUp::shouldAutoLogin()) 802 if (LLStartUp::shouldAutoLogin())
795 { 803 {
796 show_connect_box = false; 804 show_connect_box = false;
797 } 805 }
@@ -812,23 +820,35 @@ bool idle_startup()
812 820
813 // Show the login dialog 821 // Show the login dialog
814 login_show(); 822 login_show();
815 // connect dialog is already shown, so fill in the names 823
816 // icky how usernames get bolted on here as a kind of hack -- MC 824 // connect dialog is already shown, so fill in the names associated with the grid
817 if (gHippoGridManager && gHippoGridManager->getCurrentGrid()->isUsernameCompat()) 825 // note how we always remember avatar names, but don't necessarily have to
826 // icky how all this gets bolted on here as a kind of hack -- MC
827 if (gHippoGridManager)
818 { 828 {
819 if (lastname == "resident" || lastname == "Resident") 829 firstname = gHippoGridManager->getCurrentGrid()->getFirstName();
830 lastname = gHippoGridManager->getCurrentGrid()->getLastName();
831 // RememberPassword toggles this being saved
832 password = gHippoGridManager->getCurrentGrid()->getPassword();
833
834 // empty in case we used logout
835 if (gHippoGridManager->getCurrentGrid()->isUsernameCompat())
820 { 836 {
821 LLPanelLogin::setFields(firstname, password); 837 if ((lastname == "resident" || lastname == "Resident") ||
838 (firstname.empty() && lastname.empty()))
839 {
840 LLPanelLogin::setFields(firstname, password);
841 }
842 else
843 {
844 LLPanelLogin::setFields(firstname+"."+lastname, password);
845 }
822 } 846 }
823 else 847 else
824 { 848 {
825 LLPanelLogin::setFields(firstname+"."+lastname, password); 849 LLPanelLogin::setFields(firstname, lastname, password);
826 } 850 }
827 } 851 }
828 else
829 {
830 LLPanelLogin::setFields(firstname, lastname, password);
831 }
832 852
833 LLPanelLogin::giveFocus(); 853 LLPanelLogin::giveFocus();
834 854
@@ -890,8 +910,31 @@ bool idle_startup()
890 910
891 if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState()) 911 if (STATE_LOGIN_CLEANUP == LLStartUp::getStartupState())
892 { 912 {
893
894 LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_CLEANUP" << LL_ENDL; 913 LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_CLEANUP" << LL_ENDL;
914
915 // Post login screen, we should see if any settings have changed that may
916 // require us to either start/stop or change the socks proxy. As various communications
917 // past this point may require the proxy to be up.
918 bool socks_enable_required = gSavedSettings.getBOOL("Socks5ProxyEnabled");
919 if ((LLSocks::getInstance()->isEnabled() != socks_enable_required) || LLSocks::getInstance()->needsUpdate())
920 {
921 if (socks_enable_required)
922 {
923 if (!LLStartUp::handleSocksProxy(false))
924 {
925 // Proxy start up failed, we should now bail the state machine
926 // HandleSocksProxy() will have reported an error to the user
927 // already, so we just go back to the login screen. The user
928 // could then change the perferences to fix the issue.
929 LLStartUp::setStartupState(STATE_LOGIN_SHOW);
930 return FALSE;
931 }
932 }
933 else
934 {
935 LLSocks::getInstance()->stopProxy();
936 }
937 }
895 938
896 gDisconnected = TRUE; 939 gDisconnected = TRUE;
897 940
@@ -938,21 +981,8 @@ bool idle_startup()
938 lastname = gLoginHandler.getLastName(); 981 lastname = gLoginHandler.getLastName();
939 web_login_key = gLoginHandler.getWebLoginKey(); 982 web_login_key = gLoginHandler.getWebLoginKey();
940 } 983 }
941 984 // note: the grid manager overrides defaults, always -- MC
942 /* Jacek - Grid manager stuff that's changed with 1.23 985 else if (show_connect_box)
943 if(!gLoginHandler.mPassword.empty())
944 {
945 firstname = gLoginHandler.mFirstName;
946 lastname = gLoginHandler.mLastName;
947 password = gLoginHandler.mPassword;
948
949 gLoginHandler.mFirstName = "";
950 gLoginHandler.mLastName = "";
951 gLoginHandler.mPassword = "";
952 LLStartUp::setShouldAutoLogin(false);
953 }*/
954
955 if (show_connect_box)
956 { 986 {
957 // TODO if not use viewer auth 987 // TODO if not use viewer auth
958 // Load all the name information out of the login view 988 // Load all the name information out of the login view
@@ -961,24 +991,28 @@ bool idle_startup()
961 991
962 // HACK: Try to make not jump on login 992 // HACK: Try to make not jump on login
963 gKeyboard->resetKeys(); 993 gKeyboard->resetKeys();
994
995 LLStartUp::setShouldAutoLogin(false);
964 } 996 }
965 997
966 if (!firstname.empty() && !lastname.empty()) 998 if (!firstname.empty() && !lastname.empty())
967 { 999 {
968 gSavedSettings.setString("FirstName", firstname); 1000 gHippoGridManager->getCurrentGrid()->setFirstName(firstname);
969 gSavedSettings.setString("LastName", lastname); 1001 gHippoGridManager->getCurrentGrid()->setLastName(lastname);
970 1002
971 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL; 1003 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
972 gDebugInfo["LoginName"] = firstname + " " + lastname; 1004 gDebugInfo["LoginName"] = firstname + " " + lastname;
973 }
974
975
976 1005
977 1006 // create necessary directories
978 // create necessary directories 1007 // *FIX: these mkdir's should error check
979 // *FIX: these mkdir's should error check 1008 gDirUtilp->setViewerUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
980 gDirUtilp->setViewerUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname); 1009 LLFile::mkdir(gDirUtilp->getViewerUserDir());
981 LLFile::mkdir(gDirUtilp->getViewerUserDir()); 1010 }
1011 else
1012 {
1013 // we don't do anything from here on out -- MC
1014 llerrs << "No first or last name given! Cannot proceed!" << llendl;
1015 }
982 1016
983 // Set PerAccountSettingsFile to the default value. 1017 // Set PerAccountSettingsFile to the default value.
984 gSavedSettings.setString("PerAccountSettingsFile", 1018 gSavedSettings.setString("PerAccountSettingsFile",
@@ -1128,7 +1162,9 @@ bool idle_startup()
1128 // color init must be after saved settings loaded 1162 // color init must be after saved settings loaded
1129 init_colors(); 1163 init_colors();
1130 1164
1131 if (gSavedSettings.getBOOL("VivoxLicenseAccepted") || gHippoGridManager->getConnectedGrid()->isSecondLife()) 1165 if (!gSavedSettings.getBOOL("EnableVoiceChat") ||
1166 (gSavedSettings.getBOOL("EnableVoiceChat") && gSavedSettings.getBOOL("VivoxLicenseAccepted")) ||
1167 !gHippoGridManager->getConnectedGrid()->isSecondLife())
1132 { 1168 {
1133 // skipping over STATE_LOGIN_VOICE_LICENSE since we don't need it 1169 // skipping over STATE_LOGIN_VOICE_LICENSE since we don't need it
1134 // skipping over STATE_UPDATE_CHECK because that just waits for input 1170 // skipping over STATE_UPDATE_CHECK because that just waits for input
@@ -1272,6 +1308,21 @@ bool idle_startup()
1272 } 1308 }
1273 } 1309 }
1274 1310
1311 // We hash a temporary password for login auth. The actual stored password
1312 // is in the grid manager, and is XORed with the mac address -- MC
1313 std::string hashed_password("");
1314 if (password.length() == 32)
1315 {
1316 hashed_password = password;
1317 }
1318 else if (!password.empty())
1319 {
1320 LLMD5 pass((unsigned char *)password.c_str());
1321 char munged_password[MD5HEX_STR_SIZE];
1322 pass.hex_digest(munged_password);
1323 hashed_password = munged_password;
1324 }
1325
1275 // TODO if statement here to use web_login_key 1326 // TODO if statement here to use web_login_key
1276 if(web_login_key.isNull()){ 1327 if(web_login_key.isNull()){
1277 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1); 1328 sAuthUriNum = llclamp(sAuthUriNum, 0, (S32)sAuthUris.size()-1);
@@ -1280,7 +1331,7 @@ bool idle_startup()
1280 auth_method, 1331 auth_method,
1281 firstname, 1332 firstname,
1282 lastname, 1333 lastname,
1283 password, 1334 hashed_password,
1284 //web_login_key, 1335 //web_login_key,
1285 start.str(), 1336 start.str(),
1286 gSkipOptionalUpdate, 1337 gSkipOptionalUpdate,
@@ -1513,7 +1564,7 @@ bool idle_startup()
1513 default: 1564 default:
1514 if (sAuthUriNum >= (int) sAuthUris.size() - 1) 1565 if (sAuthUriNum >= (int) sAuthUris.size() - 1)
1515 { 1566 {
1516 emsg << "Unable to connect to " << gHippoGridManager->getCurrentGrid()->getGridNick() << ".\n"; 1567 emsg << "Unable to connect to " << gHippoGridManager->getCurrentGrid()->getGridName() << ".\n";
1517 emsg << LLUserAuth::getInstance()->errorMessage(); 1568 emsg << LLUserAuth::getInstance()->errorMessage();
1518 } else { 1569 } else {
1519 sAuthUriNum++; 1570 sAuthUriNum++;
@@ -1539,10 +1590,8 @@ bool idle_startup()
1539 1590
1540 if(successful_login) 1591 if(successful_login)
1541 { 1592 {
1542 { 1593 std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick();
1543 std::string current_grid = gHippoGridManager->getConnectedGrid()->getGridNick(); 1594 gSavedSettings.setString("LastConnectedGrid", current_grid);
1544 gSavedSettings.setString("LastConnectedGrid", current_grid);
1545 }
1546 1595
1547 std::string text; 1596 std::string text;
1548 text = LLUserAuth::getInstance()->getResponse("udp_blacklist"); 1597 text = LLUserAuth::getInstance()->getResponse("udp_blacklist");
@@ -1574,19 +1623,23 @@ bool idle_startup()
1574 } 1623 }
1575 text = LLUserAuth::getInstance()->getResponse("last_name"); 1624 text = LLUserAuth::getInstance()->getResponse("last_name");
1576 if(!text.empty()) lastname.assign(text); 1625 if(!text.empty()) lastname.assign(text);
1577 gSavedSettings.setString("FirstName", firstname); 1626
1578 gSavedSettings.setString("LastName", lastname); 1627 gHippoGridManager->getConnectedGrid()->setFirstName(firstname);
1628 gHippoGridManager->getConnectedGrid()->setLastName(lastname);
1579 1629
1580 if (gSavedSettings.getBOOL("RememberPassword")) 1630 if (gSavedSettings.getBOOL("RememberPassword"))
1581 { 1631 {
1582 // Successful login means the password is valid, so save it. 1632 // Successful login means the password is valid, so save it.
1583 LLStartUp::savePasswordToDisk(password); 1633 // formerly LLStartUp::savePasswordToDisk(password);
1634 // this needs to happen after gMACAddress is set -- MC
1635 gHippoGridManager->getConnectedGrid()->setPassword(password);
1584 } 1636 }
1585 else 1637 else
1586 { 1638 {
1587 // Don't leave password from previous session sitting around 1639 // Don't leave password from previous session sitting around
1588 // during this login session. 1640 // during this login session.
1589 LLStartUp::deletePasswordFromDisk(); 1641 // formerly LLStartUp::deletePasswordFromDisk(); -- MC
1642 gHippoGridManager->getConnectedGrid()->setPassword("");
1590 } 1643 }
1591 1644
1592 // this is their actual ability to access content 1645 // this is their actual ability to access content
@@ -1792,31 +1845,31 @@ bool idle_startup()
1792 std::string tmp = LLUserAuth::getInstance()->getResponse("gridname"); 1845 std::string tmp = LLUserAuth::getInstance()->getResponse("gridname");
1793 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp); 1846 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
1794 tmp = LLUserAuth::getInstance()->getResponse("loginuri"); 1847 tmp = LLUserAuth::getInstance()->getResponse("loginuri");
1795 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp); 1848 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginURI(tmp);
1796 tmp = LLUserAuth::getInstance()->getResponse("welcome"); 1849 tmp = LLUserAuth::getInstance()->getResponse("welcome");
1797 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); 1850 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1798 tmp = LLUserAuth::getInstance()->getResponse("loginpage"); 1851 tmp = LLUserAuth::getInstance()->getResponse("loginpage");
1799 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp); 1852 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
1800 tmp = LLUserAuth::getInstance()->getResponse("economy"); 1853 tmp = LLUserAuth::getInstance()->getResponse("economy");
1801 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); 1854 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperURI(tmp);
1802 tmp = LLUserAuth::getInstance()->getResponse("helperuri"); 1855 tmp = LLUserAuth::getInstance()->getResponse("helperuri");
1803 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp); 1856 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperURI(tmp);
1804 tmp = LLUserAuth::getInstance()->getResponse("about"); 1857 tmp = LLUserAuth::getInstance()->getResponse("about");
1805 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); 1858 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1806 tmp = LLUserAuth::getInstance()->getResponse("website"); 1859 tmp = LLUserAuth::getInstance()->getResponse("website");
1807 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp); 1860 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
1808 tmp = LLUserAuth::getInstance()->getResponse("help"); 1861 tmp = LLUserAuth::getInstance()->getResponse("help");
1809 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); 1862 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportURL(tmp);
1810 tmp = LLUserAuth::getInstance()->getResponse("support"); 1863 tmp = LLUserAuth::getInstance()->getResponse("support");
1811 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp); 1864 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportURL(tmp);
1812 tmp = LLUserAuth::getInstance()->getResponse("register"); 1865 tmp = LLUserAuth::getInstance()->getResponse("register");
1813 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); 1866 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterURL(tmp);
1814 tmp = LLUserAuth::getInstance()->getResponse("account"); 1867 tmp = LLUserAuth::getInstance()->getResponse("account");
1815 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp); 1868 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterURL(tmp);
1816 tmp = LLUserAuth::getInstance()->getResponse("password"); 1869 tmp = LLUserAuth::getInstance()->getResponse("password");
1817 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); 1870 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordURL(tmp);
1818 tmp = LLUserAuth::getInstance()->getResponse("search"); 1871 tmp = LLUserAuth::getInstance()->getResponse("search");
1819 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); 1872 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchURL(tmp);
1820 tmp = LLUserAuth::getInstance()->getResponse("currency"); 1873 tmp = LLUserAuth::getInstance()->getResponse("currency");
1821 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); 1874 if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
1822 tmp = LLUserAuth::getInstance()->getResponse("real_currency"); 1875 tmp = LLUserAuth::getInstance()->getResponse("real_currency");
@@ -2027,7 +2080,10 @@ bool idle_startup()
2027 { 2080 {
2028 LLFloaterMap::showInstance(); 2081 LLFloaterMap::showInstance();
2029 } 2082 }
2030 2083 if (gSavedSettings.getBOOL("ShowRadar"))
2084 {
2085 LLFloaterAvatarList::showInstance();
2086 }
2031 if (gSavedSettings.getBOOL("ShowCameraControls")) 2087 if (gSavedSettings.getBOOL("ShowCameraControls"))
2032 { 2088 {
2033 LLFloaterCamera::showInstance(); 2089 LLFloaterCamera::showInstance();
@@ -2338,9 +2394,7 @@ bool idle_startup()
2338 LLStringUtil::format_map_t args; 2394 LLStringUtil::format_map_t args;
2339 args["[FIRST_NAME]"] = firstname; 2395 args["[FIRST_NAME]"] = firstname;
2340 args["[LAST_NAME]"] = lastname; 2396 args["[LAST_NAME]"] = lastname;
2341 args["[GRID_NAME]"] = (gHippoGridManager->getConnectedGrid()->getGridName().empty()) ? 2397 args["[GRID_NAME]"] = gHippoGridManager->getConnectedGrid()->getGridName();
2342 gHippoGridManager->getConnectedGrid()->getGridNick() :
2343 gHippoGridManager->getConnectedGrid()->getGridName();
2344 std::string title_text = LLTrans::getString("TitleBarMultiple", args); 2398 std::string title_text = LLTrans::getString("TitleBarMultiple", args);
2345 gWindowTitle = gSecondLife + " - " + title_text; 2399 gWindowTitle = gSecondLife + " - " + title_text;
2346 LLStringUtil::truncate(gWindowTitle, 255); 2400 LLStringUtil::truncate(gWindowTitle, 255);
@@ -2846,6 +2900,9 @@ bool idle_startup()
2846 LL_DEBUGS("AppInitStartupState") << "STATE_CLEANUP" << LL_ENDL; 2900 LL_DEBUGS("AppInitStartupState") << "STATE_CLEANUP" << LL_ENDL;
2847 set_startup_status(1.0, "", ""); 2901 set_startup_status(1.0, "", "");
2848 2902
2903 // Make sure we do this right after the login screen -- MC
2904 update_grid_specific_menus();
2905
2849 // Make sure all the branding is in order -- MC 2906 // Make sure all the branding is in order -- MC
2850 if (gStatusBar) 2907 if (gStatusBar)
2851 { 2908 {
@@ -3185,41 +3242,6 @@ void LLStartUp::deletePasswordFromDisk()
3185 LLFile::remove(filepath); 3242 LLFile::remove(filepath);
3186} 3243}
3187 3244
3188
3189bool is_hex_string(U8* str, S32 len)
3190{
3191 bool rv = true;
3192 U8* c = str;
3193 while(rv && len--)
3194 {
3195 switch(*c)
3196 {
3197 case '0':
3198 case '1':
3199 case '2':
3200 case '3':
3201 case '4':
3202 case '5':
3203 case '6':
3204 case '7':
3205 case '8':
3206 case '9':
3207 case 'a':
3208 case 'b':
3209 case 'c':
3210 case 'd':
3211 case 'e':
3212 case 'f':
3213 ++c;
3214 break;
3215 default:
3216 rv = false;
3217 break;
3218 }
3219 }
3220 return rv;
3221}
3222
3223void show_first_run_dialog() 3245void show_first_run_dialog()
3224{ 3246{
3225 LLNotifications::instance().add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback); 3247 LLNotifications::instance().add("FirstRun", LLSD(), LLSD(), first_run_dialog_callback);
@@ -3231,7 +3253,7 @@ bool first_run_dialog_callback(const LLSD& notification, const LLSD& response)
3231 if (0 == option) 3253 if (0 == option)
3232 { 3254 {
3233 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL; 3255 LL_DEBUGS("AppInit") << "First run dialog cancelling" << LL_ENDL;
3234 const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterUrl(); 3256 const std::string &url = gHippoGridManager->getConnectedGrid()->getRegisterURL();
3235 if (!url.empty()) { 3257 if (!url.empty()) {
3236 LLWeb::loadURL(url); 3258 LLWeb::loadURL(url);
3237 } else { 3259 } else {
@@ -3283,7 +3305,7 @@ bool login_alert_status(const LLSD& notification, const LLSD& response)
3283 case 0: // OK 3305 case 0: // OK
3284 break; 3306 break;
3285 case 1: { // Help 3307 case 1: { // Help
3286 const std::string &url = gHippoGridManager->getConnectedGrid()->getSupportUrl(); 3308 const std::string &url = gHippoGridManager->getConnectedGrid()->getSupportURL();
3287 if (!url.empty()) LLWeb::loadURLInternal(url); 3309 if (!url.empty()) LLWeb::loadURLInternal(url);
3288 break; 3310 break;
3289 } 3311 }
@@ -4019,3 +4041,93 @@ void apply_udp_blacklist(const std::string& csv)
4019 4041
4020} 4042}
4021 4043
4044bool LLStartUp::handleSocksProxy(bool reportOK)
4045{
4046 std::string httpProxyType = gSavedSettings.getString("Socks5HttpProxyType");
4047
4048 // Determine the http proxy type (if any)
4049 if ((httpProxyType.compare("Web") == 0) && gSavedSettings.getBOOL("BrowserProxyEnabled"))
4050 {
4051 LLHost httpHost;
4052 httpHost.setHostByName(gSavedSettings.getString("BrowserProxyAddress"));
4053 httpHost.setPort(gSavedSettings.getS32("BrowserProxyPort"));
4054 LLSocks::getInstance()->EnableHttpProxy(httpHost,LLPROXY_HTTP);
4055 }
4056 else if ((httpProxyType.compare("Socks") == 0) && gSavedSettings.getBOOL("Socks5ProxyEnabled"))
4057 {
4058 LLHost httpHost;
4059 httpHost.setHostByName(gSavedSettings.getString("Socks5ProxyHost"));
4060 httpHost.setPort(gSavedSettings.getU32("Socks5ProxyPort"));
4061 LLSocks::getInstance()->EnableHttpProxy(httpHost,LLPROXY_SOCKS);
4062 }
4063 else
4064 {
4065 LLSocks::getInstance()->DisableHttpProxy();
4066 }
4067
4068 bool use_socks_proxy = gSavedSettings.getBOOL("Socks5ProxyEnabled");
4069 if (use_socks_proxy)
4070 {
4071
4072 // Determine and update LLSocks with the saved authentication system
4073 std::string auth_type = gSavedSettings.getString("Socks5AuthType");
4074
4075 if (auth_type.compare("None") == 0)
4076 {
4077 LLSocks::getInstance()->setAuthNone();
4078 }
4079
4080 if (auth_type.compare("UserPass") == 0)
4081 {
4082 LLSocks::getInstance()->setAuthPassword(gSavedSettings.getString("Socks5Username"),gSavedSettings.getString("Socks5Password"));
4083 }
4084
4085 // Start the proxy and check for errors
4086 int status = LLSocks::getInstance()->startProxy(gSavedSettings.getString("Socks5ProxyHost"), gSavedSettings.getU32("Socks5ProxyPort"));
4087 LLSD subs;
4088 subs["PROXY"] = gSavedSettings.getString("Socks5ProxyHost");
4089
4090 switch(status)
4091 {
4092 case SOCKS_OK:
4093 if (reportOK == true)
4094 {
4095 LLNotifications::instance().add("SOCKS_CONNECT_OK", subs);
4096 }
4097 return true;
4098 break;
4099
4100 case SOCKS_CONNECT_ERROR: // TCP Fail
4101 LLNotifications::instance().add("SOCKS_CONNECT_ERROR", subs);
4102 break;
4103
4104 case SOCKS_NOT_PERMITTED: // Socks5 server rule set refused connection
4105 LLNotifications::instance().add("SOCKS_NOT_PERMITTED", subs);
4106 break;
4107
4108 case SOCKS_NOT_ACCEPTABLE: // Selected authentication is not acceptable to server
4109 LLNotifications::instance().add("SOCKS_NOT_ACCEPTABLE", subs);
4110 break;
4111
4112 case SOCKS_AUTH_FAIL: // Authentication failed
4113 LLNotifications::instance().add("SOCKS_AUTH_FAIL", subs);
4114 break;
4115
4116 case SOCKS_UDP_FWD_NOT_GRANTED: // UDP forward request failed
4117 LLNotifications::instance().add("SOCKS_UDP_FWD_NOT_GRANTED", subs);
4118 break;
4119
4120 case SOCKS_HOST_CONNECT_FAILED: // Failed to open a TCP channel to the socks server
4121 LLNotifications::instance().add("SOCKS_HOST_CONNECT_FAILED", subs);
4122 break;
4123 }
4124
4125 return false;
4126 }
4127 else
4128 {
4129 LLSocks::getInstance()->stopProxy(); //ensure no UDP proxy is running and its all cleaned up
4130 }
4131
4132 return true;
4133}