425 Commits

Author SHA1 Message Date
Sara Arjona
3d0541c03a Merge branch 'MDL-68758-master' of git://github.com/peterRd/moodle 2020-05-27 09:46:47 +02:00
Peter Dias
31788c8cf2 MDL-68758 core_repository: Allow ability to download files on all views. 2020-05-27 14:20:15 +08:00
Tom Dickman
4399e4759a MDL-45184 tool_licenses: Add custom licenses
This feature adds an admin tool for creating custom licenses.
Now custom licenses can be added and amended in Moodle, and the site
default can be set to a custom license.

Core licenses remain hard-coded and are uneditable, so they will always
require update within Moodle core updates, and maintain their
internationalisation through core language strings.

This also includes fundamental changes to the license API including
the addition of license caching and deprecation of no longer required
admin settings for license management.
2020-05-26 12:08:05 +10:00
Peter
a216d86c6c MDL-33671 core: Add ability to download selected items
Utilise the new checkbox-toggleall functionality
2020-03-03 07:20:35 +08:00
Peter
2f03923602 MDL-33671 core: Allow for bulk delete of files
* Enable bulk delete in a details view
* Behat tests for new functionality
* Unit test for new function
2020-03-03 07:20:35 +08:00
Adrian Greeve
f1d1a60e0a MDL-61131 repositories: Added a key to verify incoming urls. 2018-01-09 11:34:37 +01:00
Adrian Greeve
33e385a5fb MDL-37757 repositories: Deleting a repository deletes files.
If the user decides to remove a repository all of the linked
files are now deleted along with file references. This was causing
problems such as the course page displaying an error with no recourse
to fix the problem.
2017-11-16 14:46:40 +08:00
Cameron Ball
03756f0bdb
MDL-59700 filestorage: Rework repositories to avoid add_file_to_pool
For historical reasons repositories need to call add_file_to_pool
to sync file records. However now that a before_file_created hook
has been added additional information is needed by add_file_to_pool.

Ideally add_file_to_pool and friends will become private/protected,
so we need to remove all uses of it in core.

This patch adds some new methods to the file class to allow syncing
to be managed internally by the file and the file_storage class.
2017-08-07 15:50:15 +08:00
Jake Dallimore
84fb93a77e Merge branch 'MDL-58297-master' of git://github.com/andrewnicols/moodle 2017-04-11 10:49:07 +08:00
Andrew Nicols
e6a4780452 MDL-58297 core: Update to use new hashing functions 2017-04-07 10:40:23 +08:00
Damyon Wiese
eb47ad4a6e MDL-58220 repository: More docs / comments
More docs / comments for the reference_file_selected function used by controlled links.
2017-04-03 13:43:26 +08:00
Damyon Wiese
141ee541ca MDL-58219 repository: Change how controlled links work
Files are copied to the system user as soon as they are uploaded. Write access is then controlled when
serving links to the file.

Part of MDL-58220
2017-04-03 13:41:19 +08:00
Damyon Wiese
151b0f9409 MDL-58132 repositories: Controlled link file type
This introduces a new "controlled link" file type where the file is not
stored in Moodle - but Moodle will control the access permissions on the file.

Plugins can "freeze" a filearea which means Moodle will take ownership of all the remote
files of this type.

When accessing a file, if the "filebrowser" infomation indicates the current user can write to the file, they
will be granted temporary write access.

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
989e14fea0 MDL-58128 googledocs: Support reference files.
Add options so the admin can control the types of files this repository can support (and the default).

Part of MDL-58220
2017-04-03 13:40:13 +08:00
Damyon Wiese
663640f5b3 MDL-40759 icons: convert uses of pix_url to pix_icon
Also change filepicker to use scaled svgs instead of sets of custom pngs. The svgs are taken from font-awesome.
2017-03-17 15:52:17 +08:00
Andrew Nicols
16a34ae189 MDL-46375 core_files: Split parts of file_storage into new file system
This change moves all operations which deal with the fetching/updating, or
setting of files from the file_storage class into a new file_system class.

