]> mj.ucw.cz Git - pciids.git/commitdiff
Notification on empty path
authorMichal Vaner <vorner@ucw.cz>
Mon, 13 Oct 2008 19:37:28 +0000 (21:37 +0200)
committerMichal Vaner <vorner@ucw.cz>
Mon, 13 Oct 2008 19:37:28 +0000 (21:37 +0200)
PciIds/Html/Notifications.pm
cf/config

index 9aa18260709de7707925d9a93327d7e927dc048c..fc20e1cef2bb0aa484e148088f2b9e6ee6ddbb09 100644 (file)
@@ -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;
index 0b103179d0d809afe29d1a525ccda091b0ac7600..8ed29e2c62505c5ca23405d4b999037ba29fd463 100644 (file)
--- 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/