Re: [Freeipa-devel] [PATCH] 715 webui: add bounce url to reset_password.html

2014-08-13 Thread Endi Sukma Dewata

On 7/29/2014 5:53 AM, Petr Vobornik wrote:

Just one thing, there is no pause between clicking the Reset button

and the redirection, so the Password reset was successful.
confirmation message might only appear very briefly. A possible
alternative is to show a confirmation page/message, but the user will
have to click to continue to the next page.


I don't believe there is a universal solution. I would say that it
depends on personal preferences and a use case. I.e., if it's part 
of  a
login procedure I would prefer immediate redirection back to login 
page.

If it's invoked from a user action - just to change the password, some
delay might be good.

We might add a URL param(s) to configure the delay/link.


How about 2 URL params?
1. the link to the next page
2. an option whether to
a) redirect to the link immediately
b) show a confirmation page with the link

Just my preference, but I don't really like a 'delay' on a web page.
It's either too short or too long, and we can't put important info
during the delay because there's no guarantee people will see it.



Yes, how about this:

1. redirection=url_to_the_page
2. in=x, where x is number of seconds or a string

- redirect immediately if only `redirection` is supplied or `in=0`
- show Continue to anext page/a link if `in` is present
- show count-down timer if `in` is  1 with You will be redirected in 
`x`s text.
- don't redirect if `in` is negative or NaN (your scenario), e.g.: 
`in=no` up to user

- ignore `in` if `redirection` is not present

Then we will support all described scenarios and the decision will be 
on web-site admin. Feel free to propose better name for `in`.


How about 'url/link' or 'next_url' for the first parameter and 'delay' 
for the second one? I think in this case 'delay' would describe its 
function better than 'in'. If delay=0 that means we're redirecting 
immediately. If delay parameter is not specified that means we're 
waiting for the user to click the link.


--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 715 webui: add bounce url to reset_password.html

2014-07-29 Thread Petr Vobornik

On 28.7.2014 19:08, Endi Sukma Dewata wrote:

On 7/28/2014 3:58 AM, Petr Vobornik wrote:

Just one thing, there is no pause between clicking the Reset button
and the redirection, so the Password reset was successful.
confirmation message might only appear very briefly. A possible
alternative is to show a confirmation page/message, but the user will
have to click to continue to the next page.


I don't believe there is a universal solution. I would say that it
depends on personal preferences and a use case. I.e., if it's part of  a
login procedure I would prefer immediate redirection back to login page.
If it's invoked from a user action - just to change the password, some
delay might be good.

We might add a URL param(s) to configure the delay/link.


How about 2 URL params?
1. the link to the next page
2. an option whether to
a) redirect to the link immediately
b) show a confirmation page with the link

Just my preference, but I don't really like a 'delay' on a web page.
It's either too short or too long, and we can't put important info
during the delay because there's no guarantee people will see it.



Yes, how about this:

1. redirection=url_to_the_page
2. in=x, where x is number of seconds or a string

- redirect immediately if only `redirection` is supplied or `in=0`
- show Continue to anext page/a link if `in` is present
- show count-down timer if `in` is  1 with You will be redirected in 
`x`s text.
- don't redirect if `in` is negative or NaN (your scenario), e.g.: 
`in=no` up to user

- ignore `in` if `redirection` is not present

Then we will support all described scenarios and the decision will be on 
web-site admin. Feel free to propose better name for `in`.

--
Petr Vobornik

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 715 webui: add bounce url to reset_password.html

2014-07-28 Thread Petr Vobornik

On 25.7.2014 22:27, Endi Sukma Dewata wrote:

On 7/23/2014 9:59 AM, Petr Vobornik wrote:

reset_password.html now redirects browser to URL specified in 'redirect'
uri component (if present).

The component has to be URI encoded. ie (in browser console):

$
encodeURIComponent('http://pvoborni.fedorapeople.org/doc/#!/guide/Debugging')



--
http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging

--

https://my.freeipa.server/ipa/ui/reset_password.html?redirect=http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging



https://fedorahosted.org/freeipa/ticket/4440


ACK.


Pushed to:
master: 8288135b5b218cd63d5f5bfba59f6d1f9657af2d
ipa-4-1: 8288135b5b218cd63d5f5bfba59f6d1f9657af2d

Not closing the ticket yet.


Just one thing, there is no pause between clicking the Reset button
and the redirection, so the Password reset was successful.
confirmation message might only appear very briefly. A possible
alternative is to show a confirmation page/message, but the user will
have to click to continue to the next page.



