mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 12:02:56 +02:00
#1633 admin delete user
This commit is contained in:
1 parent
5f1183cecf
commit
2d1bb0cf49
4 files changed
+17
-13
No files matched your search
@@ -797,6 +797,7 @@ users.update_profile = Update Account Profile
|
||||
users.delete_account = Delete This Account
|
||||
users.still_own_repo = This account still has ownership over at least one repository, you have to delete or transfer them first.
|
||||
users.still_has_org = This account still has membership in at least one organization, you have to leave or delete the organizations first.
|
||||
users.deletion_success = Account has been deleted successfully!
|
||||
|
||||
orgs.org_manage_panel = Organization Manage Panel
|
||||
orgs.name = Name
|
||||
|
||||
+2
-1
@@ -670,7 +670,8 @@ func DeleteUser(u *User) (err error) {
|
||||
}
|
||||
|
||||
if err = deleteUser(sess, u); err != nil {
|
||||
return fmt.Errorf("deleteUser: %v", err)
|
||||
// Note: don't wrapper error here.
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
|
||||
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\x48\xae\x27\xfe\x9d\x4f\xc1\xf6\x09\xff\xdd\x8e\x90\xcb\xd1\xdd\xff\xbd\x44\x87\xed\x5e\x59\x6a\x5f\xe6\x58\x96\xc6\x92\x67\x76\xd6\xe1\x60\xb3\x8a\x54\x15\xc7\x55\x64\x35\xc9\x72\x59\x73\xe2\x44\xec\x6b\xec\xeb\xed\x93\x2c\xf0\x03\x90\x17\x92\x25\xd9\x3d\x27\x76\xbf\x48\xac\x4c\xe4\x0d\x89\x44\x02\x48\x24\x32\xdf\x6e\xb3\xa2\xec\x16\xe9\xd3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\xa3\x55\xd3\xf5\x65\x91\xbe\xac\x7a\xfa\xdd\x7e\xae\x16\x65\x92\xac\x9a\x4d\x49\xa0\xaf\xe8\x5f\x52\xe4\xdd\x6a\xde\xe4\x6d\x41\x09\xa7\xf6\x9d\x94\x5f\xb6\xeb\xa6\x65\xa0\x5f\xe5\x2b\x59\x95\xeb\x2d\x97\xa1\x7f\x49\x57\x2d\xeb\xac\xaa\xe9\xe7\x25\x7d\xa5\xaf\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x0c\x24\x58\xfe\xcf\xe9\x8f\x75\x91\x5e\xf6\xe5\x36\x7d\xd2\x6d\xf2\xf5\xfa\x59\xde\xa1\x48\x5f\xa6\xf9\x62\xd1\xec\xea\xfe\xc9\x63\xc9\x90\xca\x9b\x5d\x6f\xb5\x9f\xef\x7a\x49\xdb\x6d\x2d\xe9\xfd\x36\x69\xcb\x65\x45\x03\x6b\x29\xe9\x9d\x7e\x26\xfb\x72\xde\x55\x3d\x77\xfa\xaf\xf2\x95\x7c\x2e\xdb\xae\x6a\xb8\x3f\x7f\x91\xaf\x64\x9b\x2f\x19\xe0\x82\xfe\x25\x7d\xb9\xd9\xae\x73\x14\xb8\xd2\xcf\x64\x9d\xd7\xcb\x9d\xc0\xbc\xd1\xcf\x64\xd1\x96\x94\x95\xd5\xe5\x9e\x52\x4f\xf0\x63\x36\x9b\x25\x3b\xc2\x67\xb6\x6d\x9b\xeb\x6a\x5d\x66\x79\x5d\x64\x1b\xc1\xd8\x7b\x4a\x4f\x35\x3d\xa5\xf4\x94\xd3\x31\x84\xb2\x20\xe4\x64\x79\xa7\xe3\xa0\x69\x21\x5c\xe5\x5d\x82\xaa\xea\x7c\x63\xa5\xf9\x33\x29\x37\x79\xb5\xe6\x09\x78\xc4\x1f\xd4\xf1\xae\xdb\x37\x98\xa6\x0b\xfd\x24\x24\x64\xfd\xcd\xb6\x04\x0e\x1e\x5d\xd1\x57\xb2\xc8\xb7\xfd\x62\x95\x73\x3f\xe5\x2b\x21\xa0\x6d\x43\xc8\x68\xda\x1b\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x23\xef\x05\x41\xe7\xc1\xcf\x64\x53\xb5\x6d\xc3\xb8\x3d\xc3\x47\x42\x43\xcf\xb8\x1e\x4a\x79\x4b\x58\x08\x6a\xe1\x9c\x4d\xb5\x6c\x05\x8d\x9c\x79\x86\x5f\x5c\x0b\xe7\x5d\x37\xed\x27\xcd\x78\xc1\x9f\x83\xa2\xd4\x09\xcd\x8d\xdb\xcf\x6b\x42\xbc\xe6\x9e\xe1\x47\x04\xd0\x25\x79\xb1\x21\x54\x6e\xf3\xba\x64\x1c\x1d\xf3\x2f\xc2\x0b\xfd\x4a\x94\x9e\xb2\xae\xec\xfb\xaa\x5e\x32\xb2\x8f\x25\x29\xbd\xd4\xa4\x24\xc8\x73\x69\x37\xcd\xce\x4d\x27\xa5\xff\x8d\x7e\xa6\x17\xf2\x53\xf2\x82\x42\xc8\x74\x25\x79\x24\x5d\x76\x5d\x96\x85\x8c\xa5\x4b\x5f\xd0\x77\xb2\xdd\xad\xd7\x84\xb5\xdf\x77\x65\xd7\x73\xa1\x0b\xfa\x4d\xe3\x97\xdf\x49\xd5\x75\xf4\x41\xc9\xaf\xf1\x91\xd0\xd4\xd5\x0b\x0c\xe6\x04\x1f\x49\xf2\xa1\x2b\xf3\x76\xb1\xfa\x98\xc8\x7f\xf4\x95\x3f\x98\xf6\x0e\x4d\x2a\x13\x92\x12\x91\xb4\x60\x0d\x24\x8b\xa6\xe0\x1f\x27\xf4\x8f\xaa\xae\xea\xae\xa7\xd5\xf6\x31\xd1\x0f\x06\x93\x2f\x99\x80\xbe\xea\x81\x05\x4d\xc4\xd2\xed\x78\x06\xd3\x17\x55\xdb\xf5\x8f\xfa\x8a\x88\xf5\xdd\xae\x4e\x78\x7c\xb4\xd2\xb2\x62\x6e\x0c\xe8\x65\x43\x28\x42\x72\x4b\xe3\x3b\xbb\xb9\xfc\xf3\x9b\xa3\xf4\x82\xb8\xd0\xb2\x2d\xf1\x4d\x7f\xa8\xc4\x4f\x29\x55\x76\x55\x9d\x3e\x9f\x25\x54\xd6\xda\x3b\xcd\xfb\x7c\x9e\x77\xa5\x47\x2e\x67\x0a\x8d\xbb\x3c\x50\x3a\xf3\x35\xf0\xb0\xae\x8f\x46\x3d\xb5\x4e\xa8\x0e\x5d\x5d\xae\x8e\xb7\xbc\xc4\x28\x9d\xd9\x1a\x0a\x5f\xac\x4b\x4e\xa7\xaa\xd2\xd7\x6f\xdf\x9e\x9f\x3e\x4f\xcb\x7a\x59\xd5\x65\xba\xaf\xfa\x55\xba\xeb\xaf\xff\x6b\xb6\x2c\xeb\xb2\x25\x2e\xb7\xa8\x52\x5a\x59\x2d\xd1\x43\x4a\xe4\x2d\x43\x9c\x25\x5d\xb7\x26\x0e\x00\x24\x5f\x5e\xbe\x49\xcf\x18\xd1\xdb\xbc\x5f\xa1\x23\xfd\x2a\xe9\x7e\x5f\x33\xa2\x5c\x83\x57\xab\x32\x05\xad\x01\xa8\xb9\x1e\xe2\x25\x2d\xb4\xaf\xb3\xa4\x6c\xdb\x8c\x18\x54\x7f\xc3\x68\xd6\x3a\x0f\x41\x4b\x75\x44\x4c\x75\xd3\xa7\xf3\x32\x45\x39\xa9\xa2\xaa\x3f\xe7\xeb\xaa\x20\x64\x7b\x84\xc4\x65\x91\x58\x34\x34\x6f\x5c\x9a\x26\xbe\xd9\x63\xa8\xf9\x82\xf8\x6b\x97\xde\x9b\xdd\x03\x43\xbb\xf7\xe8\xde\x2c\xa9\x9b\x4c\x16\x21\xb3\xbe\xa2\xea\xf2\x39\xb1\x41\x61\xcb\xad\x31\x15\x5a\x27\xd6\x15\x85\x48\x23\x08\xc6\x2d\xb3\x7a\x70\x58\x9a\x6e\xaa\x3d\x45\xa5\xb6\x2b\x84\x63\xb7\x25\xef\xe6\x57\x56\xbd\x4b\x18\x8d\x39\xb1\x09\x33\xea\x3a\xde\x6e\xd7\xd5\x42\x9a\x7e\x29\x79\x9e\xd0\x78\x0f\x55\xa4\x84\x70\x20\x14\xcb\x0b\xc8\x85\x7a\xcd\x5c\x21\x8d\xd8\x28\xca\xaf\x4a\xda\x06\x56\xbb\xa5\x30\xff\x75\xb3\x2b\xbe\xc3\x7a\xb5\x99\xf3\xcb\x35\x7d\xd7\x50\x87\x41\x1d\x0e\xc0\x37\x71\x4c\xeb\x8e\xb7\xed\xb6\xdc\x34\x3d\x23\x4e\x8b\x55\x34\x3d\xfb\x8a\x32\x69\xa4\x5d\xfe\x99\xb8\x4e\xdf\xa4\xfd\xaa\xea\x08\xc7\x6d\xb9\xe0\x8a\x89\x41\xec\x68\xc3\x94\x65\x41\xcb\x54\x96\x86\xa5\xc5\x34\x08\xa8\xcd\x8e\x56\xd3\x8a\x2a\x63\xc4\xb3\xec\x40\x55\x4e\xf5\x13\x43\xa2\x7a\xb0\xca\x69\xe5\x36\xb4\x37\xf1\x44\x9f\xe2\x43\x7f\x87\xf5\x53\xaf\xf2\xeb\x6b\xea\x55\x47\xab\xe2\x55\xba\x58\x37\xb4\xa4\xde\xbf\x7b\xd3\xf1\x82\x59\x65\xdb\xa6\xc5\x46\x4f\x59\x17\xf4\xe9\xd2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\xd7\x7e\x55\x11\x1f\x04\xda\xb9\x04\xcb\x33\x94\x4a\x4d\xec\x3a\x9a\xc2\xa3\x94\x96\x30\x8d\x80\x50\x06\x02\xe0\x31\x18\xd5\x31\xf8\x35\xd1\xd8\xae\xa5\xe5\xb4\xea\xfb\xad\xb5\xfc\xea\xea\xea\x42\x9a\x76\xa9\xb7\xb5\x9d\x07\x94\x81\x39\x58\xb3\xe8\x51\xa7\x4d\x3d\x03\x91\xec\xda\xf5\x80\x7e\x68\xac\x96\x73\x00\x2f\xdc\x85\xc7\xfc\xe7\xd2\xa3\x07\x78\xee\x48\x3e\xdb\x83\x9a\x08\xc7\x2Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\xbd\xeb\x72\xdc\xc8\x8e\x27\xfe\x9d\x4f\xc1\xf6\x84\xff\xee\x8e\x90\xcb\xd1\xdd\xff\xbd\x44\x47\xdb\xbd\xb2\xd4\xbe\xcc\x58\x96\xc6\x52\x9f\xb3\x67\x1d\x8e\x6a\x56\x91\xaa\xe2\x71\x15\x59\x4d\xb2\x2c\xeb\x4c\x4c\xc4\xbe\xc6\xbe\xde\x3e\xc9\x02\x3f\x00\x79\x23\x4b\xb2\xcf\x99\xd8\xfd\x22\xb1\x32\x91\x37\x24\x12\x09\x20\x91\xc8\x62\xb7\x9b\x97\x55\xbf\xcc\x9f\xe6\xc7\xf9\xae\xa8\x9b\x4d\xd5\xf7\x79\x5f\x6d\xae\x1f\xaf\xdb\x7e\xa8\xca\xfc\x65\x3d\xd0\xef\xee\x53\xbd\xac\xb2\x6c\xdd\x6e\x2b\x02\x7d\x45\xff\xb2\xb2\xe8\xd7\x8b\xb6\xe8\x4a\x4a\x38\xb5\xef\xac\xfa\xbc\xdb\xb4\x1d\x03\xfd\x2a\x5f\xd9\xba\xda\xec\xb8\x0c\xfd\xcb\xfa\x7a\xd5\xcc\xeb\x86\x7e\x5e\xd2\x57\xfe\xba\xc9\xfa\x76\x59\x17\x9b\x79\x90\x81\x04\xcb\xff\x29\xff\xa1\x29\xf3\xcb\xa1\xda\xe5\x3f\xf7\xdb\x62\xb3\x79\x56\xf4\x28\x32\x54\x79\xb1\x5c\xb6\xfb\x66\xf8\xf9\x89\x64\x48\xe5\xed\x7e\xb0\xda\xcf\xf7\x83\xa4\xed\x77\x96\xf4\xdb\x2e\xeb\xaa\x55\x4d\x03\xeb\x28\xe9\x9d\x7e\x66\x37\xd5\xa2\xaf\x07\xee\xf4\x9f\xe5\x2b\xfb\x54\x75\x7d\xdd\x72\x7f\xfe\x24\x5f\xd9\xae\x58\x31\xc0\x05\xfd\xcb\x86\x6a\xbb\xdb\x14\x28\x70\xa5\x9f\xd9\xa6\x68\x56\x7b\x81\x79\xa3\x9f\xd9\xb2\xab\x28\x6b\xde\x54\x37\x94\x7a\x82\x1f\xb3\xd9\x2c\xdb\x13\x3e\xe7\xbb\xae\xbd\xae\x37\xd5\xbc\x68\xca\xf9\x56\x30\xf6\x1b\xa5\xe7\x9a\x9e\x53\x7a\xce\xe9\x18\x42\x55\x12\x72\xe6\x45\xaf\xe3\xa0\x69\x21\x5c\x15\x7d\x86\xaa\x9a\x62\x6b\xa5\xf9\x33\xab\xb6\x45\xbd\xe1\x09\x78\xcc\x1f\xd4\xf1\xbe\xbf\x69\x31\x4d\x17\xfa\x49\x48\x98\x0f\xb7\xbb\x0a\x38\x78\x7c\x45\x5f\xd9\xb2\xd8\x0d\xcb\x75\xc1\xfd\x94\xaf\x8c\x80\x76\x2d\x21\xa3\xed\x6e\x01\x67\x3f\xb2\xb6\x5b\x15\x4d\xfd\xb7\x62\x10\x04\x9d\x07\x3f\xb3\x6d\xdd\x75\x2d\xe3\xf6\x0c\x1f\x19\x0d\x7d\xce\xf5\x50\xca\x5b\xc2\x42\x50\x0b\xe7\x6c\xeb\x55\x27\x68\xe4\xcc\x33\xfc\xe2\x5a\x38\xef\xba\xed\x3e\x6a\xc6\x0b\xfe\x4c\x8a\x52\x27\x34\x37\x6e\xbf\x68\x08\xf1\x9a\x7b\x86\x1f\x11\x40\x9f\x15\xe5\x96\x50\xb9\x2b\x9a\x8a\x71\x74\xcc\xbf\x08\x2f\xf4\x2b\x53\x7a\x9a\xf7\xd5\x30\xd4\xcd\x8a\x91\x7d\x2c\x49\xf9\xa5\x26\x65\x41\x9e\x4b\xbb\x6d\xf7\x6e\x3a\x29\xfd\x2f\xf4\x33\xbf\x90\x9f\x92\x17\x14\x42\xa6\x2b\xc9\x23\xe9\xe7\xd7\x55\x55\xca\x58\xfa\xfc\x05\x7d\x67\xbb\xfd\x66\x43\x58\xfb\x63\x5f\xf5\x03\x17\xba\xa0\xdf\x34\x7e\xf9\x9d\xd5\x7d\x4f\x1f\x94\xfc\x1a\x1f\x19\x4d\x5d\xb3\xc4\x60\x4e\xf0\x91\x65\xef\xfb\xaa\xe8\x96\xeb\x0f\x99\xfc\x47\x5f\xf9\x83\x69\xef\xd0\xa4\x32\x21\x29\x11\x49\x0b\xd6\x40\xb6\x6c\x4b\xfe\x71\x42\xff\xa8\xea\xba\xe9\x07\x5a\x6d\x1f\x32\xfd\x60\x30\xf9\x92\x09\x18\xea\x01\x58\xd0\x44\x2c\xdd\x9e\x67\x30\x7f\x51\x77\xfd\xf0\x78\xa8\x89\x58\xdf\xed\x9b\x8c\xc7\x47\x2b\x6d\x5e\x2e\x8c\x01\xbd\x6c\x09\x45\x48\xee\x68\x7c\x67\xb7\x97\xff\xfa\xe6\x28\xbf\x20\x2e\xb4\xea\x2a\x7c\xd3\x1f\x2a\xf1\x63\x4e\x95\x5d\xd5\xa7\xcf\x67\x19\x95\xb5\xf6\x4e\x8b\xa1\x58\x14\x7d\xe5\x91\xcb\x99\x42\xe3\x2e\x0f\x94\xce\x7c\x0d\x3c\xac\x1f\xa2\x51\x4f\xad\x13\xaa\x43\x57\x97\xab\xe3\x2d\x2f\x31\x4a\x67\xb6\x86\xc2\x17\x9b\x8a\xd3\xa9\xaa\xfc\xf5\xdb\xb7\xe7\xa7\xcf\xf3\xaa\x59\xd5\x4d\x95\xdf\xd4\xc3\x3a\xdf\x0f\xd7\xff\x75\xbe\xaa\x9a\xaa\x23\x2e\xb7\xac\x73\x5a\x59\x1d\xd1\x43\x4e\xe4\x2d\x43\x9c\x65\x7d\xbf\x21\x0e\x00\x24\x5f\x5e\xbe\xc9\xcf\x18\xd1\xbb\x62\x58\xa3\x23\xc3\x3a\xeb\xff\xd8\x30\xa2\x5c\x83\x57\xeb\x2a\x07\xad\x01\xa8\xbd\x4e\xf1\x92\x97\xda\xd7\x59\x56\x75\xdd\x9c\x18\xd4\x70\xcb\x68\xd6\x3a\x0f\x41\x4b\x75\x44\x4c\x4d\x3b\xe4\x8b\x2a\x47\x39\xa9\xa2\x6e\x3e\x15\x9b\xba\x24\x64\x7b\x84\xc4\x65\x91\x58\xb6\x34\x6f\x5c\x9a\x26\xbe\xbd\xc1\x50\x8b\x25\xf1\xd7\x3e\x7f\x30\x7b\x00\x86\xf6\xe0\xf1\x83\x59\xd6\xb4\x73\x59\x84\xcc\xfa\xca\xba\x2f\x16\xc4\x06\x85\x2d\x77\xc6\x54\x68\x9d\x58\x57\x14\x22\x8f\x20\x18\xb7\xcc\xea\xc1\x61\x69\xba\xa9\xf6\x1c\x95\xda\xae\x10\x8e\xdd\x96\xbc\x9b\x5f\x59\xf5\x2e\x61\x34\xe6\xcc\x26\xcc\xa8\xeb\x78\xb7\xdb\xd4\x4b\x69\xfa\xa5\xe4\x79\x42\xe3\x3d\x54\x91\x12\xc2\x81\x50\x2c\x2f\x20\x17\xea\x35\x73\x85\x3c\x62\xa3\x28\xbf\xae\x68\x1b\x58\xef\x57\xc2\xfc\x37\xed\xbe\xfc\x06\xeb\xd5\x66\xce\x2f\xd7\xfc\x5d\x4b\x1d\x06\x75\x38\x00\xdf\xc4\x31\xad\x3b\xde\xb6\xbb\x6a\xdb\x0e\x8c\x38\x2d\x56\xd3\xf4\xdc\xd4\x94\x49\x23\xed\x8b\x4f\xc4\x75\x86\x36\x1f\xd6\x75\x4f\x38\xee\xaa\x25\x57\x4c\x0c\x62\x4f\x1b\xa6\x2c\x0b\x5a\xa6\xb2\x34\x2c\x2d\xa6\x41\x40\x6d\xf7\xb4\x9a\xd6\x54\x19\x23\x9e\x65\x07\xaa\x72\xaa\x9f\x18\x12\xd5\x83\x55\x4e\x2b\xb7\xa5\xbd\x89\x27\xfa\x14\x1f\xfa\x3b\xac\x9f\x7a\x55\x5c\x5f\x53\xaf\x7a\x5a\x15\xaf\xf2\xe5\xa6\xa5\x25\xf5\xdb\xbb\x37\x3d\x2f\x98\xf5\x7c\xd7\x76\xd8\xe8\x29\xeb\x82\x3e\x5d\x5a\x80\x68\x86\x68\xf6\xdb\x05\xfd\xba\x59\xd7\xc4\x07\x81\x76\x2e\xc1\xf2\x0c\xa5\x52\x13\xfb\x9e\xa6\xf0\x28\xa7\x25\x4c\x23\x20\x94\x81\x00\x78\x0c\x46\x75\x0c\x7e\x4d\x34\xb6\xef\x68\x39\xad\x87\x61\x67\x2d\xbf\xba\xba\xba\x90\xa6\x5d\xea\x5d\x6d\x17\x01\x65\x60\x0e\x36\x2c\x7a\x34\x79\xdb\xcc\x40\x24\xfb\x6e\x93\xd0\x0f\x8d\xd5\x72\x0e\xe0\x85\xbb\xf0\x84\xff\x5c\x7a\xf4\x00\xcf\x3d\xc9\x67\x37\xaLine truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 43507, mode: os.FileMode(420), modTime: time.Unix(1442160213, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 43571, mode: os.FileMode(420), modTime: time.Unix(1442164663, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
+12
-10
@@ -220,13 +220,7 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) {
|
||||
}
|
||||
|
||||
func DeleteUser(ctx *middleware.Context) {
|
||||
uid := com.StrTo(ctx.Params(":userid")).MustInt64()
|
||||
if uid == 0 {
|
||||
ctx.Handle(404, "DeleteUser", nil)
|
||||
return
|
||||
}
|
||||
|
||||
u, err := models.GetUserByID(uid)
|
||||
u, err := models.GetUserByID(ctx.ParamsInt64(":userid"))
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetUserByID", err)
|
||||
return
|
||||
@@ -236,15 +230,23 @@ func DeleteUser(ctx *middleware.Context) {
|
||||
switch {
|
||||
case models.IsErrUserOwnRepos(err):
|
||||
ctx.Flash.Error(ctx.Tr("admin.users.still_own_repo"))
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid"))
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
"redirect": setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid"),
|
||||
})
|
||||
case models.IsErrUserHasOrgs(err):
|
||||
ctx.Flash.Error(ctx.Tr("admin.users.still_has_org"))
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid"))
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
"redirect": setting.AppSubUrl + "/admin/users/" + ctx.Params(":userid"),
|
||||
})
|
||||
default:
|
||||
ctx.Handle(500, "DeleteUser", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
log.Trace("Account deleted by admin(%s): %s", ctx.User.Name, u.Name)
|
||||
ctx.Redirect(setting.AppSubUrl + "/admin/users")
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("admin.users.deletion_success"))
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
"redirect": setting.AppSubUrl + "/admin/users",
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user