Modify URL to replace Username by GUID. How to do ?

 Hello everybody,

I would like to rewrite the url of links of the owner block, in the beside menu.

The URL are : URL_ROOT + /_plugin_name_ + "/owner/JamesKnok".

I would like to replace "JamesKnok" (username) by "45" (GUID).

Is there a plugin which already exist ?

Thanks,

CV

Question

 

 

 

 

 

 

 

 




  • Why you need this?

    Unfortunately there exists no plugin for this. Its because the owner block menus are independently registered by individual plugins. If you want to change it, its a difficult task (not impossible), because you have to create new ownerblock menu's for each and every plugins and have to create new page handlers too. 

  • I'm sure we can help you more if you explain the reason why you want to have guids in the URLs. What is the problem that you are trying to solve by replacing the username?

  • Hello Everybody,

    Thanks for your replies,

    Why I need to hide usernames ?

    I am working with an NGO where most of the members are Civil servant. They must therefore exercise certain reservations.

    They want to publish on our Elgg platform but they need to be sure to write in absolute confidential conditions.

    I found a solution for profile : www.myhost.net/elgg/45

    Through this url we can access to an "anonymous" profile which only shows "display names".

    Unfortunately, I noticed that in the Profile page, owner block has "username" mentions.

    Members want to get direct notifications on their private e-mail addresses (obvioulsy, the easiest way of doing in their point of view ...) . Our registration username system is based on the "username" of their email.

    @Team Webgalli : I understood that would be a bothering stuff to do.

    @RvR : I am not sure to be familiar enough with .htaccess.

    What do you think about : Pagehandler Hijack 1.8.x for Elgg 1.8 ?

    Can it be a way of doing ?

    Regards,

    CV

  • Removing all usages of usernames on the bage may be a lot of work.

    In general have a look at

    • elgg_register_entity_url_handler('user', 'all', 'profile_url'); - replace the username in url generation with 
    • plugin hook 'route', 'profile' - use it to rewrite internally guid's to usernames

    Might be one of easier ways to do it.

    On the other hand you could rewrite logging in process and use something with more anonymity for the real usernames but store "user friendly username" in metadata.

  • I would also recommend changing the way how you choose usernames.

    For one site I made a system that uses timestamp for username at registration. Once the ElggUser objects has been saved for the first time it gets it's own guid. After this the random string is replaced by the guid.

  • @Pawel, @Juho : Thanks for your advices.

    I will change the way of choosing usernames.

    That is the easiest solution.

    Regards,

    CV