Author |
Message |
mrix
Client
![](modules/Forums/images/avatars/blank.gif)
Joined: Dec 04, 2004
Posts: 757
|
Posted:
Wed Jul 29, 2009 7:27 am |
|
Hi there, on my site even though I have set the " Temp accounts to expire after 2 "
The registrations still stay?
Any idea`s on a fix please.
Cheers all
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
Former Moderator in Good Standing
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Wed Jul 29, 2009 9:10 am |
|
I have the same problem. Just delete 'em manually for now. There are a number of issues with waiting user behavior and deactivating/ deleting users that didn't make the cut for RN 2.4 and will have to wait for 2.5. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 29, 2009 9:49 am |
|
I have another website where the expire works great and its hosted on the same server.
So it appears to work fine at times.
If there is no fix I guess I`ll have to start deleting 80+ applications
thanks anyway
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
draxx
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Nov 19, 2003
Posts: 282
|
Posted:
Sun Aug 02, 2009 12:05 pm |
|
I noticed this on my site also - it only seems to happen when I edit users. Now I havent narrowed down what part of the edit users is doing it .... but If I dont edit any waiting users - it works fine.
I think it has something to do with resending someones activation email.
Also - It seems that it fixes itself as soon as someone creates an account AND activates. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Aug 03, 2009 4:14 pm |
|
Quote: | Also - It seems that it fixes itself as soon as someone creates an account AND activates. |
Once they activate they should be (are) deleted from the users_temp table. And once that happens they are not considered a "waiting user". The problem, as far as I can tell is that under some undetermined set of circumstances temp accounts are not deleted when the expiration time has passed. There are other problems with waiting users also. For instance, once an approval email has been sent by the admin there should be some sort of flag to remind the admin that he/she has already approved that applicant. There isn't now and this probably will require a change to the temp_users table. All this "stuff" didn't make the "cut" for 2.4 and we will probably have to live with it as a minor inconvenience until 2.5 comes along. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon Aug 03, 2009 5:59 pm |
|
The way I thought it worked was the check is only done once someone else attempts to create a new account? It may be at that time where the check occurs to see if there are older temp users which need deleting? (Sorry, don't have the code in front of me atm. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Aug 07, 2009 2:11 pm |
|
This has been bugging me. Don't have time to fix it now but I couldn't help looking. I'm pretty sure the problem is that the only place that we delete an expired user is in the activate.php program in the your_account/public directory. This accounts for the sporadic nature of the "problem". The activate program does this right at the top:
Code:
if ($ya_config['expiring'] != 0) {
$past = time() - $ya_config['expiring'];
$res = $db->sql_query('SELECT user_id FROM ' . $user_prefix . '_users_temp WHERE time < \'' . $past . '\'');
while (list($uid) = $db->sql_fetchrow($res)) {
$uid = intval($uid);
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp WHERE user_id = \'' . $uid . '\'');
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp_field_values WHERE uid = \'' . $uid . '\'');
}
$db->sql_query('OPTIMIZE TABLE ' . $user_prefix . '_users_temp_field_values');
$db->sql_query('OPTIMIZE TABLE ' . $user_prefix . '_users_temp');
}
|
Problem is that if you don't go in as an admin and activate users or possibly if the activate program is not "kicked off" by a user responding to an activation email the "expired" users will just sit there. I haven't confirmed that the response to an activation email kicks this off but probably it does.
Not sure of the appropriate solution either. It could go in mainfile as a check every time a page loads but that could be overkill. Or maybe in admin.php so that everytime the ACP loads the check would be done. Or at a minimum in ya/admin/index.php so that anytime RNYA is loaded administratively expired users would get cleared out. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 11, 2009 6:27 am |
|
I actually wouldn't be apposed to this being in mainfile.php. It is an "expiration" type thing and so having it checked more often could be a good thing, kind of like ad expirations. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Aug 11, 2009 12:56 pm |
|
Unfortunately, the code to check on expiration relies on functions.php in the YA/includes directory having been included prior to checking expiration. Both YA/index.php and YA/admin/index.php do this including. The specific function that is required is named "ya_get_configs()". We could include this function in mainfile or we could alter it to lower overhead a little by not getting all the configuration values but instead just getting the value for 'expiring'. Or perhaps it would be better to just duplicate the SQL to get the config value for 'expiring" right in mainfile and not incur the overhead of including the whole of ya/includes/functions.php.
Still, relatively speaking it is a lot of overhead to be running this for every user on every page load. Looking further, down in mainfile there is a function "adminblock". This returns, among other things, the number of waiting users. Perhaps this should be refined to first delete any expired temp users and then return the non-expired number. Overhead would be reduced because this section of code is only executed when the user is an admin. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fkelly
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Aug 12, 2009 8:34 am |
|
Hammering away on this making many "rookie" mistakes but here is some code that could go in the adminblock function of mainfile. I think it would do the trick. Find the part of adminblock that tests for RNYA and modify it to do this:
Code:
// RNYA - http://www.ravennuke/admin.php?op=yaUsers
if (file_exists('modules/Your_Account/credits.html'))
{
$ya_expire = 0;
$past = 0;
$configresult = $db->sql_query('SELECT `config_name` , `config_value` FROM `' . $user_prefix . '_users_config` WHERE `config_name`=\'expiring\'');
$ya_config = $db->sql_fetchrow($configresult);
$ya_expire = $ya_config['config_value'];
if ($ya_expire != 0) {
$past = time() - $ya_expire;
$res = $db->sql_query('SELECT user_id FROM ' . $user_prefix . '_users_temp WHERE time < \'' . $past . '\'');
while (list($uid) = $db->sql_fetchrow($res)) {
$uid = intval($uid);
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp WHERE user_id = \'' . $uid . '\'');
$db->sql_query('DELETE FROM ' . $user_prefix . '_users_temp_field_values WHERE uid = \'' . $uid . '\'');
}
}
$result = $db->sql_query('SELECT COUNT(*) FROM '.$user_prefix.'_users_temp');
$row = $db->sql_fetchrow($result);
$num = $row[0];
if ($num > 0) $content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=yaUsers">'._USERS.'</a>: '.$row[0].'<br />';
|
Note, the standard activate.php optimizes the tables after the delete. I really think that's a waste of time. I have this running on a test site and I'll check to see that it deletes the user after the expiration time passes. I don't feel like hacking at timestamps to force it to happen.
Since RNYA is standard with the last distributions I wonder if we still need the test for credits.html also. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|