|
@@ -229,31 +229,6 @@ func isAddressAllowed(email string) bool {
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
-func IsBlockedDomain(email string) bool {
|
|
|
- fpath := path.Join(setting.CustomPath, "blocklist")
|
|
|
- if !com.IsExist(fpath) {
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
- f, err := os.Open(fpath)
|
|
|
- if err != nil {
|
|
|
- log.Error(2, "Failed to open file %q: %v", fpath, err)
|
|
|
- return false
|
|
|
- }
|
|
|
- defer f.Close()
|
|
|
-
|
|
|
- scanner := bufio.NewScanner(f)
|
|
|
- for scanner.Scan() {
|
|
|
- // Check provided email address against each line as suffix
|
|
|
- if strings.HasSuffix(email, scanner.Text()) {
|
|
|
- log.Trace("New user email matched blocked domain: %q", email)
|
|
|
- return true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false
|
|
|
-}
|
|
|
-
|
|
|
func (u *User) OldGinVerifyPassword(plain string) bool {
|
|
|
err := bcrypt.CompareHashAndPassword([]byte(u.Passwd), []byte(plain))
|
|
|
return err == nil
|