~ubuntu-branches/ubuntu/breezy/moodle/breezy

« back to all changes in this revision

Viewing changes to admin/filters.php

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2005-10-13 02:00:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051013020059-y2qcyo41t7nqppcg
Tags: 1.5.2-1ubuntu1
* Resync with debian (security update)
* changed dependencys to php5
* changed apache dependency to apache2 
* References
  CAN-2005-2247

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?PHP // $Id: filters.php,v 1.6.4.1 2004/10/03 00:28:22 stronk7 Exp $
 
1
<?PHP // $Id: filters.php,v 1.11 2005/05/16 19:09:30 stronk7 Exp $
2
2
      // Allows the admin to create, delete and rename course categories
3
3
 
4
4
    require_once("../config.php");
16
16
        error("Only administrators can use this page!");
17
17
    }
18
18
 
19
 
    if (!confirm_sesskey()) {
20
 
        error(get_string('confirmsesskeybad', 'error'));
21
 
    }
22
 
 
23
19
    if (!$site = get_site()) {
24
20
        error("Site isn't defined!");
25
21
    }
36
32
    $stractive = get_string("active");
37
33
    $strinactive = get_string("inactive");
38
34
    $strcachetext = get_string("cachetext", "admin");
39
 
    $strconfigcachetext = get_string("configcachetext");
 
35
    $strconfigcachetext = get_string("configcachetext", 'admin');
40
36
    $strfilteruploadedfiles = get_string("filteruploadedfiles", "admin");
41
 
    $strconfigfilteruploadedfiles = get_string("configfilteruploadedfiles");
 
37
    $strfilterall = get_string("filterall", "admin");
 
38
    $strconfigfilteruploadedfiles = get_string("configfilteruploadedfiles", 'admin');
 
39
    $strconfigfilterall = get_string("configfilterall", "admin");
42
40
 
43
41
    print_header("$site->shortname: $strmanagefilters", "$site->fullname", 
44
42
                 "<a href=\"index.php\">$stradministration</a> -> ".
86
84
/// If data submitted, then process and store.
87
85
 
88
86
    if (!empty($options)) {
89
 
            if ($config = data_submitted()) {  
 
87
        if (($config = data_submitted()) && confirm_sesskey()) {  
90
88
            unset($config->options);
 
89
            unset($config->sesskey);
91
90
            foreach ($config as $name => $value) {
92
91
                set_config($name, $value);
93
92
            }
94
93
        }
95
94
    }
96
95
 
97
 
    if (!empty($add) and !empty($uselect)) {
 
96
    if (!empty($add) and !empty($uselect) and confirm_sesskey()) {
98
97
        $selectedfilter = $uselect;
99
98
        if (!in_array($selectedfilter, $installedfilters)) {
100
99
            $installedfilters[] = $selectedfilter;
101
100
            set_config("textfilters", implode(',', $installedfilters));
102
101
        }
103
102
 
104
 
    } else if (!empty($remove) and !empty($iselect)) {
 
103
    } else if (!empty($remove) and !empty($iselect) and confirm_sesskey()) {
105
104
        $selectedfilter = $iselect;
106
105
        foreach ($installedfilters as $key => $installedfilter) {
107
106
            if ($installedfilter == $selectedfilter) {
110
109
        }
111
110
        set_config("textfilters", implode(',', $installedfilters));
112
111
 
113
 
    } else if ((!empty($up) or !empty($down)) and !empty($iselect)) {
 
112
    } else if ((!empty($up) or !empty($down)) and !empty($iselect) and confirm_sesskey()) {
114
113
 
115
114
        if (!empty($up)) {
116
115
            if ($allfilters[$iselect]) {