]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #5163 - user/action_redir.php should print properly formatted error
authorvyshane <vyshane>
Thu, 13 Apr 2006 08:48:51 +0000 (08:48 +0000)
committervyshane <vyshane>
Thu, 13 Apr 2006 08:48:51 +0000 (08:48 +0000)
messages

user/action_redir.php

index 635843d03a9a1fae469fed838c152ae7ec06fccc..157ff1b096086ab96ff9ddee999e1d04bdd8e9c9 100644 (file)
@@ -1,26 +1,26 @@
 <?php
-/*
- * Wrapper script redirecting user operations to correct destination
- */
+/**
+* Wrapper script redirecting user operations to correct destination.
+*/
+
 require_once("../config.php");
 
-if (empty($_POST) || empty($_POST['formaction']) || empty($_POST['id'])) {
-    die();
-}
+$formaction = required_param('formaction', PARAM_FILE);
+$id = required_param('id', PARAM_INT);
 
 // Add every page will be redirected by this script
 $actions = array(
         'messageselect.php',
         'extendenrol.php'
-    );
+        );
 
-if (array_search($_POST['formaction'], $actions) === false) {
-    die();
+if (array_search($formaction, $actions) === false) {
+    print_error('unknownuseraction');
 }
 
 if (!confirm_sesskey()) {
-    die();
+    print_error('confirmsesskeybad');
 }
 
-require_once($_POST['formaction']);
+require_once($formaction);
 ?>
\ No newline at end of file