From 73785f058c581add5cdb78a51afe9eabf2c0dca6 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Mon, 13 Oct 2008 21:37:28 +0200 Subject: [PATCH] Notification on empty path --- PciIds/Html/Notifications.pm | 4 ++++ cf/config | 1 + 2 files changed, 5 insertions(+) diff --git a/PciIds/Html/Notifications.pm b/PciIds/Html/Notifications.pm index 9aa1826..fc20e1c 100644 --- a/PciIds/Html/Notifications.pm +++ b/PciIds/Html/Notifications.pm @@ -23,6 +23,7 @@ use PciIds::Html::Util; use PciIds::Html::Forms; use PciIds::Html::Users; use PciIds::Address; +use PciIds::Config; use Apache2::Const qw(:common :http); sub genNotifForm( $$$$$$ ) { @@ -70,6 +71,7 @@ sub genNotifForm( $$$$$$ ) { sub notifForm( $$$$ ) { my( $req, $args, $tables, $auth ) = @_; + return HTTPRedirect( $req, '/mods/'.$config{'default_uri'}.'?action=notifications' ) if $req->uri() =~ /^(\/(read|mods))?\/?$/; if( defined $auth->{'authid'} ) { return genNotifForm( $req, $args, $tables, $auth, undef, $tables->getNotifData( $auth->{'authid'}, PciIds::Address::new( $req->uri() )->get() ) ); } else { @@ -102,4 +104,6 @@ sub notifFormSubmit( $$$$ ) { return HTTPRedirect( $req, setAddrPrefix( $req->uri(), 'read' ).buildExcept( 'action', $args )."?action=list" ); } +checkConf( [ 'default_uri' ] ); + 1; diff --git a/cf/config b/cf/config index 0b10317..8ed29e2 100644 --- a/cf/config +++ b/cf/config @@ -11,3 +11,4 @@ hostname = localhost jelnet = /home/vorner/bin/jelnet xmpp_passwd = 1234 xmpp_name = none +default_uri = PC/ -- 2.39.2