The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Rudesind::WebApp - A MasonX::WebApp subclass for the Rudesind application.

SYNOPSIS

  if ( $App->is_admin ) { ... }

DESCRIPTION

This class provides some Rudesind-specific functionality by subclassing MasonX::WebApp. It stores sessions in the a directory called sessions under the temp directory defined by the configuration.

HANDLED URIS

This class handles the following URIs:

  • <URI ROOT>/login

    Expects to be given an "admin_password" argument. If this is defined in the configuration file, and the given argument matches this parameter, the browser session is logged-in.

  • <URI ROOT>/logout

    Logs the browser out.

  • <URI ROOT>/logout

    Expects a "path" argument, which will either be a gallery or image. It calls save_caption() with the "caption" argument on the object defined by the "path" argument.

METHODS

This class provides the following methods:

  • config

    Returns a Rudesind::Config object.

  • is_admin

    Returns a boolean indicating whether or not the browser is logged-in as an admin. If basic auth for the admin area succeeded in the past, then the browser is logged-in.

  • basic_auth

    Returns a boolean indicating whether or not the basic auth for the admin area succeeded.