Apache-Voodoo

 view release on metacpan or  search on metacpan

lib/Apache/Voodoo/Engine.pm  view on Meta::CPAN


	if (!defined($session_id) || $session->id() ne $session_id) {
		# This is a new session, or there was an old cookie from a previous sesion,
		$self->{'mp'}->set_cookie($conf->{'cookie_name'},$session->id());
	}
	elsif ($session->has_expired($conf->{'session_timeout'})) {
		# the session has expired
		$self->{'mp'}->set_cookie($conf->{'cookie_name'},'!','now');
		$session->destroy;

		Apache::Voodoo::Exception::Application::SessionTimeout->throw(
			target  => $self->_adjust_url("/timeout"),
			error => "Session has expired"
		);
	}

	# update the session timer
	$session->touch();

	return $session;
}

lib/Apache/Voodoo/Exception.pm  view on Meta::CPAN

		description => 'Parameters failed to parse'
	},
	'Apache::Voodoo::Exception::DBIConnect' => {
		isa => 'Apache::Voodoo::Exception',
		description => 'Failed to connect to the database'
	},
	'Apache::Voodoo::Exception::Application' => {
		isa => 'Apache::Voodoo::Exception',
		description => 'Application Error'
	},
	'Apache::Voodoo::Exception::Application::SessionTimeout' => {
		isa => 'Apache::Voodoo::Exception::Application',
		description => "Session has expired",
		fields => ['target']
	},
	'Apache::Voodoo::Exception::Application::Redirect' => {
		isa => 'Apache::Voodoo::Exception::Application',
		description => "Controller redirected the request to another location",
		fields => ['target']
	},
	'Apache::Voodoo::Exception::Application::DisplayError' => {

lib/Apache/Voodoo/Handler.pm  view on Meta::CPAN

	unless (-r "$filename.tmpl") { return $self->{mp}->forbidden; }

	########################################
	# We now know we have a valid request that we need to handle,
	# Get the engine ready to serve it.
	########################################
	eval {
		$self->{'engine'}->init_app();
		$self->{'engine'}->begin_run();
	};
	if (my $e = Apache::Voodoo::Exception::Application::SessionTimeout->caught()) {
		return $self->{'mp'}->redirect($e->target());
	}
	elsif ($e = Exception::Class->caught()) {
		warn "$e";
		return $self->{'mp'}->server_error;
	}

	####################
	# Get paramaters
	####################

lib/Apache/Voodoo/Soap.pm  view on Meta::CPAN

			$self->{'status'} = $self->{'mp'}->ok;
			return {
				'error'        => 0,
				'success'      => 1,
				'rawdata'      => 1,
				'content-type' => $e->content_type,
				'headers'      => $e->headers,
				'data'         => $e->data
			};
		}
		elsif ($e->isa("Apache::Voodoo::Exception::Application::SessionTimeout")) {
			$self->{'status'} = $self->{'mp'}->ok;
			$self->_client_fault(700, $e->error, $e->target);
		}
		elsif ($e->isa("Apache::Voodoo::Exception::RunTime") && $self->{'engine'}->is_devel_mode()) {
			# Apache::Voodoo::Exception::RunTime
			# Apache::Voodoo::Exception::RunTime::BadCommand
			# Apache::Voodoo::Exception::RunTime::BadReturn
			$self->{'status'} = $self->{'mp'}->server_error;
			$self->_server_fault($self->{'mp'}->server_error, $e->error, Apache::Voodoo::Exception::parse_stack_trace($e->trace));
		}



( run in 0.674 second using v1.01-cache-2.11-cpan-a5abf4f5562 )