A new file_system can be specified in the config.php and used to replace
all relevant methods in order to move the file system component to an
alternative solution.
2017-02-14 08:42:28 +08:00
Frederic Massart
df52c272cf
MDL-54785 files: Deprecate the support for $usepost and related 2016-06-23 12:41:03 +08:00
Frederic Massart
048f8073d1
Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc1992f01eadfdef02de6e56ffad8e9f, reversing
changes made to 58a2f0ac40f24da9c9955110902f8e14cd0d8419.
2016-06-23 11:51:44 +08:00
Frederic Massart
796f86f753
Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a263f7003207a382251de900341db92c.
2016-06-23 11:51:44 +08:00
Andrew Nicols
388a8dbc4f MDL-54584 repository: Set a default filename in prepare_file 2016-05-16 11:07:38 +08:00
Andrew Nicols
7e4d43e1a2 MDL-54110 repositories: Whitespace, Typo + unit test fixes 2016-05-11 10:39:40 +08:00
Mark Johnson
121b67411f MDL-54110 repositories: Allow repositories to ignore post_max_size
Repositories can now override usespost() if they don't upload using POST
requests. This restores the ability of users with
moodle/course:ignorefilesizelimits to upload files of unlimited size
lost in MDL-44626.
2016-05-10 16:10:24 +01:00
Ben Tindell
a2fb838e82 MDL-53577 repository: Added maxbytes error message
Changing the error message that is displayed to users when they
upload a file that is greater than the maximum upload size. Does not
include all upload cases; focuses on those most used by students.
2016-04-04 15:33:40 -05:00
Ruslan Kabalin
11362ae3ff MDL-50887 antivirus: Use namespace referenced classes. 2016-02-29 09:31:09 +00:00
Ruslan Kabalin
1a980fdadb MDL-50887 antivirus: Fix style issues. 2016-02-25 09:55:45 +00:00
Ruslan Kabalin
375223c6db MDL-50887 antivirus: Deprecate functions no longer required.
This also removes abandoned strings that are no longer in use (since
1e23ff2 landed).
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
001feb6649 MDL-50887 antivirus: Refactor antivirus scanning to use new plugin.
This patch moves existing scanning functionality to plugin level. It does
not add anything new, just refactors the existing functionality.

AMOS BEGIN
  MOV [clamemailsubject,core],[emailsubject,antivirus]
  MOV [clamfailed,core],[clamfailed,antivirus_clamav]
  MOV [clamlost,core],[invalidpathtoclam,antivirus_clamav]
  MOV [clamunknownerror,core],[unknownerror,antivirus_clamav]
  MOV [virusfounduser,core],[virusfounduser,antivirus]
AMOS END
2016-02-25 09:55:45 +00:00
Andrew Nicols
a9e12347b7 MDL-52217 repository: prepare_file should use per-request directory
The repository API defaults has a function, prepare_file, which is
responsible for creating a unique file to be used during the current
request.

This is usually used in the repository's get_file() function to store the
file before it is used elsewhere in the API to save the file to the
filestorage API.
It is also sometimes used to temporarily store credentials for the lifetime
of the session.

In all cases, this file is only expected to exist for the duration of the
session.

Switching to use of a per-request directory using make_request_directory()
ensures that the tempdir does not grow without control.

This commit also adds an upgrade step to remove all old temp directories
created by any repository currently installed.
2016-02-15 15:54:05 +08:00
Marina Glancy
58e5ab1bac MDL-51985 files: sync timemodified when possible 2015-10-30 14:46:09 +08:00
John Okely
e6904efc52 MDL-42166 repositories: Finalise deprecation of repository sync methods 2014-12-16 15:57:50 +08:00
Marina Glancy
e29bb97c07 MDL-45616 repositories: API changes to avoid serialized data in user input 2014-07-07 14:41:20 +08:00
Marina Glancy
56964b7948 MDL-45616 repositories: use json encoding instead of serialization 2014-07-07 14:41:20 +08:00
Marina Glancy
5ad3f3c61e MDL-45616 repositories: more clearly distinguish when we use source and when reference
Function repository::get_moodle_file() should always be called on packed reference and not on the source received from user.
Also added phpdocs to some other methods that were confusing source and reference
2014-07-07 14:41:20 +08:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Rajesh Taneja
e6e5f43efc MDL-40079 repositories: Added deprecated tags 2013-12-03 13:34:33 +08:00
Rajesh Taneja
c1b3ac4358 MDL-40079 repositories: Replaced const with configs 2013-12-02 09:41:41 +08:00
Petr Škoda
0c431257e9 MDL-42387 standardise file lifetime handling 2013-11-01 10:42:18 +01:00
Marina Glancy
873555604f MDL-42016 repository: Simplify API to sync external files
Too many functions, too different parameters, unnecessary DB queries.
All repositories developed for Moodle 2.3-2.5 will continue to work.

Also get rid of DB field files_reference.lifetime, it is not used by
anybody except repository itself.
2013-10-06 18:05:09 +11:00
Sam Hemelryk
6eef32525e Merge branch 'MDL-41907' of https://github.com/merrill-oakland/moodle 2013-09-25 10:18:30 +12:00
Sam Hemelryk
a78e39e3d3 Merge branch 'master_MDL-41580' of git://github.com/danmarsden/moodle 2013-09-25 09:27:44 +12:00
Dan Marsden
361a47d409 MDL-41580 SCORM: allow imsmanifest.xml to be used in file system repos 2013-09-24 12:08:38 +12:00
Petr Škoda
d79d5ac276 MDL-31501 rework user session architecture
List of changes:
 * New OOP API using PHP namespace \core\session\.
 * All handlers now update the sessions table consistently.
 * Experimental DB session support in Oracle.
 * Full support for session file handler (filesystem locking required).
 * New option for alternative session directory.
 * Official memcached session handler support.
 * Workaround for memcached version with non-functional gc.
 * Improved security - forced session id regeneration.
 * Improved compatibility with recent PHP releases.
 * Fixed borked CSS during install in debug mode.
 * Switched to file based sessions in new installs.
 * DB session setting disappears if DB does not support sessions.
 * DB session setting disappears if session handler specified in config.php.
 * Fast purging of sessions used in request only.
 * No legacy distinction -  file, database and memcached support the same functionality.
 * Session handler name included in performance info.
 * Fixed user_loggedin and user_loggedout event triggering.
 * Other minor bugfixing and improvements.
 * Fixed database session segfault if MUC disposed before $DB.

Limitations:
 * Session access time is now updated right after session start.
 * Support for $CFG->sessionlockloggedinonly was removed.
 * First request does not update userid in sessions table.
 * The timeouts may break badly if server hosting forces PHP.ini session settings.
 * The session GC is a lot slower, we do not rely on external session timeouts.
 * There cannot be any hooks triggered at the session write time.
 * File and memcached handlers do not support session lock acquire timeouts.
 * Some low level PHP session functions can not be used directly in Moodle code.
2013-09-21 13:11:56 +02:00
Eric Merrill
ffc8e307f3 MDL-41907 Repositories: Maintain the sortorder of a file when overwriting it. 2013-09-19 18:43:21 -04:00
Damyon Wiese
e66c84a157 Merge branch 'MDL-29954-master' of git://github.com/danpoltawski/moodle 2013-09-03 16:02:47 +08:00
Matteo Scaramuccia
a1070d3fff MDL-29218 Repository: fixed a typo in the PHPDoc 2013-09-02 23:09:24 +02:00
Matteo Scaramuccia
46d023b77a MDL-29218 Repository: $pname, get rid of all the useless code
More details in the Tracker.
2013-09-02 23:09:22 +02:00
Matteo Scaramuccia
9b64ec4dae MDL-29218 Repository: Hide the repo if repository::plugin_init returns false 2013-09-02 23:09:20 +02:00
Dan Poltawski
033d1634cc MDL-29954 repository: remove dead code
Also remove repository_attach_id() which was never used and not useful.
2013-08-28 10:52:42 +08:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Frederic Massart
a76efbcac8 MDL-38366 repository: get_option() returns proper values
Previously, even when a specific setting had to be returned, this method
would return an empty array. Now, the behaviour is the same whether
some options or none are set: if the requested setting is not found
null is returned.
2013-07-10 14:03:46 +08:00