-<div class="header-dark">Shop Discount</div>
-
-<p>
- Enjoy 20% off all merchandise at the
- <a href="http://shop.fsf.org/">FSF shop</a>
- using promotional code <strong>ASSOC</strong>
-</p>
-
-<div class="header-dark">LibrePlanet</div>
-
-<a href="http://libreplanet.org">
- <img src="https://static.fsf.org/nosvn/big-logo.png" alt="LibrePlanet" />
-</a>
-
-<p>
- Associate members get gratis admission to
- <a href="http://libreplanet.org">LibrePlanet</a>,
- the FSF's annual conference.
-</p>
-
-<p>
- Use your FSF account to join a
- <a href="http://libreplanet.org/">
- local free software group at LibrePlanet.
- </a>
-</p>
-
-<div class="header-dark">Jabber/XMPP</div>
-
-<p>
- Your Jabber/XMPP account is: <strong>{$user->name}@member.fsf.org</strong>
-</p>
-
-<h3>Instructions</h3>
-
-<p>
- Use your FSF username as the jabber username, and member.fsf.org as
- the domain if your XMPP client supports server discovery via a DNS
- SRV record lookup. Most XMPP clients support this. If your client
- does not, you can use jabber.member.fsf.org as the server name. Make
- sure to enable encryption: we support TLS on port 5222 only. Your
- password is the same as your FSF member password. (Please report
- any problems you might encounter to
- <a href="mailto:sysadmin@gnu.org">sysadmin@gnu.org</a>.)
-</p>
-
-<div class="header-dark">Email Forwarding</div>
-
-<p>
- You may maintain up to five email aliases. Each localpart name
- exists in the member.fsf.org domain name and can forward to one
- email address. The localpart you request might not be available.
-</p>
-
-<p>
- For example, a localpart of "yyz" with a forward to value of
- "xyzzy@example.com" would cause mail sent to "yyz@member.fsf.org" to
- be forwarded to "xyzzy@example.com".
-</p>
-
-<p>
- Please note that it may take up to a half hour for new forwards to
- take effect.
-</p>
-
-<p>
- mail forwarding form goes here
-</p>
-
-<div class="header-dark">Member Forums</div>
-
-<p>
- Post and participate in our
- <a href="https://my.fsf.org/associate/forum">
- Members-Only Forums
+{if $hasValidMembership}
+ <div class="header-dark">Shop Discount</div>
+
+ <p>
+ Enjoy 20% off all merchandise at the
+ <a href="http://shop.fsf.org/">FSF shop</a>
+ using promotional code <strong>ASSOC</strong>
+ </p>
+
+
+ <div class="header-dark"> Discount on Hardware from ThinkPenguin </div>
+
+ <p>
+ <a href="https://www.thinkpenguin.com/">ThinkPenguin</a> is a purveyor of computers and
+ peripherals that provides 5% off all their products to FSF members. ThinkPenguin offers some
+ devices that are certified by the FSF under our <a href="https://www.fsf.org/ryf">Respects
+ Your Freedom hardware certification</a>, and all of their products are able to run or
+ interface with <a href="https://www.gnu.org/distros/free-distros.html">free GNU/Linux
+ distributions</a>. Use the discount code <strong>FSFMEMBER</strong> at checkout.
+ </p>
+
+
+ {if !empty($buttonUrl) }
+ <div class="header-dark">Member button</div>
+
+ <p>
+ Display this member button proudly on your website to show how
+ long you have been an FSF member!
+ </p>
+
+ <img src="{$buttonUrl}{$contact.id}.png" />
+ {/if}
+
+
+ <div class="header-dark">LibrePlanet</div>
+
+ <a href="https://libreplanet.org">
+ <img src="//static.fsf.org/nosvn/big-logo.png" alt="LibrePlanet" />
</a>
-</p>
+
+ <p>
+ Associate members get gratis admission to
+ <a href="https://libreplanet.org">LibrePlanet</a>,
+ the FSF's annual conference.
+ </p>
+
+ <p>
+ Use your FSF account to join a
+ <a href="https://libreplanet.org/">
+ local free software group at LibrePlanet.
+ </a>
+ </p>
+
+
+ <div class="header-dark">Email Forwarding</div>
+
+ <p>
+ You may maintain up to five email aliases. Each localpart name
+ exists in the member.fsf.org domain name and can forward to one
+ email address. The localpart you request might not be available.
+ </p>
+
+ <p>
+ For example, a localpart of "yyz" with a forward to value of
+ "xyzzy@example.com" would cause mail sent to "yyz@member.fsf.org" to
+ be forwarded to "xyzzy@example.com".
+ </p>
+
+ <p>
+ Please note that it may take up to a half hour for new forwards to
+ take effect, and that sending mail from the forwarded address to the
+ alias won't work. Using the previous example, sending mail from
+ xyzzy@example.com to yyz@member.fsf.org won't work.
+ </p>
+
+ {if !empty($emailAliases)}
+ <form method="POST"
+ action="{crmURL p='civicrm/member-dashboard/benefits' q='action=edit'}">
+ <table>
+ <thead>
+ <tr>
+ <th>Delete</th>
+ <th>Local Part</th>
+ <th>Forward</th>
+ </tr>
+ </thead>
+ <tbody>
+ {foreach from=$emailAliases item=alias}
+ <tr>
+ <td>
+ <input type="checkbox" name="delete[{$alias->id}]" value="delete" />
+ <input type="hidden" name="ids[]" value="{$alias->id}" />
+ </td>
+ <td>
+ <input type="text" name="localparts[]" value="{$alias->localpart}" />
+ </td>
+ <td>
+ <input type="text" name="forwards[]" value="{$alias->forward}" />
+ </td>
+ </tr>
+ {/foreach}
+ </tbody>
+ </table>
+
+ <input class="crm-form-submit default" type="submit" value="Save" />
+ </form>
+ {/if}
+
+ <h2>Add New Alias</h2>
+
+ <form method="POST"
+ action="{crmURL p='civicrm/member-dashboard/benefits' q='action=add'}">
+ <label for="localpart">Local part</label>
+ <input type="text" name="localpart" />
+ <label for="forward">Forward</label>
+ <input type="text" name="forward" />
+ <input class="crm-form-submit default" type="submit" value="Add" />
+ </form>
+
+
+ <div class="header-dark">Jabber/XMPP</div>
+
+ <p>
+ Your Jabber/XMPP account is: <strong>{$user->name}@member.fsf.org</strong>
+ </p>
+
+ <h2>Instructions</h2>
+
+ <p>
+ Use your FSF username as the jabber username, and member.fsf.org as
+ the domain if your XMPP client supports server discovery via a DNS
+ SRV record lookup. Most XMPP clients support this. If your client
+ does not, you can use jabber.member.fsf.org as the server name. Make
+ sure to enable encryption: we support TLS on port 5222 only. Your
+ password is the same as your FSF member password. (Please report
+ any problems you might encounter to
+ <a href="mailto:sysadmin@gnu.org">sysadmin@gnu.org</a>.)
+ </p>
+
+
+ <div class="header-dark">Member Forums</div>
+
+ <p>
+ Post and participate in our
+ <a href="https://forum.members.fsf.org">
+ Members-Only Forums
+ </a>
+ </p>
+
+ <div class="header-dark">VideoConference</div>
+
+ <p>
+ Access to freedom-respecting videoconferencing via
+ <a href="https://jitsi.member.fsf.org">
+ our Jitsi Meet instance
+ </a>. You can start new rooms as a host using your membership user and password, and invite guests.
+ </p>
+
+
+ <div class="header-dark">Other Member Benefits</div>
+
+ <p>
+ <a href="https://www.fsf.org/associate/benefits">
+ Learn more about the benefits of membership.
+ </a>
+ </p>
+
+{else}
+ <div class="header-dark">Members Only</div>
+
+ <p>
+ Only FSF Associate Members can access this page.
+ <a href="https://fsf.org/join">Become an FSF Associate Member today!</a>
+ </p>
+{/if}