Commit Graph

170 Commits (122917f4d54f47c11f1453115aed7558637095ae)

Author SHA1 Message Date
Ethan Koenig 4cb9394a97 Fix lint errors ()
bradder555 ad24a3134d Fixes 500 error on dashboard when using MSSQL ()
MSSQL rejects the query:
  SELECT "repository"."id" FROM "repository"
  INNER JOIN "team_repo" ON "team_repo".repo_id="repository".id AND
  "repository".is_mirror=1
  WHERE (
    ("repository".owner_id=2 AND "repository".is_private=0)
        OR team_repo.team_id IN (1)
        )
        GROUP BY "repository".id ORDER BY updated_unix DESC

when the order by term (updated_unix) is not included in the group by
term.
Lunny Xiao 1739e84ac0 improve protected branch to add whitelist support ()
* improve protected branch to add whitelist support

* fix lint

* fix style check

* fix tests

* fix description on UI and import

* fix test

* bug fixed

* fix tests and languages

* move isSliceInt64Eq to util pkg; improve function names & typo
Antoine GIRARD 30787e48f2 Improve org error handling ()
* Improve ErrOrgNotExist type
Return new error type
Use good error check
Use new method to check error
Update tests

* Fix unchanged method name report
Lauris BH 6db387a21e Refactor session close as xorm already does everything needed internally ()
Ethan Koenig 036ce3f813 Fix bug in removeOrgRepo ()
Ethan Koenig 336e311a7c Fix locking bug in removeOrgRepo ()
Ethan Koenig 39348cd27e Give all units to owner team ()
Lunny Xiao 5acfc7c4bc fix migrate failed and org dashboard failed on MSSQL database ()
Lunny Xiao 5d40db629c fix random avatars ()
Lunny Xiao 0376029241 fix del org avatar potential delete all avtars ()
Ethan Koenig 76057105ca Remove unnecessary loads in org_team ()
Lunny Xiao 9c645b54dc bug fixed on issues and pulls
Lunny Xiao 4cfde304df bug fixed for my repository ()
Lunny Xiao 55ae78208e Small optimization for getTeamIDs ()
* small optimization for getTeamIDs

* rename getOrgTeamIDs to getUserTeamIDs and remove orderby
Ethan Koenig f82ea42679 Fix bug in removeOrgRepo
Gabriel Jackson bf6f61cc69 Cleanup log messaging
This change corrects a few logging issues:

 * Standardized formatting errors with '%v'.
 * Standardized failure warning word usage.
 * Corrected an instance of using the standard log library when
   the gitea log library should be used instead.
Ethan Koenig a2412492da Unit tests and bug fix for models/org
Lunny Xiao bb5a6b7a07 fix xorm NewSession uncorrected usages ()
Ethan Koenig da1b6164fe Fix FIXME and remove superfluous queries in models/org ()
btrepp 302fa42980 Removes reliance on server specific SQL ()
Breaks the retrieval of repositories into two queries
This fetches the paged ids in one go, then the
actual repository information in a second query

Some databases do not support SELECT with *
when group by is used.
Bo-Yi Wu cbf2a967c5 refactor: Add new deleteOrg func. ()
Andrey Nering 84b7d29d34 Create missing database indexes ()
Lunny Xiao 09dabe2ff2 fix bug ()
Schwobaland c0904f1942 Restrict creating organisations by user ()
* restrict creating organizations based on right on user

* revert bindata.go

* reverse vendor lib

* revert goimports change

* set AllowCreateOrganization default value to true

* revert locale

* added default value for AllowCreateOrganization

* fix typo in migration-comment

* fix comment

* add coments in migration
Lunny Xiao 799d0c2030 slight optimization for GetUserRepositories ()
Lunny Xiao ba134bd27a fix 500 when delete orgnization and resolved
Bwko fa3abc22c0 Added sorting to organizations, repos & users page ()
Denis Denisov 380e32e129 Fix random string generator ()
* Remove unused custom-alphabet feature of random string generator

Fix random string generator

Random string generator should return error if it fails to read random data via crypto/rand

* Fixes variable (un)initialization mixed assign
Update test GetRandomString
Lunny Xiao 21846d16e5 golint for models/org_team.go
Bwko a4ece1f223 Fixes typos
Bwko 0b9cf10340 Lint models/org.go & models.go
Lunny Xiao ade6d4a20f optimization on database IN
Lunny Xiao 9bf28a2799 bug fixed for 500 caused by get org users ()
Thibault Meyer b12f2a5916
Remove unused import
Thibault Meyer b0ddced2b5
Merge remote-tracking branch 'upstream/master' into feature/rewrite-xorm-queries
# Conflicts:
#	models/git_diff.go
#	models/issue.go
#	models/org.go
#	models/pull.go
#	models/repo.go
Thibault Meyer a4454f5d0f
Rewrite XORM queries
Sandro Santilli 4247304f5a Update import paths from github.com/go-gitea to code.gitea.io ()
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis

