Merge branch 'wip-MDL-52285-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Dan Poltawski 2015-12-10 10:13:40 +00:00
commit a9efb3b7d0
22 changed files with 181 additions and 35 deletions

View File

@ -39,13 +39,23 @@ class auth_plugin_cas extends auth_plugin_ldap {
/**
* Constructor.
*/
function auth_plugin_cas() {
public function __construct() {
$this->authtype = 'cas';
$this->roleauth = 'auth_cas';
$this->errorlogtag = '[AUTH CAS] ';
$this->init_plugin($this->authtype);
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_cas() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
function prevent_local_passwords() {
return true;
}

View File

@ -34,11 +34,21 @@ class auth_plugin_email extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_email() {
public function __construct() {
$this->authtype = 'email';
$this->config = get_config('auth/email');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_email() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -37,11 +37,21 @@ class auth_plugin_fc extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_fc() {
public function __construct() {
$this->authtype = 'fc';
$this->config = get_config('auth/fc');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_fc() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -30,7 +30,7 @@ class fcFPP
var $_debug = FALSE; // set to true to see some debug info
// class constructor
function fcFPP($host="localhost", $port="3333")
public function __construct($host="localhost", $port="3333")
{
$this->_hostname = $host;
$this->_port = $port;

View File

@ -35,11 +35,21 @@ class auth_plugin_imap extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_imap() {
public function __construct() {
$this->authtype = 'imap';
$this->config = get_config('auth/imap');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_imap() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -143,13 +143,23 @@ class auth_plugin_ldap extends auth_plugin_base {
/**
* Constructor with initialisation.
*/
function auth_plugin_ldap() {
public function __construct() {
$this->authtype = 'ldap';
$this->roleauth = 'auth_ldap';
$this->errorlogtag = '[AUTH LDAP] ';
$this->init_plugin($this->authtype);
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_ldap() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -46,13 +46,23 @@ class auth_plugin_manual extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_manual() {
public function __construct() {
$this->authtype = 'manual';
$config = get_config(self::COMPONENT_NAME);
$legacyconfig = get_config(self::LEGACY_COMPONENT_NAME);
$this->config = (object)array_merge((array)$legacyconfig, (array)$config);
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_manual() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist. (Non-mnet accounts only!)

View File

@ -35,12 +35,22 @@ class auth_plugin_mnet extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_mnet() {
public function __construct() {
$this->authtype = 'mnet';
$this->config = get_config('auth_mnet');
$this->mnet = get_mnet_environment();
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_mnet() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* This function is normally used to determine if the username and password
* are correct for local logins. Always returns false, as local users do not

View File

@ -35,11 +35,21 @@ class auth_plugin_nntp extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_nntp() {
public function __construct() {
$this->authtype = 'nntp';
$this->config = get_config('auth/nntp');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_nntp() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -35,10 +35,20 @@ class auth_plugin_nologin extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_nologin() {
public function __construct() {
$this->authtype = 'nologin';
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_nologin() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Do not allow any login.
*

View File

@ -34,11 +34,21 @@ class auth_plugin_none extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_none() {
public function __construct() {
$this->authtype = 'none';
$this->config = get_config('auth/none');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_none() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work or don't exist and false
* if the user exists and the password is wrong.

View File

@ -53,12 +53,22 @@ class auth_plugin_pam extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_pam() {
public function __construct() {
$this->authtype = 'pam';
$this->config = get_config('auth/pam');
$this->errormessage = '';
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_pam() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -35,11 +35,21 @@ class auth_plugin_pop3 extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_pop3() {
public function __construct() {
$this->authtype = 'pop3';
$this->config = get_config('auth/pop3');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_pop3() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -38,11 +38,21 @@ class auth_plugin_radius extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_radius() {
public function __construct() {
$this->authtype = 'radius';
$this->config = get_config('auth/radius');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_radius() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -38,11 +38,21 @@ class auth_plugin_shibboleth extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_shibboleth() {
public function __construct() {
$this->authtype = 'shibboleth';
$this->config = get_config('auth/shibboleth');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_shibboleth() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -35,11 +35,21 @@ class auth_plugin_webservice extends auth_plugin_base {
/**
* Constructor.
*/
function auth_plugin_webservice() {
public function __construct() {
$this->authtype = 'webservice';
$this->config = get_config('auth/webservice');
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function auth_plugin_webservice() {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct();
}
/**
* Returns true if the username and password work and false if they are
* wrong or don't exist.

View File

@ -85,9 +85,9 @@ class Crypt_CHAP extends PEAR
* Generates a random challenge
* @return void
*/
function Crypt_CHAP()
public function __construct()
{
$this->PEAR();
parent::__construct();
$this->generateChallenge();
}
@ -167,9 +167,9 @@ class Crypt_CHAP_MSv1 extends Crypt_CHAP
* Loads the hash extension
* @return void
*/
function Crypt_CHAP_MSv1()
public function __construct()
{
$this->Crypt_CHAP();
parent::__construct();
$this->loadExtension('hash');
}
@ -415,9 +415,9 @@ class Crypt_CHAP_MSv2 extends Crypt_CHAP_MSv1
* Generates the 16 Bytes peer and authentication challenge
* @return void
*/
function Crypt_CHAP_MSv2()
public function __construct()
{
$this->Crypt_CHAP_MSv1();
parent::__construct();
$this->generateChallenge('peerChallenge', 16);
$this->generateChallenge('authChallenge', 16);
}

View File

@ -33,4 +33,9 @@ MDL-52081 - made all constructors PHP7 compatible
Pear
====
Changed constructors in classes PEAR and PEAR_ERROR to be __construct(). This has
been already changed upstream in 1.10.0, remove this line after upgrade.
been already changed upstream in 1.10.0, remove this line after upgrade.
Crypt/CHAP
==========
MDL-52285 - made all constructors PHP7 compatible

View File

@ -17,10 +17,6 @@ class mnet_environment {
var $keypair = array();
var $deleted = 0;
function mnet_environment() {
return true;
}
function init() {
global $CFG, $DB;

View File

@ -39,10 +39,6 @@ class mnet_peer {
/** @var int $sslverification The level of SSL verification to apply. */
public $sslverification = self::SSL_HOST_AND_PEER;
function mnet_peer() {
return true;
}
/*
* Fetch information about a peer identified by wwwroot
* If information does not preexist in db, collect it together based on

View File

@ -23,12 +23,11 @@ class mnet_xmlrpc_client {
var $mnet = null;
/**
* Constructor returns true
* Constructor
*/
function mnet_xmlrpc_client() {
public function __construct() {
// make sure we've got this set up before we try and do anything else
$this->mnet = get_mnet_environment();
return true;
}
/**

View File

@ -17,7 +17,7 @@ class mnet_encxml_parser {
*
* @return bool True
*/
function mnet_encxml_parser() {
public function __construct() {
return $this->initialise();
}