The login page is: moodle / login / index.php
The key functions to achieve login:
// moodle uses the password_hash encryption method. This method cannot be verified by selecting the user name + password. The function of verifying whether the user account password is correct is as follows:
// lib/moodlelib.php 4401
authenticate_user_login( $username, $password );
// Complete user registration, set user cookie and other information
$USER = complete_user_login( $user );
After the account password authentication of $ user, you can directly call complete_user_login ($ user); function, moodle will automatically set cookies and other messages, we can jump.