summaryrefslogtreecommitdiffstats
path: root/modules/auth/admin.go
Commit message (Collapse)AuthorAgeFilesLines
* Move macaron to chi (#14293)Lunny Xiao2021-01-261-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use [chi](https://github.com/go-chi/chi) instead of the forked [macaron](https://gitea.com/macaron/macaron). Since macaron and chi have conflicts with session share, this big PR becomes a have-to thing. According my previous idea, we can replace macaron step by step but I'm wrong. :( Below is a list of big changes on this PR. - [x] Define `context.ResponseWriter` interface with an implementation `context.Response`. - [x] Use chi instead of macaron, and also a customize `Route` to wrap chi so that the router usage is similar as before. - [x] Create different routers for `web`, `api`, `internal` and `install` so that the codes will be more clear and no magic . - [x] Use https://github.com/unrolled/render instead of macaron's internal render - [x] Use https://github.com/NYTimes/gziphandler instead of https://gitea.com/macaron/gzip - [x] Use https://gitea.com/go-chi/session which is a modified version of https://gitea.com/macaron/session and removed `nodb` support since it will not be maintained. **BREAK** - [x] Use https://gitea.com/go-chi/captcha which is a modified version of https://gitea.com/macaron/captcha - [x] Use https://gitea.com/go-chi/cache which is a modified version of https://gitea.com/macaron/cache - [x] Use https://gitea.com/go-chi/binding which is a modified version of https://gitea.com/macaron/binding - [x] Use https://github.com/go-chi/cors instead of https://gitea.com/macaron/cors - [x] Dropped https://gitea.com/macaron/i18n and make a new one in `code.gitea.io/gitea/modules/translation` - [x] Move validation form structs from `code.gitea.io/gitea/modules/auth` to `code.gitea.io/gitea/modules/forms` to avoid dependency cycle. - [x] Removed macaron log service because it's not need any more. **BREAK** - [x] All form structs have to be get by `web.GetForm(ctx)` in the route function but not as a function parameter on routes definition. - [x] Move Git HTTP protocol implementation to use routers directly. - [x] Fix the problem that chi routes don't support trailing slash but macaron did. - [x] `/api/v1/swagger` now will be redirect to `/api/swagger` but not render directly so that `APIContext` will not create a html render. Notices: - Chi router don't support request with trailing slash - Integration test `TestUserHeatmap` maybe mysql version related. It's failed on my macOS(mysql 5.7.29 installed via brew) but succeed on CI. Co-authored-by: 6543 <6543@obermui.de>
* Add option to change username to the admin panel (#14229)65432021-01-101-0/+1
| | | | | Co-authored-by: Bwko <bouwko@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net>
* Add option for administrator to reset user 2FA (#14243)65432021-01-051-0/+1
| | | | | | | * Frontend * Backend * only show 2FA-Reset option if posible
* Multiple small admin dashboard fixes (#12153)zeripath2020-07-051-1/+2
| | | | | | | | | * Remove spurious spacing between Maintenance Operations and its table on dashboard * Prevent (EXTRA string) comments in Task headers * Redirect tasks started from monitor page back to monitor * Fix #12107 - redirects from process cancel should use AppSubUrl * When wrapping queues set the name correctly Signed-off-by: Andrew Thornton <art27@cantab.net>
* Refactor Cron and merge dashboard tasks (#10745)zeripath2020-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor Cron and merge dashboard tasks * Merge Cron and Dashboard tasks * Make every cron task report a system notice on completion * Refactor the creation of these tasks * Ensure that execution counts of tasks is correct * Allow cron tasks to be started from the cron page * golangci-lint fixes * Enforce that only one task with the same name can be registered Signed-off-by: Andrew Thornton <art27@cantab.net> * fix name check Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @guillep2k * as per @lafriks Signed-off-by: Andrew Thornton <art27@cantab.net> * Add git.CommandContext variants Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Change admin dashboard to POST (#10465)John Olheiser2020-02-251-0/+10
| | | | | | | | * Add form and convert to POST * Redirect for flash Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Restricted users (#6274)Manush Dodunekov2020-01-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restricted users (#4334): initial implementation * Add User.IsRestricted & UI to edit it * Pass user object instead of user id to places where IsRestricted flag matters * Restricted users: maintain access rows for all referenced repos (incl public) * Take logged in user & IsRestricted flag into account in org/repo listings, searches and accesses * Add basic repo access tests for restricted users Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Mention restricted users in the faq Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert unnecessary change `.isUserPartOfOrg` -> `.IsUserPartOfOrg` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Remove unnecessary `org.IsOrganization()` call Signed-off-by: Manush Dodunekov <manush@stendahls.se> * Revert to an `int64` keyed `accessMap` * Add type `userAccess` * Add convenience func updateUserAccess() * Turn accessMap into a `map[int64]userAccess` Signed-off-by: Manush Dodunekov <manush@stendahls.se> * or even better: `map[int64]*userAccess` * updateUserAccess(): use tighter syntax as suggested by lafriks * even tighter * Avoid extra loop * Don't disclose limited orgs to unauthenticated users * Don't assume block only applies to orgs * Use an array of `VisibleType` for filtering * fix yet another thinko * Ok - no need for u * Revert "Ok - no need for u" This reverts commit 5c3e886aabd5acd997a3b35687d322439732c200. Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-3/+2
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Increase Username and Orgname MaxSize 35 -> 40 (#6178)Segev Finer2019-02-251-1/+1
| | | | | | | | | | | | | | * Increase Username and Orgname MaxSize 35 -> 40 Signed-off-by: Segev Finer <segev@codeocean.com> * Dep update code.gitea.io/sdk Signed-off-by: Segev Finer <segev@codeocean.com> * Run generate-swagger Signed-off-by: Segev Finer <segev@codeocean.com>
* Allow admin toggle forcing a password change for newly created users (#4563)Lanre Adelowo2018-09-131-6/+7
|
* Better URL validation (#1507)Lauris BH2017-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | * Add correct git branch name validation * Change git refname validation error constant name * Implement URL validation based on GoLang url.Parse method * Backward compatibility with older Go compiler * Add git reference name validation unit tests * Remove unused variable in unit test * Implement URL validation based on GoLang url.Parse method * Backward compatibility with older Go compiler * Add url validation unit tests
* Update Website binding MaxSize to 255 (#722)Bwko2017-01-251-1/+1
|
* Restrict creating organisations by user (#193)Schwobaland2016-12-311-13/+14
| | | | | | | | | | | | | | | | | | | | | | * 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
* golint fixed for modules/authLunny Xiao2016-11-271-2/+6
|
* #2937 able to prohibit user loginUnknwon2016-07-161-0/+1
|
* #1575 Limit repo creationUnknwon2015-12-101-0/+1
|
* #1511 Allow local import only for admin usersUnknwon2015-11-031-10/+11
|
* fix import path, fix #1782Unknwon2015-10-151-2/+2
|
* #1525 Triggere mailer for admin created accountsUnknwon2015-09-251-5/+6
|
* #697 and #1606 and new admin edit user UIUnknwon2015-09-131-4/+16
|
* #1579 change e-mail max length to 254Unknwon2015-09-041-1/+1
|
* Add full name field to admin's user edit page (fixes #1130)James2015-04-281-0/+1
|
* #851: Edit Account does not take into consideration password rulesUnknwon2015-03-171-9/+9
|
* fox #620Unknwon2014-11-171-8/+9
|
* Use binding middlewareUnknwon2014-10-151-4/+3
|
* Finish new admin users pagesUnknwon2014-08-291-1/+1
|
* New UI merge in progressUnknwon2014-07-261-18/+4
|
* Make possible for administrators to change user's password (fix proposal for ↵gima2014-07-181-0/+1
| | | | #290)
* Clean namesUnknown2014-05-081-1/+1
|
* Clean repo codeUnknown2014-05-051-15/+0
|
* fix codeUnknown2014-05-051-2/+2
|
* Merge branch 'dev-ldap' into devLunny Xiao2014-05-051-6/+7
|\
| * basic authenticationsLunny Xiao2014-05-051-6/+7
| |
* | Fix import pathUnknown2014-05-051-1/+2
|/
* Move binding as subrepoUnknown2014-04-131-3/+1
|
* Change new martini impot pathUnknown2014-03-301-1/+1
|
* Add admin edit userUnknown2014-03-211-0/+55