Different region regarding user option

If you need support with TeamCal Pro (installation, configuration, usage) post your request here.
Post Reply
robw
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 2005-01-06, 06:26

Different region regarding user option

Post by robw » 2009-09-15, 10:12

Hi all,
I had the problem that the showmonth function for each user didn't show the appropriate region (what he/she had aassigned in his personal options). In spite of his assignment you've got the default region by the administration.

This is controlled by the /tcpro/includes/showmonth.function.php

In line 637 the statement is:
"

Code: Select all

javascript:openPopup('editcalendar.php?lang=".$CONF['options']['lang']."&Year=".$year."&Month=".$month."&region=".$CONF['options']['region']."&Member=".addslashes($U->username)...
"

I've changed it to:
"

Code: Select all

javascript:openPopup('editcalendar.php?lang=".$CONF['options']['lang']."&Year=".$year."&Month=".$month."&region=".$UO->find($U->username,"defregion")."&Member=".addslashes($U->username)...
"

...Now everyone gets his/her appropriate region calendar. Voilá.

Greetz robw
User avatar
George
Platinum Boarder
Platinum Boarder
Posts: 407
Joined: 2004-11-29, 21:20
Are you a spam bot?: No
Contact:

Re:Different region regarding user option

Post by George » 2009-10-07, 00:25

Hi robw,

thanks for this post. Great idea. How about making it a little safer:
"

Code: Select all

if (!$thisregion = $UO->find($U->username,"defregion")) $thisregion = $CONF['options']['region'];
$monthBody .= "<a href=\"javascript:openPopup('editcalendar.php?lang=".$CONF['options']['lang']."&Year=".$year."&Month=".$month."&region=".$thisregion."&Member=".addslashes($U->username)...
"

Best regards,
George
TeamCal Neo is free for private use but requires licensing for use in a commercial environment:
https://georgelewe.atlassian.net/wiki/s ... eo+License
Post Reply