mirror of
https://github.com/go-gitea/gitea
synced 2024-07-27 17:17:08 +02:00
Compare commits
4 Commits
d90801cc69
...
359c515d3f
Author | SHA1 | Date | |
---|---|---|---|
|
359c515d3f | ||
|
a40192dc12 | ||
|
e1cf760d2f | ||
|
b56df63c86 |
|
@ -142,18 +142,18 @@ type Action struct {
|
|||
ID int64 `xorm:"pk autoincr"`
|
||||
UserID int64 `xorm:"INDEX"` // Receiver user id.
|
||||
OpType ActionType
|
||||
ActUserID int64 // Action user id.
|
||||
ActUser *user_model.User `xorm:"-"`
|
||||
RepoID int64
|
||||
ActUserID int64 // Action user id.
|
||||
ActUser *user_model.User `xorm:"-"`
|
||||
RepoID int64 `xorm:"INDEX"`
|
||||
Repo *repo_model.Repository `xorm:"-"`
|
||||
CommentID int64 `xorm:"INDEX"`
|
||||
Comment *issues_model.Comment `xorm:"-"`
|
||||
Issue *issues_model.Issue `xorm:"-"` // get the issue id from content
|
||||
IsDeleted bool `xorm:"NOT NULL DEFAULT false"`
|
||||
IsDeleted bool `xorm:"INDEX NOT NULL DEFAULT false"`
|
||||
RefName string
|
||||
IsPrivate bool `xorm:"NOT NULL DEFAULT false"`
|
||||
Content string `xorm:"TEXT"`
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -168,10 +168,13 @@ func (a *Action) TableIndices() []*schemas.Index {
|
|||
actUserIndex := schemas.NewIndex("au_r_c_u_d", schemas.IndexType)
|
||||
actUserIndex.AddColumn("act_user_id", "repo_id", "created_unix", "user_id", "is_deleted")
|
||||
|
||||
actDashboardIndex := schemas.NewIndex("r_c_u_d", schemas.IndexType)
|
||||
actDashboardIndex.AddColumn("repo_id", "created_unix", "user_id", "is_deleted")
|
||||
|
||||
cudIndex := schemas.NewIndex("c_u_d", schemas.IndexType)
|
||||
cudIndex.AddColumn("created_unix", "user_id", "is_deleted")
|
||||
|
||||
indices := []*schemas.Index{actUserIndex, repoIndex, cudIndex}
|
||||
indices := []*schemas.Index{actUserIndex, repoIndex, actDashboardIndex, cudIndex}
|
||||
|
||||
return indices
|
||||
}
|
||||
|
|
|
@ -2981,6 +2981,10 @@ emails.not_updated=Falhou a modificação do endereço de email solicitado: %v
|
|||
emails.duplicate_active=Este endereço de email já está a ser usado por outro utilizador.
|
||||
emails.change_email_header=Modificar propriedades do email
|
||||
emails.change_email_text=Tem a certeza que quer modificar este endereço de email?
|
||||
emails.delete=Eliminar email
|
||||
emails.delete_desc=Tem a certeza que quer eliminar este endereço de email?
|
||||
emails.deletion_success=O endereço de email foi eliminado.
|
||||
emails.delete_primary_email_error=Não pode eliminar o email principal.
|
||||
|
||||
orgs.org_manage_panel=Gestão das organizações
|
||||
orgs.name=Nome
|
||||
|
|
|
@ -327,7 +327,7 @@ func getOAuthGroupsForUser(ctx go_context.Context, user *user_model.User) ([]str
|
|||
|
||||
func parseBasicAuth(ctx *context.Context) (username, password string, err error) {
|
||||
authHeader := ctx.Req.Header.Get("Authorization")
|
||||
if authType, authData, ok := strings.Cut(authHeader, " "); ok && authType == "Basic" {
|
||||
if authType, authData, ok := strings.Cut(authHeader, " "); ok && strings.EqualFold(authType, "Basic") {
|
||||
return base.BasicAuthDecode(authData)
|
||||
}
|
||||
return "", "", errors.New("invalid basic authentication")
|
||||
|
@ -661,7 +661,7 @@ func AccessTokenOAuth(ctx *context.Context) {
|
|||
// if there is no ClientID or ClientSecret in the request body, fill these fields by the Authorization header and ensure the provided field matches the Authorization header
|
||||
if form.ClientID == "" || form.ClientSecret == "" {
|
||||
authHeader := ctx.Req.Header.Get("Authorization")
|
||||
if authType, authData, ok := strings.Cut(authHeader, " "); ok && authType == "Basic" {
|
||||
if authType, authData, ok := strings.Cut(authHeader, " "); ok && strings.EqualFold(authType, "Basic") {
|
||||
clientID, clientSecret, err := base.BasicAuthDecode(authData)
|
||||
if err != nil {
|
||||
handleAccessTokenError(ctx, AccessTokenError{
|
||||
|
|
Loading…
Reference in New Issue
Block a user