Website Membership Install Issue

2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 23, 2010   (RSS)

By (Deleted User) - June 22, 2010

Hello everyone,

I am having a few problems trying to install/setup the Website Membership addon. The first issue is:

When a new client attempts register for a new account, the email does not go through and voids the entire application. It then redirects them to this message:
"Mail Error: mail(): SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html." I have not clue what that is and I haven't done any editing once so ever to the sample signup php. Here is the script just in case you need it:

<?php require_once "cmsAdmin/lib/viewer_functions.php"; ?>
<?php if ([url "mailto:!@$GLOBALS['WEBSITE_MEMBERSHIP_PLUGIN'"]!@$GLOBALS['WEBSITE_MEMBERSHIP_PLUGIN'[/url]]) { die("You must activate the Website Membership plugin before you can access this page."); } ?>
<?php

$showSignupForm = true;

// error checking
if (@$CURRENT_USER) {
$errorsAndAlerts = "You are already signed up! <a href='{$GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL']}'>Click here to continue</a>.";
$showSignupForm = false;
}

// process form
if (@$_REQUEST['save']) {

// error checking
$errorsAndAlerts = "";
if ([url "mailto:!@$_REQUEST['fullname'"]!@$_REQUEST['fullname'[/url]]) { $errorsAndAlerts .= "You must enter your full name!<br/>\n"; }
if ([url "mailto:!@$_REQUEST['email'"]!@$_REQUEST['email'[/url]]) { $errorsAndAlerts .= "You must enter your email!<br/>\n"; }
else if(!isValidEmail(@$_REQUEST['email'])) { $errorsAndAlerts .= "Please enter a valid email (example: user@example.com)<br/>\n"; }
if ([url "mailto:!@$_REQUEST['username'"]!@$_REQUEST['username'[/url]]) { $errorsAndAlerts .= "You must choose a username!<br/>\n"; }

// check for duplicate usernames and emails
if (!$errorsAndAlerts) {
$count = mysql_select_count_from('accounts', "`username` = '".mysql_escape(@$_REQUEST['username'])."'");
if ($count > 0 && @$_REQUEST['username']) { $errorsAndAlerts .= "That username is already in use, please choose another!<br/>\n"; }

$count = mysql_select_count_from('accounts', "'".mysql_escape($_REQUEST['email'])."' IN (email, username)");
if ($count > 0) { $errorsAndAlerts .= "That email is already in use, please choose another!<br/>\n"; }
}

// turn off strict mysql error checking for: STRICT_ALL_TABLES
mysqlStrictMode(false); // disable Mysql strict errors for when a field isn't defined below (can be caused when fields are added later)

// add user
if (!$errorsAndAlerts) {
$_REQUEST['password'] = substr(md5(uniqid(rand(), true)), 15); // example output: c5560251ef0b3eef9

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( $_REQUEST['password'] )."',

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");
$userNum = mysql_insert_id();

// create accesslist entry
// replace '_sample' with the table you want the user to access
// replace '6' with the access level they should have: 0=none, 6=author, 9=editor
// replace '1' with the max listings they are allowed
mysql_query("INSERT INTO `{$TABLE_PREFIX}_accesslist`
(userNum, tableName, accessLevel, maxRecords, randomSaveId)
VALUES ($userNum, 'all', '1', NULL, '1234567890'),
($userNum, '_sample', '6', 1, '1234567890'),
($userNum, '_sample', '6', 1, '1234567890'),
($userNum, '_sample', '6', 1, '1234567890')") or die("MySQL Error Creating Access List:<br/>\n". htmlspecialchars(mysql_error()) . "\n");

//
_websiteLogin_sendSignupMessage();
$errorsAndAlerts = "Thanks, We've created an account for you and emailed you your password.<br/><br/>\n";
$errorsAndAlerts .= "If you don't receive an email from us within a few minutes check your spam filter for messages from {$SETTINGS['adminEmail']}<br/><br/>\n";
$errorsAndAlerts .= "<a href='{$GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL']}'>Click here to login</a>.";

$_REQUEST = array(); // clear form values
$showSignupForm = false;
}
}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
body, td { font-family: arial; font-size: 14px; }
</style>
</head>
<body>

<h1>UGPA Account Signup Form</h1>

<!-- USER SIGNUP FORM -->
<?php if (@$errorsAndAlerts): ?>
<div style="color: #C00; font-weight: bold; font-size: 14px; font-family: arial;"><br/>
<?php echo $errorsAndAlerts; ?><br/>
</div>
<?php endif ?>

<?php if ($showSignupForm): ?>
<form method="post" action="?">
<input type="hidden" name="save" value="1" />

<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Full Name</td>
<td><input type="text" name="fullname" value="<?php echo htmlspecialchars(@$_REQUEST['fullname']); ?>" size="50" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" value="<?php echo htmlspecialchars(@$_REQUEST['email']); ?>" size="50" /></td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="username" value="<?php echo htmlspecialchars(@$_REQUEST['username']); ?>" size="50" /></td>
</tr>

<tr>
<td colspan="2" align="center">
<br/><input class="button" type="submit" name="submit" value="Sign up &gt;&gt;" />
</td>
</tr>
</table>

</form>
<?php endif ?>
<!-- /USER SIGNUP FORM -->

</body>
</html>


The Second issue I am having is trying to add new fields to my membership signup page. I need a detailed description "step by step" process onto HOW to make such changes. I need the form to ask the same questions like this www.theugpa.com/join.html I will be honest, I have little to none PHP or ASP programming skills at all. I thought this program was suppost to be easy but so far I am having trouble understanding how it works. I have read the documents given and have attempted to do as much as I can but still find I need some additional help.



Thanks so much!

Alex