Loading...
 
Skip to main content

Custom Share Module 0.1dev

Development

Development


Change

posts: 8

Wasn't sure what to do with this, so I'm posting here and hopefully someone will see and pass on to correct persons.

I wanted a way to pass the tiki username to an external web page. I got a lot of information from the tiki people on the irc channel, thank you.

This is what I did, and think this or something like this would be useful in a future release.

I basically modified one line in the tiki-featured_link.php file that transposes the string "PassTikiName" with $user, so if you want to use the tiki user name in a featured link you would do:

http://www.somesite.com?name=PassTikiName

and if you were logged on as Tikiuser, it would actually execute:

http://www.somesite.com?name=Tikiuser


the code is as follows:


$section = 'featured_links';
include_once ('tiki-section_options.php');

$smarty->assign_by_ref('url',str_replace('PassTikiName',$user, $_REQUEST%22url%22));
$smarty->assign('mid', 'tiki-featured_link.tpl');
$smarty->display("tiki.tpl");

?

The only line I changed is the $smarty->assign('url',$_REQUEST%22url'));

to

$smarty->assign_by_ref('url',str_replace('PassTikiName',$user, $_REQUEST%22url%22));

posts: 2881 United Kingdom

Hi,

Not really happy about commiting this as I fear it could be used against a site maybe.

In any case Id like to see a fully optional setting rather that the str_replace getting run on every single featured link.

Its a good idea, and I hope it helps others Incedentally I recall a IRC conversation relating to similar similar but using a iframe on a wiki page and called require_once('tiki-setup.php'); to get the $user available in that script.

Id favour this second method personally. as I think its more secure for both tiki and your called script.

Damian

posts: 9

> Damian wrote:
> Hi,
>
> Its a good idea, and I hope it helps others Incedentally I recall a IRC conversation relating to similar similar but using a iframe on a wiki page and called require_once('tiki-setup.php'); to get the $user available in that script.
>

Hi Damian - can you provide more details on the solution you saw in the IRC conversation? I would really like to use it - see topic http://tikiwiki.org/tiki-view_forum_thread.php?comments_parentId=7488&forumId=3 for more details.


posts: 8

I just started learning php about 2 weeks ago, and Tiki is very difficult for me to figure out as I don't have a clue about smarty yet, so this may not be the best answer.

All I'm saying is I'm surprised there is not a way to pass the tiki user name to an external page. I use an external page to verify my users against a game database for example.

I don't understand the security concerns, but it could be made stronger by making an admin option to use this....


posts: 9

> Damian wrote:
> Hi,
>
> Its a good idea, and I hope it helps others Incedentally I recall a IRC conversation relating to similar similar but using a iframe on a wiki page and called require_once('tiki-setup.php'); to get the $user available in that script.
>

Hi Damian - can you provide more details on the solution you saw in the IRC conversation? I would really like to use it - see topic http://tikiwiki.org/tiki-view_forum_thread.php?comments_parentId=7488&forumId=3 for more details.


Upcoming Events

1)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4) 
Tiki birthday
5)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting