mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle
This commit is contained in:
commit
3278ce7aba
1147 changed files with 2621 additions and 2617 deletions
|
@ -70,7 +70,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
|
|||
* @param string $password The password (with system magic quotes)
|
||||
* @return bool Authentication success or failure.
|
||||
*/
|
||||
function user_login ($username, $password) {
|
||||
function user_login($username, $password) {
|
||||
$this->connectCAS();
|
||||
return phpCAS::isAuthenticated() && (trim(core_text::strtolower(phpCAS::getUser())) == $username);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -49,7 +49,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
|
||||
$collection->add_user_preference('auth_forcepasswordchange', 'privacy:metadata:userpref:forcepasswordchange');
|
||||
$collection->add_user_preference('create_password', 'privacy:metadata:userpref:createpassword');
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -57,7 +57,7 @@ class auth_plugin_email extends auth_plugin_base {
|
|||
* @param string $password The password
|
||||
* @return bool Authentication success or failure.
|
||||
*/
|
||||
function user_login ($username, $password) {
|
||||
function user_login($username, $password) {
|
||||
global $CFG, $DB;
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
return validate_internal_user_password($user, $password);
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -1467,7 +1467,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
|||
* @param string $user_dn User distinguished name for the user we are checking password expiration (only needed for Active Directory).
|
||||
* @return timestamp
|
||||
*/
|
||||
function ldap_expirationtime2unix ($time, $ldapconnection, $user_dn) {
|
||||
function ldap_expirationtime2unix($time, $ldapconnection, $user_dn) {
|
||||
$result = false;
|
||||
switch ($this->config->user_type) {
|
||||
case 'edir':
|
||||
|
@ -1520,7 +1520,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
|||
* @return array
|
||||
*/
|
||||
|
||||
function ldap_attributes () {
|
||||
function ldap_attributes() {
|
||||
$moodleattributes = array();
|
||||
// If we have custom fields then merge them with user fields.
|
||||
$customfields = $this->get_custom_user_profile_fields();
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -45,7 +45,7 @@ class provider implements
|
|||
* @param collection $collection The initialised item collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
// There is a one user preference.
|
||||
$collection->add_user_preference('auth_manual_passwordupdatetime',
|
||||
'privacy:metadata:preference:passwordupdatetime');
|
||||
|
|
|
@ -1037,7 +1037,7 @@ class auth_plugin_mnet extends auth_plugin_base {
|
|||
* @param object $logline The log information to be trimmed
|
||||
* @return object The passed logline object trimmed to not exceed storable limits
|
||||
*/
|
||||
function trim_logline ($logline) {
|
||||
function trim_logline($logline) {
|
||||
$limits = array('ip' => 15, 'coursename' => 40, 'module' => 20, 'action' => 40,
|
||||
'url' => 255);
|
||||
foreach ($limits as $property => $limit) {
|
||||
|
|
|
@ -49,7 +49,7 @@ class provider implements
|
|||
* @param collection $collection The initialised item collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
|
||||
$sessionfields = [
|
||||
'userid' => 'privacy:metadata:mnet_session:userid',
|
||||
|
@ -130,7 +130,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$sql = "SELECT ctx.id
|
||||
FROM {mnet_log} ml
|
||||
JOIN {context} ctx ON ctx.instanceid = ml.userid AND ctx.contextlevel = :contextlevel
|
||||
|
|
|
@ -112,7 +112,7 @@ class auth_plugin_nologin extends auth_plugin_base {
|
|||
* @param stdClass $user A user object
|
||||
* @return string[] An array of strings with keys subject and message
|
||||
*/
|
||||
public function get_password_change_info(stdClass $user) : array {
|
||||
public function get_password_change_info(stdClass $user): array {
|
||||
$site = get_site();
|
||||
|
||||
$data = new stdClass();
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -57,7 +57,7 @@ class auth_plugin_none extends auth_plugin_base {
|
|||
* @param string $password The password
|
||||
* @return bool Authentication success or failure.
|
||||
*/
|
||||
function user_login ($username, $password) {
|
||||
function user_login($username, $password) {
|
||||
global $CFG, $DB;
|
||||
if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
return validate_internal_user_password($user, $password);
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -631,7 +631,7 @@ class auth extends \auth_plugin_base {
|
|||
* @param stdClass $user A user object
|
||||
* @return string[] An array of strings with keys subject and message
|
||||
*/
|
||||
public function get_password_change_info(stdClass $user) : array {
|
||||
public function get_password_change_info(stdClass $user): array {
|
||||
$site = get_site();
|
||||
|
||||
$data = new stdClass();
|
||||
|
|
|
@ -50,7 +50,7 @@ class provider implements
|
|||
* @param collection $collection An object for storing metadata.
|
||||
* @return collection The metadata.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$authfields = [
|
||||
'timecreated' => 'privacy:metadata:auth_oauth2:timecreated',
|
||||
'timemodified' => 'privacy:metadata:auth_oauth2:timemodified',
|
||||
|
@ -89,7 +89,7 @@ class provider implements
|
|||
* @param int $userid The user ID.
|
||||
* @return contextlist The list of context IDs.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$sql = "SELECT ctx.id
|
||||
FROM {auth_oauth2_linked_login} ao
|
||||
JOIN {context} ctx ON ctx.instanceid = ao.userid AND ctx.contextlevel = :contextlevel
|
||||
|
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue