From 08b3606390af575d7aa9b9684d01a7ef7cf88160 Mon Sep 17 00:00:00 2001 From: gregb_cc Date: Tue, 11 Mar 2003 21:35:12 +0000 Subject: [PATCH] This is a first attempt to make moodle frame safe. I've added the variable CFG->main_frame to config-dist.php, and replaced _top targets with the variable in all the php files. HTML files, like those in the documentation, have not been modified, as they are not (yet) parsed. The variable should probably get moved into the config table, and get some documentation. I've also included, but commented out, a slight change in weblib.php, which would guarantee that messages would be seen before redirecting the user (unless delay intentionally set to 0 when redirect is used). --- admin/auth.php | 2 +- config-dist.php | 2 ++ lib/weblib.php | 18 ++++++++++++++---- mod/resource/view.php | 24 ++++++++++++++---------- mod/survey/report.php | 10 +++++----- theme/oceanblue/header.html_logo | 2 +- theme/poweraid/header.html | 4 ++-- 7 files changed, 39 insertions(+), 23 deletions(-) diff --git a/admin/auth.php b/admin/auth.php index 41d12ab612..dd73e0ae1d 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -91,7 +91,7 @@ "$stradministration -> $strauthenticationoptions", "$focus"); echo "

"; - echo "

"; + echo "main_frame}\" NAME=\"authmenu\" method=\"post\" action=\"auth.php\">"; print_string("chooseauthmethod","auth"); choose_from_menu ($options, "auth", $auth, "","top.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", ""); diff --git a/config-dist.php b/config-dist.php index 9836dd99e5..fb09e7d0f1 100644 --- a/config-dist.php +++ b/config-dist.php @@ -113,4 +113,6 @@ require_once("$CFG->dirroot/lib/setup.php"); // Do not change this // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE. + +$CFG->main_frame = '_top'; ?> diff --git a/lib/weblib.php b/lib/weblib.php index db868a645c..f6c0153a76 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -364,7 +364,7 @@ function popup_form ($common, $options, $formname, $selected="", $nothing="choos $nothing = get_string("choose")."..."; } - $output = ""; + $output = "main_frame}\" NAME=$formname>"; $output .= "