Delete all shares directly on DB

Hello everyone.

Is there a way i can delete reshares on my files maybe direct on the DB (oc_share table)??

i have admin1 that share a folder with user2 and user2 reshared that file with user3. I want to be able to delete all shares so only admin1 can see the files. Note: i may or may not have the password of admin1.

OC Version 10.0.10

As far as I can tell there is no way to look only for re shares in the database. It’s a share type 0, just like a normal user share.

You can reset your admins password, or set it to something you want. You can also create a new user with a new password and put him in the admin group, granting him admin privileges.

Here is the occ password reset command:

occ user:resetpassword --help
Description:
  Resets the password of the named user.

Usage:
  user:resetpassword [options] [--] <user>

Arguments:
  user                     The user's name.

Options:
      --password-from-env  Read the password from the OC_PASS environment variable.
      --send-email         The email-id set while creating the user, will be used to send link for password reset. This option will also display the link sent to user.
      --output-link        The link to reset the password will be displayed.
1 Like

Sorry if I didn’t make myself clear. I want to delete all shares, no matter who the share user is. Just found the reshare=true arguments from OCS api but that way I would need to iterate over every share

new information:

UID_OWNDER = UID_INITIATOR ->>> normal share
UID_OWNDER =/= UID_INITIATOR ->>> re-share

example:

+----+-----------+---------------+
| id | uid_owner | uid_initiator |
+----+-----------+---------------+
| 13 | admin     | admin         |
| 14 | admin     | user1         |
+----+-----------+---------------+
2 Likes