This commit is contained in:
Jun Pataleta 2024-03-08 08:00:41 +08:00
commit 3278ce7aba
No known key found for this signature in database
GPG key ID: F83510526D99E2C7
1147 changed files with 2621 additions and 2617 deletions

View file

@ -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);
}

View file

@ -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';
}
}

View file

@ -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');

View file

@ -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';
}
}

View file

@ -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);

View file

@ -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';
}
}

View file

@ -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();

View file

@ -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';
}
}

View file

@ -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');

View file

@ -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) {

View file

@ -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

View file

@ -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();

View file

@ -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';
}
}

View file

@ -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);

View file

@ -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';
}
}

View file

@ -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();

View file

@ -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

View file

@ -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';
}
}

View file

@ -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';
}
}