Security

last person joined: 9 hours ago 

Forum to discuss Enterprise security using HPE Aruba Networking NAC solutions (ClearPass), Introspect, VIA, 360 Security Exchange, Extensions, and Policy Enforcement Firewall (PEF).
Expand all | Collapse all

Print Template if else code to list guest user ssid per guest user role

This thread has been viewed 0 times
  • 1.  Print Template if else code to list guest user ssid per guest user role

    Posted Sep 09, 2015 05:03 AM

    Hello community,

     

    can someone help me with a code for my print template?

     

    I want that the ssid name change with the user role. My code should be make:

     

    If Role Name = 4 then put text "WLAN = mobile",

    otherwise put text "WLAN = guest".

     

    I try this but didn´t work. I don´t know something about html code.

     

    {if $u.role_name} mobile
      <tr>
       <td class="nwaBody">Wlan = Mobile</td>
      </tr>

    {

    <td class="nwaBody">Wlan = Guest</td>

    }
     {/if}

     

     



  • 2.  RE: Print Template if else code to list guest user ssid per guest user role

    Posted Sep 11, 2015 08:39 AM

    I would think it should be something like this:

     

    {if $u.role_name}
      <tr>
       <td class="nwaBody">Wlan = {if $u.role_name=mobile}Mobile{else}Guest{/if}</td>
      </tr>
    {/if}

    First line triggers if there exists a $u.role_name

    Then third line enters Mobile as WLAN if the role equals mobile, or Guest if anything else.

     

    Please note: 

    tr = table row

    td = table column/cell



  • 3.  RE: Print Template if else code to list guest user ssid per guest user role

    Posted Sep 14, 2015 04:53 AM
      |   view attached

    Thanks a lot for the reply.

     

    There is a syntax error with "=" can you please help?

     

    {if $u.role_name}
      <tr>
       <td class="nwaBody">Wlan = {if $u.role_name=mobile}Mobile{else}Guest{/if}</td>
      </tr>
    {/if}

     

    Error in template: [in __template__55f68ab234ee20.31538420.html line 3]: syntax error: unidentified token '=' (Smarty_Compiler.class.php, line 296)



  • 4.  RE: Print Template if else code to list guest user ssid per guest user role
    Best Answer

    Posted Sep 14, 2015 03:21 PM
    Use double equals sign ==


    {if $u.role_name}

    Wlan = {if $u.role_name==mobile}Mobile{else}Guest{/if}

    {/if}


  • 5.  RE: Print Template if else code to list guest user ssid per guest user role

    Posted Sep 16, 2015 04:15 AM

    Thanks a lot for your help.

     

    Now I try to build all seetings we need in a print template.

     

    Thank you so much.

     

    Regards,

     

    Marco