I don't believe there is a universal solution. I would say that it 
depends on personal preferences and a use case. I.e., if it's part of  a 
login procedure I would prefer immediate redirection back to login page. 
If it's invoked from a user action - just to change the password, some 
delay might be good.


We might add a URL param(s) to configure the delay/link.

--
Petr Vobornik

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 715 webui: add bounce url to reset_password.html

2014-07-28 Thread Endi Sukma Dewata

On 7/28/2014 3:58 AM, Petr Vobornik wrote:

Just one thing, there is no pause between clicking the Reset button
and the redirection, so the Password reset was successful.
confirmation message might only appear very briefly. A possible
alternative is to show a confirmation page/message, but the user will
have to click to continue to the next page.


I don't believe there is a universal solution. I would say that it
depends on personal preferences and a use case. I.e., if it's part of  a
login procedure I would prefer immediate redirection back to login page.
If it's invoked from a user action - just to change the password, some
delay might be good.

We might add a URL param(s) to configure the delay/link.


How about 2 URL params?
1. the link to the next page
2. an option whether to
   a) redirect to the link immediately
   b) show a confirmation page with the link

Just my preference, but I don't really like a 'delay' on a web page. 
It's either too short or too long, and we can't put important info 
during the delay because there's no guarantee people will see it.


--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 715 webui: add bounce url to reset_password.html

2014-07-25 Thread Endi Sukma Dewata

On 7/23/2014 9:59 AM, Petr Vobornik wrote:

reset_password.html now redirects browser to URL specified in 'redirect'
uri component (if present).

The component has to be URI encoded. ie (in browser console):

$
encodeURIComponent('http://pvoborni.fedorapeople.org/doc/#!/guide/Debugging')


--
http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging

--

https://my.freeipa.server/ipa/ui/reset_password.html?redirect=http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging


https://fedorahosted.org/freeipa/ticket/4440


ACK. Just one thing, there is no pause between clicking the Reset button 
and the redirection, so the Password reset was successful. 
confirmation message might only appear very briefly. A possible 
alternative is to show a confirmation page/message, but the user will 
have to click to continue to the next page.


--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 715 webui: add bounce url to reset_password.html

2014-07-23 Thread Petr Vobornik

reset_password.html now redirects browser to URL specified in 'redirect'
uri component (if present).

The component has to be URI encoded. ie (in browser console):

$ 
encodeURIComponent('http://pvoborni.fedorapeople.org/doc/#!/guide/Debugging')


--
http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging

--

https://my.freeipa.server/ipa/ui/reset_password.html?redirect=http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging

https://fedorahosted.org/freeipa/ticket/4440
--
Petr Vobornik
From 975c1afb4a96d699a43f9c68af343316659d7c6d Mon Sep 17 00:00:00 2001
From: Petr Vobornik pvobo...@redhat.com
Date: Wed, 23 Jul 2014 16:53:56 +0200
Subject: [PATCH] webui: add bounce url to reset_password.html

reset_password.html now redirects browser to URL specified in 'redirect'
uri component (if present).

The component has to be URI encoded. ie (in browser console):

$ encodeURIComponent('http://pvoborni.fedorapeople.org/doc/#!/guide/Debugging')

--
http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging

--

https://my.freeipa.server/ipa/ui/reset_password.html?redirect=http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging

https://fedorahosted.org/freeipa/ticket/4440
---
 install/ui/reset_password.js | 24 
 1 file changed, 24 insertions(+)

diff --git a/install/ui/reset_password.js b/install/ui/reset_password.js
index bc08349876ea18d204ce4d6e8ae7724878967620..1afc76eba061a7015d1e817e840177fd60e35160 100644
--- a/install/ui/reset_password.js
+++ b/install/ui/reset_password.js
@@ -114,6 +114,7 @@ RP.on_submit = function() {
 } else {
 RP.reset_form();
 RP.show_success(Password reset was successful.);
+RP.redirect();
 }
 };
 
@@ -140,6 +141,29 @@ RP.show_success = function(message) {
 $('.alert-success').css('display', '');
 };
 
+RP.parse_uri = function() {
+var opts = {};
+if (window.location.search.length  1) {
+var couples = window.location.search.substr(1).split();
+for (var i=0,l=couples.length; i  l; i++) {
+var couple = couples[i].split(=);
+var key = decodeURIComponent(couple[0]);
+var value = couple.length  1 ? decodeURIComponent(couple[1]) : '';
+opts[key] = value;
+}
+}
+return opts;
+};
+
+RP.redirect = function() {
+
+var opts = RP.parse_uri();
+var url = opts['redirect'];
+if (url) {
+window.location = url;
+}
+};
+
 
 RP.init = function() {
 
-- 
1.9.3

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel