weekly release 2.4.6+
[moodle.git] / user / action_redir.php
blob21359317a05cb2083cb2313c156fc6a628f7b87c
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 /**
19 * Wrapper script redirecting user operations to correct destination.
21 * @copyright 1999 Martin Dougiamas http://dougiamas.com
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 * @package user
26 require_once("../config.php");
28 $formaction = required_param('formaction', PARAM_FILE);
29 $id = required_param('id', PARAM_INT);
31 $PAGE->set_url('/user/action_redir.php', array('formaction'=>$formaction,'id'=>$id));
33 // Add every page will be redirected by this script
34 $actions = array(
35 'messageselect.php',
36 'addnote.php',
37 'groupaddnote.php',
40 if (array_search($formaction, $actions) === false) {
41 print_error('unknownuseraction');
44 if (!confirm_sesskey()) {
45 print_error('confirmsesskeybad');
48 require_once($formaction);