App-MFILE-WWW

 view release on metacpan or  search on metacpan

lib/App/MFILE/WWW.pm  view on Meta::CPAN


=item * if the connection is asking for static content (defined as anything in
C<images/>, C<css/>, or C<js/>), that content is served immediately and the
request doesn't even make it into our Perl code

=item * any other path is considered dynamic content and is passed to
L<Web::Machine> for processing -- L<Web::Machine> implements the HTTP standard
as a state machine

=item * the L<Web::Machine> state machine takes the incoming request and runs
it through several functions that are overlayed in L<App::MFILE::WWW::Resource>
- an appropriate HTTP error code is returned if the request doesn't make it
through the state machine. Along the way, log messages are written to the log.

=item * as part of the state machine, all incoming requests are subject to
"authorization" (in the HTTP sense, which actually means authentication).
First, the session data is examined to determine if the request belongs to an
existing authorized session. If it doesn't, the request is treated as a
login/logout attempt -- the session is cleared and control passes to the 
JavaScript side, which, lacking a currentUser object, displays the login
dialog.

share/js/mfile-www/lib.js  view on Meta::CPAN

    currentUser
) {

    return {

        //
        // function returns string to be displayed in the 'userbox'
        // <span> element at the top right of the "screen" (i.e. browser
        // window) -- called from html.js
        //
        // Derived apps will want to overlay this function. See
        // App::Dochazka::WWW's version for an example.
        //
        fillUserBox: function () {

            console.log("Entering mfile-www fillUserBox function");

            var r = '', 
                cu = currentUser('obj'),
                nick,
                priv = currentUser('priv') || 'null';



( run in 1.174 second using v1.01-cache-2.11-cpan-49f99fa48dc )