Fix legacy login
[?]
Jul 9, 2013, 11:55 AM
PFB5ZUQWW67FRYY54QGTAVTWYMUKXLXRA2XCY3IWK6HZNE6DDLFACDependencies
- [2]
XUKHBDR5Prevent Persona users from setting a password - [3]
RU7AQO7U* Role-based access control. Only admins can create projects. Only - [4]
XMB4MTRLShow sign in as success - [5]
LZVO64YGMerge in the first bits of the API work - [6]
LC64D4PUCorrectly redirect to the referring page when logging in - [7]
36ZTCZ4FAdd basic Persona support - [8]
XJRJ4J7MAdd user registration - [9]
7KF7YZDRDisable account creation for now - [10]
OEPUOUNBUsing twitter bootstrap for more consistent looks for Hydra - [11]
J5UVLXOK* Start of a basic Catalyst web interface. - [12]
2CZSW5S5Don't redirect to /login if authentication is required - [13]
QL55ECJ6- adapted ui for hydra, more in line with nixos.org website - [14]
JARRBLZDBootstrapify the Hydra forms (except the project and jobset edit pages)
Change contents
- edit in src/lib/Hydra/Controller/User.pm at line 61
$c->flash->{flashMsg} = "You are no longer signed in." if $c->user_exists(); - replacement in src/lib/Hydra/Controller/User.pm at line 63[3.1347]→[3.24646:24820](∅→∅),[3.24820]→[3.1417:1420](∅→∅),[3.1417]→[3.1417:1420](∅→∅),[3.1420]→[3.24821:24930](∅→∅)
if ($c->request->looks_like_browser) {$c->response->redirect($c->request->referer || $c->uri_for('/'));} else {$self->status_no_content($c);}}sub logout_GET {# Probably a better way to do thismy ($self, $c) = @_;logout_POST($self, $c);$self->status_no_content($c); - replacement in src/lib/Hydra/Controller/User.pm at line 101
$c->flash->{successMsg} = "You are now signed in as <tt>" . encode_entities($email) . "</tt>";}sub persona_logout :Path('/persona-logout') Args(0) {my ($self, $c) = @_;$c->stash->{json} = {};requirePost($c);$c->flash->{flashMsg} = "You are no longer signed in." if $c->user_exists();$c->logout;$c->flash->{successMsg} = "You are now signed in as <tt>" . encode_entities($email) . "</tt>."; - edit in src/root/layout.tt at line 104
<script src="https://login.persona.org/include.js"></script> - replacement in src/root/layout.tt at line 106[3.1337]→[3.1337:1899](∅→∅),[3.1899]→[3.828:1049](∅→∅),[3.1049]→[3.2148:2168](∅→∅),[3.2148]→[3.2148:2168](∅→∅)
navigator.id.watch({loggedInUser: [% c.user_exists ? '"' _ HTML.escape(c.user.username) _ '"' : "null" %],onlogin: function(assertion) {$.post("[% c.uri_for('/persona-login') %]", { assertion: assertion }).done(function(data) {if (data.error)bootbox.alert("Login failed: " + data.error);elsewindow.location.reload();}).fail(function() { bootbox.alert("Server request failed!"); });},onlogout: function() {$.post("[% c.uri_for('/persona-logout') %]").done(function(data) {window.location.reload();}).fail(function() { bootbox.alert("Server request failed!"); });}});function doLogout() {$.post("[% c.uri_for('/logout') %]").done(function(data) {window.location.reload();}).fail(function() { bootbox.alert("Server request failed!"); });}</script> - replacement in src/root/layout.tt at line 115
$("#persona-signin").click(function() {navigator.id.request();});[% IF c.user_exists && c.user.password != '!' %]<script>$("#persona-signout").click(doLogout);</script>[% ELSE %]<script src="https://login.persona.org/include.js"></script> - replacement in src/root/layout.tt at line 122
$("#persona-signout").click(function() {navigator.id.logout();});</script><script>navigator.id.watch({loggedInUser: [% c.user_exists ? '"' _ HTML.escape(c.user.username) _ '"' : "null" %],onlogin: function(assertion) {$.post("[% c.uri_for('/persona-login') %]", { assertion: assertion }).done(function(data) {if (data.error)bootbox.alert("Login failed: " + data.error);elsewindow.location.reload();}).fail(function() { bootbox.alert("Server request failed!"); });},onlogout: doLogout}); - edit in src/root/layout.tt at line 138
$("#persona-signin").click(function() {navigator.id.request();});$("#persona-signout").click(function() {navigator.id.logout();});</script>[% END %] - replacement in src/root/login.tt at line 5
<p class="btn-info btn-large">You are already logged in as <tt>[% c.user.username %]</tt>.You can <a href="[% c.uri_for('/logout') %]">logout</a> here.<p class="alert alert-info">You are already signed in as <tt>[% HTML.escape(c.user.username) %]</tt>. - edit in src/root/login.tt at line 15
<!-- - edit in src/root/login.tt at line 38
-->