Topic: Confirmation tells user they're activated even when blocked (Read 774 times)
Just another rainy day
Posts: 1
10 credits Members referred : 0
« on: Nov 14, 2007, 05:52:29 AM »
I have manual activation turned on because I only want registered users from certain domains. But if I block or don't activate someone they still get an email saying they have been activated. When they go to the login form they are then told there isn't an active user by their name.
I have made the following change to the send_confirmation method which sends a more meaningful message. I'm sure there is a better way but this has been working for me. See the switch statement. Or is there a better way of doing this?
function send_confirmation($id) { $sql = sprintf("SELECT real_name, email, active FROM %s WHERE id = %d", $this->table_name, $id); $res = mysql_query($sql); $user_email = mysql_result($res, 0, "email"); $this->user_full_name = mysql_result($res, 0, "real_name"); $user_active = mysql_result($res, 0, "active"); if ($this->user_full_name == "") $this->user_full_name = "User"; // change "User" to whatever you want, it's just a default name switch ($user_active) { case "y" : if ($this->send_mail($user_email, 37, 24, $this->send_copy)) { return true; } else { return false; } break; case "n" or "b" : if ($this->send_mail($user_email, 22, 19, $this->send_copy)) { return true; } else { return false; } break; } }
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6557
40174 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Nov 14, 2007, 08:58:02 AM »
I know, there is a limt for this in that version, change/expand the text for this state