See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
Lunny Xiao c6c840faf7 Merge pull request from lunny/lunny/SQL_instead_Sql
use x.SQL instead of x.Sql
Thibault Meyer 3a10a0c1ca
Ordering organizations and users by name
Lunny Xiao 7dcc3bc3d7 use x.SQL instead of x.Sql
Sandro Santilli aadd7dcdc3 And others
Sandro Santilli f388661bda ACCESS_MODE_* -> AccessMode*
Thibault Meyer fe8bfa54de Ordering team by name ascending except for 'Owners' ()
Rémy Boulanouar 2d68bd1ef9 Change import reference to match gitea instead of gogs ()
Thibault Meyer 8ad92bb8a4 Verify list len before use it with IN ()
Unknwon a562228c5e Add org.getUserTeams to reduce redundant code
Unknwon e74630ae3b add pagination for repositories
Unknwon 1f2e173a74 Refactor User.Id to User.ID
Unknwon 69f5308761 use different reversed words and patterns for repository and user
Unknwon 4f78abe7dc fix create organization ignores full name property
Unknwon f1b8d52eb3 fix no mail notification when issue is closed/reopened
Kim Carlbäcker 3c0c7a9f83 Fix listing team members ()
Unknwon b1d41cfa60 add admin APIs to add/remove a user from teams
Unknwon 2bf8494332 finish user and repository search
Both are possible on explore and admin panel
Unknwon eed9966ad6 fix incompatible SQL in PostgreSQL
Unknwon 5335e671be more fixes on SQL errors
Unknwon d57a2b908a and fix bad SQL generated by XORM
Use hand-written SQL to do complex query
Unknwon c9901bbba5 workaround to fix XORM problem
Unknwon 97429a25ab make IN clause compatible with Postgres
Unknwon aa12135b97 Fix panic when view profile without signin
Also fix that no matter who, still able to see organizations with private membership.
Unknwon fd92d91da3 Minor fix for
ExMex 2cfe6f8c60 Admins and user itself sees private org relations on profile
Unknwon ddf9fa06c7 Minor fix for
Unknwon 739d5aa1d3 Merge pull request from fnkr/hide-other-teams-repos-from-org-page
Hide other teams & repos from organization page
Florian Kaiser fb1708e1af Remove unnecessary private functions
Florian Kaiser 90780a0d90 Use invalid value (-1) instead of 0 to prevent bug if auto increment starts with 0
Florian Kaiser bba1847a8e Everyone can see public repos
Florian Kaiser e35791b2b2 Only show teams the user has access to
Florian Kaiser 5eafe2b17e Only show repositories the user has access to, on the organization home
Florian Kaiser 295de51b99 Show all orgs on user profile, except the private one's
Unknwon 112a7cab31 incorrect error handle for team name
Unknwon 9cd16c5b12 add organization APIs
Unknwon 3362b3a44f fix possible disclosure
Unknwon 4d31eb2c0d fix org max repo limit default to -1
Antoine GIRARD c98dad1cf3 New admin organization UI
Unknwon 3d9b98fae4 order owners list by last changed time
Unknwon 80701d45bb Make organization emails non-mandatory
Unknwon aa67de910a fix
Unknwon ff35a37769 : Authorities were messed up when using mysql database
Unknwon dea3a8c6a4 WIP: create PR - choose branch
Unknwon 698b9e2acc Clearer error message for illegal characters
Unknwon 466facc009 : Deleting users should remove them from collaborator lists
- fix delete user but repository watches are not decreased
Unknwon 473e265727 models: done testing on new access system
Unknwon 8896c82d34 models: fix issue with transfer repository
README: fix typo
Unknwon ee68a826a5 v4 migration, merge 'dev', clean code and mirror fix
Unknwon 10e4b5b6c6 Merge branch 'access' of github.com:gogits/gogs into access
Unknwon 7ccab9cd09 Merge branch 'dev' of github.com:gogits/gogs into access
Conflicts:
	gogs.go
	models/models.go
	models/user.go
	templates/.VERSION
	templates/org/home.tmpl
Unknwon 04164eada3 models: able to rename user with diff letter cases
- templates/org: mirror fix on name output
- routers: add missing error check
Peter Smit 0009a1d2b1 Fix access for team mode update
Unknwon 6d0f3a07d4 code fix caution: undertest
Peter Smit 6c1ee384f1 Merge remote-tracking branch 'mine/access_refactor' into access_refactor
Conflicts:
	cmd/serve.go
	models/access.go
	models/migrations/migrations.go
	models/org.go
	models/repo.go
	models/user.go
	modules/middleware/org.go
	modules/middleware/repo.go
	routers/api/v1/repo.go
	routers/org/teams.go
	routers/repo/http.go
	routers/user/home.go
Peter Smit 0a4cda0dd4 Refactoring of the Access Table
This commit does a lot of the work of refactoring the access table in a table with id's instead of strings.

The result does compile, but has not been tested. It may eat your kittens.
Unknwon 485ea6f14f models: make code change for session issue with SQLite3
Peter Smit 0d158e569b Change constants to UPPERCASE_WITH_UNDERSCORE style
Peter Smit 4e79adf6b5 Refactoring of the Access Table
This commit does a lot of the work of refactoring the access table in a table with id's instead of strings.

The result does compile, but has not been tested. It may eat your kittens.
Unknwon ac4a10456e api: able to create repo and fix
- POST /user/repos
- POST /org/:org/repos
Joseph Crail 39c068400e Fix spelling errors in comments.
Unknwon 8ea7ba3afa fix
Unknwon c04aea8d9d Fix