original_string: public static function get_autologin_key() {
          global $USER;
          // Delete previous keys.
          delete_user_key('tool_mobile', $USER->id);
  
          // Create a new key.
          $iprestriction = getremoteaddr();
          $validuntil = time() + self::LOGIN_KEY_TTL;
          return create_user_key('tool_mobile', $USER->id, null, $iprestriction, $validuntil);
      }
code: public static function get_autologin_key() {
          global $USER;
          // Delete previous keys.
          delete_user_key('tool_mobile', $USER->id);
  
          // Create a new key.
          $iprestriction = getremoteaddr();
          $validuntil = time() + self::LOGIN_KEY_TTL;
          return create_user_key('tool_mobile', $USER->id, null, $iprestriction, $validuntil);
      }
code_tokens: public static function get_autologin_key ( ) { global $ USER ; // Delete previous keys. delete_user_key ( 'tool_mobile' , $ USER -> id ) ; // Create a new key. $ iprestriction = getremoteaddr ( ) ; $ validuntil = time ( ) + self :: LOGIN_KEY_TTL ; return create_user_key ( 'tool_mobile' , $ USER -> id , null , $ iprestriction , $ validuntil ) ; }
docstring: Creates an auto-login key for the current user, this key is restricted by time and ip address.
  
  @return string the key
  @since Moodle 3.2
docstring_tokens: Creates an auto - login key for the current user this key is restricted by time and ip address .