From a0a4a0736d93e0ab4f397281e38bf21f2f2f1425 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 4 Feb 2014 13:57:10 -0800 Subject: MAINT-3675 NUI:Login Screen - Allow login call to be made from web --- indra/newview/llpanellogin.cpp | 98 +++++++++++++++++++++++++++++++++++++++++- indra/newview/llpanellogin.h | 1 + 2 files changed, 98 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 911ecaad9d..60208c92b0 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -26,6 +26,8 @@ #include "llviewerprecompiledheaders.h" +#include + #include "llpanellogin.h" #include "lllayoutstack.h" @@ -97,6 +99,87 @@ public: } }; +class LLLoginLocationAutoHandler : public LLCommandHandler +{ +public: + // don't allow from external browsers + LLLoginLocationAutoHandler() : LLCommandHandler("location_login", UNTRUSTED_BLOCK) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + { + if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) + { + if ( tokens.size() == 0 || tokens.size() > 4 ) + return false; + + // unescape is important - uris with spaces are escaped in this code path + // (e.g. space -> %20) and the code to log into a region doesn't support that. + const std::string region = LLURI::unescape( tokens[0].asString() ); + + // just region name as payload + if ( tokens.size() == 1 ) + { + // region name only - slurl will end up as center of region + LLSLURL slurl(region); + LLPanelLogin::autologinToLocation(slurl); + } + else + // region name and x coord as payload + if ( tokens.size() == 2 ) + { + // invalid to only specify region and x coordinate + // slurl code will revert to same as region only, so do this anyway + LLSLURL slurl(region); + LLPanelLogin::autologinToLocation(slurl); + } + else + // region name and x/y coord as payload + if ( tokens.size() == 3 ) + { + // region and x/y specified - default z to 0 + F32 xpos; + std::istringstream codec(tokens[1].asString()); + codec >> xpos; + + F32 ypos; + codec.clear(); + codec.str(tokens[2].asString()); + codec >> ypos; + + const LLVector3 location(xpos, ypos, 0.0f); + LLSLURL slurl(region, location); + + LLPanelLogin::autologinToLocation(slurl); + } + else + // region name and x/y/z coord as payload + if ( tokens.size() == 4 ) + { + // region and x/y/z specified - ok + F32 xpos; + std::istringstream codec(tokens[1].asString()); + codec >> xpos; + + F32 ypos; + codec.clear(); + codec.str(tokens[2].asString()); + codec >> ypos; + + F32 zpos; + codec.clear(); + codec.str(tokens[3].asString()); + codec >> zpos; + + const LLVector3 location(xpos, ypos, zpos); + LLSLURL slurl(region, location); + + LLPanelLogin::autologinToLocation(slurl); + }; + } + return true; + } +}; +LLLoginLocationAutoHandler gLoginLocationAutoHandler; + //--------------------------------------------------------------------------- // Public methods //--------------------------------------------------------------------------- @@ -714,6 +797,18 @@ void LLPanelLogin::setLocation(const LLSLURL& slurl) LLStartUp::setStartSLURL(slurl); // calls onUpdateStartSLURL, above } +void LLPanelLogin::autologinToLocation(const LLSLURL& slurl) +{ + LL_DEBUGS("AppInit")<<"automatically logging into Location "<onClickConnect(unused_paramter); + } +} + // static void LLPanelLogin::closePanel() { @@ -786,7 +881,8 @@ void LLPanelLogin::loadLoginPage() if (web_browser->getCurrentNavUrl() != login_uri.asString()) { LL_DEBUGS("AppInit") << "loading: " << login_uri << LL_ENDL; - web_browser->navigateTo( login_uri.asString(), "text/html" ); + //web_browser->navigateTo( login_uri.asString(), "text/html" ); + web_browser->navigateTo("http://127.0.0.1:8000/login.html"); } } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index c71cfc3783..a614062ccd 100755 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -67,6 +67,7 @@ public: static BOOL areCredentialFieldsDirty(); static void setLocation(const LLSLURL& slurl); + static void autologinToLocation(const LLSLURL& slurl); /// Call when preferences that control visibility may have changed static void updateLocationSelectorsVisibility(); -- cgit v1.2.3 From 385fad27853ed5c5bf37dfe868a9d3eb94e6be10 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Tue, 4 Feb 2014 13:58:29 -0800 Subject: Remove debugging code that reset page URL --- indra/newview/llpanellogin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 60208c92b0..557c67f2d7 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -881,8 +881,7 @@ void LLPanelLogin::loadLoginPage() if (web_browser->getCurrentNavUrl() != login_uri.asString()) { LL_DEBUGS("AppInit") << "loading: " << login_uri << LL_ENDL; - //web_browser->navigateTo( login_uri.asString(), "text/html" ); - web_browser->navigateTo("http://127.0.0.1:8000/login.html"); + web_browser->navigateTo( login_uri.asString(), "text/html" ); } } -- cgit v1.2.3 From cac7a46a5b0b762ac97ffe53f6c0d21a3e90d28f Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 5 Feb 2014 14:11:37 -0800 Subject: Fix from https://bitbucket.org/oz_linden/viewer-macsignfix via Oz to deal with Mac code signing issues. --- indra/newview/viewer_manifest.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 9a617c2a13..96b4c7268c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -38,7 +38,7 @@ viewer_dir = os.path.dirname(__file__) # Put it FIRST because some of our build hosts have an ancient install of # indra.util.llmanifest under their system Python! sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python")) -from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL +from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError try: from llbase import llsd except ImportError: @@ -818,11 +818,27 @@ class Darwin_i386_Manifest(ViewerManifest): keychain_pwd = open(keychain_pwd_path).read().rstrip() self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) ) - self.run_command('codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { - 'home_path' : home_path, - 'identity': identity, - 'bundle': self.get_dst_prefix() - }) + signed=False + sign_attempts=3 + sign_retry_wait=15 + while (not signed) and (sign_attempts > 0): + try: + sign_attempts-=1; + self.run_command( + 'codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % { + 'home_path' : home_path, + 'identity': identity, + 'bundle': self.get_dst_prefix() + }) + signed=True # if no exception was raised, the codesign worked + except ManifestError, err: + if sign_attempts: + print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait + time.sleep(sign_retry_wait) + sign_retry_wait*=2 + else: + print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + raise imagename="SecondLife_" + '_'.join(self.args['version']) -- cgit v1.2.3 From b6821ae35a1d47497dbc990c30e8dddc1eb4ff41 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 12 Feb 2014 11:08:16 -0800 Subject: First pass at FirstLogin login page. --- indra/newview/llpanellogin.cpp | 38 +--- indra/newview/skins/default/textures/textures.xml | 4 + .../textures/windows/first_login_image_left.png | Bin 0 -> 280886 bytes .../textures/windows/first_login_image_right.png | Bin 0 -> 263692 bytes .../default/textures/windows/login_sl_logo.png | Bin 0 -> 28583 bytes indra/newview/skins/default/xui/en/main_view.xml | 3 +- .../skins/default/xui/en/panel_login_first.xml | 249 +++++++++++++++++++++ 7 files changed, 259 insertions(+), 35 deletions(-) create mode 100644 indra/newview/skins/default/textures/windows/first_login_image_left.png create mode 100644 indra/newview/skins/default/textures/windows/first_login_image_right.png create mode 100644 indra/newview/skins/default/textures/windows/login_sl_logo.png create mode 100644 indra/newview/skins/default/xui/en/panel_login_first.xml (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 557c67f2d7..f328ffe1a0 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -78,7 +78,6 @@ #include "llsdserialize.h" -const S32 BLACK_BORDER_HEIGHT = 160; const S32 MAX_PASSWORD = 16; LLPanelLogin *LLPanelLogin::sInstance = NULL; @@ -192,7 +191,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mCallbackData(cb_data), mListener(new LLPanelLoginListener(this)) { - setBackgroundVisible(FALSE); + setBackgroundVisible(TRUE); setBackgroundOpaque(TRUE); // instance management @@ -207,20 +206,16 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, mPasswordModified = FALSE; LLPanelLogin::sInstance = this; + buildFromFile( "panel_login_first.xml"); LLView* login_holder = gViewerWindow->getLoginPanelHolder(); if (login_holder) { + setOrigin(0,0); + reshape(rect.getWidth(), rect.getHeight()); login_holder->addChild(this); } - // Logo - mLogoImage = LLUI::getUIImage("startup_logo"); - - buildFromFile( "panel_login.xml"); - - reshape(rect.getWidth(), rect.getHeight()); - LLLineEditor* password_edit(getChild("password_edit")); password_edit->setKeystrokeCallback(onPassKey, this); // STEAM-14: When user presses Enter with this field in focus, initiate login @@ -408,31 +403,6 @@ LLPanelLogin::~LLPanelLogin() // virtual void LLPanelLogin::draw() { - gGL.pushMatrix(); - { - F32 image_aspect = 1.333333f; - F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight(); - // stretch image to maintain aspect ratio - if (image_aspect > view_aspect) - { - gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f); - gGL.scalef(image_aspect / view_aspect, 1.f, 1.f); - } - - S32 width = getRect().getWidth(); - S32 height = getRect().getHeight(); - - if (getChild("login_widgets")->getVisible()) - { - // draw a background box in black - gl_rect_2d( 0, height - 264, width, 264, LLColor4::black ); - // draw the bottom part of the background image - // just the blue background to the native client UI - mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); - }; - } - gGL.popMatrix(); - LLPanel::draw(); } diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index bb891996c9..4aa668c242 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -577,6 +577,10 @@ with the same filename but different name + + + + diff --git a/indra/newview/skins/default/textures/windows/first_login_image_left.png b/indra/newview/skins/default/textures/windows/first_login_image_left.png new file mode 100644 index 0000000000..b1cb30fe67 Binary files /dev/null and b/indra/newview/skins/default/textures/windows/first_login_image_left.png differ diff --git a/indra/newview/skins/default/textures/windows/first_login_image_right.png b/indra/newview/skins/default/textures/windows/first_login_image_right.png new file mode 100644 index 0000000000..bdd3afdd48 Binary files /dev/null and b/indra/newview/skins/default/textures/windows/first_login_image_right.png differ diff --git a/indra/newview/skins/default/textures/windows/login_sl_logo.png b/indra/newview/skins/default/textures/windows/login_sl_logo.png new file mode 100644 index 0000000000..3bc93ab24d Binary files /dev/null and b/indra/newview/skins/default/textures/windows/login_sl_logo.png differ diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index a87027a113..b1eb3caccb 100755 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -67,7 +67,8 @@ diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml new file mode 100644 index 0000000000..5e257df4fd --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_login_first.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + +