From e49987b0699d5eba3eef4ead33ca28f949523255 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sun, 28 Oct 2007 10:25:23 +1300 Subject: [PATCH] Remove erroneous messages when you just hi 'Enter' instead of clicking submit. --- inc/RSCDSUser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/RSCDSUser.php b/inc/RSCDSUser.php index 56db0e03..656a7159 100644 --- a/inc/RSCDSUser.php +++ b/inc/RSCDSUser.php @@ -359,7 +359,7 @@ EOSQL; $this->CreateHomeCalendar(); $this->CreateDefaultRelationships(); } - if ( $this->AllowedTo("Admin") && isset($_POST['relate_to']) && isset($_POST['relate_as']) && isset($_POST['submit']) && $_POST['submit'] == htmlspecialchars(translate('Add Relationship')) ) { + if ( $this->AllowedTo("Admin") && isset($_POST['relate_to']) && $_POST['relate_to'] != '' && isset($_POST['relate_as']) && $_POST['relate_as'] != '' && isset($_POST['submit']) && $_POST['submit'] == htmlspecialchars(translate('Add Relationship')) ) { dbg_error_log("User",":Write: Adding relationship as %d to %d", $_POST['relate_as'], isset($_POST['relate_to'] ) ); $qry = new PgQuery("INSERT INTO relationship (from_user, to_user, rt_id ) VALUES( $this->user_no, ?, ? )", $_POST['relate_to'], $_POST['relate_as'] ); if ( $qry->Exec() ) { @@ -374,5 +374,6 @@ EOSQL; } return false; } + }