* */ extract($_SERVER); extract($_REQUEST); # initialization stuff # -------------------- $bn_action="delete"; $bn_action_mode="W"; include "./init.inc"; $header_footer = ($bn_frames==0) ? true : false; # if note to delete is not defined then return to the list # -------------------------------------------------------- if (!$key) { display_header ("Delete note", $header_footer); MsgForm (Msg(3), "list.$ext", ""); display_footer ($header_footer); } elseif ($do_delete) { # Execute before_access program # ------------------------------ if ($bn_before_access) { include "$bn_dir/$bn_before_access"; } display_header ("Delete note", $header_footer); # delete the note from the database # --------------------------------- $ret = $db->DeleteNote ($bn_db, $key, $password, $bn_dir_notes); if ($ret < 0) { switch ($ret): case (-2): MsgForm (Msg (12), "list.$ext?bn=$bn&first=$first&last=$last&expnd=$expnd", "back"); /* invalid password */ break; case (-4): MsgForm (Msg (10), "list.$ext?bn=$bn&first=$first&last=$last&expnd=$expnd", "back"); /* invalid key */ break; default: MsgForm (Msg (13), "list.$ext?bn=$bn&first=$first&last=$last&expnd=$expnd", ""); /* other error */ break; endswitch; } else { # Start search indexation if a search engine is configured # -------------------------------------------------------- if ($bn_search && ($bn_doc_type == "static") && ($bn_search_engine != "none") ) { include "$inc_dir/$bn_search_engine.$ext"; $search->indexNotes(); } # Displays success message then exit # ---------------------------------- MsgForm (Msg (14), "list.$ext?bn=$bn&first=$first&last=$last&expnd=$expnd&force_refresh=1", ""); } } else { display_header ("Delete note", $header_footer); $note = $db->getNote ($bn_db, $key); if (!$note) { MsgForm (Msg(10), "$WA_SELF?bn=$bn&first=$first&last=$last&expnd=$expnd", ""); display_footer ($header_footer); } while ( list( $var, $val ) = each( $note)) { if (is_string ($var)) $$var = $val; } # displays form (OK to delete) # ---------------------------- beginForm(); hiddenField ("key", $key); hiddenField ("expnd", $expnd); hiddenField ("do_delete", 1); dspMsg(49); // Ask for confirmation dspMsg(41); // password passwordField ("password", "", 10); br(); ?>

"; display_attachment ($key, $attachment, $att_type, $att_size); } } # Display footer # -------------- display_footer ($header_footer); ?>