Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 2305... Línea 2305...
2305
                        get_string(
2305
                        get_string(
2306
                            'activitylinkname',
2306
                            'activitylinkname',
2307
                            'lesson',
2307
                            'lesson',
2308
                            format_string($instancename, true, ['context' => $this->get_context()]),
2308
                            format_string($instancename, true, ['context' => $this->get_context()]),
2309
                        ),
2309
                        ),
2310
                        ['class' => 'centerpadded lessonbutton standardbutton pr-3'],
2310
                        ['class' => 'centerpadded lessonbutton standardbutton pe-3'],
2311
                    );
2311
                    );
2312
                }
2312
                }
2313
            }
2313
            }
2314
        }
2314
        }
2315
        return '';
2315
        return '';
Línea 2862... Línea 2862...
2862
            return false;
2862
            return false;
2863
        }
2863
        }
Línea 2864... Línea 2864...
2864
 
2864
 
2865
        if ($this->properties->usepassword && empty($USER->lessonloggedin[$this->id])) {
2865
        if ($this->properties->usepassword && empty($USER->lessonloggedin[$this->id])) {
-
 
2866
            $correctpass = false;
-
 
2867
 
2866
            $correctpass = false;
2868
            $userpassword = trim((string) $userpassword);
2867
            if (!empty($userpassword) &&
2869
            if ($userpassword !== '' &&
2868
                    (($this->properties->password == md5(trim($userpassword))) || ($this->properties->password == trim($userpassword)))) {
2870
                    ($this->properties->password === md5($userpassword) || $this->properties->password === $userpassword)) {
2869
                // With or without md5 for backward compatibility (MDL-11090).
2871
                // With or without md5 for backward compatibility (MDL-11090).
2870
                $correctpass = true;
2872
                $correctpass = true;
2871
                $USER->lessonloggedin[$this->id] = true;
2873
                $USER->lessonloggedin[$this->id] = true;
2872
            } else if (isset($this->properties->extrapasswords)) {
2874
            } else if (isset($this->properties->extrapasswords)) {
2873
                // Group overrides may have additional passwords.
2875
                // Group overrides may have additional passwords.
2874
                foreach ($this->properties->extrapasswords as $password) {
2876
                foreach ($this->properties->extrapasswords as $password) {
2875
                    if (strcmp($password, md5(trim($userpassword))) === 0 || strcmp($password, trim($userpassword)) === 0) {
2877
                    if ($password === md5($userpassword) || $password === $userpassword) {
2876
                        $correctpass = true;
2878
                        $correctpass = true;
2877
                        $USER->lessonloggedin[$this->id] = true;
2879
                        $USER->lessonloggedin[$this->id] = true;
2878
                    }
2880
                    }
2879
                }
2881
                }
Línea 3759... Línea 3761...
3759
            return !empty($val);
3761
            return !empty($val);
3760
        }
3762
        }
3761
        return !empty($this->properties->{$key});
3763
        return !empty($this->properties->{$key});
3762
    }
3764
    }
Línea 3763... Línea -...
3763
 
-
 
3764
    //NOTE: E_STRICT does not allow to change function signature!
-
 
3765
 
3765
 
3766
    /**
3766
    /**
3767
     * If implemented should create a new instance, save it in the DB and return it
3767
     * If implemented should create a new instance, save it in the DB and return it
3768
     */
3768
     */
3769
    //public static function create() {}
3769
    //public static function create() {}