29 Commits

Author SHA1 Message Date
Meirza
e95540d9ff MDL-77341 mnet: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-20 21:37:01 +07:00
Eloy Lafuente (stronk7)
621d75dbce MDL-76053 admin: Remove various warnings related to MNet
This partially reverts MDL-73270, where some useful environmental
checks and notifications in the admin UI were added to inform
about different parts of Moodle relying on the "unsupported"
php-xmlrpc extension.

Since then, some changes have happened in core, only available
for Moodle 4.1 and up (see the MDL-70889 mini-epic). Namely:

  - MNet (SSO, roaming, auth, enrol and Mahara portfolio) are not
    using the php-xmlrpc extension anymore, but a pure php library.
  - The xmlrpc webservices protocol, has been move from core to
    the plugins directory, although it continues using the php-xmlrpc
    extension.

Because of that here we are removing all the checks and notifications
related with MNet (not using the extension anymore), but keeping the
webservice plugin ones (still using the extension). Surely if some day the
protocol stops using the extension, we'll be able to remove the
corresponding checks too. But that's future.

Note the associated lang strings have been also removed (not deprecated)
because they were highly specific and hardly reusable:
  - xmlrpcmaharaenabled
  - xmlrpcmnetauthenticationenabled
  - xmlrpcmnetenabled

And very same applies, because MNet doesn't contain anything deprecated
or not supported anymore, hence, straight deletion, to the function:
  - mnet_get_deprecation_notice()

Also, related tests using any of the removed stuff above have been deleted.

In the other side, the "check_xmlrpc_usage" continues existing and
being used both by environment checks and admin notifications but,
as commented above, now it only looks for the xmlrpc webservice
protocol now.
2022-11-08 16:49:18 +01:00
Eloy Lafuente (stronk7)
856b593796 MDL-75645 mnet: Stop caching OpenSSLAsymmetricKey keys
The mnet_environment->keypair array contains the following
elements (and more, just focussing on these):
- keypair_PEM : textual representation of the private key.
- certificate : textual representation of the public key.
- privatekey  : OpenSSLAsymmetricKey representation of the private key,
                generated from keypair_PEM. See get_private_key().
- publickey   : OpenSSLAsymmetricKey representation if the public key,
                generated from certificate. See get_public_key().

The last 2 elements in the array are only used as "caching", to avoid
having to call to openssl_pkey_get_private() and
openssl_pkey_get_public() to convert from the textual representation
to the OpenSSLAsymmetricKey representation that is the one required
by a number of openssl functions.

Problems arrive when, as part of the MNet protocol, the mnet_environment
is serialised, because, since PHP 8.0 those OpenSSLAsymmetricKey objects
aren't serialisable any more.

So, as far as they are only used for internal caching it's perfectly ok
to remove the caching bits and use the openssl_pkey_get_xxx() methods
to calculate them under demand.

The alternative to this would be to implement into the mnet_environment
some custom serialisation, skipping those OpenSSLAsymmetricKey
instances, using __sleep(), the Serializabla interface or __serialize(),
but that seems unnecessary because, as explained above, the uses are
really limited and easily replaceable.

That's what this patch does.
2022-10-18 14:30:50 +02:00
Huong Nguyen
683375af8b MDL-73270 admin: Warn about xmlrpc webservice protocol enabled
Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
2022-01-28 09:32:08 +07:00
Marina Glancy
4a89e83b80 MDL-52285 auth: use __construct() for constructors 2015-12-10 13:40:42 +08:00
Penny Leach
bac44e6dc9 mnet MDL-19239 changed all instances of fetching config from db to use get_config 2010-01-11 22:53:11 +00:00
Petr Skoda
1d42298086 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 12:22:45 +00:00
tjhunt
31a9987770 install: MDL-19610 encapsulate empty($CFG->rolesactive) checks in a during_initial_install() function. 2009-06-24 09:17:56 +00:00
skodak
1caea91efb MDL-17457 moved a lot of code into lib/db/install.php + other refactoring and cleanup 2009-01-11 09:41:48 +00:00
skodak
eb7f89bc15 MDL-17419 misconfigured openssl extension blocks installation - openssl.cnf missing?? 2008-11-28 12:54:15 +00:00
stronk7
4ab65b56df Setting some proper zeros. MDL-16565 ; merged from 19_STABLE 2008-09-18 16:15:21 +00:00
Francois Marier
6800d78e06 Drift between CVS and git
- large deletions
- lucene updates
- error() => print_error()
- NO_MOODLE_COOKIES define
- various other things
2008-06-25 17:31:23 +00:00
cataluke
e47ac6818b MDL-15008: mnet/environment.php: Update wwwroot/ip_address when key is deleted/recreated. 2008-06-12 01:16:49 +00:00
skodak
cc38ff5d6d MDL-15097 mnet conversion revisited 2008-06-05 18:07:41 +00:00
skodak
a5d424df7c MDL-14679 converted some get/set_field() 2008-06-02 21:39:23 +00:00
donal
09f0abb2ff MDL-12492: Thanks to Nigel McNie, this addresses a problem which prevents hosts from re-keying when their keys expire. 2008-02-15 08:32:22 +00:00
donal
309eb04025 Write to the log when the SSL key is created 2008-02-15 08:10:50 +00:00
skodak
3772df8dee MDL-11354 ipaddress typo in mnet environment.php 2007-09-19 15:44:31 +00:00
stronk7
b16393cb07 Adding the $Id tag to some scripts to allow better changes detection.
(soory, I deleted a few trailing spaces within comments...)
2007-08-29 10:48:44 +00:00
moodler
94783496f1 Added some robustness because on at least two occasions the mnet_localhost_id has been spontaneously reset to a new entry, which causes havoc as no-one can log in. MDL-10828 2007-08-13 09:53:04 +00:00
donal72
dd9f1b7df5 Patch for upgrade breakage on IIS (and maybe other non-Apache webservers) MDL-8926 2007-03-26 22:51:37 +00:00
martinlanghoff
36e6379ef8 mnet: $CFG->mnet_dispatcher_mode - ensure we set it on install and upgrade, silence warnings - MDL-8284 2007-01-24 22:17:42 +00:00
donal72
08cb427af6 mnet: Remove bogus XYZ prefixes from last commit MDL-8070 2007-01-05 03:31:05 +00:00
donal72
722f3f053e mnet: Allow an environment variable to be established in the absence of openssl - MDL-8070 2007-01-05 02:59:14 +00:00
martinlanghoff
e2d4f75c40 admin/mnet/peers: Allow admins to manually update a remote server's public
key


Author: Donal McMullan <donal@catalyst.net.nz>
2007-01-04 03:38:30 +00:00
martinlanghoff
8c99567eec mnet/environment: Bugfix
Author: Donal McMullan <donal@catalyst.net.nz>
2007-01-04 03:34:48 +00:00
martinlanghoff
735c7beb0a mnet: We now keep several generations of SSL keys
Author: Donal McMullan <donal@catalyst.net.nz>
2007-01-04 03:34:14 +00:00
martinlanghoff
f32689ad4b mnet/environment: Fixup to make proper use of Moodle dml functions
Author: Donal McMullan <donal@catalyst.net.nz>
2007-01-04 03:33:14 +00:00
martinlanghoff
71558f8502 mnet: core libraries and admin pages 2007-01-04 02:33:51 +00:00