Customer Portal

Get Involved. Join the Conversation.

Topic

    Tuğçen İlke Çolak
    Login Customers on PortalAnswered
    Topic posted January 16, 2019 by Tuğçen İlke ÇolakRed Ribbon: 250+ Points 
    81 Views, 1 Comment
    Title:
    Login Customers on Portal
    Content:

    Hi All,

    Is there any way to understand login customers on portal? I need to show different fields on the workspaces to the agents, according to login customers and the other customers. For example, if the customer logins to the portal agent will see field A and B, if the customer is not login to the portal, agent will see  just field B.

    Thanks

     

    Best Comment

    Gursimran Singh Saini

    Totally possible.

    1. Create a custom field on Contacts table: Logged-In to CP (Yes/No)

    2. Create a Custom Model (ContactModel.php) which has two functions: PostLogin and PostLogout
    In PostLogin, set the Logged-In field to Yes
    In PostLogout, set the Logged-In field to No

    3. In hooks.php, add following code:
    $rnHooks['post_login'][] = array(
       'class' => 'ContactModel',
        'function' => 'PostLogin',
        'filepath' => ''
    );
    $rnHooks['post_logout'][] = array(
       'class' => 'ContactModel',
        'function' => 'PostLogout',
        'filepath' => ''
    );

    4. Now you create a workspace rule which shows/hides fields based on value of Contact.CustomFields.c.logged_in

    Comment

     

    • Gursimran Singh Saini

      Totally possible.

      1. Create a custom field on Contacts table: Logged-In to CP (Yes/No)

      2. Create a Custom Model (ContactModel.php) which has two functions: PostLogin and PostLogout
      In PostLogin, set the Logged-In field to Yes
      In PostLogout, set the Logged-In field to No

      3. In hooks.php, add following code:
      $rnHooks['post_login'][] = array(
         'class' => 'ContactModel',
          'function' => 'PostLogin',
          'filepath' => ''
      );
      $rnHooks['post_logout'][] = array(
         'class' => 'ContactModel',
          'function' => 'PostLogout',
          'filepath' => ''
      );

      4. Now you create a workspace rule which shows/hides fields based on value of Contact.CustomFields.c.logged_in