Add a flag to enable Persona support

[?]
Nov 6, 2013, 1:38 PM
JFW656FT5JSDCA5NBNFGTJABIR2LR5VRDRYI7KF54PYNFDSL4DMAC

Dependencies

  • [2] WDKFN4B2 Make sign in a modal dialog box rather than a separate page
  • [3] P75LFRF4 Slight cleanup in the Persona sign in code
  • [4] DV43UILU Don't float the search bar to the right in collapsed mode
  • [5] S5GCSCNS Update bootstrap to 2.3.1
  • [6] KSBB33RE Add a dashboard
  • [7] 36ZTCZ4F Add basic Persona support
  • [8] VVRM3EGC Link to both the Persona and legacy sign in
  • [9] OEPUOUNB Using twitter bootstrap for more consistent looks for Hydra
  • [10] D44B24QC Store the account type ("hydra" or "persona") explicitly in the database
  • [11] PFB5ZUQW Fix legacy login
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] XJRJ4J7M Add user registration
  • [*] MGOGOKQP add tracker html code via HYDRA_TRACKER
  • [*] 2CZSW5S5 Don't redirect to /login if authentication is required
  • [*] 2P7VNAAC Move common Javascript code into a separate file
  • [*] DAPOSS44 Use the REST API in the web interface for editing projects
  • [*] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website

Change contents

  • edit in src/lib/Hydra/Controller/Root.pm at line 27
    [14.196]
    [15.51]
    $c->stash->{personaEnabled} = $c->config->{enable_persona} // "0" eq "1";
  • edit in src/lib/Hydra/Controller/User.pm at line 50
    [16.21]
    [4.182]
    error($c, "Persona support is not enabled.") unless $c->stash->{personaEnabled};
  • replacement in src/root/layout.tt at line 104
    [4.246][4.246:449]()
    $.post("[% c.uri_for('/logout') %]")
    .done(function(data) {
    window.location.reload();
    })
    .fail(function() { bootbox.alert("Server request failed!"); });
    [4.246]
    [4.449]
    [% IF c.user_exists %]
    $.post("[% c.uri_for('/logout') %]")
    .done(function(data) {
    window.location.reload();
    })
    .fail(function() { bootbox.alert("Server request failed!"); });
    [% END %]
  • replacement in src/root/layout.tt at line 129
    [3.191][3.191:259]()
    success: function(data) { window.location.reload(); }
    [3.191]
    [3.259]
    success: function(data) { window.location.reload(); },
    postError: function() { navigator.id.logout(); }
  • replacement in src/root/static/css/hydra.css at line 110
    [4.7242][4.7242:7243]()
    }
    [4.7242]
    }
  • edit in src/root/static/js/common.js at line 138
    [18.2780]
    [18.2780]
    if (args.postError) args.postError(data);
  • replacement in src/root/topbar.tt at line 126
    [4.311][4.56:328]()
    [% WRAPPER makeSubMenu title="Sign in" %]
    <li>
    <a href="#" id="persona-signin">
    <img src="https://developer.mozilla.org/files/3963/persona_sign_in_blue.png" alt="Sign in with Persona" />
    </a>
    </li>
    <li class="divider"></li>
    [4.311]
    [4.328]
    [% IF personaEnabled %]
    [% WRAPPER makeSubMenu title="Sign in" %]
    <li>
    <a href="#" id="persona-signin">
    <img src="https://developer.mozilla.org/files/3963/persona_sign_in_blue.png" alt="Sign in with Persona" />
    </a>
    </li>
    <li class="divider"></li>
    <li>
    <a href="#hydra-signin" data-toggle="modal">Sign in with a Hydra account</a>
    </li>
    [% END %]
    [% ELSE %]
  • replacement in src/root/topbar.tt at line 140
    [4.339][2.1806:1891]()
    <a href="#hydra-signin" data-toggle="modal">Sign in with a Hydra account</a>
    [4.339]
    [4.418]
    <a href="#hydra-signin" data-toggle="modal">Sign in</a>