ChrisJenkins

Q: How can I remove a user from the Wiki server?

As part of some troubleshooting with Apple Support I had to create a couple of test users in Open Directoiry and then create blogs for them in the WiKi server.

 

Now that is finished I want to remove them from the Wiki server as they are polluting the 'People' page. Unfortunately you cannot 'hide' Network users in the Wiki server (only local users) and deleting them from OD does not remove them from the Wiki server. So I am now left with two 'orphan' users in my Wiki setup. I cannot log in as them (as they no longer exist in OD) nor can I hide or delete them from within the Wiki server (as it does not seem to provide these functions).

 

Can anyone help?

 

Chris

Posted on Aug 23, 2013 4:15 AM

Close

Q: How can I remove a user from the Wiki server?

  • All replies
  • Helpful answers

  • by Francis Drouillard,

    Francis Drouillard Francis Drouillard Aug 23, 2013 11:26 AM in response to ChrisJenkins
    Level 1 (14 points)
    Desktops
    Aug 23, 2013 11:26 AM in response to ChrisJenkins

    What happens when you sign into the Wiki server with admin privileges then delete the wikis?

  • by ChrisJenkins,

    ChrisJenkins ChrisJenkins Aug 24, 2013 7:57 AM in response to Francis Drouillard
    Level 1 (15 points)
    Apple Music
    Aug 24, 2013 7:57 AM in response to Francis Drouillard

    These users do not have any wikis. Users and wikis are separate objects and it is perfectly possible to have a user without a wiki.

     

    It turns out that although one cannot delete them one can at least 'hide' them. If you login to the Wiki server as alocal admin user, click on one of the users and then click the gear icon at the top of the page then you have the option to hide the user.

     

    Not a perfect solution but an adequate one.

  • by FlorianLeo,

    FlorianLeo FlorianLeo Apr 1, 2014 12:47 AM in response to ChrisJenkins
    Level 1 (9 points)
    Mac OS X
    Apr 1, 2014 12:47 AM in response to ChrisJenkins

    Nope - that's not true - no button in the gear-wheel-menue

  • by ChrisJenkins,

    ChrisJenkins ChrisJenkins Apr 1, 2014 1:18 AM in response to FlorianLeo
    Level 1 (15 points)
    Apple Music
    Apr 1, 2014 1:18 AM in response to FlorianLeo

    No. It looks like they removed this option in Server 3.0 :-( At least I no longer see the option on my systems running Server 3.0.3 and Server 3.1.1.

     

    I actually solved my original problem in a much more compelx and scary way. I analysed the structure of the PostGres database used to store all the WikiData and then wroet a script to delete all the items for all the users I wanted to get rid of, plus the users themselves. Then I tested it thouroughly on a backup of the database and eventually used it on my real database. It still needed a lot of manual 'cleanup' but the end result was good.

     

    Not an exercise I woudl care to repeat. Apple really should provide some supported tools for this!!!

  • by MagnusWE,

    MagnusWE MagnusWE Apr 2, 2014 5:59 AM in response to FlorianLeo
    Level 1 (0 points)
    Apr 2, 2014 5:59 AM in response to FlorianLeo

    I had the same issue with no hide user when opening "gear-wheel-menue" in Mavericks.

     

    I then stumbeled on that you have to go to the profile of the user that should be hidden, then press documents in the upper-right corner. Now you should have "hide person" in the gear-wheel-menu. As long as you are logged in with a local admin account.

     

    Not shure why it has been moved?

  • by FlorianLeo,

    FlorianLeo FlorianLeo Apr 3, 2014 8:15 PM in response to MagnusWE
    Level 1 (9 points)
    Mac OS X
    Apr 3, 2014 8:15 PM in response to MagnusWE

    There are 3 orphaned entries

    • default bot group user
    • defaultscmrepogroupu
    • servermgr_xcode

    once you klick on one of them, an error-page shows - and that's it. No Documents, no Gearwheel to hide a user

  • by FlorianLeo,

    FlorianLeo FlorianLeo Apr 3, 2014 9:45 PM in response to MagnusWE
    Level 1 (9 points)
    Mac OS X
    Apr 3, 2014 9:45 PM in response to MagnusWE

    the real question in my opinion is: "How would we manipulate the PSQL-Database instead"

     

    If you just try - you fail - believe me, I tried. Since I am not an psql-specialist, and there's no in depth documentation about this database (ERD etc.) it would really be nice if anybody .......

     

    Well, one would say "what about wikiadmin?!" - yeah - same problem. Documents about wikiadmin are in my opinion isufficient.

  • by toop68,

    toop68 toop68 Jun 15, 2014 5:42 AM in response to FlorianLeo
    Level 1 (27 points)
    Servers Enterprise
    Jun 15, 2014 5:42 AM in response to FlorianLeo

    Florian, did you found a solution to those orphaned entries?

    They also showed up in my wiki server with no option to hide.

  • by Laurent Seroude,

    Laurent Seroude Laurent Seroude Aug 1, 2014 11:53 AM in response to ChrisJenkins
    Level 1 (69 points)
    Publishing
    Aug 1, 2014 11:53 AM in response to ChrisJenkins

    Same problem here as well...DId you (or anyone here) find a way to fix it?

  • by kbacon,

    kbacon kbacon Jul 8, 2015 11:02 AM in response to ChrisJenkins
    Level 1 (35 points)
    Mac OS X
    Jul 8, 2015 11:02 AM in response to ChrisJenkins

    Same issue here with Yosemite and Server 4.1.3 (Build 14S1127).

  • by alternapop,

    alternapop alternapop Jul 29, 2015 2:28 PM in response to kbacon
    Level 3 (779 points)
    Jul 29, 2015 2:28 PM in response to kbacon

    I upgraded an Xserve from 10.6.8 to 10.10 and see the same thing.

  • by FlorianLeo,

    FlorianLeo FlorianLeo Feb 11, 2016 6:57 AM in response to ChrisJenkins
    Level 1 (9 points)
    Mac OS X
    Feb 11, 2016 6:57 AM in response to ChrisJenkins

    I've tried to dig into it - deep into it.

     

    I've managed to connect to the Database - took me a while.

    bash-3.2# psql -h "/Library/Server/Wiki/PostgresSocket" -p 5432 collab collab

    psql (9.3.9)

    Type "help" for help.

     

    collab=# \d

                      List of relations

    Schema |            Name            | Type  | Owner

    --------+-----------------------------+-------+--------

    public | adc_device_entity          | table | collab

    public | adc_team_entity            | table | collab

    public | blog_entity                | table | collab

    public | bot_entity                  | table | collab

    public | botgroup_entity            | table | collab

    public | botrun_entity              | table | collab

    public | build_agent_registry        | table | collab

    public | document_entity            | table | collab

    public | email_notification          | table | collab

    public | entity                      | table | collab

    public | entity_acls                | table | collab

    public | entity_acls_defaults        | table | collab

    public | entity_attrs                | table | collab

    public | entity_auditlog            | table | collab

    public | entity_changesets          | table | collab

    public | entity_comment              | table | collab

    public | entity_lock                | table | collab

    public | entity_preview              | table | collab

    public | entity_private_attrs        | table | collab

    public | entity_tag                  | table | collab

    public | entity_type                | table | collab

    public | file_entity                | table | collab

    public | filedata_entity            | table | collab

    public | filename_reservation        | table | collab

    public | global_settings            | table | collab

    public | groups                      | table | collab

    public | migration_entity            | table | collab

    public | migration_status            | table | collab

    public | migrationplaceholder_entity | table | collab

    public | page_entity                | table | collab

    public | preview_queue              | table | collab

    public | relationship                | table | collab

    public | savedquery_entity          | table | collab

    public | scm_commit_entity          | table | collab

    public | scm_server                  | table | collab

    public | scmrepogroup_entity        | table | collab

    public | search_index                | table | collab

    public | search_stat                | table | collab

    public | session                    | table | collab

    public | subscription                | table | collab

    public | timeseries                  | table | collab

    public | timeseries_toc              | table | collab

    public | user_activity              | table | collab

    public | user_entity                | table | collab

    public | user_entity_favorites      | table | collab

    public | user_entity_read_status    | table | collab

    public | user_entity_unread_status  | table | collab

    public | user_entity_updates        | table | collab

    public | user_entity_watched        | table | collab

    public | user_readall_time          | table | collab

    public | visible_entity_tag          | view  | collab

    public | wiki_entity                | table | collab

    public | work_queue                  | table | collab

    public | work_schedule              | table | collab

    public | work_schedule_recurrence    | table | collab

    public | work_schedule_status        | table | collab

    (56 rows)

     

    Of interest are the tables

    • entity
    • user_entity

     

    You can do a query on the table entity with

    collab=# \x

    Expanded display is on.

    collab=# SELECT * FROM entity WHERE long_name='defaultscmrepogroupu';

    -[ RECORD 1 ]----------+---------------------------------------

    uid                    | 1e69725d-4494-b1a1-10ef-b1a1d6204fd5

    tiny_id                | defaultscmrepogroupu

    entity_type_fk         | com.apple.entity.User

    short_name             | defaultscmrepogroupu

    long_name              | defaultscmrepogroupu

    description            |

    create_time            | 2013-10-28 22:07:32.120515

    update_time            | 2013-10-28 22:07:32.120515

    revision               | 1

    createdby_user_fk      | 1e69725d-4494-b1a1-10ef-b1a1d6204fd5

    updatedby_user_fk      | 1e69725d-4494-b1a1-10ef-b1a1d6204fd5

    ownedby_uid_fk         |

    owner_entity_type_fk   |

    avatar_uid_fk          |

    is_deleted             | f

    is_perm_deleted        | f

    is_hidden              | t

    is_blog_enabled        | f

    is_deleted_with_parent | f

    parent_uids            | {1e69725d-4494-b1a1-10ef-b1a1d6204fd5}

    theme_info             |

    blog_uid_fk            |

    container_uid_fk       |

     

    Do the query on the table again but now

    SELECT * FROM entity WHERE entity_type_fk='com.apple.entity.User';

    and focus on the is_hidden value! Compare between the records -> print the list and place the next to each other. It takes a while but it's worth it.

     

    I've altered (through an UPDATE-command) the users

    • defaultscmrepogroupu
    • servermgr_xcode
    • default bot group user

    so that the is_hidden is set to t (t for true).

     

    BAD NEWS - it doesn't work! They still show on the peoples page

    However, it works for any other user that is not a System-User i.e. is either as user on the server or via Open Directory

     

    Has anyone an idea?!

     

     

     

     

    Table user_entity

     

    You can verify through this table if UIDs i.e. any numbers match. In this table you can verify if for example login_name and UID coming from Directory-Service (of any kind) do match

  • by FlorianLeo,

    FlorianLeo FlorianLeo Feb 11, 2016 9:34 AM in response to toop68
    Level 1 (9 points)
    Mac OS X
    Feb 11, 2016 9:34 AM in response to toop68

    Hi Toop

     

    I found a way - a terrible one since it may take you almost a day?

     

    Are you familiar with postgresql-CLI?! If not, you are going to have a steep learning-curve!

     

    Just must be sudo! Log in with:

    bash-3.2# psql -h "/Library/Server/Wiki/PostgresSocket" -p 5432 collab collab

    psql (9.3.9)

    Type "help" for help.

     

    collab=#

     

    Well - as I've figured out - the hub of everything is seemingly the entity-table. You need to look at the whole record for the mentioned users i.e. from within the pgsql-CLI search the table entity with:

    SELECT * FROM entity WHERE short_name='defaultscmrepogroupu';

    Try to delete this entry with:

    DELETE FROM entity WHERE short_name='defaultscmrepgroupu';

    and READ CAREFULLY the error-statement from the CLI i.e. the CLI tells you where there are still dependencies in other tables that reference to this entry. Try to delete them 1 by 1 until the entry in entity is the only one that's left.

     

    Cheers and GOOD LUCK

  • by FlorianLeo,

    FlorianLeo FlorianLeo Feb 11, 2016 11:50 AM in response to toop68
    Level 1 (9 points)
    Mac OS X
    Feb 11, 2016 11:50 AM in response to toop68

    .... oh - I almost forgot - DON'T FORGET TO VACUUM <- literally - I mean the command from psql-cli