Loading...
 
Features / Usability

Features / Usability


Replace Login Module

posts: 29 United States

All,
Simply, I am integrating the TW into an intranet. I have a mod tiki-autologin.php which can autocreate users if necessary. I also have tiki-autologout.php which terminates the session and then links to a 'tiki bye bye' page which closes the window.
Only registered users are allowed. I created a nodule, auto_login_box which has a very simple function:

  • display the currently logged-on user
  • provide a link to tiki-autologout.php

Ok, so I can do HTML and build a Logout link which does actually work.
Q1: how do I find the current user, and can I use php in my HTML code
Q2: how do I make the link, style, etc. behave like the original login_box., i.e. how do I utilize the currently selected stylesheet.
TIA, Dr Magu

posts: 2881 United Kingdom

Hi

For this you will need to create a new module to live in modules/ and templates/modules/ rather than using the admin->modules creation interface.

Simply take a look at the existing mod-login_box.php and mod-login_box.tpl file and copy/remove what you need/dont need.

Damian

posts: 29 United States

May sound stupid (but I just got the TW site running two days ago cool ) if I place the properly named files in the correct directories (assuming I set the right permissions) the admin->modules will pick up on that?
That would be awesome indeed exclaim
Dr Magu

posts: 29 United States

DrMagu:
Damian wrote:
> Simply take a look at the existing mod-login_box.php and mod-login_box.tpl file and copy/remove what you need/dont need.
Can't find it. There appears to be no mod-login_box.php file anywhere cry. Now, there is a mod-login_box.tpl in templates/modules and also in templates/styles/geo/modules neutral.
In that template, the current user is refered to as {$user}. I'd expect that somewhere the smarty assignment is made ...
In any case, by just creating the new template mod-myloginbox.tpl, the whole thing works mrgreen. Amazing .. to say the least.
Dr Magu


posts: 29 United States

May sound stupid (but I just got the TW site running two days ago cool ) if I place the properly named files in the correct directories (assuming I set the right permissions) the admin->modules will pick up on that?
That would be awesome indeed exclaim
Dr Magu


posts: 63 United Kingdom

Well, Tiki is cool, because I do believe that - Yes - it will pick up on the appropriate module files if properly named and placed within the directory structure.

Cool eh?

BTW: Welcome to the Tikiwiki Community!


posts: 29 United States

DrMagu:
Damian wrote:
> Simply take a look at the existing mod-login_box.php and mod-login_box.tpl file and copy/remove what you need/dont need.
Can't find it. There appears to be no mod-login_box.php file anywhere cry. Now, there is a mod-login_box.tpl in templates/modules and also in templates/styles/geo/modules neutral.
In that template, the current user is refered to as {$user}. I'd expect that somewhere the smarty assignment is made ...
In any case, by just creating the new template mod-myloginbox.tpl, the whole thing works mrgreen. Amazing .. to say the least.
Dr Magu


posts: 1001 Canada

Hi drmagu,
welcome in the community!biggrin
Login box doesn't require a file in tiki/modules/ "because" it's some kind of core function anyway.
The Smarty assignations apply to the whole script. If smarty is assigned the value of $user from tiki-setup_base.php or tiki-setup.php for example, then until it's assigned another value to $user, $user will stay defined even in the modules's templates.

BTW, make sure to come at IRC #tikiwiki, you could get answers (even!) faster.


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting