6.0.0-beta1
7/13/25

[#1683] Patch to generate static user FB URL
Summary Patch to generate static user FB URL
Queue Kronolith
Queue Version 2.0.2
Type Enhancement
State Resolved
Priority 2. Medium
Owners chuck (at) horde (dot) org
Requester kevin_myer (at) iu13 (dot) org
Created 04/04/2005 (7405 days ago)
Due
Updated 05/20/2005 (7359 days ago)
Assigned
Resolved 04/10/2005 (7399 days ago)
Milestone 2.1
Patch No

History
05/20/2005 12:28:38 AM Chuck Hagenbuch Comment #21 Reply to this comment
picky, picky. thanks.
05/19/2005 10:56:19 PM kevin_myer (at) iu13 (dot) org Comment #20 Reply to this comment
Wouldn't it be the following?



RCS file: /repository/kronolith/fb.php,v

retrieving revision 1.32

diff -u -r1.32 fb.php

--- fb.php      19 May 2005 20:46:09 -0000      1.32

+++ fb.php      19 May 2005 22:52:50 -0000

@@ -41,7 +41,7 @@

          // to their username.

          if (!$cal) {

              $cal = $prefs->getValue('default_share');

-            if ($cal) {

+            if (!$cal) {

                  $cal = $user;

              }

          }


05/19/2005 08:46:30 PM Chuck Hagenbuch Comment #19 Reply to this comment
#2 implemented.
05/19/2005 06:19:00 PM kevin_myer (at) iu13 (dot) org Comment #18 Reply to this comment
I should clarify - we came up with two mutually exclusive ideas...   
They aren't meant to be reconciled.
05/19/2005 06:16:08 PM kevin_myer (at) iu13 (dot) org Comment #17 Reply to this comment
I had a discussion with my number #1 beta tester yesterday (my 
secretary :) and we came up with two ideas.



1)  Its better not to assume a share exists (by virtue of defaulting 
to a username if all else fails) than it is to return wrong FB info 
(assuming the user really wanted a different share or set of shares to 
be used).



2)  Its better to return potentially wrong FB info, than it is to 
require all users to set fb_cals in their Kronolith preferences so you 
don't have to worry about falling through to nothing and getting FB 
Not Found.



