Commit graph

259 commits

Author SHA1 Message Date
Jerome Mouneyrac
3f308ae916 MDL-35666 remove uninstall protocol option 2013-04-22 12:02:39 +08:00
David Mudrák
7b1e0645c1 MDL-39249 Fix typo in available_update_deployer class
I have accidentally spotted this typo while working on this branch. It
has never caused any harm as both parameters callerurl and returnurl are
always passed. Blame copy/pasting of code blocks.
2013-04-20 03:01:36 +02:00
David Mudrák
5d7a4bab3f MDL-39249 Return to the correct page after successful update deployment
The method available_update_deployer::make_execution_widget() used to
have hard-coded return URL. Now it accepts the return URL as the second
parameter and passes it to the mdeploy.php utility.

The callerurl parameter is now correctly passed and used.
2013-04-20 03:00:19 +02:00
David Mudrák
badf464792 MDL-39148 Non-installed plugins cannot be uninstalled
If the plugin has been only deployed to the disk without installing into
the database, do not allow going through the uninstallation procedure.
Not only it does not have much sense. But it can also lead to some
tricky situation due to dependencies. Better to block it and wait till
the plugin is either fully installed or removed from the disk.
2013-04-19 11:24:43 +02:00
Dan Poltawski
73f5a0d864 MDL-39021 pluginlib: theme_simple is a core plugin
Don't list as an add-on.
2013-04-17 12:27:24 +01:00
Dan Poltawski
c6101ef441 Merge branch 'MDL-39087-plugins-uninstall' of git://github.com/mudrd8mz/moodle 2013-04-17 12:09:20 +01:00
Petr Škoda
ca117d1e5b MDL-34674 add CTRL+right click hint to tinymce context menus 2013-04-16 08:37:21 +02:00
David Mudrák
3ca1b54642 MDL-39087 Use progress_trace class to display uninstallation progress
This is much better API than using the array passed by reference. At the
moment, it is pretty hacky as it abuses text_progress_trace to output
raw HTML echoed by uninstall_plugin() but that will be improved later
while moving the logic out of that function into the plugin_manager.
2013-04-12 04:02:28 +02:00
David Mudrák
ccc6c15fd2 MDL-39087 Fix plugin_manager::can_uninstall_plugin() implementation
There was a false positive result for subplugin required by other
subplugin. See the unit test.
2013-04-12 03:23:47 +02:00
David Mudrák
73658371eb MDL-39087 Simplify get_uninstall_url() interpretation
The get_uninstall_url() method of all subclasses of plugininfo_base
class is now expected to always return moodle_url. Subclasses can use
the new method is_uninstall_allowed() to control the availability of the
'Uninstall' link at the Plugins overview page (previously they would do
it by get_uninstall_url() returning null). By default, URL to a new
general plugin uninstall tool is returned. Unless the plugin type needs
extra steps that can't be handled by plugininfo_xxx::uninstall() method
or xmldb_xxx_uninstall() function, this default URL should satisfy all
plugin types.

The overall logic is implemented in plugin_manager::can_install_plugin()
that respects the plugininfo class decision and vetoes it in certain
cases (typically when plugin or its subplugin is required by some other
plugin).
2013-04-12 01:44:35 +02:00
David Mudrák
d7d48b4091 MDL-39087 Add new helper methods to the plugin_manager API
These are mainly intended for callers that had to iterate over
get_plugins() result manually.
2013-04-12 01:44:34 +02:00
David Mudrák
c6f4c88ffb MDL-39087 Offer deleting for standard plugins if possible, too
The plugin_manager::is_plugin_folder_removable() method should do just
one thing and do it well. Also, as was raised during the peer-review,
there should not be technical differences between standard plugins and
add-ons.
2013-04-12 01:42:58 +02:00
David Mudrák
86a862cdc2 MDL-39087 Add missing unit tests for the plugin_manager
This patch improves and adds unit tests for the plugin_manager class.
These unit tests cover the existing functionalities. Tests for the
new features related directly with MDL-38259 will be added in a separate
commit (to make it clear what's related to it).
2013-04-12 01:42:58 +02:00
David Mudrák
7a46a55d00 MDL-39087 Fix plugin_manager::plugin_name() implementation
This is not directly related to the issue. However, it turned out that
if this method was called on plugin_manager without loaded plugins, it
would throw an error. This new implementation uses cleaner access to the
plugininfo subclass.
2013-04-12 01:42:58 +02:00
David Mudrák
436d94478d MDL-39087 Implement a common interface for uninstalling general plugin
Plugins may use this general tool for uninstallation and eventually
removal of the deployed source code. At the moment, this is implemented
as a wrapper for the core function uninstall_plugin() with an extra hook
in the relevant plugin info subclass.

For non-standard add-ons, the tool can remove the deployed plugin source
code as well, if the web server has required write permissions. Ideally,
all add-ons installed via the new tool_installaddon should be removable
via the web interface as well.
2013-04-12 01:42:58 +02:00
David Mudrák
0b733dd9e2 MDL-39087 Clarify plugininfo_base::get_uninstall_url() return value
The method now returns null if there should be no 'Uninstall' link at
the Plugins management screen. For non-standard add-ons the method now
returns URL to a general uninstall tool.

Plugin info subclasses can still override the method to provide URL to
their own UI for uninstalling. If the plugin type wants to use the
general uninstall tool also for standard plugins, it should override
this method and explicitly return $this->get_default_uninstall_url().
Otherwise, the 'Uninstall' link will be provided for add-ons only.
2013-04-12 01:42:58 +02:00
David Mudrák
803738ea41 MDL-39056 Use new version of API when fetching available updates info 2013-04-09 17:07:30 +02:00
Dan Poltawski
6833c6d901 Merge branch 'MDL-38509-tool-installaddon' of git://github.com/mudrd8mz/moodle 2013-04-03 11:28:49 +08:00
Damyon Wiese
29c1fb339d MDL-38016 Theme Bootstrap - Add bootstrap to standard themes list. 2013-04-03 10:26:12 +08:00
Damyon Wiese
2188a69799 MDL-35073 Badges - Set of minor fixes for issues found during integration 2013-04-02 15:55:21 +08:00
David Mudrák
2459758b30 MDL-38509 Mark the new installaddon admin tool as the standard plugin 2013-03-28 11:54:05 +01:00
David Mudrák
b8efcb9233 MDL-38509 Implement new plugin_manager::plugintype_name()
This has exactly the same behaviour as the existing
plugintype_name_plural() method, but returns the singular form of the
plugin type (such as 'Activity module').
2013-03-28 11:54:05 +01:00
David Mudrák
ce1a0d3cd8 MDL-38509 Implement new plugin_manager::get_plugin_types()
This new method just takes the result of the core get_plugin_types() and
re-orders the plugin types in the same way as they are displayed at the
Plugins overview screen.
2013-03-28 11:54:05 +01:00
Damyon Wiese
c2eb74df47 Merge branch 'MDL-34401-muc-pluginlib' of git://github.com/mudrd8mz/moodle
Conflicts:
	lib/db/caches.php
	version.php
2013-03-20 14:08:55 +08:00
Eloy Lafuente (stronk7)
613eebfc6a MDL-38212 fix related unit tests.
For statslib tests was enough to require cronlib.php as
far as all the tests there are using ob-capture / output
expectations, so the new function does not bork anything.

For pluginlib tests finally the use was deleted because
it's a part of cron not interesting (should be always "cheap")
and to keep it there we should be adding a bunch of output
expectations under some cases, for practically nothing.
2013-03-12 19:35:16 +01:00
Eloy Lafuente (stronk7)
63b738a177 Merge branch 'MDL-38212' of git://github.com/timhunt/moodle 2013-03-12 16:02:39 +01:00
David Mudrák
9d6eb027b4 MDL-34401 Cache the contents of version.php files
This saves many inclusions of version.php files.
2013-03-11 12:51:30 +01:00
David Mudrák
ad3ed98b05 MDL-34401 Replace ad-hoc plugin request caches with proper application caches
Data cached in these caches change only at well defined places (during
need for upgrade checks, at the plugin management screen etc). So it
makes sense to use proper application caches instead of request caches.

This saves couple of database queries at almost every page in Moodle.
2013-03-11 12:48:53 +01:00
David Mudrák
b8a6f26ee3 MDL-34401 Replace static variables in pluginlib with ad-hoc request caches
Where the static variable was not really needed (as in case of arrays
defined by the hard-coded list of items), non-static variable is used as
I believe that there is no real performance gain.
2013-03-11 12:48:07 +01:00
Rajesh Taneja
5c9e8898c0 MDL-35716: Added performance to core plugin list 2013-03-11 14:30:02 +08:00
Tim Hunt
658b9372ee MDL-38212 cron: display time and memory usage before each task.
This helps diagnose problems.

Also, call gc_collect_cycles between tasks, which may reduce the
frequency of out-of-memory errors.
2013-03-08 10:24:41 +00:00
Jean-Michel Vedrine
4f315786e8 MDL-37897 Remove useless Blackboard question import format 2013-02-28 17:46:29 +01:00
Petr Škoda
bdbcb6d7fa MDL-38121 tell admins when plugin installed into wrong dir 2013-02-23 18:16:42 +01:00
David Monllao
ff2ec29bb1 MDL-37046 behat: Added to standard plugins list 2013-01-29 08:40:38 +08:00
Petr Škoda
c7a3399041 MDL-37257 improve enrol overview page and enrol plugin info 2013-01-19 13:14:41 +01:00
Petr Škoda
8d21130267 MDL-29996 cleanup filter plugin info 2013-01-07 12:42:13 +01:00
Sam Hemelryk
b8459c0267 MDL-29996 filters: fixed bug when upgrading filter plugin names 2013-01-07 17:40:41 +13:00
Petr Škoda
0662bd677c MDL-29996 remove deprecated stuff from filter code 2012-12-30 17:02:18 +01:00
David Mudrák
fa1415f193 MDL-37003 Fix repeated line in update notification email
There was a problem experienced after 2.4.0 release because the version
of the 2.4.0 release was the same as 2.5dev release. So the version
value matched twice in the loop and the line was repeated in the email.
2012-12-06 01:50:48 +01:00
David Mudrák
d2713eff38 MDL-36943 Do not notify about already installed updates
Before this patch, the available_update_checker::cron_notifications()
method accessed the availableupdates property. But for plugins, that property
basically contains the most recent version available. So we were missing
the check against the actual version installed.

The fix was simple - obtain available updates via the available_updates()
method that performs the check.
2012-12-06 01:50:42 +01:00
Dan Poltawski
0dcae7cd14 MDL-36950 pluginlib - add MDL to comment 2012-12-03 15:47:35 +08:00
David Mudrák
63def597a6 MDL-36950 Pass the Moodle proxy setting to the mdeploy.php utility 2012-11-30 16:12:34 +01:00
David Mudrák
30e2682756 MDL-36903 Pre-check the ZIP download before executing the mdeploy.php utility
This patch makes Moodle call HTTP HEAD method via cURL to see if the ZIP
is expected to be downloadable by mdeploy.php. This is mainly intended
for SSL certificates check.
2012-11-30 16:09:58 +01:00
David Mudrák
4785c45dd8 MDL-36903 Verify the SSL certificate of available updates provider
From now on, Moodle verifies the available updates provider server. To
make it work, either there must be a valid CA certificate available in
the operating system, or the administrator has to upload the valid CA
certificate to moodledata/moodleorgca.crt (PEM format) file manually.
2012-11-30 16:09:58 +01:00
David Mudrák
40a9c2e531 MDL-36720 Fetch available updates info via HTTPS 2012-11-20 15:51:35 +01:00
Dan Poltawski
f58c96f842 Merge branch 'MDL-36369' of git://github.com/timhunt/moodle 2012-11-14 09:29:51 +08:00
Dan Poltawski
59d332ea71 Merge branch 'MDL-36494-invalid-update-debugging' of git://github.com/mudrd8mz/moodle 2012-11-14 08:31:29 +08:00
Tim Hunt
837e181225 MDL-36369 qtypes and qbehaviour settings permissions.
The correct policy is that users with moodle/question:config can set the
default settings for particular qtypes. However, it requires
moodle/site:config in order to do manage qbehaviours or manage qtypes.
2012-11-13 16:07:28 +00:00
David Mudrák
a22de4ce99 MDL-36494 Do not display a debugging message about invalid update info
It turned out that this well-meant debugging message just caused a lot
of false alarm with no good reason. It seems to be better just ignore it
at the moment.
2012-11-13 11:24:55 +01:00
Marina Glancy
3776335ce2 MDL-35260 Course formats may have settings, be enabled, disabled and uninstalled 2012-11-10 15:34:29 +08:00