Log out redirection

Hi Iam using  elgg(1.8), the file menu part in my web site . 

If  I log out the url redirect to default activity page but i want it redirect to my about us page how can i make it 

any one please help me.

  • To do this you should write your custom handler for the logout event.  So you need to write a simple plugin like this:

    <?php
        /**
        * Logout Redirector
        *
        */
       
    function logout_redirector_init() {
            elgg_register_event_handler('logout','user','logout_redirector_handler');
    }

    function logout_redirector_handler($event, $type, $entity)    {

        // Redirect the user to wherever you want
        forward(elgg_get_site_url() . 'your about page'); 
    }

    elgg_register_event_handler('init', 'system', 'logout_redirector_init');
    ?>

     

  • sory am very new in elgg can you please cleare it where i write  the plugin..

  • @sharon - read up on the structure of a plugin - all you need for this is the manifest and what elggcloud posted as the start.php

    Documentation: docs.elgg.org

     

    Also, please just post your question once.

     

  • No problem, it is really easy to create plugins for Elgg, and such a logout redirector plugin will be a very small one.

    First of all, you should start with reading this documentation:

    http://docs.elgg.org/wiki/Plugin_development

    And, here is a short guidance:

    1. You create a subdirectory called logout-redirector under /mod folder. Every Elgg plugin sits in a subdirectory of the /mod folder.

    2. Create a the file start.php under /mod/logout-redirector subdirectory.

    3. Copy and paste the code I posted in start.php

    4. Create the plugin manifest file manifest.xml under /mod/logout-redirecto subdirectory. You can see so many examples of manifest files in Elgg community plugins in order to create your own. It is just a simple xml file to edit.

    5. Activate your plugin in your Elgg admin site.

     

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking