-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#35 update Anope IRC password on passwort change
- Loading branch information
1 parent
2b1db42
commit 22c93d3
Showing
3 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/faforever/api/user/AnopeUserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.faforever.api.user; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | ||
import org.springframework.stereotype.Repository; | ||
|
||
/** | ||
* Repository to access Anope's @{NickCore} table (the one that contains usernames and passwords). | ||
*/ | ||
@Repository | ||
@Slf4j | ||
public class AnopeUserRepository { | ||
|
||
private final NamedParameterJdbcTemplate jdbcTemplate; | ||
|
||
public AnopeUserRepository(NamedParameterJdbcTemplate jdbcTemplate) { | ||
this.jdbcTemplate = jdbcTemplate; | ||
} | ||
|
||
// Don't make this package private, see https://jira.spring.io/browse/SPR-15911 | ||
public void updatePassword(String username, String password) { | ||
jdbcTemplate.update("UPDATE `faf-anope`.anope_db_NickCore SET pass = :password WHERE display = :username", | ||
ImmutableMap.of( | ||
"password", password, | ||
"username", username | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters