AppUser subclasses may need access to System modules.
This commit is contained in:
parent
c4b03ea01a
commit
01d3ee2fda
11
AppUser.pm
11
AppUser.pm
@ -104,6 +104,17 @@ sub init {
|
||||
}
|
||||
|
||||
|
||||
## @method void set_system($system)
|
||||
# Set the AppUser's refrence to the system object. This must be done after both
|
||||
# construction and initialisation, as the system object may not be available
|
||||
# at either stage.
|
||||
#
|
||||
# @param system A reference to the system System object.
|
||||
sub set_system {
|
||||
my $self = shift;
|
||||
$self -> {"system"} = shift;
|
||||
}
|
||||
|
||||
# ============================================================================
|
||||
# Constants access
|
||||
|
||||
|
@ -219,6 +219,8 @@ sub run {
|
||||
phpbb => $self -> {"phpbb"},
|
||||
modules => $self -> {"modules"})
|
||||
or $self -> {"logger"} -> die_log($self -> {"cgi"} -> remote_host(), "Application: Unable to create system object: ".$self -> {"system"} -> {"errstr"});
|
||||
|
||||
$self -> {"appuser"} -> set_system($self -> {"system"}) if($self -> {"appuser"});
|
||||
}
|
||||
|
||||
# Has a block selector been specified? If not, make a default one
|
||||
@ -255,6 +257,7 @@ sub run {
|
||||
# Prevent circular references from messing up shutdown
|
||||
$self -> {"template"} -> set_module_obj(undef);
|
||||
$self -> {"system"} -> clear() if($self -> {"system"});
|
||||
$self -> {"appuser"} -> set_system(undef) if($self -> {"appuser"});
|
||||
|
||||
$self -> {"dbh"} -> disconnect();
|
||||
$self -> {"logger"} -> end_log();
|
||||
|
Loading…
x
Reference in New Issue
Block a user