aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorJacek Antonelli2009-09-10 02:38:36 -0500
committerJacek Antonelli2009-09-10 02:38:36 -0500
commitb3c39a47e76f595fd953d9ccffc58b0dfb8359db (patch)
treea4bfdb28caf5f42c7ff1878b359aa3fa6a79bc2c /linden
parentFixed line endings on hippo and grid manager files. (diff)
downloadmeta-impy-b3c39a47e76f595fd953d9ccffc58b0dfb8359db.zip
meta-impy-b3c39a47e76f595fd953d9ccffc58b0dfb8359db.tar.gz
meta-impy-b3c39a47e76f595fd953d9ccffc58b0dfb8359db.tar.bz2
meta-impy-b3c39a47e76f595fd953d9ccffc58b0dfb8359db.tar.xz
Updated Grid Manager from Meerkat's SVN (as of r215).
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llvfs/lldir.cpp12
-rw-r--r--linden/indra/llvfs/lldir.h4
-rw-r--r--linden/indra/newview/CMakeLists.txt12
-rw-r--r--linden/indra/newview/app_settings/default_grids.xml14
-rw-r--r--linden/indra/newview/authentication_controller.cpp80
-rw-r--r--linden/indra/newview/authentication_controller.h42
-rw-r--r--linden/indra/newview/authentication_floater.cpp75
-rw-r--r--linden/indra/newview/authentication_floater.h35
-rw-r--r--linden/indra/newview/authentication_model.cpp111
-rw-r--r--linden/indra/newview/authentication_model.h53
-rw-r--r--linden/indra/newview/controllerlogin.cpp142
-rw-r--r--linden/indra/newview/controllerlogin.h55
-rw-r--r--linden/indra/newview/controllerpasswords.cpp41
-rw-r--r--linden/indra/newview/controllerpasswords.h37
-rw-r--r--linden/indra/newview/floaterlogin.cpp348
-rw-r--r--linden/indra/newview/floaterlogin.h26
-rw-r--r--linden/indra/newview/hippoGridManager.cpp5
-rw-r--r--linden/indra/newview/hippoGridManager.h344
-rw-r--r--linden/indra/newview/llfloaterworldmap.cpp4
-rw-r--r--linden/indra/newview/llpanellogin.cpp49
-rw-r--r--linden/indra/newview/llprefsim.cpp4
-rw-r--r--linden/indra/newview/llstartup.cpp17
-rw-r--r--linden/indra/newview/prefpanelpasswords.cpp40
-rw-r--r--linden/indra/newview/prefpanelpasswords.h30
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_login.xml208
25 files changed, 478 insertions, 1310 deletions
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp
index 1dc00dd..c9af311 100644
--- a/linden/indra/llvfs/lldir.cpp
+++ b/linden/indra/llvfs/lldir.cpp
@@ -520,19 +520,23 @@ std::string LLDir::getForbiddenFileChars()
520 return "\\/:*?\"<>|"; 520 return "\\/:*?\"<>|";
521} 521}
522 522
523void LLDir::setLindenUserDir(const std::string &first, const std::string &last) 523void LLDir::setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last)
524{ 524{
525 // if both first and last aren't set, assume we're grabbing the cached dir 525 // if both first and last aren't set, assume we're grabbing the cached dir
526 if (!first.empty() && !last.empty()) 526 if (!first.empty() && !last.empty())
527 { 527 {
528 // some platforms have case-sensitive filesystems, so be 528 // some platforms have case-sensitive filesystems, so be
529 // utterly consistent with our firstname/lastname case. 529 // utterly consistent with our firstname/lastname case.
530 std::string gridlower(grid);
531 LLStringUtil::toLower(gridlower);
530 std::string firstlower(first); 532 std::string firstlower(first);
531 LLStringUtil::toLower(firstlower); 533 LLStringUtil::toLower(firstlower);
532 std::string lastlower(last); 534 std::string lastlower(last);
533 LLStringUtil::toLower(lastlower); 535 LLStringUtil::toLower(lastlower);
534 mLindenUserDir = getOSUserAppDir(); 536 mLindenUserDir = getOSUserAppDir();
535 mLindenUserDir += mDirDelimiter; 537 mLindenUserDir += mDirDelimiter;
538 mLindenUserDir += gridlower;
539 mLindenUserDir += "-";
536 mLindenUserDir += firstlower; 540 mLindenUserDir += firstlower;
537 mLindenUserDir += "_"; 541 mLindenUserDir += "_";
538 mLindenUserDir += lastlower; 542 mLindenUserDir += lastlower;
@@ -557,19 +561,23 @@ void LLDir::setChatLogsDir(const std::string &path)
557 } 561 }
558} 562}
559 563
560void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string &last) 564void LLDir::setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last)
561{ 565{
562 // if both first and last aren't set, assume we're grabbing the cached dir 566 // if both first and last aren't set, assume we're grabbing the cached dir
563 if (!first.empty() && !last.empty()) 567 if (!first.empty() && !last.empty())
564 { 568 {
565 // some platforms have case-sensitive filesystems, so be 569 // some platforms have case-sensitive filesystems, so be
566 // utterly consistent with our firstname/lastname case. 570 // utterly consistent with our firstname/lastname case.
571 std::string gridlower(grid);
572 LLStringUtil::toLower(gridlower);
567 std::string firstlower(first); 573 std::string firstlower(first);
568 LLStringUtil::toLower(firstlower); 574 LLStringUtil::toLower(firstlower);
569 std::string lastlower(last); 575 std::string lastlower(last);
570 LLStringUtil::toLower(lastlower); 576 LLStringUtil::toLower(lastlower);
571 mPerAccountChatLogsDir = getChatLogsDir(); 577 mPerAccountChatLogsDir = getChatLogsDir();
572 mPerAccountChatLogsDir += mDirDelimiter; 578 mPerAccountChatLogsDir += mDirDelimiter;
579 mPerAccountChatLogsDir += gridlower;
580 mPerAccountChatLogsDir += "-";
573 mPerAccountChatLogsDir += firstlower; 581 mPerAccountChatLogsDir += firstlower;
574 mPerAccountChatLogsDir += "_"; 582 mPerAccountChatLogsDir += "_";
575 mPerAccountChatLogsDir += lastlower; 583 mPerAccountChatLogsDir += lastlower;
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h
index b041afc..4ab5d85 100644
--- a/linden/indra/llvfs/lldir.h
+++ b/linden/indra/llvfs/lldir.h
@@ -119,8 +119,8 @@ class LLDir
119 static std::string getForbiddenFileChars(); 119 static std::string getForbiddenFileChars();
120 120
121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir 121 virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir
122 virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. 122 virtual void setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last); // Set the per user chat log directory.
123 virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir 123 virtual void setLindenUserDir(const std::string &grid, const std::string &first, const std::string &last); // Set the linden user dir to this user's dir
124 virtual void setSkinFolder(const std::string &skin_folder); 124 virtual void setSkinFolder(const std::string &skin_folder);
125 virtual bool setCacheDir(const std::string &path); 125 virtual bool setCacheDir(const std::string &path);
126 126
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index cd725d2..0a4ee82 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -61,11 +61,6 @@ include_directories(
61 ) 61 )
62 62
63set(viewer_SOURCE_FILES 63set(viewer_SOURCE_FILES
64 authentication_controller.cpp
65 authentication_floater.cpp
66 authentication_model.cpp
67 controllerlogin.cpp
68 controllerpasswords.cpp
69 floaterlogin.cpp 64 floaterlogin.cpp
70 hippoGridManager.cpp 65 hippoGridManager.cpp
71 hippoLimits.cpp 66 hippoLimits.cpp
@@ -442,7 +437,6 @@ set(viewer_SOURCE_FILES
442 llxmlrpctransaction.cpp 437 llxmlrpctransaction.cpp
443 noise.cpp 438 noise.cpp
444 pipeline.cpp 439 pipeline.cpp
445 prefpanelpasswords.cpp
446 primbackup.cpp 440 primbackup.cpp
447 rlvhandler.cpp 441 rlvhandler.cpp
448 rlvhelper.cpp 442 rlvhelper.cpp
@@ -471,11 +465,6 @@ endif (LINUX)
471set(viewer_HEADER_FILES 465set(viewer_HEADER_FILES
472 CMakeLists.txt 466 CMakeLists.txt
473 ViewerInstall.cmake 467 ViewerInstall.cmake
474 authentication_controller.h
475 authentication_floater.h
476 authentication_model.h
477 controllerlogin.h
478 controllerpasswords.h
479 floaterlogin.h 468 floaterlogin.h
480 hippoGridManager.h 469 hippoGridManager.h
481 hippoLimits.h 470 hippoLimits.h
@@ -859,7 +848,6 @@ set(viewer_HEADER_FILES
859 macmain.h 848 macmain.h
860 noise.h 849 noise.h
861 pipeline.h 850 pipeline.h
862 prefpanelpasswords.h
863 primbackup.h 851 primbackup.h
864 randgauss.h 852 randgauss.h
865 VertexCache.h 853 VertexCache.h
diff --git a/linden/indra/newview/app_settings/default_grids.xml b/linden/indra/newview/app_settings/default_grids.xml
index dabcb0b..05d8bed 100644
--- a/linden/indra/newview/app_settings/default_grids.xml
+++ b/linden/indra/newview/app_settings/default_grids.xml
@@ -10,20 +10,6 @@
10 <key>default_grids_version</key><string>0</string> 10 <key>default_grids_version</key><string>0</string>
11 </map> 11 </map>
12 12
13 <!-- OSGrid -->
14 <map>
15 <key>gridnick</key><string>osgrid</string>
16 <key>gridname</key><string>OSGrid</string>
17 <key>platform</key><string>OpenSim</string>
18 <key>loginuri</key><string>http://osgrid.org:8002/</string>
19 <key>loginpage</key><string>http://osgrid.org/loginscreen.php</string>
20 <key>helperuri</key><string>http://osgrid.org/</string>
21 <key>website</key><string>http://osgrid.org/</string>
22 <key>support</key><string>http://osgrid.org/</string>
23 <key>register</key><string>http://osgrid.org/index.php?page=create</string>
24 <key>password</key><string>http://osgrid.org/index.php?page=change</string>
25 </map>
26
27 <!-- Second Life --> 13 <!-- Second Life -->
28 <map> 14 <map>
29 <key>gridnick</key><string>secondlife</string> 15 <key>gridnick</key><string>secondlife</string>
diff --git a/linden/indra/newview/authentication_controller.cpp b/linden/indra/newview/authentication_controller.cpp
deleted file mode 100644
index a060409..0000000
--- a/linden/indra/newview/authentication_controller.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * AuthenticationController.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9#include "llviewerprecompiledheaders.h"
10#include "authentication_floater.h"
11#include "llviewerobject.h"
12#include "llcheckboxctrl.h"
13#include "llselectmgr.h"
14#include "authentication_controller.h"
15
16// Statics
17std::string AuthenticationController::target_grid;
18std::string AuthenticationController::username;
19std::string AuthenticationController::password;
20BOOL AuthenticationController::store_pw = FALSE;
21
22AuthenticationController::AuthenticationController(const std::string& tg, void (*cb)(void*))
23{
24 target_grid = tg;
25 callback = cb;
26}
27
28AuthenticationController::~AuthenticationController()
29{
30}
31
32// user interface callbacks: all static
33void AuthenticationController::onCommitUser(LLUICtrl* ctrl, void* userdata)
34{
35 AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
36 username = floater->childGetText("User_edit");
37}
38
39void AuthenticationController::onCommitPassword(LLUICtrl* ctrl, void* userdata)
40{
41 AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
42 password = floater->childGetText("Password_edit");
43}
44
45void AuthenticationController::onCommitRemember(LLUICtrl* ctrl, void* userdata)
46{
47 LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
48 if(!object) return;
49
50 LLCheckBoxCtrl *check = (LLCheckBoxCtrl*)ctrl;
51 store_pw = check->get();
52}
53
54void AuthenticationController::onAccept(void* userdata)
55{
56
57}
58
59void AuthenticationController::onCancel(void* userdata)
60{
61 AuthenticationFloater *floater = (AuthenticationFloater*)userdata;
62 floater->cancel();
63 floater->close();
64}
65
66void AuthenticationController::onClickRegister(void* userdata)
67{
68 llinfos << "onClickRegister" << llendl;
69}
70
71void AuthenticationController::retrieveStoredAccountData(void* userdata)
72{
73
74}
75
76// static
77std::string AuthenticationController::getTargetGrid()
78{
79 return target_grid;
80}
diff --git a/linden/indra/newview/authentication_controller.h b/linden/indra/newview/authentication_controller.h
deleted file mode 100644
index db875ea..0000000
--- a/linden/indra/newview/authentication_controller.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * AuthenticationController.h
3 * SecondLife
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9#ifndef PL_AuthenticationController_H
10#define PL_AuthenticationController_H
11
12#include "llfloater.h"
13
14class AuthenticationController
15{
16public:
17 AuthenticationController(const std::string& tg, void (*cb)(void*));
18 virtual ~AuthenticationController();
19
20 // line editor callbacks
21 static void onCommitUser(LLUICtrl* ctrl, void* userdata);
22 static void onCommitPassword(LLUICtrl* ctrl, void* userdata);
23 static void onCommitRemember(LLUICtrl* ctrl, void* userdata);
24 // button callbacks
25 static void onAccept(void* userdata);
26 static void onCancel(void* userdata);
27 static void onClickRegister(void* userdata);
28
29 void retrieveStoredAccountData(void* userdata);
30 static std::string getTargetGrid();
31
32private:
33 static std::string target_grid;
34 static std::string username;
35 static std::string password;
36 static BOOL store_pw;
37 void (*callback)(void*);
38};
39
40
41#endif // PL_AuthenticationController_H
42
diff --git a/linden/indra/newview/authentication_floater.cpp b/linden/indra/newview/authentication_floater.cpp
deleted file mode 100644
index 2fc7add..0000000
--- a/linden/indra/newview/authentication_floater.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * AuthenticationFloater.cpp
3 * Cross-grid authentication system view.
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9
10#include "llviewerprecompiledheaders.h"
11#include "authentication_floater.h"
12#include "lluictrlfactory.h"
13
14// Statics
15AuthenticationFloater* AuthenticationFloater::sInstance = NULL;
16AuthenticationController* AuthenticationFloater::sController = NULL;
17
18AuthenticationFloater::AuthenticationFloater()
19: LLFloater("floater_authentication")
20{
21 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_authentication.xml");
22
23 childSetTextArg("Intro_text", "[TARGET_GRID]", sController->getTargetGrid());
24
25 childSetCommitCallback("User_edit", controller()->onCommitUser, this);
26 childSetCommitCallback("Password_edit", controller()->onCommitPassword, this);
27 childSetCommitCallback("Remember_check", controller()->onCommitRemember, this);
28
29 childSetAction("OK", controller()->onAccept, this);
30 childSetAction("Cancel", controller()->onCancel, this);
31 childSetAction("Register", controller()->onClickRegister, this);
32
33 setDefaultBtn("OK");
34}
35
36AuthenticationFloater::~AuthenticationFloater()
37{
38 sInstance = NULL;
39 delete sController;
40 sController = NULL;
41}
42
43// static
44void AuthenticationFloater::show(void* userdata)
45{
46 std::string target_grid;
47 void (*cb)(void*) = NULL;
48
49 if (!userdata)
50 {
51 target_grid = "Authentication Test";
52 }
53
54 if (!sInstance)
55 sInstance = new AuthenticationFloater();
56 if (!sController)
57 sController = new AuthenticationController(target_grid, cb);
58
59 sInstance->open();
60}
61
62void AuthenticationFloater::accept()
63{
64 llinfos << "accept" << llendl;
65}
66
67void AuthenticationFloater::cancel()
68{
69 llinfos << "cancel" << llendl;
70}
71
72AuthenticationController* AuthenticationFloater::controller()
73{
74 return sController;
75}
diff --git a/linden/indra/newview/authentication_floater.h b/linden/indra/newview/authentication_floater.h
deleted file mode 100644
index b24426b..0000000
--- a/linden/indra/newview/authentication_floater.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * AuthenticationFloater.h
3 * Cross-grid authentication system view.
4 *
5 * Created by RMS on 7/1/08.
6 *
7 */
8
9#ifndef PL_AuthenticationFloater_H
10#define PL_AuthenticationFloater_H
11
12#include "llfloater.h"
13#include "authentication_controller.h"
14
15class AuthenticationFloater : public LLFloater
16{
17public:
18 AuthenticationFloater();
19 virtual ~AuthenticationFloater();
20
21 static void show(void* userdata);
22 static void accept();
23 static void cancel();
24
25 // data accessors
26 static AuthenticationController* controller();
27
28private:
29 // static because we only need one floater
30 static AuthenticationFloater* sInstance;
31 static AuthenticationController* sController;
32};
33
34
35#endif // PL_AuthenticationFloater_H
diff --git a/linden/indra/newview/authentication_model.cpp b/linden/indra/newview/authentication_model.cpp
deleted file mode 100644
index 763ab4a..0000000
--- a/linden/indra/newview/authentication_model.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * authentication_model.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/17/08.
6 *
7 */
8
9#include "llviewerprecompiledheaders.h"
10
11#include "lldir.h"
12#include "llfile.h"
13#include "llsdserialize.h"
14#include "authentication_model.h"
15
16AuthenticationModel::AuthenticationModel()
17{
18 loadPersistentData();
19}
20
21AuthenticationModel::~AuthenticationModel()
22{
23 savePersistentData();
24}
25
26void AuthenticationModel::loadPersistentData()
27{
28 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
29 "cross_grid_authentication.xml");
30 LLSD auth_llsd;
31 llifstream file;
32 file.open(filename);
33 if(file.is_open())
34 LLSDSerialize::fromXML(mAuthLLSD, file);
35}
36
37void AuthenticationModel::savePersistentData()
38{
39 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,
40 "cross_grid_authentication.xml");
41 llofstream ofile;
42 ofile.open(filename);
43 LLSDSerialize::toPrettyXML(mAuthLLSD, ofile);
44}
45
46void AuthenticationModel::revert()
47{
48 loadPersistentData();
49}
50
51AuthenticationModel::connection_t AuthenticationModel::subscribeToModelUpdates
52 (event_t::slot_function_type subscriber)
53{
54 return mEventUpdate.connect(subscriber);
55}
56
57void AuthenticationModel::unsubscribe(connection_t subscriber)
58{
59 subscriber.disconnect();
60}
61
62/* setters */
63void AuthenticationModel::addAccount(const std::string &grid, const std::string &accountName,
64 const std::string &accountPassword)
65{
66 mAuthLLSD[grid][accountName] = LLSD::LLSD(accountPassword);
67 mEventUpdate();
68}
69
70void AuthenticationModel::removeAccount(const std::string &grid, const std::string &accountName)
71{
72 mAuthLLSD[grid].erase(accountName);
73 mEventUpdate();
74}
75
76void AuthenticationModel::changePassword(const std::string &grid, const std::string &accountName,
77 const std::string &newPassword)
78{
79 mAuthLLSD[grid][accountName] = newPassword;
80 // no event necessary: passwords aren't displayed in any view
81}
82
83/* getters */
84
85void AuthenticationModel::getAllAccountNames(std::list<std::string> &names)
86{
87 // TODO: implement this for account management
88}
89
90void AuthenticationModel::getAccountNames(const std::string &grid, std::set<std::string> &names)
91{
92 if(!mAuthLLSD.has(grid))
93 return;
94
95 for(LLSD::map_const_iterator it = mAuthLLSD[grid].beginMap();
96 it != mAuthLLSD[grid].endMap(); ++it)
97 {
98 names.insert(it->first);
99 }
100}
101
102void AuthenticationModel::getPassword(const std::string &grid, const std::string &accountName,
103 std::string &password)
104{
105 password = mAuthLLSD[grid][accountName].asString();
106}
107
108void AuthenticationModel::requestUpdate()
109{
110 mEventUpdate();
111}
diff --git a/linden/indra/newview/authentication_model.h b/linden/indra/newview/authentication_model.h
deleted file mode 100644
index 858e936..0000000
--- a/linden/indra/newview/authentication_model.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * authentication_model.h
3 * SecondLife
4 *
5 * Created by RMS on 7/17/08.
6 *
7 */
8
9#ifndef PL_authentication_model_H
10#define PL_authentication_model_H
11
12#include <string>
13#include <set>
14#include <list>
15#include <boost/signal.hpp>
16#include <boost/bind.hpp>
17#include "lluuid.h"
18#include "llmemory.h"
19#include "llsd.h"
20
21class AuthenticationModel : public LLSingleton<AuthenticationModel>
22{
23public:
24 typedef boost::signal<void ()> event_t;
25 typedef boost::signals::connection connection_t;
26
27 AuthenticationModel();
28 virtual ~AuthenticationModel();
29
30 void loadPersistentData();
31 void savePersistentData();
32 void revert();
33
34 /* generic update, pull model: */
35 connection_t subscribeToModelUpdates(event_t::slot_function_type subscriber);
36 void unsubscribe(connection_t subscriber);
37
38 /* setters */
39 void addAccount(const std::string &grid, const std::string &accountName, const std::string &accountPassword);
40 void removeAccount(const std::string &grid, const std::string &accountName);
41 void changePassword(const std::string &grid, const std::string &accountName, const std::string &newPassword);
42
43 /* getters */
44 void getAllAccountNames(std::list<std::string> &names);
45 void getAccountNames(const std::string &grid, std::set<std::string> &names);
46 void getPassword(const std::string &grid, const std::string &accountName, std::string &password);
47 void requestUpdate();
48protected:
49 LLSD mAuthLLSD;
50private:
51 event_t mEventUpdate;
52};
53#endif // PL_authentication_model_H
diff --git a/linden/indra/newview/controllerlogin.cpp b/linden/indra/newview/controllerlogin.cpp
deleted file mode 100644
index 9dd61a6..0000000
--- a/linden/indra/newview/controllerlogin.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
1/*
2 * controllerlogin.cpp
3 * SecondLife
4 *
5 * Created by RMS on 7/16/08.
6 *
7 */
8#include "llerror.h"
9#include "llmd5.h"
10#include <boost/bind.hpp>
11#include "controllerlogin.h"
12
13LoginController::LoginController(LoginFloater *floater, AuthenticationModel *authModel, const std::string &grid)
14: mFloater(floater), mModel(authModel), mGrid(grid)
15{
16 // set up the user interface subview pointers
17 name_combo = mFloater->getChild<LLComboBox>("name_combo");
18 password_edit = mFloater->getChild<LLLineEditor>("password_edit");
19 start_location_combo= mFloater->getChild<LLComboBox>("start_location_combo");
20 remember_check = mFloater->getChild<LLCheckBoxCtrl>("remember_check");
21 connect_btn = mFloater->getChild<LLButton>("connect_btn");
22 quit_btn = mFloater->getChild<LLButton>("quit_btn");
23 server_combo = mFloater->getChild<LLComboBox>("server_combo");
24
25 // callbacks
26 // TODO: account creation and version information callbacks
27 name_combo->setCommitCallback(onCommitName);
28 name_combo->setCallbackUserData(this);
29 password_edit->setCommitCallback(onCommitPassword);
30 password_edit->setCallbackUserData(mFloater);
31 connect_btn->setClickedCallback(onAccept, this);
32 quit_btn->setClickedCallback(onCancel, this);
33
34 // subscribe to the model
35 mModelConnection = mModel->subscribeToModelUpdates(boost::bind(&LoginController::update, this));
36 // request an initial update
37 mModel->requestUpdate();
38}
39
40LoginController::~LoginController()
41{
42 mModel->unsubscribe(mModelConnection);
43}
44
45void LoginController::update()
46{
47 // when we want to update, we need to make sure it's relevant to our
48 // interests and make the change as smooth as possible for the user
49 std::set<std::string> newAccountNames;
50 mModel->getAccountNames(mGrid, newAccountNames);
51
52 if(mAccountNames == newAccountNames)
53 return;
54
55 name_combo->removeall();
56
57 for(std::set<std::string>::iterator it = newAccountNames.begin();
58 it != newAccountNames.end(); ++it)
59 {
60 name_combo->add(*it);
61 }
62
63 name_combo->sortByName();
64 mAccountNames.swap(newAccountNames);
65}
66
67void LoginController::mungePassword(std::string &password)
68{
69 LLMD5 pass((unsigned char *)password.c_str());
70 char munged_password[MD5HEX_STR_SIZE];
71 pass.hex_digest(munged_password);
72 password = munged_password;
73}
74
75// user interface callbacks
76
77void LoginController::onCommitName(LLUICtrl *control, void *userdata)
78{
79 // look at this shit it fills in the password box if it finds a stored account
80 // and auto checks remember password
81 LoginController *controller = (LoginController *)userdata;
82 LoginFloater *floater = controller->mFloater;
83
84 std::string loginname = floater->childGetText("name_combo");
85 std::set<std::string>::iterator it = controller->mAccountNames.find(loginname);
86 if(it != controller->mAccountNames.end())
87 {
88 std::string loginpassword;
89
90 controller->mModel->getPassword(controller->mGrid, loginname, loginpassword);
91 LoginFloater::setFields(loginname, loginpassword, true);
92 }
93}
94
95void LoginController::onCommitPassword(LLUICtrl *control, void *userdata)
96{
97 LoginFloater *floater = (LoginFloater *)userdata;
98 LLLineEditor *editor = (LLLineEditor *)control;
99 std::string password = editor->getText();
100
101 // when we have a new password we need to MD5 it and tell the floater
102 if(!floater->isSamePassword(password))
103 {
104 mungePassword(password);
105 floater->setPassword(password);
106 }
107}
108
109void LoginController::onAccept(void* userdata)
110{
111 // this here does the main work of telling the model we need to write
112 // account data
113 LoginController *controller = (LoginController *)userdata;
114 LoginFloater *floater = controller->mFloater;
115
116 if(!floater->childGetValue("remember_check"))
117 {
118 LoginFloater::accept();
119 return;
120 }
121
122 std::string username = floater->childGetText("name_combo");
123 std::string password = floater->getPassword();
124
125 if(controller->mAccountNames.find(username) != controller->mAccountNames.end())
126 {
127 controller->mModel->changePassword(controller->mGrid, username, password);
128 }
129
130 else
131 {
132 controller->mModel->addAccount(controller->mGrid, username, password);
133 }
134 controller->mModel->savePersistentData();
135 LoginFloater::accept();
136}
137
138void LoginController::onCancel(void* userdata)
139{
140 // if the user backs out of the dialog we tell it to clean up and such
141 LoginFloater::cancel_old();
142}
diff --git a/linden/indra/newview/controllerlogin.h b/linden/indra/newview/controllerlogin.h
deleted file mode 100644
index a187558..0000000
--- a/linden/indra/newview/controllerlogin.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * controllerlogin.h
3 * SecondLife
4 *
5 * Created by RMS on 7/16/08.
6 *
7 */
8#ifndef PL_controllerlogin_H
9#define PL_controllerlogin_H
10
11#include <set>
12#include <string>
13#include "llcombobox.h"
14#include "lllineeditor.h"
15#include "llcheckboxctrl.h"
16#include "llbutton.h"
17#include "floaterlogin.h"
18#include "authentication_model.h"
19
20class LoginController
21{
22public:
23 LoginController(LoginFloater *floater, AuthenticationModel *authModel, const std::string &grid);
24 virtual ~LoginController();
25 virtual void update();
26protected:
27 LoginFloater *mFloater;
28 AuthenticationModel *mModel;
29 std::string mGrid;
30private:
31 AuthenticationModel::connection_t mModelConnection;
32
33 static void mungePassword(std::string &password);
34
35 // UI subview pointers
36 LLComboBox *name_combo;
37 LLLineEditor *password_edit;
38 LLComboBox *start_location_combo;
39 LLCheckBoxCtrl *remember_check;
40 LLButton *connect_btn;
41 LLButton *quit_btn;
42 LLComboBox *server_combo;
43
44 // state
45 std::set<std::string> mAccountNames;
46
47 // user interface callbacks
48 // TODO: find an alternative to linden callbacks
49 static void onCommitName(LLUICtrl *control, void *userdata);
50 static void onCommitPassword(LLUICtrl *control, void *userdata);
51 static void onAccept(void* userdata);
52 static void onCancel(void* userdata);
53};
54
55#endif // PL_controllerlogin_H
diff --git a/linden/indra/newview/controllerpasswords.cpp b/linden/indra/newview/controllerpasswords.cpp
deleted file mode 100644
index 6e39d9a..0000000
--- a/linden/indra/newview/controllerpasswords.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * controllerpasswords.cpp
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "authentication_model.h"
10#include "prefpanelpasswords.h"
11#include "controllerpasswords.h"
12
13PasswordsController::PasswordsController(PasswordsPrefPanel *panel)
14: mPanel(panel)
15{
16 accounts_list = mPanel->getChild<LLScrollListCtrl>("accounts_list");
17 remove_btn = mPanel->getChild<LLButton>("remove_btn");
18 mModel = AuthenticationModel::getInstance();
19
20 // subscribe to the model
21 mModelConnection = mModel->subscribeToModelUpdates(boost::bind(&PasswordsController::update, this));
22 // request an initial update
23 mModel->requestUpdate();
24}
25
26PasswordsController::~PasswordsController()
27{
28 mModel->unsubscribe(mModelConnection);
29 mModel = NULL;
30}
31
32void PasswordsController::update()
33{
34 std::list<std::string> newAccountData;
35 mModel->getAllAccountNames(newAccountData);
36
37 if(mAccountData == newAccountData)
38 return;
39
40 accounts_list->deleteAllItems();
41}
diff --git a/linden/indra/newview/controllerpasswords.h b/linden/indra/newview/controllerpasswords.h
deleted file mode 100644
index e656659..0000000
--- a/linden/indra/newview/controllerpasswords.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * controllerpasswords.h
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include <string>
10#include <list>
11#include "llscrolllistctrl.h"
12#include "llbutton.h"
13#include "authentication_model.h"
14
15#ifndef PL_controllerpasswords_H
16#define PL_controllerpasswords_H
17class PasswordsPrefPanel;
18
19class PasswordsController
20{
21public:
22 PasswordsController(PasswordsPrefPanel *panel);
23 virtual ~PasswordsController();
24 virtual void update();
25protected:
26 LLScrollListCtrl *accounts_list;
27 LLButton *remove_btn;
28private:
29 AuthenticationModel::connection_t mModelConnection;
30
31 PasswordsPrefPanel *mPanel;
32 AuthenticationModel *mModel;
33
34 std::list<std::string> mAccountData;
35};
36
37#endif // PL_controllerpasswords_H
diff --git a/linden/indra/newview/floaterlogin.cpp b/linden/indra/newview/floaterlogin.cpp
index b943c4e..6519962 100644
--- a/linden/indra/newview/floaterlogin.cpp
+++ b/linden/indra/newview/floaterlogin.cpp
@@ -1,9 +1,7 @@
1/* 1/*
2 * floaterlogin.cpp 2 * floaterlogin.cpp (floatergridmanager.cpp pls)
3 * SecondLife 3 * This is Meerkats grid manager, and I accidentally finished it with the wrong name :)
4 * 4 * -Patrick Sapinski (Monday, August 17, 2009)
5 * Created by RMS on 7/15/08.
6 *
7 */ 5 */
8 6
9#include "llviewerprecompiledheaders.h" 7#include "llviewerprecompiledheaders.h"
@@ -16,7 +14,6 @@
16#include "llmd5.h" 14#include "llmd5.h"
17#include "llurlsimstring.h" 15#include "llurlsimstring.h"
18#include "lluictrlfactory.h" 16#include "lluictrlfactory.h"
19#include "controllerlogin.h"
20#include "floaterlogin.h" 17#include "floaterlogin.h"
21#include "hippoGridManager.h" 18#include "hippoGridManager.h"
22#include "llviewernetwork.h" 19#include "llviewernetwork.h"
@@ -26,13 +23,11 @@
26 23
27LoginFloater* LoginFloater::sInstance = NULL; 24LoginFloater* LoginFloater::sInstance = NULL;
28LoginController* LoginFloater::sController = NULL; 25LoginController* LoginFloater::sController = NULL;
29AuthenticationModel* LoginFloater::sModel = NULL;
30bool LoginFloater::sIsInitialLogin; 26bool LoginFloater::sIsInitialLogin;
31std::string LoginFloater::sGrid; 27std::string LoginFloater::sGrid;
32 28
33LoginFloater::LoginFloater(void (*callback)(S32 option, void* user_data), 29LoginFloater::LoginFloater()
34 void *cb_data) 30: LLFloater("floater_login")
35: LLFloater("floater_login"), mCallback(callback), mCallbackData(cb_data)
36{ 31{
37 32
38 mState = NORMAL; 33 mState = NORMAL;
@@ -56,7 +51,7 @@ LoginFloater::LoginFloater(void (*callback)(S32 option, void* user_data),
56 } 51 }
57 52
58 center(); 53 center();
59 LLLineEditor* edit = getChild<LLLineEditor>("password_edit"); 54 LLLineEditor* edit = getChild<LLLineEditor>("avatar_password_edit");
60 if (edit) edit->setDrawAsterixes(TRUE); 55 if (edit) edit->setDrawAsterixes(TRUE);
61 LLComboBox* combo = getChild<LLComboBox>("start_location_combo"); 56 LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
62 combo->setAllowTextEntry(TRUE, 128, FALSE); 57 combo->setAllowTextEntry(TRUE, 128, FALSE);
@@ -79,34 +74,11 @@ LoginFloater::LoginFloater(void (*callback)(S32 option, void* user_data),
79 { 74 {
80 combo->setCurrentByIndex( 0 ); 75 combo->setCurrentByIndex( 0 );
81 } 76 }
82
83 LLTextBox* version_text = getChild<LLTextBox>("version_text");
84 std::string version = llformat("%d.%d.%d (%d)",
85 LL_VERSION_MAJOR,
86 LL_VERSION_MINOR,
87 LL_VERSION_PATCH,
88 LL_VIEWER_BUILD );
89 version_text->setText(version);
90
91 LLTextBox* channel_text = getChild<LLTextBox>("channel_text");
92 channel_text->setText(gSavedSettings.getString("VersionChannelName"));
93
94 sendChildToBack(getChildView("channel_text"));
95 sendChildToBack(getChildView("version_text"));
96 sendChildToBack(getChildView("forgot_password_text"));
97
98 setDefaultBtn("connect_btn");
99
100
101
102} 77}
103 78
104 79
105LoginFloater::~LoginFloater() 80LoginFloater::~LoginFloater()
106{ 81{
107 delete LoginFloater::sController;
108
109 LoginFloater::sModel = NULL;
110 LoginFloater::sController = NULL; 82 LoginFloater::sController = NULL;
111 LoginFloater::sInstance = NULL; 83 LoginFloater::sInstance = NULL;
112} 84}
@@ -122,17 +94,19 @@ void LoginFloater::close()
122 94
123BOOL LoginFloater::postBuild() 95BOOL LoginFloater::postBuild()
124{ 96{
125 requires<LLComboBox>("grid_selector"); 97 requires<LLScrollListCtrl>("grid_selector");
126 requires<LLLineEditor>("gridnick"); 98 requires<LLLineEditor>("gridnick");
127 requires<LLComboBox>("platform");
128 requires<LLLineEditor>("gridname"); 99 requires<LLLineEditor>("gridname");
129 requires<LLLineEditor>("loginuri"); 100 requires<LLLineEditor>("loginuri");
130 requires<LLLineEditor>("loginpage"); 101 requires<LLLineEditor>("loginpage");
131 requires<LLLineEditor>("helperuri"); 102 requires<LLLineEditor>("helperuri");
132 requires<LLLineEditor>("website"); 103 requires<LLLineEditor>("website");
104 requires<LLLineEditor>("support");
105 requires<LLLineEditor>("register");
106 requires<LLLineEditor>("password");
133 requires<LLLineEditor>("first_name"); 107 requires<LLLineEditor>("first_name");
134 requires<LLLineEditor>("last_name"); 108 requires<LLLineEditor>("last_name");
135 requires<LLLineEditor>("password"); 109 requires<LLLineEditor>("avatar_password");
136 //requires<LLLineEditor>("search"); 110 //requires<LLLineEditor>("search");
137 requires<LLButton>("btn_delete"); 111 requires<LLButton>("btn_delete");
138 requires<LLButton>("btn_add"); 112 requires<LLButton>("btn_add");
@@ -141,17 +115,18 @@ BOOL LoginFloater::postBuild()
141 requires<LLButton>("btn_gridinfo"); 115 requires<LLButton>("btn_gridinfo");
142 requires<LLButton>("btn_help_render_compat"); 116 requires<LLButton>("btn_help_render_compat");
143 if (!checkRequirements()) return false; 117 if (!checkRequirements()) return false;
144 LLLineEditor* password_edit = getChild<LLLineEditor>("password"); 118 LLLineEditor* password_edit = getChild<LLLineEditor>("avatar_password");
145 if (password_edit) password_edit->setDrawAsterixes(TRUE); 119 if (password_edit) password_edit->setDrawAsterixes(TRUE);
146 120
147 childSetAction("btn_delete", onClickDelete, this); 121 childSetAction("btn_delete", onClickDelete, this);
148 childSetAction("btn_add", onClickAdd, this); 122 childSetAction("btn_add", onClickAdd, this);
149 childSetAction("btn_copy", onClickCopy, this); 123 childSetAction("btn_copy", onClickCopy, this);
124 childSetAction("btn_ok", onClickOk, this);
150 childSetAction("btn_apply", onClickApply, this); 125 childSetAction("btn_apply", onClickApply, this);
151 childSetAction("set_default", onClickDefault, this); 126 childSetAction("set_default", onClickDefault, this);
152 childSetAction("btn_cancel", onClickCancel, this); 127 childSetAction("btn_cancel", onClickCancel, this);
153//KOW childSetAction("set_default", onClickDefault, this); 128//KOW childSetAction("set_default", onClickDefault, this);
154//KOW childSetAction("btn_gridinfo", onClickGridInfo, this); 129 childSetAction("btn_gridinfo", onClickGridInfo, this);
155//KOW childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this); 130//KOW childSetAction("btn_help_render_compat", onClickHelpRenderCompat, this);
156 131
157 childSetCommitCallback("grid_selector", onSelectGrid, this); 132 childSetCommitCallback("grid_selector", onSelectGrid, this);
@@ -209,29 +184,24 @@ void LoginFloater::refresh_grids()
209 sInstance->childSetEnabled("set_default", (sInstance->mState == NORMAL) && (selectIndex > 0)); 184 sInstance->childSetEnabled("set_default", (sInstance->mState == NORMAL) && (selectIndex > 0));
210 sInstance->childSetEnabled("gridnick", (sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY)); 185 sInstance->childSetEnabled("gridnick", (sInstance->mState == ADD_NEW) || (sInstance->mState == ADD_COPY));
211 186
212
213 LLComboBox *platform = sInstance->getChild<LLComboBox>("platform");
214 platform->removeall();
215 for (int p=HippoGridInfo::PLATFORM_OTHER; p<HippoGridInfo::PLATFORM_LAST; p++)
216 platform->add(HippoGridInfo::getPlatformString(static_cast<HippoGridInfo::Platform>(p)));
217
218
219 if (sInstance->mState == NORMAL) { 187 if (sInstance->mState == NORMAL) {
220 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(sInstance->mCurGrid); 188 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(sInstance->mCurGrid);
221 if (gridInfo) { 189 if (gridInfo) {
222 sInstance->childSetText("gridnick", gridInfo->getGridNick()); 190 sInstance->childSetText("gridnick", gridInfo->getGridNick());
223 platform->setCurrentByIndex(gridInfo->getPlatform());
224 //sInstance->childSetText("grid_name", gridInfo->getGridName()); 191 //sInstance->childSetText("grid_name", gridInfo->getGridName());
225 sInstance->childSetText("loginuri", gridInfo->getLoginUri()); 192 sInstance->childSetText("loginuri", gridInfo->getLoginUri());
226 sInstance->childSetText("loginpage", gridInfo->getLoginPage()); 193 sInstance->childSetText("loginpage", gridInfo->getLoginPage());
227 sInstance->childSetText("helperuri", gridInfo->getHelperUri()); 194 sInstance->childSetText("helperuri", gridInfo->getHelperUri());
228 sInstance->childSetText("website", gridInfo->getWebSite()); 195 sInstance->childSetText("website", gridInfo->getWebSite());
196 sInstance->childSetText("support", gridInfo->getSupportUrl());
197 sInstance->childSetText("register", gridInfo->getRegisterUrl());
198 sInstance->childSetText("password", gridInfo->getPasswordUrl());
229 sInstance->childSetText("first_name", gridInfo->getFirstName()); 199 sInstance->childSetText("first_name", gridInfo->getFirstName());
230 sInstance->childSetText("last_name", gridInfo->getLastName()); 200 sInstance->childSetText("last_name", gridInfo->getLastName());
231 if(gridInfo->getAvatarPassword().length() == 32) 201 if(gridInfo->getAvatarPassword().length() == 32)
232 sInstance->childSetText("password", std::string(PASSWORD_FILLER)); 202 sInstance->childSetText("avatar_password", std::string(PASSWORD_FILLER));
233 else if(gridInfo->getPasswordUrl().empty()) 203 else if(gridInfo->getPasswordUrl().empty())
234 sInstance->childSetText("password", std::string("")); 204 sInstance->childSetText("avatar_password", std::string(""));
235/* 205/*
236 if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) { 206 if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) {
237 //childSetEnabled("search", false); 207 //childSetEnabled("search", false);
@@ -248,7 +218,6 @@ void LoginFloater::refresh_grids()
248 } else { 218 } else {
249 std::string empty = ""; 219 std::string empty = "";
250 sInstance->childSetText("gridnick", empty); 220 sInstance->childSetText("gridnick", empty);
251 platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
252 sInstance->childSetText("gridname", empty); 221 sInstance->childSetText("gridname", empty);
253 sInstance->childSetText("loginuri", empty); 222 sInstance->childSetText("loginuri", empty);
254 sInstance->childSetText("loginpage", empty); 223 sInstance->childSetText("loginpage", empty);
@@ -256,28 +225,26 @@ void LoginFloater::refresh_grids()
256 sInstance->childSetText("website", empty); 225 sInstance->childSetText("website", empty);
257 sInstance->childSetText("first_name", empty); 226 sInstance->childSetText("first_name", empty);
258 sInstance->childSetText("last_name", empty); 227 sInstance->childSetText("last_name", empty);
259 sInstance->childSetText("password", empty); 228 sInstance->childSetText("avatar_password", empty);
260 sInstance->childSetEnabled("render_compat", true);
261 sInstance->childSetValue("render_compat", true);
262 } 229 }
263 } else if (sInstance->mState == ADD_NEW) { 230 } else if (sInstance->mState == ADD_NEW) {
264 llwarns << "ADD_NEW" << llendl; 231 llwarns << "ADD_NEW" << llendl;
265 std::string required = "<required>"; 232 std::string required = "<required>";
266 std::string empty = ""; 233 std::string empty = "";
267 sInstance->childSetText("gridnick", required); 234 sInstance->childSetText("gridnick", required);
268 platform->setCurrentByIndex(HippoGridInfo::PLATFORM_OTHER);
269 sInstance->childSetText("gridname", empty); 235 sInstance->childSetText("gridname", empty);
270 sInstance->childSetText("loginuri", required); 236 sInstance->childSetText("loginuri", required);
271 sInstance->childSetText("loginpage", empty); 237 sInstance->childSetText("loginpage", empty);
272 sInstance->childSetText("helperuri", empty); 238 sInstance->childSetText("helperuri", empty);
273 sInstance->childSetText("website", empty); 239 sInstance->childSetText("website", empty);
240 sInstance->childSetText("support", empty);
241 sInstance->childSetText("register", empty);
242 sInstance->childSetText("password", empty);
274 sInstance->childSetText("first_name", empty); 243 sInstance->childSetText("first_name", empty);
275 sInstance->childSetText("last_name", empty); 244 sInstance->childSetText("last_name", empty);
276 sInstance->childSetText("password", empty); 245 sInstance->childSetText("avatar_password", empty);
277 //childSetEnabled("search", true); 246 //childSetEnabled("search", true);
278 //childSetText("search", empty); 247 //childSetText("search", empty);
279 sInstance->childSetEnabled("render_compat", true);
280 sInstance->childSetValue("render_compat", true);
281 } else if (sInstance->mState == ADD_COPY) { 248 } else if (sInstance->mState == ADD_COPY) {
282 llwarns << "ADD_COPY" << llendl; 249 llwarns << "ADD_COPY" << llendl;
283 sInstance->childSetText("gridnick", LLStringExplicit("<required>")); 250 sInstance->childSetText("gridnick", LLStringExplicit("<required>"));
@@ -302,29 +269,32 @@ void LoginFloater::applyChanges()
302 { 269 {
303 if (gridInfo->getGridNick() == childGetValue("gridnick").asString()) 270 if (gridInfo->getGridNick() == childGetValue("gridnick").asString())
304 { 271 {
305 gridInfo->setPlatform(childGetValue("platform"));
306 gridInfo->setGridName(childGetValue("gridname")); 272 gridInfo->setGridName(childGetValue("gridname"));
307 gridInfo->setLoginUri(childGetValue("loginuri")); 273 gridInfo->setLoginUri(childGetValue("loginuri"));
308 gridInfo->setLoginPage(childGetValue("loginpage")); 274 gridInfo->setLoginPage(childGetValue("loginpage"));
309 gridInfo->setHelperUri(childGetValue("helperuri")); 275 gridInfo->setHelperUri(childGetValue("helperuri"));
310 gridInfo->setWebSite(childGetValue("website")); 276 gridInfo->setWebSite(childGetValue("website"));
277 gridInfo->setSupportUrl(childGetValue("support"));
278 gridInfo->setRegisterUrl(childGetValue("register"));
279 gridInfo->setPasswordUrl(childGetValue("password"));
311 gridInfo->setFirstName(childGetValue("first_name")); 280 gridInfo->setFirstName(childGetValue("first_name"));
312 gridInfo->setLastName(childGetValue("last_name")); 281 gridInfo->setLastName(childGetValue("last_name"));
313 //gridInfo->setSearchUrl(childGetValue("search")); 282 //gridInfo->setSearchUrl(childGetValue("search"));
314 gridInfo->setRenderCompat(childGetValue("render_compat")); 283 gridInfo->setRenderCompat(childGetValue("render_compat"));
315 284
316 if(childGetValue("password").asString().empty()) 285 if(childGetValue("avatar_password").asString().empty())
317 gridInfo->setPasswordUrl(std::string("")); 286 gridInfo->setAvatarPassword(std::string(""));
318 else if(childGetValue("password").asString() != std::string(PASSWORD_FILLER)) 287 else if(childGetValue("avatar_password").asString() != std::string(PASSWORD_FILLER))
319 { 288 {
320 // store account authentication data 289 // store account authentication data
321 std::string auth_password = childGetValue("password"); 290 std::string auth_password = childGetValue("avatar_password");
322 std::string hashed_password; 291 std::string hashed_password;
323 hashPassword(auth_password, hashed_password); 292 hashPassword(auth_password, hashed_password);
324 gridInfo->setAvatarPassword(hashed_password); 293 gridInfo->setAvatarPassword(hashed_password);
325 } 294 }
326 LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(), 295 //this bug was a feature -Patrick Sapinski (Friday, August 21, 2009)
327 gridInfo->getAvatarPassword(), true); 296 //LLPanelLogin::setFields(gridInfo->getFirstName(), gridInfo->getLastName(),
297 // gridInfo->getAvatarPassword(), true);
328 } 298 }
329 else 299 else
330 { 300 {
@@ -363,24 +333,26 @@ bool LoginFloater::createNewGrid()
363 333
364 // create new grid 334 // create new grid
365 HippoGridInfo *grid = new HippoGridInfo(gridnick); 335 HippoGridInfo *grid = new HippoGridInfo(gridnick);
366 grid->setPlatform(childGetValue("platform"));
367 grid->setGridName(childGetValue("gridname")); 336 grid->setGridName(childGetValue("gridname"));
368 grid->setLoginUri(loginuri); 337 grid->setLoginUri(loginuri);
369 grid->setLoginPage(childGetValue("loginpage")); 338 grid->setLoginPage(childGetValue("loginpage"));
370 grid->setHelperUri(childGetValue("helperuri")); 339 grid->setHelperUri(childGetValue("helperuri"));
371 grid->setWebSite(childGetValue("website")); 340 grid->setWebSite(childGetValue("website"));
341 grid->setSupportUrl(childGetValue("support"));
342 grid->setRegisterUrl(childGetValue("register"));
343 grid->setPasswordUrl(childGetValue("password"));
372 grid->setFirstName(childGetValue("first_name")); 344 grid->setFirstName(childGetValue("first_name"));
373 grid->setLastName(childGetValue("last_name")); 345 grid->setLastName(childGetValue("last_name"));
374 //grid->setSearchUrl(childGetValue("search")); 346 //grid->setSearchUrl(childGetValue("search"));
375 grid->setRenderCompat(childGetValue("render_compat")); 347 grid->setRenderCompat(childGetValue("render_compat"));
376 gHippoGridManager->addGrid(grid); 348 gHippoGridManager->addGrid(grid);
377 349
378 if(childGetValue("password").asString().empty()) 350 if(childGetValue("avatar_password").asString().empty())
379 grid->setAvatarPassword(std::string("")); 351 grid->setAvatarPassword(std::string(""));
380 else 352 else
381 { 353 {
382 std::string hashed_password; 354 std::string hashed_password;
383 hashPassword(childGetValue("password"), hashed_password); 355 hashPassword(childGetValue("avatar_password"), hashed_password);
384 grid->setAvatarPassword(hashed_password); 356 grid->setAvatarPassword(hashed_password);
385 } 357 }
386 358
@@ -388,6 +360,49 @@ bool LoginFloater::createNewGrid()
388 return true; 360 return true;
389} 361}
390 362
363void LoginFloater::retrieveGridInfo()
364{
365 std::string loginuri = childGetValue("loginuri");
366 if ((loginuri == "") || (loginuri == "<required>")) {
367 //KOW gViewerWindow->alertXml("GridInfoNoLoginUri");
368 return;
369 }
370
371 HippoGridInfo *grid = 0;
372 bool cleanupGrid = false;
373 if (mState == NORMAL) {
374 grid = gHippoGridManager->getGrid(mCurGrid);
375 } else if ((mState == ADD_NEW) || (mState == ADD_COPY)) {
376 grid = new HippoGridInfo("");
377 cleanupGrid = true;
378 } else {
379 llerrs << "Illegal state " << mState << '.' << llendl;
380 return;
381 }
382 if (!grid) {
383 llerrs << "Internal error retrieving grid info." << llendl;
384 return;
385 }
386
387 grid->setLoginUri(loginuri);
388 if (grid->retrieveGridInfo()) {
389 if (grid->getGridNick() != "") childSetText("gridnick", grid->getGridNick());
390 if (grid->getGridName() != "") childSetText("gridname", grid->getGridName());
391 if (grid->getLoginUri() != "") childSetText("loginuri", grid->getLoginUri());
392 if (grid->getLoginPage() != "") childSetText("loginpage", grid->getLoginPage());
393 if (grid->getHelperUri() != "") childSetText("helperuri", grid->getHelperUri());
394 if (grid->getWebSite() != "") childSetText("website", grid->getWebSite());
395 if (grid->getSupportUrl() != "") childSetText("support", grid->getSupportUrl());
396 if (grid->getRegisterUrl() != "") childSetText("register", grid->getRegisterUrl());
397 if (grid->getPasswordUrl() != "") childSetText("password", grid->getPasswordUrl());
398 //if (grid->getSearchUrl() != "") childSetText("search", grid->getSearchUrl());
399 } else {
400 //KOW gViewerWindow->alertXml("GridInfoError");
401 }
402
403 if (cleanupGrid) delete grid;
404}
405
391void LoginFloater::apply() 406void LoginFloater::apply()
392{ 407{
393 if (mState == NORMAL) { 408 if (mState == NORMAL) {
@@ -417,8 +432,6 @@ void LoginFloater::setDefault()
417 } 432 }
418 gHippoGridManager->setCurrentGrid(mCurGrid); 433 gHippoGridManager->setCurrentGrid(mCurGrid);
419 gHippoGridManager->setDefaultGrid(mCurGrid); 434 gHippoGridManager->setDefaultGrid(mCurGrid);
420 llwarns << "I think me grid is " << mCurGrid << llendl;
421 //LLPanelLogin::refreshLoginPage();
422 gHippoGridManager->saveFile(); 435 gHippoGridManager->saveFile();
423 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel()); 436 LLPanelLogin::addServer(LLViewerLogin::getInstance()->getGridLabel());
424} 437}
@@ -426,7 +439,6 @@ void LoginFloater::setDefault()
426void LoginFloater::cancel() 439void LoginFloater::cancel()
427{ 440{
428 gHippoGridManager->discardAndReload(); 441 gHippoGridManager->discardAndReload();
429 LoginFloater::sModel->revert();
430 update(); 442 update();
431} 443}
432 444
@@ -439,14 +451,8 @@ void LoginFloater::onSelectGrid(LLUICtrl* ctrl, void *data)
439 if (self->createNewGrid()) { 451 if (self->createNewGrid()) {
440 self->mState = NORMAL; 452 self->mState = NORMAL;
441 } else { 453 } else {
442 //LLCtrlListInterface *grids = self->childGetListInterface("search_results"); 454 //LLScrollListCtrl *grids = self->getChild<LLScrollListCtrl>("grid_selector");
443 //if (!grids) return; 455 //grids->setCurrentByIndex(grids->getItemCount() - 1);
444
445 //LLSD selected_value = grids->getSelectedValue();
446 //std::string sim_name = selected_value.asString();
447
448 LLComboBox *grids = self->getChild<LLComboBox>("grid_selector");
449 grids->setCurrentByIndex(grids->getItemCount() - 1);
450 return; 456 return;
451 } 457 }
452 } else { 458 } else {
@@ -454,8 +460,6 @@ void LoginFloater::onSelectGrid(LLUICtrl* ctrl, void *data)
454 return; 460 return;
455 } 461 }
456 self->mCurGrid = ctrl->getValue().asString(); 462 self->mCurGrid = ctrl->getValue().asString();
457 llwarns << "I think me grid is " << self->mCurGrid << llendl;
458
459 self->refresh_grids(); 463 self->refresh_grids();
460} 464}
461 465
@@ -488,16 +492,38 @@ void LoginFloater::onClickCopy(void *data)
488 self->refresh_grids(); 492 self->refresh_grids();
489} 493}
490 494
495// static
496void LoginFloater::onClickOk(void* data)
497{
498 if(NULL==sInstance)
499 return;
500
501 sInstance->apply();
502 sInstance->close();
503}
504
491//static 505//static
492void LoginFloater::onClickApply(void *data) 506void LoginFloater::onClickApply(void *data)
493{ 507{
508 if(NULL==sInstance)
509 return;
510
494 sInstance->apply(); 511 sInstance->apply();
512 refresh_grids();
495} 513}
496 514
497//static 515//static
498void LoginFloater::onClickDefault(void *data) 516void LoginFloater::onClickDefault(void *data)
499{ 517{
500 sInstance->setDefault(); 518 sInstance->setDefault();
519 sInstance->refresh_grids();
520}
521
522//static
523void LoginFloater::onClickGridInfo(void *data)
524{
525 //HippoPanelGrids* self = (HippoPanelGrids*)data;
526 sInstance->retrieveGridInfo();
501} 527}
502 528
503//static 529//static
@@ -542,64 +568,28 @@ void LoginFloater::refreshLocation( bool force_visible )
542 sInstance->childSetVisible("server_combo", TRUE); 568 sInstance->childSetVisible("server_combo", TRUE);
543} 569}
544 570
545void LoginFloater::newShow(const std::string &grid, bool initialLogin, 571void LoginFloater::newShow(const std::string &grid, bool initialLogin)
546 void (*callback)(S32 option, void* user_data),
547 void* callback_data)
548{ 572{
549 573
550 llwarns << "newShow called" << llendl; 574 llwarns << "newShow called" << llendl;
551 if(NULL==sInstance) 575 if(NULL==sInstance)
552 { 576 {
553 LoginFloater::sGrid = grid; 577 LoginFloater::sGrid = grid;
554 LoginFloater::sIsInitialLogin = initialLogin; 578 LoginFloater::sIsInitialLogin = initialLogin;
555 sInstance = new LoginFloater(callback, callback_data); 579 sInstance = new LoginFloater();
556 580
557 llwarns << "sInstance assigned. sInstance=" << sInstance << llendl; 581 llwarns << "sInstance assigned. sInstance=" << sInstance << llendl;
558 } 582 }
559
560 // floater controller requires initialized floater and model
561 if(NULL==sModel)
562 sModel = AuthenticationModel::getInstance();
563 if(NULL==sController)
564 //sController = new LoginController(sInstance, sModel, sGrid);
565
566
567
568 llwarns << "newshow called" << llendl;
569 sInstance->mCurGrid = gHippoGridManager->getCurrentGridNick();
570 refresh_grids();
571 583
572 // we're important 584 llwarns << "newshow called" << llendl;
573 sInstance->setFrontmost(TRUE); 585 sInstance->mCurGrid = gHippoGridManager->getCurrentGridNick();
574 sInstance->setFocus(TRUE); 586 refresh_grids();
575
576}
577 587
578void LoginFloater::testShow(void *lies) 588 sInstance->open(); /*Flawfinder: ignore*/
579{ 589 // we're important
580 // this is if we want to call LoginFloater from a menu option 590 //sInstance->setFrontmost(TRUE);
581 // or you know whatever 591 //sInstance->setFocus(TRUE);
582 newShow(std::string("Test"), false, testCallback, NULL);
583}
584 592
585void LoginFloater::testCallback(S32 option, void *user_data)
586{
587 // test callback, referenced by testShow()
588 if(LOGIN_OPTION_CONNECT == option)
589 {
590 llinfos << "this is how we connect to a METAVERSE" << llendl;
591 std::string first, last, password;
592 BOOL remember = TRUE;
593 getFields(first, last, password, remember);
594 llinfos << "first\t\tlast\t\tpassword" << llendl;
595 llinfos << first << "\t\t" << last << "\t\t" << password << llendl;
596 }
597 else if(LOGIN_OPTION_QUIT == option)
598 {
599 llinfos << "my login, she die" << llendl;
600 llinfos << ":(" << llendl;
601 close();
602 }
603} 593}
604 594
605void LoginFloater::show(const LLRect &rect, BOOL show_server, 595void LoginFloater::show(const LLRect &rect, BOOL show_server,
@@ -608,7 +598,7 @@ void LoginFloater::show(const LLRect &rect, BOOL show_server,
608{ 598{
609 // we don't need a grid passed in because this is old-style login 599 // we don't need a grid passed in because this is old-style login
610 std::string grid = ""; 600 std::string grid = "";
611 newShow(grid, TRUE, callback, callback_data); 601 newShow(grid, TRUE);
612} 602}
613 603
614void LoginFloater::setFocus(BOOL b) 604void LoginFloater::setFocus(BOOL b)
@@ -628,7 +618,7 @@ void LoginFloater::setFocus(BOOL b)
628 618
629void LoginFloater::giveFocus() 619void LoginFloater::giveFocus()
630{ 620{
631 LLComboBox *combo = NULL; 621 LLScrollListCtrl *combo = NULL;
632 622
633 if(NULL==sInstance) 623 if(NULL==sInstance)
634 { 624 {
@@ -638,91 +628,10 @@ void LoginFloater::giveFocus()
638 628
639 // for our combo box approach, selecting the combo box is almost always 629 // for our combo box approach, selecting the combo box is almost always
640 // the right thing to do on the floater receiving focus 630 // the right thing to do on the floater receiving focus
641 combo = sInstance->getChild<LLComboBox>("name_combo"); 631 combo = sInstance->getChild<LLScrollListCtrl>("grid_selector");
642 combo->setFocus(TRUE); 632 combo->setFocus(TRUE);
643} 633}
644 634
645void LoginFloater::getFields(std::string &firstname, std::string &lastname, std::string &password,
646 BOOL &remember)
647{
648 if (!sInstance)
649 {
650 llwarns << "Attempted getFields with no login view shown" << llendl;
651 return;
652 }
653
654 std::string loginname = sInstance->childGetText("name_combo");
655
656 LLStringUtil::replaceTabsWithSpaces(loginname, 1);
657 LLStringUtil::trim(loginname);
658 std::vector<std::string> loginVec;
659 boost::split(loginVec, loginname, boost::is_any_of(" "), boost::token_compress_on);
660 if(loginVec.size() == 2)
661 {
662 firstname = loginVec[0];
663 lastname = loginVec[1];
664 }
665
666 password = sInstance->mMungedPassword;
667 remember = sInstance->childGetValue("remember_check");
668}
669
670void LoginFloater::getFields(std::string &loginname, std::string &password, BOOL &remember)
671{
672 std::string first, last, pass;
673 BOOL rem;
674 getFields(first, last, pass, rem);
675 loginname = first + " " + last;
676 password = pass;
677 remember = rem;
678}
679
680void LoginFloater::setFields(const std::string& firstname, const std::string& lastname, const std::string& password,
681 BOOL remember)
682{
683 if (!sInstance)
684 {
685 llwarns << "Attempted setFields with no login view shown" << llendl;
686 return;
687 }
688
689 std::string loginname = firstname + " " + lastname;
690 sInstance->childSetText("name_combo", loginname);
691
692 // Max "actual" password length is 16 characters.
693 // Hex digests are always 32 characters.
694 if (password.length() == 32)
695 {
696 // This is a MD5 hex digest of a password.
697 // We don't actually use the password input field,
698 // fill it with MAX_PASSWORD characters so we get a
699 // nice row of asterixes.
700 const std::string filler("123456789!123456");
701 sInstance->childSetText("password_edit", filler);
702 sInstance->mIncomingPassword = filler;
703 sInstance->mMungedPassword = password;
704 }
705 else
706 {
707 // this is a normal text password
708 sInstance->childSetText("password_edit", password);
709 sInstance->mIncomingPassword = password;
710 LLMD5 pass((unsigned char *)password.c_str());
711 char munged_password[MD5HEX_STR_SIZE];
712 pass.hex_digest(munged_password);
713 sInstance->mMungedPassword = munged_password;
714 }
715
716 sInstance->childSetValue("remember_check", remember);
717}
718
719void LoginFloater::setFields(const std::string &loginname, const std::string &password, BOOL remember)
720{
721 std::vector<std::string> loginVec;
722 boost::split(loginVec, loginname, boost::is_any_of(" "), boost::token_compress_on);
723 setFields(loginVec[0], loginVec[1], password, remember);
724}
725
726BOOL LoginFloater::isGridComboDirty() 635BOOL LoginFloater::isGridComboDirty()
727{ 636{
728 BOOL user_picked = FALSE; 637 BOOL user_picked = FALSE;
@@ -778,25 +687,6 @@ void LoginFloater::addServer(const std::string& server, S32 domain_name)
778 combo->setCurrentByIndex(0); 687 combo->setCurrentByIndex(0);
779} 688}
780 689
781void LoginFloater::accept()
782{
783 if(NULL==sInstance || NULL==sInstance->mCallback)
784 return;
785
786 sInstance->setFocus(FALSE);
787
788 std::string name_combo = sInstance->childGetText("name_combo");
789 if(!name_combo.empty())
790 {
791 sInstance->mCallback(LOGIN_OPTION_CONNECT, sInstance->mCallbackData);
792 }
793 else
794 {
795 // TODO: new account call goes here
796 return;
797 }
798}
799
800void LoginFloater::cancel_old() 690void LoginFloater::cancel_old()
801{ 691{
802 if(NULL==sInstance) 692 if(NULL==sInstance)
diff --git a/linden/indra/newview/floaterlogin.h b/linden/indra/newview/floaterlogin.h
index 1800897..cdb60b0 100644
--- a/linden/indra/newview/floaterlogin.h
+++ b/linden/indra/newview/floaterlogin.h
@@ -1,10 +1,9 @@
1/* 1/*
2 * floaterlogin.h 2 * floaterlogin.h (floatergridmanager.h pls)
3 * SecondLife 3 * This is Meerkats grid manager, and I accidentally finished it with the wrong name :)
4 * 4 * -Patrick Sapinski (Monday, August 17, 2009)
5 * Created by RMS on 7/15/08.
6 *
7 */ 5 */
6
8#ifndef PL_floaterlogin_H 7#ifndef PL_floaterlogin_H
9#define PL_floaterlogin_H 8#define PL_floaterlogin_H
10 9
@@ -19,8 +18,7 @@ class AuthenticationModel;
19class LoginFloater : public LLFloater 18class LoginFloater : public LLFloater
20{ 19{
21public: 20public:
22 LoginFloater(void (*callback)(S32 option, void *user_data), 21 LoginFloater();
23 void *callback_data);
24 virtual ~LoginFloater(); 22 virtual ~LoginFloater();
25 23
26 virtual BOOL postBuild(); 24 virtual BOOL postBuild();
@@ -31,11 +29,7 @@ public:
31 void cancel(); 29 void cancel();
32 30
33 // new-style login methods 31 // new-style login methods
34 static void newShow(const std::string &grid, bool initialLogin, 32 static void newShow(const std::string &grid, bool initialLogin);
35 void (*callback)(S32 option, void *user_data),
36 void *callback_data);
37 static void testShow(void *lies);
38 static void testCallback(S32 option, void *user_data);
39 virtual std::string& getPassword(); 33 virtual std::string& getPassword();
40 virtual void setPassword(std::string &password); 34 virtual void setPassword(std::string &password);
41 virtual bool isSamePassword(std::string &password); 35 virtual bool isSamePassword(std::string &password);
@@ -54,14 +48,9 @@ public:
54 static void refreshLocation(bool force_visible); 48 static void refreshLocation(bool force_visible);
55 virtual void setFocus(BOOL b); 49 virtual void setFocus(BOOL b);
56 static void giveFocus(); 50 static void giveFocus();
57 static void getFields(std::string& firstname, std::string& lastname,
58 std::string& password, BOOL& remember);
59 static void setFields(const std::string& firstname, const std::string &lastname,
60 const std::string& password, BOOL remember);
61 static void getLocation(std::string &location); 51 static void getLocation(std::string &location);
62 static BOOL isGridComboDirty(); 52 static BOOL isGridComboDirty();
63 static void addServer(const std::string& server, S32 domain_name); 53 static void addServer(const std::string& server, S32 domain_name);
64 static void accept();
65 static void cancel_old(); 54 static void cancel_old();
66 static void hashPassword(const std::string& password, std::string& hashedPassword); 55 static void hashPassword(const std::string& password, std::string& hashedPassword);
67protected: 56protected:
@@ -78,13 +67,16 @@ private:
78 void applyChanges(); 67 void applyChanges();
79 bool createNewGrid(); 68 bool createNewGrid();
80 void update(); 69 void update();
70 void retrieveGridInfo();
81 71
82 static void onSelectGrid(LLUICtrl *ctrl, void *data); 72 static void onSelectGrid(LLUICtrl *ctrl, void *data);
83 static void onClickDelete(void *data); 73 static void onClickDelete(void *data);
84 static void onClickAdd(void *data); 74 static void onClickAdd(void *data);
85 static void onClickCopy(void *data); 75 static void onClickCopy(void *data);
76 static void onClickOk(void *data);
86 static void onClickApply(void *data); 77 static void onClickApply(void *data);
87 static void onClickDefault(void *data); 78 static void onClickDefault(void *data);
79 static void onClickGridInfo(void *data);
88 static void onClickCancel(void *data); 80 static void onClickCancel(void *data);
89 81
90 static LoginFloater *sInstance; 82 static LoginFloater *sInstance;
diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp
index 19ed2c4..56d585c 100644
--- a/linden/indra/newview/hippoGridManager.cpp
+++ b/linden/indra/newview/hippoGridManager.cpp
@@ -447,10 +447,10 @@ void HippoGridManager::loadFromFile()
447 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty()); 447 parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
448 // merge grid info from web site, if newer. Force load, if list of grids is empty. 448 // merge grid info from web site, if newer. Force load, if list of grids is empty.
449 if (gSavedSettings.getBOOL("CheckForGridUpdates")) 449 if (gSavedSettings.getBOOL("CheckForGridUpdates"))
450 parseUrl("http://opensim-viewer.sourceforge.net/db/grids.php", !mGridInfo.empty()); 450 parseUrl("http://meerkatviewer.org/scripts/grids.php", !mGridInfo.empty());
451 451
452 setDefaultGrid(gSavedSettings.getString("DefaultGrid")); 452 setDefaultGrid(gSavedSettings.getString("DefaultGrid"));
453 setCurrentGrid(gSavedSettings.getString("CmdLineGridChoice")); 453 setCurrentGrid(gSavedSettings.getString("DefaultGrid"));
454} 454}
455 455
456 456
@@ -575,6 +575,7 @@ void HippoGridManager::saveFile()
575 gridInfo[i]["website"] = grid->getWebSite(); 575 gridInfo[i]["website"] = grid->getWebSite();
576 gridInfo[i]["support"] = grid->getSupportUrl(); 576 gridInfo[i]["support"] = grid->getSupportUrl();
577 gridInfo[i]["register"] = grid->getRegisterUrl(); 577 gridInfo[i]["register"] = grid->getRegisterUrl();
578 gridInfo[i]["password"] = grid->getPasswordUrl();
578 gridInfo[i]["firstname"] = grid->getFirstName(); 579 gridInfo[i]["firstname"] = grid->getFirstName();
579 gridInfo[i]["lastname"] = grid->getLastName(); 580 gridInfo[i]["lastname"] = grid->getLastName();
580 gridInfo[i]["avatarpassword"] = grid->getAvatarPassword(); 581 gridInfo[i]["avatarpassword"] = grid->getAvatarPassword();
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
index f6ee497..9925495 100644
--- a/linden/indra/newview/hippoGridManager.h
+++ b/linden/indra/newview/hippoGridManager.h
@@ -1,171 +1,175 @@
1#ifndef __HIPPO_GRID_MANAGER_H__ 1#ifndef __HIPPO_GRID_MANAGER_H__
2#define __HIPPO_GRID_MANAGER_H__ 2#define __HIPPO_GRID_MANAGER_H__
3 3
4 4
5#include <map> 5#include <map>
6#include <string> 6#include <string>
7 7
8#ifndef XML_STATIC 8#ifndef XML_STATIC
9#define XML_STATIC 9#define XML_STATIC
10#endif
11#include <expat/expat.h>
12
13
14class LLSD;
15
16
17class HippoGridInfo
18{
19public:
20 enum Platform {
21 PLATFORM_OTHER = 0,
22 PLATFORM_OPENSIM,
23 PLATFORM_SECONDLIFE,
24 PLATFORM_LAST
25 };
26 enum SearchType {
27 SEARCH_ALL_EMPTY,
28 SEARCH_ALL_QUERY,
29 SEARCH_ALL_TEMPLATE
30 };
31
32 explicit HippoGridInfo(const std::string &gridNick);
33
34 Platform getPlatform() const { return mPlatform; }
35 const std::string &getGridNick() const { return mGridNick; }
36 const std::string &getGridName() const { return mGridName; }
37 const std::string &getLoginUri() const { return mLoginUri; }
38 const std::string &getLoginPage() const { return mLoginPage; }
39 const std::string &getHelperUri() const { return mHelperUri; }
40 const std::string &getWebSite() const { return mWebSite; }
41 const std::string &getSupportUrl() const { return mSupportUrl; }
42 const std::string &getRegisterUrl() const { return mRegisterUrl; }
43 const std::string &getPasswordUrl() const { return mPasswordUrl; }
44 const std::string &getSearchUrl() const { return mSearchUrl; }
45 const std::string &getFirstName() const { return mFirstName; }
46 const std::string &getLastName() const { return mLastName; }
47 const std::string &getAvatarPassword() const { return mAvatarPassword; }
48 std::string getSearchUrl(SearchType ty) const;
49 bool isRenderCompat() const { return mRenderCompat; }
50
51 const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
52 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
53 std::string getUploadFee() const;
54 std::string getGroupCreationFee() const;
55 std::string getDirectoryFee() const;
56
57 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
58 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
59
60 void setPlatform (const std::string &platform);
61 void setPlatform (Platform platform);
62 void setGridName (const std::string &gridName) { mGridName = gridName; }
63 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
64 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
65 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
66 void setWebSite (const std::string &website) { mWebSite = website; }
67 void setSupportUrl(const std::string &url) { mSupportUrl = url; }
68 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
69 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
70 void setSearchUrl(const std::string &url) { mSearchUrl = url; }
71 void setRenderCompat(bool compat) { mRenderCompat = compat; }
72 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
73 void setLastName(const std::string &lastName) { mLastName = lastName; }
74 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
75
76 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
77 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
78 void setDirectoryFee(int fee) { mDirectoryFee = fee; }
79
80 bool retrieveGridInfo();
81
82 static const char *getPlatformString(Platform platform);
83 static void cleanUpGridNick(std::string &gridnick);
84
85 static HippoGridInfo FALLBACK_GRIDINFO;
86 static void initFallback();
87
88private:
89 Platform mPlatform;
90 std::string mGridNick;
91 std::string mGridName;
92 std::string mLoginUri;
93 std::string mLoginPage;
94 std::string mHelperUri;
95 std::string mWebSite;
96 std::string mSupportUrl;
97 std::string mRegisterUrl;
98 std::string mPasswordUrl;
99 std::string mSearchUrl;
100 std::string mFirstName;
101 std::string mLastName;
102 std::string mAvatarPassword;
103 bool mRenderCompat;
104
105 std::string mCurrencySymbol;
106 std::string mRealCurrencySymbol;
107 int mDirectoryFee;
108
109 // for parsing grid info XML
110 enum XmlState {
111 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
112 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
113 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
114 };
115 XmlState mXmlState;
116
117 static void cleanUpUri(std::string &uri);
118 void formatFee(std::string &fee, int cost, bool showFree) const;
119
120 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
121 static void onXmlElementEnd(void *userData, const XML_Char *name);
122 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
123};
124
125
126class HippoGridManager
127{
128public:
129 HippoGridManager();
130 ~HippoGridManager();
131
132 void init();
133 void saveFile();
134 void discardAndReload();
135
136 HippoGridInfo *getGrid(const std::string &grid) const;
137 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
138 HippoGridInfo *getCurrentGrid() const;
139 const std::string &getDefaultGridNick() const { return mDefaultGrid; }
140 const std::string &getCurrentGridNick() const { return mCurrentGrid; }
141
142 void setDefaultGrid(const std::string &grid);
143 void setCurrentGrid(const std::string &grid);
144 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
145
146 void addGrid(HippoGridInfo *grid);
147 void deleteGrid(const std::string &grid);
148
149 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
150 GridIterator beginGrid() { return mGridInfo.begin(); }
151 GridIterator endGrid() { return mGridInfo.end(); }
152
153private:
154 std::map<std::string, HippoGridInfo*> mGridInfo;
155 std::string mDefaultGrid;
156 std::string mCurrentGrid;
157 HippoGridInfo *mConnectedGrid;
158 int mDefaultGridsVersion;
159
160 void cleanup();
161 void loadFromFile();
162 void parseFile(const std::string &fileName, bool mergeIfNewer);
163 void parseUrl(const char *url, bool mergeIfNewer);
164 void parseData(LLSD &gridInfo, bool mergeIfNewer);
165};
166
167
168extern HippoGridManager *gHippoGridManager;
169
170
171#endif 10#endif
11
12#ifdef LL_STANDALONE
13#include <expat.h>
14#else
15#include "expat/expat.h"
16#endif
17
18class LLSD;
19
20
21class HippoGridInfo
22{
23public:
24 enum Platform {
25 PLATFORM_OTHER = 0,
26 PLATFORM_OPENSIM,
27 PLATFORM_SECONDLIFE,
28 PLATFORM_LAST
29 };
30 enum SearchType {
31 SEARCH_ALL_EMPTY,
32 SEARCH_ALL_QUERY,
33 SEARCH_ALL_TEMPLATE
34 };
35
36 explicit HippoGridInfo(const std::string &gridNick);
37
38 Platform getPlatform() const { return mPlatform; }
39 const std::string &getGridNick() const { return mGridNick; }
40 const std::string &getGridName() const { return mGridName; }
41 const std::string &getLoginUri() const { return mLoginUri; }
42 const std::string &getLoginPage() const { return mLoginPage; }
43 const std::string &getHelperUri() const { return mHelperUri; }
44 const std::string &getWebSite() const { return mWebSite; }
45 const std::string &getSupportUrl() const { return mSupportUrl; }
46 const std::string &getRegisterUrl() const { return mRegisterUrl; }
47 const std::string &getPasswordUrl() const { return mPasswordUrl; }
48 const std::string &getSearchUrl() const { return mSearchUrl; }
49 const std::string &getFirstName() const { return mFirstName; }
50 const std::string &getLastName() const { return mLastName; }
51 const std::string &getAvatarPassword() const { return mAvatarPassword; }
52 std::string getSearchUrl(SearchType ty) const;
53 bool isRenderCompat() const { return mRenderCompat; }
54
55 const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
56 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
57 std::string getUploadFee() const;
58 std::string getGroupCreationFee() const;
59 std::string getDirectoryFee() const;
60
61 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
62 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
63
64 void setPlatform (const std::string &platform);
65 void setPlatform (Platform platform);
66 void setGridName (const std::string &gridName) { mGridName = gridName; }
67 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
68 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
69 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
70 void setWebSite (const std::string &website) { mWebSite = website; }
71 void setSupportUrl(const std::string &url) { mSupportUrl = url; }
72 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
73 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
74 void setSearchUrl(const std::string &url) { mSearchUrl = url; }
75 void setRenderCompat(bool compat) { mRenderCompat = compat; }
76 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
77 void setLastName(const std::string &lastName) { mLastName = lastName; }
78 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
79
80 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
81 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
82 void setDirectoryFee(int fee) { mDirectoryFee = fee; }
83
84 bool retrieveGridInfo();
85
86 static const char *getPlatformString(Platform platform);
87 static void cleanUpGridNick(std::string &gridnick);
88
89 static HippoGridInfo FALLBACK_GRIDINFO;
90 static void initFallback();
91
92private:
93 Platform mPlatform;
94 std::string mGridNick;
95 std::string mGridName;
96 std::string mLoginUri;
97 std::string mLoginPage;
98 std::string mHelperUri;
99 std::string mWebSite;
100 std::string mSupportUrl;
101 std::string mRegisterUrl;
102 std::string mPasswordUrl;
103 std::string mSearchUrl;
104 std::string mFirstName;
105 std::string mLastName;
106 std::string mAvatarPassword;
107 bool mRenderCompat;
108
109 std::string mCurrencySymbol;
110 std::string mRealCurrencySymbol;
111 int mDirectoryFee;
112
113 // for parsing grid info XML
114 enum XmlState {
115 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
116 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
117 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
118 };
119 XmlState mXmlState;
120
121 static void cleanUpUri(std::string &uri);
122 void formatFee(std::string &fee, int cost, bool showFree) const;
123
124 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
125 static void onXmlElementEnd(void *userData, const XML_Char *name);
126 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
127};
128
129
130class HippoGridManager
131{
132public:
133 HippoGridManager();
134 ~HippoGridManager();
135
136 void init();
137 void saveFile();
138 void discardAndReload();
139
140 HippoGridInfo *getGrid(const std::string &grid) const;
141 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
142 HippoGridInfo *getCurrentGrid() const;
143 const std::string &getDefaultGridNick() const { return mDefaultGrid; }
144 const std::string &getCurrentGridNick() const { return mCurrentGrid; }
145
146 void setDefaultGrid(const std::string &grid);
147 void setCurrentGrid(const std::string &grid);
148 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
149
150 void addGrid(HippoGridInfo *grid);
151 void deleteGrid(const std::string &grid);
152
153 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
154 GridIterator beginGrid() { return mGridInfo.begin(); }
155 GridIterator endGrid() { return mGridInfo.end(); }
156
157private:
158 std::map<std::string, HippoGridInfo*> mGridInfo;
159 std::string mDefaultGrid;
160 std::string mCurrentGrid;
161 HippoGridInfo *mConnectedGrid;
162 int mDefaultGridsVersion;
163
164 void cleanup();
165 void loadFromFile();
166 void parseFile(const std::string &fileName, bool mergeIfNewer);
167 void parseUrl(const char *url, bool mergeIfNewer);
168 void parseData(LLSD &gridInfo, bool mergeIfNewer);
169};
170
171
172extern HippoGridManager *gHippoGridManager;
173
174
175#endif
diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp
index 2f6dc99..5399867 100644
--- a/linden/indra/newview/llfloaterworldmap.cpp
+++ b/linden/indra/newview/llfloaterworldmap.cpp
@@ -1159,7 +1159,7 @@ void LLFloaterWorldMap::onPanBtn( void* userdata )
1159// static 1159// static
1160void LLFloaterWorldMap::onGridManager(void*) 1160void LLFloaterWorldMap::onGridManager(void*)
1161{ 1161{
1162 LoginFloater::newShow(std::string("Test"), false, LoginFloater::testCallback, NULL); 1162 LoginFloater::newShow(std::string("Test"), false);
1163 //gAgent.teleportHome(); 1163 //gAgent.teleportHome();
1164 //gFloaterWorldMap->close(); 1164 //gFloaterWorldMap->close();
1165} 1165}
@@ -1528,7 +1528,7 @@ void LLFloaterWorldMap::teleport()
1528 } 1528 }
1529 1529
1530 gHippoGridManager->setCurrentGrid(gridInfo->getGridNick()); 1530 gHippoGridManager->setCurrentGrid(gridInfo->getGridNick());
1531 gHippoGridManager->setDefaultGrid(gridInfo->getGridNick()); 1531 //gHippoGridManager->setDefaultGrid(gridInfo->getGridNick());
1532 //this doesn't work :( gSavedSettings.setBOOL("CmdLineLoginURI", FALSE); 1532 //this doesn't work :( gSavedSettings.setBOOL("CmdLineLoginURI", FALSE);
1533 LLStartUp::setShouldAutoLogin(true); 1533 LLStartUp::setShouldAutoLogin(true);
1534 LLAppViewer::instance()->requestLogout(false); 1534 LLAppViewer::instance()->requestLogout(false);
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp
index 2ecdcb5..026b0b2 100644
--- a/linden/indra/newview/llpanellogin.cpp
+++ b/linden/indra/newview/llpanellogin.cpp
@@ -1078,10 +1078,9 @@ void LLPanelLogin::onClickGrid(void *)
1078{ 1078{
1079 if (sInstance && sInstance->mCallback) 1079 if (sInstance && sInstance->mCallback)
1080 { 1080 {
1081 LoginFloater::newShow(std::string("Test"), false, LoginFloater::testCallback, NULL); 1081 LoginFloater::newShow(std::string("Test"), false);
1082 } 1082 }
1083} 1083}
1084
1085 1084
1086// static 1085// static
1087void LLPanelLogin::newAccountAlertCallback(S32 option, void*) 1086void LLPanelLogin::newAccountAlertCallback(S32 option, void*)
@@ -1164,8 +1163,6 @@ void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*)
1164 std::string mCurGrid = ctrl->getValue().asString(); 1163 std::string mCurGrid = ctrl->getValue().asString();
1165 //KOW 1164 //KOW
1166 gHippoGridManager->setCurrentGrid(mCurGrid); 1165 gHippoGridManager->setCurrentGrid(mCurGrid);
1167 //gHippoGridManager->setDefaultGrid(mCurGrid);
1168 //gHippoGridManager->saveFile();
1169 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid); 1166 HippoGridInfo *gridInfo = gHippoGridManager->getGrid(mCurGrid);
1170 if (gridInfo) { 1167 if (gridInfo) {
1171 //childSetText("gridnick", gridInfo->getGridNick()); 1168 //childSetText("gridnick", gridInfo->getGridNick());
@@ -1177,54 +1174,14 @@ void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*)
1177 1174
1178 1175
1179 1176
1180 llwarns << "current grid = " << mCurGrid << llendl;
1181 1177
1182 /*
1183 1178
1184 if (LLSD::TypeInteger == combo_val.type()) 1179
1185 { 1180 llwarns << "current grid = " << mCurGrid << llendl;
1186 grid_index = combo->getValue().asInteger();
1187
1188 if ((S32)GRID_INFO_OTHER == grid_index)
1189 {
1190 // This happens if the user specifies a custom grid
1191 // via command line.
1192 grid_label = combo->getSimple();
1193 }
1194 }
1195 else
1196 {
1197 // no valid selection, return other
1198 grid_index = (S32)GRID_INFO_OTHER;
1199 grid_label = combo_val.asString();
1200 }
1201
1202 // This new seelction will override preset uris
1203 // from the command line.
1204 LLViewerLogin* vl = LLViewerLogin::getInstance();
1205 vl->resetURIs();
1206 if(grid_index != GRID_INFO_OTHER)
1207 {
1208 vl->setGridChoice(grid_index);
1209 }
1210 else
1211 {
1212 vl->setGridChoice(grid_label);
1213 }
1214 1181
1215 // clear the password if we are switching grids so we don't send
1216 // the wrong pass to the wrong grid.
1217 if (sInstance)
1218 {
1219 // no method to clear a text box?
1220 const std::string nothing("");
1221 sInstance->childSetText("password_edit", nothing);
1222 }
1223 */
1224 // grid changed so show new splash screen (possibly) 1182 // grid changed so show new splash screen (possibly)
1225 loadLoginPage(); 1183 loadLoginPage();
1226} 1184}
1227
1228/* 1185/*
1229void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) 1186void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
1230{ 1187{
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp
index 5cb14fc..3d71202 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -46,6 +46,8 @@
46 46
47#include "lldirpicker.h" 47#include "lldirpicker.h"
48 48
49#include "hippoGridManager.h"
50
49class LLPrefsIMImpl : public LLPanel 51class LLPrefsIMImpl : public LLPanel
50{ 52{
51public: 53public:
@@ -181,7 +183,7 @@ void LLPrefsIMImpl::apply()
181 183
182 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 184 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
183 185
184 gDirUtilp->setPerAccountChatLogsDir(gSavedSettings.getString("FirstName"), 186 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), gSavedSettings.getString("FirstName"),
185 gSavedSettings.getString("LastName") ); 187 gSavedSettings.getString("LastName") );
186 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 188 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
187 189
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index ffd7f3d..cdcd539 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -705,10 +705,13 @@ bool idle_startup()
705 else 705 else
706 { 706 {
707 // if not automatically logging in, display login dialog 707 // if not automatically logging in, display login dialog
708 // a valid grid is selected 708 // a valid grid is selected (in llpanellogin, for some reason?)
709 firstname = gSavedSettings.getString("FirstName"); 709 // This should get the right values from the grid manager now -Patrick Sapinski (Monday, August 17, 2009)
710 lastname = gSavedSettings.getString("LastName"); 710 HippoGridInfo *gridInfo = gHippoGridManager->getCurrentGrid();
711 password = load_password_from_disk(); 711 firstname = gridInfo->getFirstName();
712 lastname = gridInfo->getLastName();
713 password = gridInfo->getAvatarPassword();
714
712 remember_password = gSavedSettings.getBOOL("RememberPassword"); 715 remember_password = gSavedSettings.getBOOL("RememberPassword");
713 show_connect_box = true; 716 show_connect_box = true;
714 } 717 }
@@ -870,14 +873,14 @@ bool idle_startup()
870 } 873 }
871 gSavedSettings.setBOOL("RememberPassword", remember_password); 874 gSavedSettings.setBOOL("RememberPassword", remember_password);
872 875
873 LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL; 876 //LL_INFOS("AppInit") << "Attempting login as: " << firstname << " " << lastname << " " << password << LL_ENDL;
874 gDebugInfo["LoginName"] = firstname + " " + lastname; 877 gDebugInfo["LoginName"] = firstname + " " + lastname;
875 } 878 }
876 879
877 gHippoGridManager->setCurrentGridAsConnected(); 880 gHippoGridManager->setCurrentGridAsConnected();
878 // create necessary directories 881 // create necessary directories
879 // *FIX: these mkdir's should error check 882 // *FIX: these mkdir's should error check
880 gDirUtilp->setLindenUserDir(firstname, lastname); 883 gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
881 LLFile::mkdir(gDirUtilp->getLindenUserDir()); 884 LLFile::mkdir(gDirUtilp->getLindenUserDir());
882 885
883 // Set PerAccountSettingsFile to the default value. 886 // Set PerAccountSettingsFile to the default value.
@@ -908,7 +911,7 @@ bool idle_startup()
908 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); 911 gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
909 } 912 }
910 913
911 gDirUtilp->setPerAccountChatLogsDir(firstname, lastname); 914 gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname);
912 915
913 LLFile::mkdir(gDirUtilp->getChatLogsDir()); 916 LLFile::mkdir(gDirUtilp->getChatLogsDir());
914 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 917 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
diff --git a/linden/indra/newview/prefpanelpasswords.cpp b/linden/indra/newview/prefpanelpasswords.cpp
deleted file mode 100644
index 17b9b1a..0000000
--- a/linden/indra/newview/prefpanelpasswords.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * prefpanelpasswords.cpp
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "lluictrlfactory.h"
10
11#include "controllerpasswords.h"
12#include "prefpanelpasswords.h"
13
14PasswordsPrefPanel::PasswordsPrefPanel()
15: LLPanel(std::string("panel_preferences_passwords"))
16{
17 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_passwords.xml");
18}
19
20PasswordsPrefPanel::~PasswordsPrefPanel()
21{
22 delete mController;
23 mController = NULL;
24}
25
26BOOL PasswordsPrefPanel::postBuild()
27{
28 mController = new PasswordsController(this);
29 return TRUE;
30}
31
32void PasswordsPrefPanel::apply()
33{
34
35}
36
37void PasswordsPrefPanel::cancel()
38{
39
40}
diff --git a/linden/indra/newview/prefpanelpasswords.h b/linden/indra/newview/prefpanelpasswords.h
deleted file mode 100644
index d7bbf39..0000000
--- a/linden/indra/newview/prefpanelpasswords.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * prefpanelpasswords.h
3 * SecondLife
4 *
5 * Created by RMS on 8/5/08.
6 *
7 */
8
9#include "llpanel.h"
10
11#ifndef PL_prefpanelpasswords_H
12#define PL_prefpanelpasswords_H
13
14class PasswordsController;
15
16class PasswordsPrefPanel : public LLPanel
17{
18public:
19 PasswordsPrefPanel();
20 virtual ~PasswordsPrefPanel();
21
22 BOOL postBuild();
23
24 void apply();
25 void cancel();
26protected:
27 PasswordsController *mController;
28};
29
30#endif // PL_prefpanelpasswords_H
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_login.xml b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
index 4ad07b5..4c2146b 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_login.xml
@@ -1,13 +1,7 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="false" can_drag_on_left="false" can_minimize="false" 2<floater can_close="false" can_drag_on_left="false" can_minimize="false"
3 can_resize="true" height="400" min_height="400" min_width="600" 3 can_resize="true" height="400" min_height="400" min_width="600"
4 name="floater_login" title="Reeeeeeee" width="600"> 4 name="floater_login" title="plasticwuzhere" width="600">
5 <string name="real_url">
6 http://secondlife.com/app/login/
7 </string>
8 <string name="forgot_password_url">
9 http://secondlife.com/account/request.php
10 </string>
11 5
12 <!-- Grid Selector --> 6 <!-- Grid Selector -->
13 <text type="string" length="1" enabled="true" name="grid_selector_label" 7 <text type="string" length="1" enabled="true" name="grid_selector_label"
@@ -52,63 +46,163 @@
52 </text> 46 </text>
53 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="360" 47 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom="360"
54 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true" 48 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
55 height="20" left_delta="80" max_length="40" mouse_opaque="true" 49 height="20" left_delta="90" max_length="40" mouse_opaque="true"
56 name="gridnick" select_all_on_focus_received="true" width="200" /> 50 name="gridnick" select_all_on_focus_received="true" width="200" />
57 51
58 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 52 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
59 bottom_delta="-25" drop_shadow_visible="true" follows="left|top" 53 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
54 font="SansSerif" h_pad="0" halign="left" height="16"
55 left_delta="-90" mouse_opaque="true" name="first_name_text" v_pad="0" width="100">
56 First Name:
57 </text>
58 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
59 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
60 height="20" left_delta="90" max_length="45" mouse_opaque="true"
61 name="first_name" select_all_on_focus_received="true" width="200" />
62
63 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
64 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
65 font="SansSerif" h_pad="0" halign="left" height="16"
66 left_delta="-90" mouse_opaque="true" name="last_name_text" v_pad="0" width="100">
67 Last Name:
68 </text>
69 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
70 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
71 height="20" left_delta="90" max_length="45" mouse_opaque="true"
72 name="last_name" select_all_on_focus_received="true" width="200" />
73
74 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
75 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
76 font="SansSerif" h_pad="0" halign="left" height="16"
77 left_delta="-90" mouse_opaque="true" name="avatar_password_text" v_pad="0" width="120">
78 Password:
79 </text>
80 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
81 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
82 height="20" left_delta="90" max_length="16" mouse_opaque="true"
83 name="avatar_password" select_all_on_focus_received="true" width="200" />
84
85
86 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
87 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
88 font="SansSerif" h_pad="0" halign="left" height="16"
89 left_delta="-90" mouse_opaque="true" name="start_location_text" v_pad="0"
90 width="95">
91 Start Location:
92 </text>
93 <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="18"
94 left_delta="90" max_chars="128" mouse_opaque="true"
95 name="start_location_combo" width="180">
96 <combo_item name="MyHome" value="My Home">
97 My Home
98 </combo_item>
99 <combo_item name="MyLastLocation" value="My Last Location">
100 My Last Location
101 </combo_item>
102 <combo_item name="Typeregionname" value="&lt;Type region name&gt;">
103 &lt;Type region name&gt;
104 </combo_item>
105 </combo_box>
106
107 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
108 bottom_delta="-23" drop_shadow_visible="true" follows="left|top"
60 font="SansSerif" h_pad="0" halign="left" height="16" 109 font="SansSerif" h_pad="0" halign="left" height="16"
61 left_delta="-80" mouse_opaque="true" name="loginuri_text" v_pad="0" width="120"> 110 left_delta="-90" mouse_opaque="true" name="loginuri_text" v_pad="0" width="120">
62 Grid URI: 111 Login URI:
63 </text> 112 </text>
64 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 113 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
65 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true" 114 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true"
66 height="20" left_delta="80" max_length="255" mouse_opaque="true" 115 height="20" left_delta="90" max_length="255" mouse_opaque="true"
67 name="loginuri" select_all_on_focus_received="true" width="320" /> 116 name="loginuri" select_all_on_focus_received="true" width="320" />
68 117
118 <button label="Get Grid Info" label_selected="Get Grid Info" enabled="true" name="btn_gridinfo"
119 height="18" width="100" bottom_delta="-22"
120 halign="center"
121 follows="left|top" scale_image="true"
122 font="SansSerifSmall" mouse_opaque="true" />
123
124 <text_editor type="string" length="1" allow_html="false" bg_readonly_color="0 0 0 0" bottom_delta="-62"
125 embedded_items="false" enabled="false" follows="left|top"
126 font="SansSerifSmall" height="65" hide_border="true" hide_scrollbar="true"
127 left="190" max_length="65535" mouse_opaque="true"
128 name="protip1" tab_stop="false" width="420" word_wrap="true">
129 Tip: Store information for alternate accounts by using the "Copy" button to create multiple profiles for the same grid.
130 </text_editor>
131
132 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
133 bottom_delta="10" drop_shadow_visible="true" follows="left|top"
134 font="SansSerif" h_pad="0" halign="left" height="16"
135 left="182" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
136 Optional Fields
137 </text>
69 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 138 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
70 bottom_delta="-25" drop_shadow_visible="true" follows="left|top" 139 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
71 font="SansSerif" h_pad="0" halign="left" height="16" 140 font="SansSerif" h_pad="0" halign="left" height="16"
72 left_delta="-80" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120"> 141 left_delta="0" mouse_opaque="true" name="loginpage_text" v_pad="0" width="120">
73 Login Page: 142 Login Page:
74 </text> 143 </text>
75 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 144 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
76 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true" 145 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
77 height="20" left_delta="80" max_length="255" mouse_opaque="true" 146 height="20" left_delta="90" max_length="255" mouse_opaque="true"
78 name="loginpage" select_all_on_focus_received="true" width="320" /> 147 name="loginpage" select_all_on_focus_received="true" width="320" />
79 148
80 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 149 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
81 bottom_delta="-35" drop_shadow_visible="true" follows="left|top" 150 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
82 font="SansSerif" h_pad="0" halign="left" height="16" 151 font="SansSerif" h_pad="0" halign="left" height="16"
83 left_delta="-80" mouse_opaque="true" name="first_name_text" v_pad="0" width="100"> 152 left_delta="-90" mouse_opaque="true" name="helperuri_text" v_pad="0" width="120">
84 First Name: 153 Helper URI:
85 </text> 154 </text>
86 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 155 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
87 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true" 156 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
88 height="20" left_delta="80" max_length="45" mouse_opaque="true" 157 height="20" left_delta="90" max_length="255" mouse_opaque="true"
89 name="first_name" select_all_on_focus_received="true" width="270" /> 158 name="helperuri" select_all_on_focus_received="true" width="320" />
90 159
91 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 160 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
92 bottom_delta="-25" drop_shadow_visible="true" follows="left|top" 161 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
93 font="SansSerif" h_pad="0" halign="left" height="16" 162 font="SansSerif" h_pad="0" halign="left" height="16"
94 left_delta="-80" mouse_opaque="true" name="last_name_text" v_pad="0" width="100"> 163 left_delta="-90" mouse_opaque="true" name="website_text" v_pad="0" width="120">
95 Last Name: 164 Website:
96 </text> 165 </text>
97 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 166 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
98 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true" 167 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
99 height="20" left_delta="80" max_length="45" mouse_opaque="true" 168 height="20" left_delta="90" max_length="255" mouse_opaque="true"
100 name="last_name" select_all_on_focus_received="true" width="270" /> 169 name="website" select_all_on_focus_received="true" width="320" />
101 170
102 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 171 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
103 bottom_delta="-25" drop_shadow_visible="true" follows="left|top" 172 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
104 font="SansSerif" h_pad="0" halign="left" height="16" 173 font="SansSerif" h_pad="0" halign="left" height="16"
105 left_delta="-80" mouse_opaque="true" name="password_text" v_pad="0" width="120"> 174 left_delta="-90" mouse_opaque="true" name="support_text" v_pad="0" width="120">
106 Password: 175 Support URL:
107 </text> 176 </text>
108 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0" 177 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
109 follows="left|top|right" font="SansSerif" handle_edit_keys_directly="true" 178 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
110 height="20" left_delta="80" max_length="16" mouse_opaque="true" 179 height="20" left_delta="90" max_length="255" mouse_opaque="true"
111 name="password" select_all_on_focus_received="true" width="240" /> 180 name="support" select_all_on_focus_received="true" width="320" />
181
182 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
183 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
184 font="SansSerif" h_pad="0" halign="left" height="16"
185 left_delta="-90" mouse_opaque="true" name="register_text" v_pad="0" width="120">
186 Account URL:
187 </text>
188 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
189 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
190 height="20" left_delta="90" max_length="255" mouse_opaque="true"
191 name="register" select_all_on_focus_received="true" width="320" />
192
193 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
194 bottom_delta="-22" drop_shadow_visible="true" follows="left|top"
195 font="SansSerif" h_pad="0" halign="left" height="16"
196 left_delta="-90" mouse_opaque="true" name="password_text" v_pad="0" width="120">
197 Password URL:
198 </text>
199 <line_editor bevel_style="in" border_style="line" border_thickness="1" bottom_delta="0"
200 follows="left|top|right" font="SansSerifSmall" handle_edit_keys_directly="true"
201 height="20" left_delta="90" max_length="255" mouse_opaque="true"
202 name="password" select_all_on_focus_received="true" width="320" />
203
204 <view_border bevel_style="none" border_thickness="1" bottom_delta="-4" follows="top|left" height="155" left_delta="-93" name="OptionalPrefsBorder" width="417" />
205
112 <!-- Combo box for multi avatar grid manager avatar name 206 <!-- Combo box for multi avatar grid manager avatar name
113 <combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1" 207 <combo_box allow_text_entry="true" bevel_style="in" border_style="line" border_thickness="1"
114 bottom_delta="0" follows="left|top" font="SansSerif" handle_edit_keys_directly="true" 208 bottom_delta="0" follows="left|top" font="SansSerif" handle_edit_keys_directly="true"
@@ -127,26 +221,7 @@
127 left="480" mouse_opaque="true" name="remove_btn" scale_image="TRUE" 221 left="480" mouse_opaque="true" name="remove_btn" scale_image="TRUE"
128 width="70" /> 222 width="70" />
129--> 223-->
130 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 224
131 bottom_delta="-25" drop_shadow_visible="true" follows="left|top"
132 font="SansSerif" h_pad="0" halign="left" height="16"
133 left_delta="-80" mouse_opaque="true" name="start_location_text" v_pad="0"
134 width="95">
135 Start Location:
136 </text>
137 <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="18"
138 left_delta="90" max_chars="128" mouse_opaque="true"
139 name="start_location_combo" width="180">
140 <combo_item name="MyHome" value="My Home">
141 My Home
142 </combo_item>
143 <combo_item name="MyLastLocation" value="My Last Location">
144 My Last Location
145 </combo_item>
146 <combo_item name="Typeregionname" value="&lt;Type region name&gt;">
147 &lt;Type region name&gt;
148 </combo_item>
149 </combo_box>
150 <!-- Checkbox for selecting a global avatar (for when combo box avatar selector works) 225 <!-- Checkbox for selecting a global avatar (for when combo box avatar selector works)
151 <check_box bottom="85" follows="left|top" font="SansSerifSmall" height="16" 226 <check_box bottom="85" follows="left|top" font="SansSerifSmall" height="16"
152 initial_value="false" label="Global Avatar" 227 initial_value="false" label="Global Avatar"
@@ -155,7 +230,6 @@
155 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16" 230 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
156 initial_value="false" label="Remember password" 231 initial_value="false" label="Remember password"
157 left_delta="165" mouse_opaque="true" name="remember_check" width="138" /> 232 left_delta="165" mouse_opaque="true" name="remember_check" width="138" />
158 -->
159 233
160 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16" 234 <check_box bottom="10" follows="left|bottom" font="SansSerifSmall" height="16"
161 initial_value="false" label="secret level" 235 initial_value="false" label="secret level"
@@ -163,6 +237,7 @@
163 --> 237 -->
164 238
165 <!-- Cancel/Connect Buttons --> 239 <!-- Cancel/Connect Buttons -->
240
166 <button bottom="-44" follows="right|top" font="SansSerif" halign="center" 241 <button bottom="-44" follows="right|top" font="SansSerif" halign="center"
167 height="24" label="Set as Default" label_selected="Set as Default" 242 height="24" label="Set as Default" label_selected="Set as Default"
168 left="470" mouse_opaque="true" name="set_default" scale_image="TRUE" 243 left="470" mouse_opaque="true" name="set_default" scale_image="TRUE"
@@ -171,11 +246,14 @@
171 height="24" label="Connect" label_selected="Connect" 246 height="24" label="Connect" label_selected="Connect"
172 left="280" mouse_opaque="true" name="connect_btn" scale_image="TRUE" 247 left="280" mouse_opaque="true" name="connect_btn" scale_image="TRUE"
173 width="100" /> --> 248 width="100" /> -->
174 <button bottom="28" follows="right|bottom" font="SansSerif" halign="center" 249 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
250 height="24" label="Ok" label_selected="Apply" left="280"
251 mouse_opaque="true" name="btn_ok" scale_image="TRUE" width="100" />
252 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
175 height="24" label="Apply" label_selected="Apply" left="385" 253 height="24" label="Apply" label_selected="Apply" left="385"
176 mouse_opaque="true" name="btn_apply" scale_image="TRUE" width="100" /> 254 mouse_opaque="true" name="btn_apply" scale_image="TRUE" width="100" />
177 <button bottom="28" follows="right|bottom" font="SansSerif" halign="center" 255 <button bottom="8" follows="right|bottom" font="SansSerif" halign="center"
178 height="24" label="Quit" label_selected="Quit" left="490" 256 height="24" label="Undo" label_selected="Undo" left="490"
179 mouse_opaque="true" name="btn_cancel" scale_image="TRUE" width="100" /> 257 mouse_opaque="true" name="btn_cancel" scale_image="TRUE" width="100" />
180 <!-- 258 <!--
181 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18" 259 <combo_box allow_text_entry="true" bottom="32" follows="left|bottom" height="18"