Page 1 of 1

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

Posted: Sat Mar 27, 2010 5:57 pm
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.

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

Posted: Sat Mar 27, 2010 6:47 pm
by vilkis
Hi,
What are versions of FEU and SelfRegistration?
vilkis

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

Posted: Sun Mar 28, 2010 1:07 am
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"

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

Posted: Sun Mar 28, 2010 5:58 am
by vilkis
there are newer versions of FEU and SelfRegistration. Next question - Do you use pretty url?
vilkis

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

Posted: Sun Mar 28, 2010 4:26 pm
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.

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

Posted: Sun Mar 28, 2010 5:25 pm
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');

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

Posted: Sun Mar 28, 2010 5:38 pm
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.

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

Posted: Mon Mar 29, 2010 3:13 am
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.