Request.pm 1.29 KB
Newer Older
Yadd's avatar
Yadd committed
1
2
package Lemonldap::NG::Portal::Main::Request;

Yadd's avatar
Yadd committed
3
4
5
# Developpers, be careful: new() is never called so default values will not be
# taken in account (see Portal::Run::handler())

Yadd's avatar
Yadd committed
6
7
8
9
10
use strict;
use Mouse;

extends 'Lemonldap::NG::Common::PSGI::Request';

Yadd's avatar
Yadd committed
11
# List of methods to call
Yadd's avatar
Yadd committed
12
has steps => ( is => 'rw' );
Yadd's avatar
Yadd committed
13
14

# Datas shared between methods
Yadd's avatar
Yadd committed
15
has datas => ( is => 'rw', default => sub { {} } );
Yadd's avatar
Yadd committed
16
17

# Session datas when created
Yadd's avatar
Yadd committed
18
has id          => ( is => 'rw' );
Yadd's avatar
Yadd committed
19
has sessionInfo => ( is => 'rw' );
Yadd's avatar
Yadd committed
20
has user        => ( is => 'rw' );
Yadd's avatar
Yadd committed
21
22

# Response cookies (list of strings built by cookie())
Yadd's avatar
Yadd committed
23
has respCookies => ( is => 'rw' );
Yadd's avatar
Yadd committed
24

Yadd's avatar
Yadd committed
25
# Template to display (if not defined, login or menu)
Yadd's avatar
Yadd committed
26
27
28
29
30
31
32
has template => ( is => 'rw' );

# Boolean to indicate that response must be a redirection
has mustRedirect => ( is => 'rw' );

# Boolean to indicate that url isn't Base64 encoded
has urlNotBase64 => ( is => 'rw' );
Yadd's avatar
Yadd committed
33

Yadd's avatar
Yadd committed
34
35
36
37
38
39
40
41
42
43
44
45
# Info to display at login
has info => ( is => 'rw' );

# Menu error
has menuError => ( is => 'rw' );

# Notification
has notification => ( is => 'rw' );

has _authChoice   => ( is => 'rw' );
has _openidPortal => ( is => 'rw' );

Yadd's avatar
Yadd committed
46
47
48
49
sub wantJSON {
    return $_[0]->accept =~ m#(?:application|text)/json# ? 1 : 0;
}

Yadd's avatar
Yadd committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Error type
sub error_type {

    #TODO
}

sub errorString {

    #TODO
}

sub loginInfo {
}

# TODO: oldpassword
Yadd's avatar
Yadd committed
65
1;