mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
web UI/REST API: add password reset
In order to reset the password from the admin/client user interface, an SMTP configuration must be added and the user/admin must have an email address. You can prohibit the reset functionality on a per-user basis by using a specific restriction. Fixes #597
This commit is contained in:
@@ -12,6 +12,11 @@ func (e *ValidationError) Error() string {
|
||||
return fmt.Sprintf("Validation error: %s", e.err)
|
||||
}
|
||||
|
||||
// GetErrorString returns the unmodified error string
|
||||
func (e *ValidationError) GetErrorString() string {
|
||||
return e.err
|
||||
}
|
||||
|
||||
// NewValidationError returns a validation errors
|
||||
func NewValidationError(error string) *ValidationError {
|
||||
return &ValidationError{
|
||||
@@ -19,7 +24,7 @@ func NewValidationError(error string) *ValidationError {
|
||||
}
|
||||
}
|
||||
|
||||
// RecordNotFoundError raised if a requested user is not found
|
||||
// RecordNotFoundError raised if a requested object is not found
|
||||
type RecordNotFoundError struct {
|
||||
err string
|
||||
}
|
||||
@@ -53,3 +58,19 @@ func NewMethodDisabledError(error string) *MethodDisabledError {
|
||||
err: error,
|
||||
}
|
||||
}
|
||||
|
||||
// GenericError raised for not well categorized error
|
||||
type GenericError struct {
|
||||
err string
|
||||
}
|
||||
|
||||
func (e *GenericError) Error() string {
|
||||
return e.err
|
||||
}
|
||||
|
||||
// NewGenericError returns a generic error
|
||||
func NewGenericError(error string) *GenericError {
|
||||
return &GenericError{
|
||||
err: error,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user