28, May 2012

Confirmation tells user they're activated even when blocked - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Confirmation tells user they're activated even when blocked
« previous next »
Pages: [1] Print

Author Topic: Confirmation tells user they're activated even when blocked  (Read 1757 times)
Just another rainy day
*
Posts: 1
10 credits
Members referred : 0


« on: Nov 14, 2007, 04: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: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Nov 14, 2007, 07:58:02 am »

I know, there is a limt for this in that version, change/expand the text for this state

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7355
Tags : access user confirmation Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Confirmation tells user they're activated even when blocked
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 08:46:34 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.