[dev] Patch for hiding invite link

Jason Rust jrust at rustyparts.com
Tue May 13 13:44:49 PDT 2003


Attached is a patch that hides the Invite link on the view event page if
the user has no valid email addresses in their list of identities.
Since the user would not be able to send an invite anyhow if they have
no valid from_adresses it saves them the confusion and trouble of trying
to invite someone to an event.

-Jason

-- 
http://www.rustyparts.com/
ferrous oxidation
-------------- next part --------------
Index: viewevent.php
===================================================================
RCS file: /repository/kronolith/viewevent.php,v
retrieving revision 1.16
diff -u -r1.16 viewevent.php
--- viewevent.php	17 Apr 2003 16:34:44 -0000	1.16
+++ viewevent.php	13 May 2003 20:32:23 -0000
@@ -87,7 +87,19 @@
     $mylinks[] = Horde::link($editurl, sprintf(_("Edit '%s'"), $event->getTitle()), 'menuitem') . _("Edit") . '</a>';
 }
 
-if (Auth::getAuth()) {
+// Only show invite link if they are logged on and have an
+// identity with a from_addr
+require_once HORDE_BASE . '/lib/Identity.php';
+$ident = &new Identity();
+$tmp_emails = $ident->getAll('from_addr');
+$hasEmail = false;
+foreach ($tmp_emails as $tmp_email) {
+    if (!empty($tmp_email)) {
+        $hasEmail = true;
+        break;
+    }
+}
+if ($hasEmail && Auth::getAuth()) {
     $inviteurl = Horde::addParameter('invite.php', 'calendar', Horde::getFormData('calendar'));
     $inviteurl = Horde::addParameter($inviteurl, 'url', Horde::selfURL(true));
     if (Horde::getFormData('calendar') != '**remote') {


More information about the dev mailing list