/**
* 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;
}
/**
* 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.
/**
* 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.
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;
/**
* 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.
/**
* 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.
/**
* 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!)
/**
* 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
/**
* 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.
/**
* 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.
*
/**
* 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.
/**
* 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.
/**
* 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.
/**
* 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.
/**
* 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.
/**
* 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.
* Generates a random challenge
* @return void
*/
- function Crypt_CHAP()
+ public function __construct()
{
- $this->PEAR();
+ parent::__construct();
$this->generateChallenge();
}
* Loads the hash extension
* @return void
*/
- function Crypt_CHAP_MSv1()
+ public function __construct()
{
- $this->Crypt_CHAP();
+ parent::__construct();
$this->loadExtension('hash');
}
* 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);
}
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.
\ No newline at end of file
+been already changed upstream in 1.10.0, remove this line after upgrade.
+
+
+Crypt/CHAP
+==========
+MDL-52285 - made all constructors PHP7 compatible
var $keypair = array();
var $deleted = 0;
- function mnet_environment() {
- return true;
- }
-
function init() {
global $CFG, $DB;
/** @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
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;
}
/**
*
* @return bool True
*/
- function mnet_encxml_parser() {
+ public function __construct() {
return $this->initialise();
}