2
0
Commit Graph

45 Commits

Author SHA1 Message Date
Manush Dodunekov
a159b9c780 Restricted users (#6274)
* 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>
2020-01-13 18:33:46 +01:00
jaqra
29cb92e1f6 Change some label colors (#9051)
* Change label colors

* Override black basic label background for green theme on label list
2019-12-03 20:39:58 -05:00
Lauris BH
99334f66ef Fix new user form for non-local users (#8826) 2019-11-04 21:10:37 +02:00
Lanre Adelowo
677b5855e3 Allow admin toggle forcing a password change for newly created users (#4563) 2018-09-13 12:34:36 -04:00
EnricoFerro
d35ab52323 Disable 'May Import Local Repository' when is disabled by setting (Issue #4779) (#4780) 2018-08-24 01:00:22 -04:00
Lunny Xiao
1539bd5c3b Refactor struct's time to remove unnecessary memory usage (#3142)
* refactor struct's time to remove unnecessary memory usage

* use AsTimePtr simple code

* fix tests

* fix time compare

* fix template on gpg

* use AddDuration instead of Add
2017-12-11 06:37:04 +02:00
techknowlogick
9bb4c60c8f Disable custom Git Hooks globally via configuration file (#2450)
* Create option to disable githooks globally via configuration file

* Update comment in app.ini to align with @ethantkoenig's suggestion

Signed-off-by: Matti Ranta <matti@mdranta.net>
2017-09-12 12:25:42 +03:00
Patrick G
3a0472e672 Cleaner ui for admin, repo settings, and user settings page (#1269) (#1270) 2017-03-15 23:39:38 +01:00
Willem van Dreumel
64016ca7ac Oauth2 consumer (#679)
* initial stuff for oauth2 login, fails on:
* login button on the signIn page to start the OAuth2 flow and a callback for each provider
Only GitHub is implemented for now
* show login button only when the OAuth2 consumer is configured (and activated)
* create macaron group for oauth2 urls
* prevent net/http in modules (other then oauth2)
* use a new data sessions oauth2 folder for storing the oauth2 session data
* add missing 2FA when this is enabled on the user
* add password option for OAuth2 user , for use with git over http and login to the GUI
* add tip for registering a GitHub OAuth application
* at startup of Gitea register all configured providers and also on adding/deleting of new providers
* custom handling of errors in oauth2 request init + show better tip
* add ExternalLoginUser model and migration script to add it to database
* link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed
* remove the linked external account from the user his settings
* if user is unknown we allow him to register a new account or link it to some existing account
* sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers)

* from gorilla/sessions docs:
"Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!"
(we're using gorilla/sessions for storing oauth2 sessions)

* use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
2017-02-22 08:14:37 +01:00
Bo-Yi Wu
5411e9c468 feat: Able to disable non-admin to create new organization (#927) 2017-02-14 20:16:00 +08:00
Schwobaland
d8821eec53 Restrict creating organisations by user (#193)
* 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
2016-12-31 10:33:30 +08:00
Joubert RedRat
8c1f9a1283 Support to last login feature 2016-11-09 08:53:45 -02:00
Kim "BKC" Carlbäcker
65cb0b4ab0 Merge all pagination-templates into 'base/paginate'
to reduce code-duplicity
2016-11-07 12:44:29 +01:00
Unknwon
48b0d21673 Refactor User.Id to User.ID 2016-07-24 01:08:22 +08:00
Unknwon
27778760b9 #2937 able to prohibit user login 2016-07-16 10:22:16 +08:00
Unknwon
e84cef16cf #13 finish user and repository search
Both are possible on explore and admin panel
2016-03-11 15:33:12 -05:00
Unknwon
c2717eb029 #2156 admin able to edit organization max repo creation 2015-12-11 19:24:57 -05:00
Unknwon
74ceced0e8 #1575 Limit repo creation 2015-12-10 12:37:53 -05:00
Adam Strzelecki
14c04615a0 Indent all templates with tabs
This commit improves templates readability, since all of them use consistent
indent with all template command blocks indented too.

1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks
   such as {{if}} {{with}}

2. Cleans all trailing white-space

3. Adds trailing last line-break to each file
2015-12-08 00:57:46 +01:00
Unknwon
efd1b30453 #1511 Allow local import only for admin users 2015-11-03 18:40:52 -05:00
Unknwon
41a27b7e75 #1525 Triggere mailer for admin created accounts 2015-09-25 19:45:44 -04:00
Unknwon
0d977db881 #697 and #1606 and new admin edit user UI 2015-09-13 11:07:21 -04:00
Unknwon
4226a6f8d6 #1606 GUI bug while adding ldap user 2015-09-13 10:05:18 -04:00
Unknwon
fa05620079 fix html logic 2015-09-13 09:56:50 -04:00
Unknwon
dfcfb9f5cd #697 disable captcha and new admin create user UI 2015-09-13 09:51:51 -04:00
Unknwon
3a8eecbf71 fix css 2015-09-11 20:49:28 -04:00
Unknwon
d44f90afee new admin user list UI 2015-09-11 20:42:26 -04:00
Unknwon
3fb75a8024 more fix on #1553 2015-09-01 08:13:45 -04:00
Unknwon
2938459ee3 fix #1553 2015-09-01 05:44:36 -04:00
James
34a325581a Add full name field to admin's user edit page (fixes #1130) 2015-04-28 11:59:05 -04:00
Sternik
416c93b953 Fix for deleting user when gogs instalation is on http://hostname/gogs 2015-03-13 20:17:20 +01:00
Peter Smit
327d3cd26f Remove the "PHP" style formatting function
The "PHP" formatting function doesn't add anything, except an undocumented date format.

All usages in the templates have been replaced with DateFmtShort and DateFmtLong for convenience.
2015-02-16 14:44:27 +02:00
Peter Smit
fd70f9ec1b Fix #799 by adding a tooltip for all dates in all settings/panels 2015-01-02 12:41:05 +02:00
Unknwon
0c92da7e9c fix invalid user links in admin panels 2014-11-19 21:19:37 -05:00
Unknwon
32dcaefafa fox #620 2014-11-17 14:53:41 -05:00
Unknwon
49193bebd2 UI: Confirmation box 2014-09-28 01:38:25 -04:00
Unknwon
5bbeeb0f1b Page: Commits and fix #249 2014-09-23 15:30:04 -04:00
Unknwon
7ba9257a7f Add suburl support 2014-09-19 20:11:34 -04:00
Martin van Beurden
0055cbd365 Allow Gogs to run from a suburl behind a reverse proxy. e.g. http://mydomain.com/gogs/
Conflicts:
	modules/setting/setting.go

Conflicts:
	templates/repo/release/list.tmpl
	templates/user/dashboard/dashboard.tmpl

Conflicts:
	routers/repo/setting.go
2014-09-18 20:50:48 +02:00
Unknwon
d2aff9a46a Continue working on new admin pages 2014-08-29 20:50:43 +08:00
Unknwon
8829174574 Finish new admin users pages 2014-08-29 15:32:52 +08:00
lunnyxiao
57f6ec672a bug fixed 2014-08-08 13:51:02 +08:00
gima
5a97cc69ed Make possible for administrators to change user's password (fix proposal for #290) 2014-07-18 05:30:57 +03:00
António Meireles
3ad20773a2 fix typos in users' editing template. 2014-06-30 20:12:55 +01:00
Unknown
9924e65ca1 In progress of name template name constant 2014-06-22 13:14:03 -04:00