[SOLVED] Expiry Date on Self-Registration doesn't match that set in FEU

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
rpr
Forum Members
Forum Members
Posts: 20
Joined: Wed Oct 10, 2007 2:24 pm

[SOLVED] Expiry Date on Self-Registration doesn't match that set in FEU

Post by rpr »

In FEU prefs I've set the 'Default user expiry period' to 12 months, however when someone self registers (via Self-Registration) that user's expiry date defaults to five years? Can these 2 expiry dates be synchronised?

I'm also having problems with Self-Registration, in that it sends the wrong URL in the confirmation email. When the user clicks the links in their email it takes them to the sites homepage. Which PHP file in (www/cmsms1.6test/modules/SelfRegistration) holds the info for the 'smarty' tags:

{$url}
{$smallurl}

Maybe I can tweak these to form a valid URL that works on my site?

Thank you.
Last edited by rpr on Mon Mar 29, 2010 3:17 am, edited 1 time in total.
vilkis

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by vilkis »

Hi,
What are versions of FEU and SelfRegistration?
vilkis
rpr
Forum Members
Forum Members
Posts: 20
Joined: Wed Oct 10, 2007 2:24 pm

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by rpr »

Hi Vilkis, thanks for getting back.

Think I'm using the latest:

FEU v1.7.1
SelfRegistration v1.2.6
on CMSMS 1.6.7 "Teremba Bay"
vilkis

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by vilkis »

there are newer versions of FEU and SelfRegistration. Next question - Do you use pretty url?
vilkis
rpr
Forum Members
Forum Members
Posts: 20
Joined: Wed Oct 10, 2007 2:24 pm

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by rpr »

Thanks Vilkis, I am using pretty URLs and I noticed the 'release notes' on Self-Registration mentions pretty URLs. I'm using 'heirarchy' and 'page_extension' as part of that too.

But I'd still like to know if I can tweak those settings ({$url} {$smallurl}) if it still doesn't work?

Is there a fix for changing the default expiry date on Self-Reg from 60 months to 12 months?

Thanks.
Last edited by rpr on Sun Mar 28, 2010 4:31 pm, edited 1 time in total.
cwboaze
New Member
New Member
Posts: 6
Joined: Wed Mar 03, 2010 3:53 am

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by cwboaze »

To Change the Expiry Date when a user user registers
it's located: SelfRegistration.Module.php

Code: Select all

// todo, figure out when users should expire
    $expires = strtotime('+5 years');
Line 586

simply change 5 to 1 and it will increase their expire date by 1 year when
they register. By default Version 1.2.6 this is how it works, it doesn't
plug into FUE module to get the info, it just runs on it's own
piece of code.

Here's the code if you just want to replace

Code: Select all

$expires = strtotime('+1 years');
cwboaze
New Member
New Member
Posts: 6
Joined: Wed Mar 03, 2010 3:53 am

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by cwboaze »

Also, the URL and ShortURL are generated inside the same file SelfRegistration.module.php

Under the function:

Line: 890

Code: Select all

function _SendUserConfirmationEmail($id,$returnid,$address,$username,$group_id,$code)
The Following Code Creates those links:
Line: 907-908

Code: Select all

    $url = $this->CreateLink($id,'default',$returnid,'',$parms,'',true,true);
    $smallurl = $this->CreateLink( $id, 'default', $returnid, '', array('mode' => 'verify'),'',true, true);
and The functions for those CreateLinks
File: root/lib/classes/class.module.inc.php
Line: 1982

Code: Select all

function CreateLink($id, $action, $returnid='', $contents='', $params=array(), $warn_message='', $onlyhref=false, $inline=false, $addttext='', $targetcontentonly=false, $prettyurl='')
	{
		$this->LoadFormMethods();
		return cms_module_CreateLink($this, $id, $action, $returnid, $contents, $params, $warn_message, $onlyhref, $inline, $addttext, $targetcontentonly, $prettyurl);
	}
I'm not sure why but it then assigns them to smarty using the same commands,
not sure why they are seperate!:

Line: 911-912

Code: Select all

    $this->smarty->assign('link',$this->CreateLink($id,'default',$returnid,$url,$parms,'',false,true));
    $this->smarty->assign('smalllink',$this->CreateLink($id,'default',$returnid,$smallurl,array('mode'=>'verify'),'',false,true));
O now, I see why they are seperated, one's for Text and ones for html emails.

Just supplying you with where they are located,
not really with answers, don't know enough about your problems
to answer it. But here's the locations you ask for.
Last edited by cwboaze on Sun Mar 28, 2010 5:42 pm, edited 1 time in total.
rpr
Forum Members
Forum Members
Posts: 20
Joined: Wed Oct 10, 2007 2:24 pm

Re: Expiry Date on Self-Registration doesn't match that set in FEU

Post by rpr »

Many thanks cwboaze, for all those code references. Really helpful!

The ability to change the default expiry date on SelfRegistration was important. I was going to abandon the confirmation email scenario, but the latest version of SelfRegistration now supports pretty URLs, so I might give it another go.

Thanks again.
Post Reply

Return to “Modules/Add-Ons”