MDL-28279 remove flash client version blocking

Everybody is responsible for upgrades of Flash, there is no excuse any more.
This commit is contained in:
Petr Skoda 2011-07-10 11:03:02 +02:00
parent f6f6138379
commit cdbd37126d
12 changed files with 0 additions and 129 deletions

View File

@ -81,7 +81,6 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_configcheckbox('loginhttps', get_string('loginhttps', 'admin'), get_string('configloginhttps', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('cookiesecure', get_string('cookiesecure', 'admin'), get_string('configcookiesecure', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('cookiehttponly', get_string('cookiehttponly', 'admin'), get_string('configcookiehttponly', 'admin'), 0));
$temp->add(new admin_setting_configtext('excludeoldflashclients', get_string('excludeoldflashclients', 'admin'), get_string('configexcludeoldflashclients', 'admin'), '10.0.12', PARAM_TEXT));
$ADMIN->add('security', $temp);

View File

@ -207,7 +207,6 @@ $string['configenabletrusttext'] = 'By default Moodle will always thoroughly cle
$string['configenablewebservices'] = 'Web services enable other systems to log in to this Moodle and perform operations. For extra security this feature should be disabled unless you are really using it.';
$string['configenablewsdocumentation'] = 'Enable auto-generation of web services documentation. A user can access to his own documentation on his security keys page {$a}. It displays the documentation for the enabled protocols only.';
$string['configerrorlevel'] = 'Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.';
$string['configexcludeoldflashclients'] = 'Some versions of the Adobe Flash plugin are known to be vulnerable to attacks from malicious Flash content. You can specify a minimum supported version here, and Moodle will not show Flash files to users with lower versions. Instead they will see an alternate Flash file telling them how to upgrade. Leave this empty to disable all checks.';
$string['configextendedusernamechars'] = 'Enable this setting to allow students to use any characters in their usernames (note this does not affect their actual names). The default is "false" which restricts usernames to be alphanumeric lowercase characters, underscore (_), hyphen (-), period (.) or at symbol (@).';
$string['configextramemorylimit'] = 'Some scripts like search, backup/restore or cron require more memory. Set higher values for large sites.';
$string['configextrauserselectorfields'] = 'Select which fields are searched and displayed, in addition to full names, when selecting users, for example when assigning roles or when adding users to a group. For security reasons, it is recommended that the username field is NOT selected.';
@ -514,7 +513,6 @@ $string['errorsetting'] = 'Could not save setting:';
$string['errorwithsettings'] = 'Some settings were not changed due to an error.';
$string['everyonewhocan'] = 'Everyone who can \'{$a}\'';
$string['exceptions'] = 'exceptions';
$string['excludeoldflashclients'] = 'Required Flash player version';
$string['experimental'] = 'Experimental';
$string['experimentalsettings'] = 'Experimental settings';
$string['extendedusernamechars'] = 'Allow extended characters in usernames';

View File

@ -663,10 +663,6 @@ $string['findmorecourses'] = 'Find more courses...';
$string['firstaccess'] = 'First access';
$string['firstname'] = 'First name';
$string['firsttime'] = 'Is this your first time here?';
$string['flashlinkmessage'] = 'Please upgrade your Flash player now:';
$string['flashupgrademessage'] = 'The Flash plugin is required to play this content, but the version you have is too old.
You may need to log out and log in back after upgrade.';
$string['folder'] = 'Folder';
$string['folderclosed'] = 'Closed folder';
$string['folderopened'] = 'Opened folder';

View File

@ -1,30 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// //
// This file is part of Moodle - http://moodle.org/ //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// //
// Moodle is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Moodle is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. //
// //
///////////////////////////////////////////////////////////////////////////
/*
* Library for flash player version detection
*/
M.core_flashdetect = {};
M.core_flashdetect.init = function(Y) {
var flashversion = swfobject.getFlashPlayerVersion();
Y.io(M.cfg.wwwroot+'/login/environment.php?sesskey='+M.cfg.sesskey+'&flashversion='+flashversion.major+'.'+flashversion.minor+'.'+flashversion.release, {method: "POST"});
};

Binary file not shown.

Binary file not shown.

View File

@ -1,30 +0,0 @@
<?php
///////////////////////////////////////////////////////////////////////////
// //
// This file is part of Moodle - http://moodle.org/ //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// //
// Moodle is free software: you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation, either version 3 of the License, or //
// (at your option) any later version. //
// //
// Moodle is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. //
// //
///////////////////////////////////////////////////////////////////////////
/*
* This file displays some variable for the flashupgrade.swf
* the variable contain the translated message to displayed into the flashupgrade.swf ("Please update you flash ...")
* NOTE: flash can load variable from html (variable1=value&variable2=value2)
*/
require('../../config.php');
require_login();
echo 'alertmessage='.get_string('flashupgrademessage').'&linkmessage='.get_string('flashlinkmessage');
?>

View File

@ -7035,7 +7035,6 @@ function get_core_subsystems() {
'filepicker' => NULL,
'files' => 'files',
'filters' => NULL,
'flashdetect' => NULL,
'fonts' => NULL,
'form' => 'lib/form',
'grades' => 'grade',

View File

@ -313,12 +313,6 @@ class core_renderer extends renderer_base {
$jsurl = $this->page->theme->javascript_url(false);
$this->page->requires->js($jsurl);
// Perform a browser environment check for the flash version. Should only run once per login session.
if (!NO_MOODLE_COOKIES && isloggedin() && !empty($CFG->excludeoldflashclients) && empty($SESSION->flashversion)) {
$this->page->requires->js('/lib/swfobject/swfobject.js');
$this->page->requires->js_init_call('M.core_flashdetect.init');
}
// Get any HTML from the page_requirements_manager.
$output .= $this->page->requires->get_head_code($this->page, $this);

View File

@ -448,11 +448,6 @@ class page_requirements_manager {
'requires' => array('base', 'node', 'event', 'node-event-simulate'),
'fullpath' => '/message/module.js');
break;
case 'core_flashdetect':
$module = array('name' => 'core_flashdetect',
'fullpath' => '/lib/flashdetect/flashdetect.js',
'requires' => array('io'));
break;
case 'core_group':
$module = array('name' => 'core_group',
'fullpath' => '/group/module.js',

View File

@ -1,35 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script can set environment variables in the current session
*
* @package core
* @subpackage auth
* @copyright 2009 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require('../config.php');
require_sesskey();
if (!empty($SESSION)) {
if ($flashversion = optional_param('flashversion', false, PARAM_TEXT)) { // eg 10.0.32
$SESSION->flashversion = $flashversion;
}
}

View File

@ -56,21 +56,6 @@ list($context, $course, $cm) = get_context_info_array($contextid);
$fs = get_file_storage();
// If the file is a Flash file and that the user flash player is outdated return a flash upgrader MDL-20841
$mimetype = mimeinfo('type', $args[count($args)-1]);
if (!empty($CFG->excludeoldflashclients) && $mimetype == 'application/x-shockwave-flash'&& !empty($SESSION->flashversion)) {
$userplayerversion = explode('.', $SESSION->flashversion);
$requiredplayerversion = explode('.', $CFG->excludeoldflashclients);
if (($userplayerversion[0] < $requiredplayerversion[0]) ||
($userplayerversion[0] == $requiredplayerversion[0] && $userplayerversion[1] < $requiredplayerversion[1]) ||
($userplayerversion[0] == $requiredplayerversion[0] && $userplayerversion[1] == $requiredplayerversion[1]
&& $userplayerversion[2] < $requiredplayerversion[2])) {
$path = $CFG->dirroot."/lib/flashdetect/flashupgrade.swf"; // Alternate content asking user to upgrade Flash
$filename = "flashupgrade.swf";
send_file($path, $filename, O, 0, false, false, 'application/x-shockwave-flash'); // Do not cache
}
}
// ========================================================================================================================
if ($component === 'blog') {
// Blog file serving