
Jason
Staff
/ Moderator

Dec 8, 2011, 8:02 AM
Post #7 of 7
(947 views)
Shortcut
|
|
Re: [kovali] emailOnApproved plugin problem
[In reply to]
|
Can't Post
|
|
Hi Koen, There is a "disabled" checkbox in the accounts table that you can set to 1 when an account is created. For example:
mysql_query("INSERT INTO `{$TABLE_PREFIX}accounts` SET fullname = '".mysql_escape( $_REQUEST['fullname'] )."', email = '".mysql_escape( $_REQUEST['email'] )."', username = '".mysql_escape( $_REQUEST['username'] )."', password = '".mysql_escape( $passwordHash )."', disabled = '0', isAdmin = '0', expiresDate = '0000-00-00 00:00:00', neverExpires = '1', createdDate = NOW(), updatedDate = NOW(), createdByUserNum = '0', updatedByUserNum = '0'") or die("MySQL Error Creating Record:<br/>\n". htmlspecialchars(mysql_error()) . "\n"); This code is found in the user-signup page that came with the Website Membership plugin. So when you go in to approve a user, you can uncheck the disabled check box so they are able to login. The code that is used to create a password is also found on this page and looks like this:
// generate password $password = substr(md5(uniqid(mt_rand(), true)), 15); // example output: c5560251ef0b3eef9 if (@$SETTINGS['advanced']['encryptPasswords']) { $passwordHash = getPasswordDigest($password); } else { $passwordHash = $password; } At the end of this code $password will be the plain text version of the password and $passwordHash will be the encrypted version that you will save to the accounts record. Hope this helps --------------------------------------------------- Jason Sauchuk - Programmer interactivetools.com Hire me! Save time by getting our experts to help with your project. http://www.interactivetools.com/consulting/
|