The percentage of users who will delete their primary share, and have 
multiple shares to choose from to generate FB info, but who would not 
set fb_cals, is probably very small.  So our thinking is that #2 is 
the way to go, which would be to default to their default_share and 
fall through to their username.  And if there was an initial 
maintenance task in Horde, fb_cal could be an item that was set during 
the first run (enhancement logged in ticket 2001).
05/19/2005 05:21:10 PM Chuck Hagenbuch Comment #16 Reply to this comment
We could try to load their default_share (we alread have the user's 
prefs object, as opposed to the current user's). Then if default_share 
is empty, default to the username?
05/18/2005 01:49:26 PM kevin_myer (at) iu13 (dot) org Comment #15 Reply to this comment
Also, if you're not logged in, default_share is "0" :)



So maybe default_share isn't the place to fall back to.
05/18/2005 01:41:48 PM kevin_myer (at) iu13 (dot) org Comment #14 Reply to this comment
Any clever ideas on how to handle cases where a user has not 
configured a fb_cal preference?  Or do we just assume that a user 
_must_ configure a default FB calendar?



I'd like to default it to their default _share.  But that doesn't work 
quite right, if they've never set their default share, because the 
default preference for that is Auth::getAuth() ? Auth::getAuth() : 0.   
If I'm logged in and I query FB info for userA, and userA has no 
fb_cal set (and assuming we drop back to look at default_share if 
fb_cal isn't set), no default_share set, then the preference for 
default_share becomes kevin_myer@iu13.org :(



I really need something along the lines of an Auth::getTheirAuth(), if 
I'm not retrieving prefs for myself.




05/12/2005 07:53:23 PM Chuck Hagenbuch Comment #13 Reply to this comment
Should be fixed now.
05/12/2005 07:02:28 PM kevin_myer (at) iu13 (dot) org Comment #12 Reply to this comment
There's a cache namespace collision possible with my patch.  The FB 
info is cached with the username or calendar as the key (depending on 
if u or c is specified).  If I have a share named kevin_myer@iu13.org 
and I call fb.php with c=kevin_myer@iu13.org, the cache will contain 
FB info for a share.  If I shortly thereafter call fb.php with 
u=kevin_myer@iu13.org, and I have defined a different set of shares 
that should be used to generate my FB info (i.e. fb_cals is set to one 
or more shares), I'll get the cached results of just 
c=kevin_myer@iu13.org.



In other words, if fb_cals=kevin_myer@iu13.org and I call fb.php with 
either u, or c, I'll get the right results because u == c.



If fb_cals=kevin_myer@iu13,org, and another share 
(examplesharepadto32bits...), I'll get the wrong results from the 
cache, because u is actually c + exampleshare, but it will be cached 
with my email address as the key (and what results will be returned 
will depend on whether fb.php was called with u or c first).



Or maybe in plainer terms - my patch uses the same key for both user 
FB and single calendar FB info.  A simple solution would be to prepend 
a "u-" or a "c-" before the share/user name, so the cached result for 
u-kevin_myer@iu13.org would be my fb_cals FB info and the cached 
result for c-kevin_myer@iu13.org would be a share FB info.
04/21/2005 07:21:17 PM kevin_myer (at) iu13 (dot) org Comment #11 Reply to this comment
So silly question, definitely outside the scope of this enhancement but...



Is there an easy way to get a diff of all the changes that were 
commited to CVS related to this patch?  You cleaned some of my hacking 
up and if I backport something, I want to track as closely as possible 
what was actually committed, instead of what I wrote.  I checked the 
CVS commit log mailing list but only found the one entry for fb.php 
and none for the supporting files.  I can always create a patch by 
piecing together the diffs from that date for the files that I know 
were changed but if there's an easier way to do it, I'd appreciate 
knowing it.



If not, having Chora be able to track the CVS commits (and generate a 
link to download a diff) related to a bug or enhancement would be a 
nice feature :)
04/13/2005 05:31:07 PM Chuck Hagenbuch Comment #10 Reply to this comment
Our general policy is to leave new features for new minor versions. 
There's a few other decent things in Kronolith 2.1, and with some work 
on the attendees/scheduling stuff, it'd be a solid minor release.
04/13/2005 05:14:29 PM kevin_myer (at) iu13 (dot) org Comment #9 Reply to this comment
Any chance of having the bulk of this merged to the 2.0.X branch?  If 
not, I'll just maintain a local patch until 2.1 is "ready".
04/10/2005 04:03:11 AM Chuck Hagenbuch Comment #8
State ⇒ Resolved
Reply to this comment
Committed for Kronolith 2.1, thanks!
04/09/2005 10:33:53 PM Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
04/08/2005 09:53:21 AM Jan Schneider Priority ⇒ 2. Medium
Type ⇒ Enhancement
State ⇒ Accepted
 
04/04/2005 02:10:39 PM kevin_myer (at) iu13 (dot) org Comment #7
New Attachment: kronolith-master-fb.patch Download
Reply to this comment
Ok, here is a fixed version (also cleaned up to remove my site prefs.php).



This is all the previous patches rolled into one.  Remove the bits 
that make changes to the portions you don't want (i.e. My Calendars, 
and lib/Kronolith Free/Busy URL line).
04/04/2005 01:30:47 PM kevin_myer (at) iu13 (dot) org Comment #6 Reply to this comment
Ugh - I now remember why I didn't submit this when I coded it up - I 
needed to add the preference lookup if a username argument was 
specified.  Fix to my fix coming up shortly :)
04/04/2005 12:28:20 PM kevin_myer (at) iu13 (dot) org Comment #5 Reply to this comment
And if you could file as an enhancement and not a bug..  Need a second 
cup of coffee...
04/04/2005 12:11:23 PM kevin_myer (at) iu13 (dot) org Comment #4
New Attachment: kronolith-libKronolith-URL.patch Download
Reply to this comment
Guess it would help to actually attach the patch...
04/04/2005 12:10:25 PM kevin_myer (at) iu13 (dot) org Comment #3 Reply to this comment
One minor thing that I missed - the actual VFB file contains a URL 
reference.  This is hardcoded to contain the c=shareid as the argument 
to fb.php.



This patch changes that behavior to use the u=username argument.



lib/Kronolith.php should probably return the URL that's used to 
generate the file, instead of hard-coding it one way or the other.  So 
maybe modifying the API for generateFreeBusy to include the URL as an 
argument as well...  I definitely can't change APIs, but I would think 
that adding another optional paremeter to generateFreeBusy would be 
pretty unobtrusive.
04/04/2005 11:44:45 AM kevin_myer (at) iu13 (dot) org Comment #2
New Attachment: kronolith-calendars-fburl.patch Download
Reply to this comment
I'm keeping this separate from the preceeding patch.  This can be 
applied to change the functionality of "My Calendars" and have the 
user's FB URL be autogenerated and changed to the new username 
argument FB URL.  If, however, you have an installed base using FB 
URLs with the share ids and you need the ability to generate URLs with 
all those ids, you may not want to apply this.
04/04/2005 11:42:14 AM kevin_myer (at) iu13 (dot) org Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
New Attachment: kronolith-user-fb.patch Download
Queue ⇒ Kronolith
Summary ⇒ Patch to generate static user FB URL
Type ⇒ Bug
Reply to this comment
This patch adds an argument to fb.php ("u") that will accept a 
username as an argument.  Result returned is the FB info for that 
user.  A new preference has been added ("fb_cals") that allows the 
user to select which of their available calenders they want to be 
included in generating FB info.  When the username is passed to 
fb.php, this preference is consulted to see which calendars to use.



This should be fully backwards compatible with existing functionality 
of fb.php, as it will still accept one or more share ids with the 
"c=shareid" arguments.

Saved Queries