summaryrefslogtreecommitdiffstats
path: root/models/user.go
Commit message (Collapse)AuthorAgeFilesLines
* LDAP: ignore already existing public keys after ldap sync (#6766)Lukas Prettenthaler2019-04-261-1/+5
| | | | | | | | | | | | | | | | | | * fix type in public key exist error, only log trace for ldap public key import if existing Signed-off-by: Lukas Prettenthaler <lukas@noenv.com> * cleanup switch statement Signed-off-by: Lukas Prettenthaler <lukas@noenv.com> * replace switch with if, fix log formatting Signed-off-by: Lukas Prettenthaler <lukas@noenv.com> * fix formatting Signed-off-by: Lukas Prettenthaler <lukas@noenv.com>
* Fix org visibility bug when git cloning (#6743)Lunny Xiao2019-04-251-1/+5
| | | | | | | | | | | | | | * fix org visibility bug * fix permission check * add integration tests * fix tests * change test user name for easier maintainance and fix test * fix test git repo name
* Trace Logging on Permission Denied & ColorFormat (#6618)zeripath2019-04-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add log.ColorFormat and log.ColorFormatted Structs can now implement log.ColorFormatted to provide their own colored format when logged with `%-v` or additional flags. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add basic ColorFormat to repository and user Signed-off-by: Andrew Thornton <art27@cantab.net> * Add basic ColorFormat to access and unit Signed-off-by: Andrew Thornton <art27@cantab.net> * Add ColorFormat to permission and on trace log it Signed-off-by: Andrew Thornton <art27@cantab.net> * Add log.NewColoredIDValue to make ID value coloring consistent Signed-off-by: Andrew Thornton <art27@cantab.net> * formatting changes * Add some better tracing to permission denied for read issues/pulls Signed-off-by: Andrew Thornton <art27@cantab.net> * Add Trace logging on permission denied Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove isTrace() check from deferred func * Adjust repo and allow logging of team * use FormatInt instead of Itoa * Add blank line Signed-off-by: Andrew Thornton <art27@cantab.net> * Update access.go
* add .gpg url (match github behaviour) (#6610)Antoine GIRARD2019-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | * add .gpg url (match github behaviour) * wildcard * test to export maximum data * working POC * add comment for old imported keys * cleaning * Update routers/user/profile.go Co-Authored-By: sapk <sapk@users.noreply.github.com> * add migration script * add integration tests
* Better logging (#6038) (#6095)zeripath2019-04-021-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* Add bio field for user (#6113)techknowlogick2019-03-181-6/+6
| | | | Fix #4339
* Integrate OAuth2 Provider (#5378)Jonas Franz2019-03-081-0/+1
|
* Add robots.txt as reserved username (#6272)techknowlogick2019-03-071-0/+1
| | | Fix #6271
* add isAdmin to user model (#6231)Lanre Adelowo2019-03-031-0/+1
| | | | | update vendor and add tests fix swagger
* Add "ghost" and "notifications" to list of reserved user names. (#6208)tklein232019-02-271-0/+2
|
* Admins can now do unlimited page size user search (listAllUsers & ↵John Olheiser2019-02-211-0/+3
| | | | | listAllOrgs) (#6143) Non-admins will default to 10 page size
* Allow to set organization visibility (public, internal, private) (#1763)Rémy Boulanouar2019-02-181-13/+51
|
* Fix empty ssh key importing in ldap (#5984)zeripath2019-02-061-3/+6
|
* Don't discard the value of DISABLE_REGULAR_ORG_CREATION (#5886)Lanre Adelowo2019-01-301-0/+1
| | | | | * Consider the configuration value of DISABLE_REGULAR_ORG_CREATION when creating a user
* Ensure valid git author names passed in signatures (#5774)zeripath2019-01-241-3/+24
| | | | | | | | | | | | | | | | | | | | * Ensure valid git author names passed in signatures Fix #5772 - Git author names are not allowed to include `\n` `<` or `>` and must not be empty. Ensure that the name passed in a signature is valid. * Account for pathologically named external users LDAP and the like usernames are not checked in the same way that users who signup are. Therefore just ensure that user names are also git safe and if totally pathological - Set them to "user-$UID" * Add Tests and adjust test users Make our testcases a little more pathological so that we be sure that integration tests have a chance to spot these cases. Signed-off-by: Andrew Thornton <art27@cantab.net>
* New API routes added (#5594)Shashvat Kedia2019-01-231-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New API routes added * Comments added * Build fix * swagger_v1_json.tmpl without new line character * Typo fix * Code review changes * Code review changes * Add copyright * Add copyright * Add copyright * Update per @lafriks feedback * Update org.go * Update user.go * Update user.go * make fmt
* Allow for user specific themes (#5668)Lanre Adelowo2019-01-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | * add migration and basic UI for changing a user's theme * update user themem * use right text on button * load theme based on users' selection * load theme based on users' selection in pwa too * update sample config * delete older theme loading * implement AfterLoad to set users' theme properly * set up default theme when creating a user. This uses the installation wide theme * use flash messages for error * set default theme when creating a user from the cli * fix @lunny review
* Synchronize SSH keys on login with LDAP + Fix SQLite deadlock on ldap ssh ↵zeripath2018-12-271-6/+8
| | | | | | | | key deletion (#5557) * Synchronize SSH keys on login with LDAP * BUG: Fix hang on sqlite during LDAP key deletion
* fix forgot removed records when deleting user (#5429)Lunny Xiao2018-12-181-15/+12
| | | | | | | | | | * fix forgot removed records when deleting user * fix migration * fix rewritekey lock on sqlite * remove unused codes
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-281-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
* Prometheus endpoint (#5256)Stanislav2018-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add prometheus collector and route * dep ensure -add github.com/prometheus/client_golang/prometheus * dep ensure -update github.com/golang/protobuf * add metrics to reserved usernames * add comment head in metrics package * fix style imports * add metrics settings * add bearer token check * mapping metrics configs * fix lint * update config cheat sheet * update conf sample, typo fix
* Fix issue where ecdsa and other key types are not synced from LDAP (#5092) ↵Jerry Jacobs2018-10-301-1/+3
| | | | | | | | | | (#5094) * Fix issue where ecdsa and other key types are not synced from LDAP authentication provider fixes #5092 * integrations/auth_ldap_test.go: Add Hermes Conrad new ecdsa-sha2-nistp256 publickey fingerprint * integrations/auth_ldap_test.go: Use ssh-keygen -lf <filename> -E sha256
* Use named const instead of a raw string (#5115)Oleg Kovalov2018-10-201-1/+1
|
* Remove duplicated if bodies (#5121)Oleg Kovalov2018-10-191-12/+5
|
* Add support for search by uid (#4876)zeripath2018-10-181-0/+6
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Force user to change password (#4489)Lanre Adelowo2018-09-131-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * redirect to login page after successfully activating account * force users to change password if account was created by an admin * force users to change password if account was created by an admin * fixed build * fixed build * fix pending issues with translation and wrong routes * make sure path check is safe * remove unneccessary newline * make sure users that don't have to view the form get redirected * move route to use /settings prefix so as to make sure unauthenticated users can't view the page * update as per @lafriks review * add necessary comment * remove unrelated changes * support redirecting to location the user actually want to go to before being forced to change his/her password * run make fmt * added tests * improve assertions * add assertion * fix copyright year Signed-off-by: Lanre Adelowo <yo@lanre.wtf>
* Do not autocreate directory for new user/orgs (#4828) (#4849)SagePtr2018-09-061-3/+6
|
* add vendor to user reserved words and format words list according alphabet ↵Lunny Xiao2018-08-131-1/+29
| | | | (#4685)
* Update xorm to latest version and fix correct `user` table referencing in ↵Lauris BH2018-07-201-4/+4
| | | | sql (#4473)
* fix repository last updated time update when delete a user who watched the ↵Lunny Xiao2018-07-051-2/+2
| | | | repo (#4363)
* Limit uploaded avatar image-size to 4096x3072 by default (#4353)Kim "BKC" Carlbäcker2018-07-031-0/+11
|
* hide issues from org private repos w/o team assignment (#4034)David Schneiderbauer2018-06-211-10/+28
|
* LDAP Public SSH Keys synchronization (#1844)Magnus Lindvall2018-05-241-1/+133
| | | | | | | | | | | | | | | | | | | * Add LDAP Key Synchronization feature Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Add migration: add login source id column for public_key table * Only update keys if needed * Add function to only list pubkey synchronized from ldap * Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it. * Only get keys belonging to current login source id * Set default login source id to 0 * Some minor cleanup. Add integration tests (updete dep testify)
* Added repository search ordered by stars or forks. Forks column in admin ↵Alexey Terentyev2018-05-241-2/+2
| | | | | | | | | | | | | repo list. (#3969) * Added repository search order by stars or forks. Added Forks column to admin repository list. Signed-off-by: Alexey Terentyev <axifnx@gmail.com> * Renamed search repo template Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
* Multiple assignees (#3705)kolaente2018-05-091-3/+3
|
* Added user language setting (#3875)kolaente2018-05-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added user language setting * Added translation string for setting * Fixed import order + typo * improved checking if the user has a language saved in the db * The current saved language is now set a default inside the dropdown * fmt * When a user signs in and doesn't have a language saved, the current browser language is saved * updated gitea-sdk * Merge branch 'master' of https://github.com/go-gitea/gitea into save-user-language # Conflicts: # models/migrations/migrations.go # models/migrations/v62.go * Made tests work again * trigger CI * trigger CI * fmt * re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO * re-trigger that FUCKING CI SO IT REALLY PICKS UP THE LATEST COMMIT ISTEAD OF PREDENDING TO DO SO * When loggin in, only the language col gets updated instead of everything
* Add "error" as reserved username (#3882)Lauris BH2018-05-021-1/+1
|
* Fix typo in deleteUser (#3781)Michael Kuhn2018-04-101-1/+1
| | | num_watches was used where num_stars should have been used.
* Implements generator cli for secrets (#3531)Codruț Constantin Gușoi2018-02-181-1/+2
| | | Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
* Fixes missing avatars in offline mode (#3471)Codruț Constantin Gușoi2018-02-081-1/+3
| | | Signed-off-by: Codruț Constantin Gușoi <codrut.gusoi@gmail.com>
* Enable caching on assets and avatars (#3376)Morgan Bazalgette2018-02-041-1/+1
| | | | | | | | | | | | | | * Enable caching on assets and avatars Fixes #3323 * Only set avatar in user BeforeUpdate when there is no avatar set * add error checking after stat * gofmt * Change cache time for avatars to an hour
* Change reserved avatar name to correct - avatars (#3375)Lauris BH2018-01-161-1/+1
|
* refactor(model): update user method. (#3360)Bo-Yi Wu2018-01-131-32/+16
|
* Cleanup models.User.HashPassword (#3334)Kim "BKC" Carlbäcker2018-01-121-7/+10
|
* Change EncodePasswd to HashPassword (#3329)Morgan Bazalgette2018-01-081-4/+4
| | | | | | * Change EncodePasswd to HashPassword * Create test+benchmark for HashPassword
* Fix ignored errors when checking if organization, team member (#3177)Ethan Koenig2017-12-211-2/+12
|
* Improvements for supporting UI Location (#3146)Lunny Xiao2017-12-141-8/+0
| | | | | | * improvements for supporting UI Location * improved the comment
* Refactor struct's time to remove unnecessary memory usage (#3142)Lunny Xiao2017-12-111-8/+6
| | | | | | | | | | | | | | * 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
* Add reactions to issues/PR and comments (#2856)Lauris BH2017-12-041-0/+1
|