Page 1 of 1

SelfRegistration. Change +5 years expires by default.

Posted: Tue Dec 02, 2008 9:57 am
by rafa-el
I need to change +5 years expires by default when a new user registers.

where I can change it?

Re: SelfRegistration. Change +5 years expires by default.

Posted: Sun Dec 28, 2008 12:44 pm
by jimbabwe
I haven't confirmed it works, but looks like you can edit SelfRegistration.module.php:    $expires = strtotime('+5 years');

You probably already know how to look for things like this, but here's a basic set of steps that my help others who come across this post...

Any easy way to find things like this, especially if you have phpmyadmin:

1. locate the table that holds the field/variable you are looking for

In this case, I looked at cms_module_feusers_users and found the field "expires"

2. search the module (i.e., SelfRegistration) for an update statement or similar where "expires" is used or look for a variable for "expires".

Example:
grep "expires" ./*
./SelfRegistration.module.php:    $expires = strtotime('+5 years');
./SelfRegistration.module.php:    $result = $feusers->AddUser( $username, $password, $expires, $do_md5 );
./SelfRegistration.module.php:    $expires = $db->DbTimeStamp(strtotime( $expirycode ));
./SelfRegistration.module.php:    $dbresult = $db->Execute( $q, array( $expires ) );
./SelfRegistration.module.php:    $expires = $db->DbTimeStamp(strtotime( $expirycode ));
./SelfRegistration.module.php:    $dbresult = $db->Execute( $q, array( $expires ) );
./SelfRegistration.module.php:    $dbresult = $db->Execute( $q, array( $expires ) );

3. make a backup copy of any file before you change it.

4. make your change and test.

Of course, it's best if you have a development site to test vs testing a production server/domain.