Commit graph

388 commits

Author SHA1 Message Date
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
Frederic Massart
e42861d4fa MDL-38474 repository: Correct context when checking permissions to access a repository 2013-03-14 14:49:29 +08:00
Frederic Massart
89a9d21a15 MDL-37852 repository: Prevent undesired access to repositories settings 2013-03-05 09:56:22 +01:00
Frederic Massart
31581ae65d MDL-36426 repository: Prevent login_as() users to access private repositories 2013-03-04 02:38:35 +01:00
Frederic Massart
d7d69396b0 MDL-37641 files: Improve file name suggestion and performance 2013-02-20 08:50:40 +08:00
Dan Poltawski
0e35ba6ffc MDL-36357 cleanup - remove double semicolons 2012-11-15 09:51:26 +08:00
Frederic Massart
68acd1157e MDL-33766 files: Improved validation of areamaxbytes 2012-11-01 16:47:06 +08:00
Dan Poltawski
aed58a3da8 Merge branch 'MDL-35990-master' of git://github.com/FMCorz/moodle 2012-10-29 14:32:11 +08:00
Frederic Massart
e56de3a4d1 MDL-35990 repository: Added MOODLE_INTERNAL check and removed config inclusion 2012-10-16 14:01:29 +08:00
Matteo Scaramuccia
c67f1a342c MDL-35990 Repository Library should not include the main config.php file 2012-10-16 13:54:23 +08:00
Frederic Massart
8136753abf MDL-35892 repository: prepare_listing recursively prepares the data 2012-10-15 09:46:04 +08:00
Eloy Lafuente (stronk7)
92b75df804 Merge branch 'MDL-34945-master' of git://github.com/FMCorz/moodle 2012-09-06 20:11:53 +02:00
Eloy Lafuente (stronk7)
69689b4c3e Merge branch 'wip-MDL-34290-master' of git://github.com/marinaglancy/moodle 2012-08-29 12:11:00 +02:00
Marina Glancy
bc6f241ca2 MDL-34290 repository API: add repository function to import referenced file
it must be independed from sync_external_file because sync often does not actually download contents, it is used just to retrieve
the size of the file. Besides the timeouts for get_file and sync requests are very different.

Also add option to send_stored_file() to ignore reference and send cached contents
2012-08-29 11:56:15 +08:00
Marina Glancy
72a5655566 MDL-34290 repository API: add timeout to get_file and throw exception
- get_file should have a request timeout and throw an exception with the details (i.e. timeout reached) if download can
not be completed
- corrected phpdocs
2012-08-29 11:56:14 +08:00
Marina Glancy
59cb759850 MDL-34290 repository API: do not confuse source and reference
make sure that repository function get_file_source_info receives as argument the source of the file,
and get_file receives a reference;
reference is a value of DB field files_reference.reference and result of get_file_reference(source).
Fix dropbox as the only repository that have different values in those fields;
also added information about user in dropbox reference and original
2012-08-29 11:56:14 +08:00
Marina Glancy
2d222a3243 MDL-34290 repository API: allow get_file_by_reference return only filesize
we want to allow repositories to perform quick synchronisation, without downloading the file. In this case they return
only filesize, without the contenthash
2012-08-29 11:56:07 +08:00
Ankit Agarwal
5fbe2118bc MDL-34549 libraries: Changing strictness of context::instance_by_id() when required 2012-08-24 11:30:35 +08:00
Ankit Agarwal
d197ea4300 MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id() 2012-08-24 11:30:10 +08:00
Frederic Massart
2c86955027 MDL-34945 Repository: Creating an instance requires the user to have the permission to view it 2012-08-24 10:55:22 +08:00
Paul Nicholls
ec3eaa2c38 MDL-33640 - change $templatesinitialized to an array; improve naming and automate use of template
* $templatesinitialized is now an array, so that subsequent calls to initialise_filepicker which request different repositories will include those (and only those) templates which it requires but have not yet been included
* The get_template method has also been renamed to get_upload_template (and the template to "uploadform_" followed by the repository type), since it only applies to upload forms
* If a plugin provides a get_upload_template method, the template it returns will now automatically be used instead of the standard uploadform template when generating an upload form
2012-08-09 09:47:40 +12:00
Paul Nicholls
013cf2878c MDL-33640 - Add ability to use custom filepicker templates
Allow repository plugins to register a template by defining a get_template() method, coupled with the ability to request the template be used by create_upload_form() instead of the standard 'uploadform' template.  The template is automatically registered using the plugin's name, and core templates will override any which clash; this also means that a theme can override these templates in a custom renderer if it wants to.
2012-08-08 13:50:47 +12:00