Commit Graph

409 Commits

Author SHA1 Message Date
Frederic Massart 97bf703346 MDL-54785 files: Deprecate the support for $usepost and related 2016-06-23 12:40:51 +08:00
Frederic Massart f31567294d Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc, reversing
changes made to 58a2f0ac40.
2016-06-23 12:33:04 +08:00
Frederic Massart 055bf3ca61 Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a2.
2016-06-23 12:33:04 +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
Sam Hemelryk a13ee8e18a Merge branch 'MDL-40402-master2' of git://github.com/ankitagarwal/moodle 2013-07-09 14:42:03 +12:00
Ankit Agarwal 0601e0eef6 MDL-40402 libraries: Replace get_system_context() with context_system::instance() in core 2013-07-04 15:41:06 +08:00
Frederic Massart d802435e00 MDL-38314 repository: Delete repository instances on context deletion 2013-07-03 15:26:20 +08:00
Marina Glancy f7c588d226 MDL-39177 Discard file origin when moving/renaming a file in filemanager
Created one function that handles file update to be used from both JS and nonJS filepicker
2013-05-17 13:43:45 +10:00
Marina Glancy 0ab3070c0c MDL-39177 Original info is not preserved when overwriting a file in filemanager
original file location is used by filemanager to indicate that file is a source of reference and file the list of referencing files
2013-05-17 13:43:44 +10:00
Marina Glancy e9e32b1d88 MDL-39177 File reference is not updated when overwriting the file 2013-05-17 13:43:44 +10:00
Frederic Massart 157fd8aaef MDL-39641 repository: Correct check for uniqueness of the name 2013-05-13 17:12:37 +08:00
Frederic Massart f23d95ef84 MDL-38500 repository: Instance names must be unique 2013-05-01 16:11:44 +08:00
Damyon Wiese 7d45396306 Merge branch 'MDL-34939-master' of https://github.com/lucisgit/moodle 2013-04-24 15:01:35 +08:00
Rajesh Taneja 1fe56a2a00 MDL-38851 Administration: Fixed setType in admin section 2013-04-19 15:18:33 +08:00
Eloy Lafuente (stronk7) d10d607e8c Merge branch 'MDL-39151-master' of git://github.com/FMCorz/moodle 2013-04-17 02:01:16 +02:00
Frederic Massart 5ab1b98274 MDL-39151 repository: Do not filter repository listing on manage pages 2013-04-16 14:43:51 +08:00
Marina Glancy f6812f575f MDL-39111 check repository instance context instead of repository usage context (following MDL-34346) 2013-04-16 13:28:42 +10:00
Ruslan Kabalin ef7dd02cc7 MDL-34939: Fix clamdscan permissions-related issues
Use --fdpass parameter that passes the file descriptor permissions to clamd,
which allows to scan given file irrespective of directory and file
permissions. Changing file permissions is not required.
2013-04-15 10:30:36 +01:00
Marina Glancy 118ca9e96d MDL-34346 Cache retrieved repositories 2013-04-08 11:00:22 +10:00
Marina Glancy cfb713519d MDL-34346 Correctly set repository current context 2013-04-08 11:00:22 +10:00