Single step registration + Confirmation e-mail v0.1

Register an Account
Reply
 
Thread Tools Display Modes
  #31 (permalink)  
Old 05-28-2007, 02:30 AM
jrothra's Avatar
Constant Pligger
Pligg Version: 9.9.5
Pligg Template: Silverbullet
 
Join Date: Apr 2007
Location: Fort Worth, TX
Posts: 179
I tested the system and it works, but I noticed the following:

1. The sender's email address is listed as: PLIGG_PassEmail_From @ linux39.cqservers.com (spaces put around the @ to prevent auto-linking as email)

2. The subject is listed as: Welcome to PLIGG_Visual_Name

I checked the admin > Modify Language section and here's what's set to be in those sections:

PLIGG_PassEmail_From = webmaster @ faithtag.com
PLIGG_Visual_Name = FaithTag

I would think the sending email address would be the webmaster email and the welcome to would say FaithTag.
Reply With Quote
  #32 (permalink)  
Old 05-28-2007, 04:11 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
Pls refer this thread for an updated version with more customizations and detailed instructions : http://forums.pligg.com/showpost.php...5&postcount=13

Also Ash will be working to improve on it latter when he finds time - atp he is busy with critical things for version 9.5.1 release.
Reply With Quote
  #33 (permalink)  
Old 05-28-2007, 05:31 AM
jrothra's Avatar
Constant Pligger
Pligg Version: 9.9.5
Pligg Template: Silverbullet
 
Join Date: Apr 2007
Location: Fort Worth, TX
Posts: 179
Quote:
Originally Posted by dollars5 View Post
Pls refer this thread for an updated version with more customizations and detailed instructions : http://forums.pligg.com/showpost.php...5&postcount=13

Also Ash will be working to improve on it latter when he finds time - atp he is busy with critical things for version 9.5.1 release.
I read that thread and didn't see anything about the email sent by the validator to the registrant. Did I miss it? It says what in the latest version (which I downloaded and implemented on yesterday).

I don't see where it pulls the info for PLIGG_PassEmail_From and PLIGG_Visual_Name as set in the Admin > Modify Language section. As of the version I'm using, it does not pull correctly. To see what it looks like, register with my site (sometimes it's easier to show than to describe )
Reply With Quote
  #34 (permalink)  
Old 05-28-2007, 07:43 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
Please check this function do_register1() in register.php that is responsible for sending e-mails you should find the from address in headers part as
$headers = "From: " . $main_smarty->get_config_vars("PLIGG_PassEmail_From") . "\r\nReply-To: " . $main_smarty->get_config_vars("PLIGG_PassEmail_From") . "\r\nCC: account@domain.com\r\nX-Priority: 1\r\n";

and the subject is constructed as $subject= 'Welcome to ' . $main_smarty->get_config_vars("PLIGG_Visual_Name");

So sure the code uses lang.conf elements.

EDIT: the packed files will send an cc to some account you mention too - atp that is hardcoded to account [at] greatinnovus.com - chage it

Last edited by dollars5; 05-28-2007 at 07:48 AM.
Reply With Quote
  #35 (permalink)  
Old 05-28-2007, 08:30 PM
jrothra's Avatar
Constant Pligger
Pligg Version: 9.9.5
Pligg Template: Silverbullet
 
Join Date: Apr 2007
Location: Fort Worth, TX
Posts: 179
That makes more sense to me. Thank you.

I'll look into it and make the necessary adjustments.
Reply With Quote
  #36 (permalink)  
Old 05-28-2007, 09:06 PM
jrothra's Avatar
Constant Pligger
Pligg Version: 9.9.5
Pligg Template: Silverbullet
 
Join Date: Apr 2007
Location: Fort Worth, TX
Posts: 179
I checked the register.php file and two strings are not listed in there anywhere. The one I've got is the one-step registration version from here.

Here's the code of my register.php
Code:
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

include_once('Smarty.class.php');
$main_smarty = new Smarty;

include('config.php');
include(mnminclude.'html1.php');
include(mnminclude.'link.php');
include(mnminclude.'smartyvariables.php');
include(mnminclude.'ts.php');

// determine which step of the registration process we are on
if(isset($_POST["process"])) {
	switch ($_POST["process"]) {
		case 1:
		  // breadcrumbs and page title
			$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_RegisterStep2');
			$navwhere['link1'] = getmyurl('register', '');
			$main_smarty->assign('navbar_where', $navwhere);
			$main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_RegisterStep2'));
			break;
	}
} 
else {
	// breadcrumbs and page title
	$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Register');
	$navwhere['link1'] = getmyurl('register', '');
	$main_smarty->assign('navbar_where', $navwhere);
	$main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Register'));
}

// pagename
define('pagename', 'register'); 
$main_smarty->assign('pagename', pagename);

// sidebar
$main_smarty = do_sidebar($main_smarty);

// show the template
$main_smarty->assign('tpl_center', $the_template . '/register_center');
$main_smarty->display($the_template . '/pligg.tpl');

// register step 1
function do_register0() {
	global $main_smarty, $the_template;
	$main_smarty->display($the_template . '/register_step_1.tpl');
}

// verify registration information
function verify_reg($username, $email, $password, $password2) {
	global $main_smarty, $the_template;
	
	if(!isset($username) || strlen($username) < 3) { // if no username was given or username is less than 3 characters
		$main_smarty->assign('register_error_text', "usertooshort");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}	
	if(!preg_match('/^[a-zA-Z0-9\-\.@]+$/', $username)) { // if username contains invalid characters
		$main_smarty->assign('register_error_text', "usernameinvalid");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}
	if(user_exists(trim($username)) ) { // if username already exists
		$main_smarty->assign('register_error_text', "usernameexists");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}
	if(!check_email(trim($email))) { // if email is not valid
		$main_smarty->assign('register_error_text', "bademail");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}
	if(email_exists(trim($email)) ) { // if email already exists
		$main_smarty->assign('register_error_text', "emailexists");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}
	if(strlen($password) < 5 ) { // if password is less than 5 characters
		$main_smarty->assign('register_error_text', "fivecharpass");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}
	if($password !== $password2) { // if both passwords do not match
		$main_smarty->assign('register_error_text', "nopassmatch");
		$main_smarty->display($the_template . '/register_error.tpl');
		$error = true;
	}	
	
	return $error;
	
}

function do_register1() {
	global $main_smarty, $the_template;

	$error = false;
	$error = verify_reg($_POST["username"], $_POST["email"], $_POST["password"], $_POST["password2"]);
	
	if ($error) return;

	if(enable_captcha == 'true') {
	$main_smarty->assign('reghash', generateHash($_POST["username"].$_POST["email"].$_POST["password"]));
	$main_smarty->assign('ts_random', rand(10000000, 99999999));
	$main_smarty->display($the_template . '/register_step_2.tpl');
	}
	else {
	do_register2();
	}
}

function do_register2() {
	global $db, $current_user, $main_smarty, $the_template;
	
	if(enable_captcha == 'true') {
		if (!ts_is_human()) { // if incorrect captcha code was entered
			$main_smarty->assign('register_error_text', "badcode");
			$main_smarty->display($the_template . '/register_error.tpl');
			return;
		}
	
		$reghash = $_POST["reghash"];
		$mycombo = $_POST["username"].$_POST["email"].$_POST["password"];
		if(generateHash($mycombo, substr($reghash, 0, SALT_LENGTH)) != $reghash){
			loghack('Register Step 2', 'username: ' . $_POST["username"].'|email: '.$_POST["email"]);
		}
	}

	$error = false;
	$error = verify_reg($_POST["username"], $_POST["email"], $_POST["password"], $_POST["password"]); 
	if ($error) return;

	$username=$db->escape(trim($_POST['username']));
	$password=$db->escape(trim($_POST['password']));
	$userip=$_SERVER['REMOTE_ADDR'];
	$saltedpass=generateHash($password);
	$email=$db->escape(trim($_POST['email']));
	if (!user_exists($username)) {
		if ($db->query("INSERT INTO " . table_users . " (user_login, user_email, user_pass, user_date, user_ip) VALUES ('$username', '$email', '$saltedpass', now(), '$userip')")) {
			if($current_user->Authenticate($username, $password, false) == false) {
				$main_smarty->assign('register_error_text', "errorinserting");
				$main_smarty->display($the_template . '/register_error.tpl');
			} else {
				
				define('registerdetails', $username . ';' . $password . ';' . $email . ';' . $return);
				check_actions('register_success_pre_redirect');
				
				header('Location: ' . getmyurl('user', $username));
			}
		} else {
			$main_smarty->assign('register_error_text', "errorinserting");
			$main_smarty->display($the_template . '/register_error.tpl');
		}
	} else {
		$main_smarty->assign('register_error_text', "usernameexists");
		$main_smarty->display($the_template . '/register_error.tpl');
	}
}
?>
Reply With Quote
  #37 (permalink)  
Old 05-28-2007, 10:02 PM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
pls try from here http://forums.pligg.com/showpost.php...5&postcount=13
Reply With Quote
  #38 (permalink)  
Old 06-03-2007, 11:51 AM
New Pligger
 
Join Date: Mar 2007
Posts: 22
I am using paul01 template and Pligg 9.1.
What should i do to get this work?
Reply With Quote
  #39 (permalink)  
Old 06-04-2007, 01:09 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
There are only minimum template changes, should you follow the instructions, things should work fine.
Reply With Quote
  #40 (permalink)  
Old 06-04-2007, 06:48 AM
New Pligger
 
Join Date: Mar 2007
Posts: 22
I can not find any instructions.
Can anyone give a link?
And please give me some help with the changes in the template...

Last edited by blackpr; 06-04-2007 at 06:54 AM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email confirmation for registration sbanerjee Questions and Comments 2 11-23-2008 12:42 PM
Single Step Registration+Email Verification arkasun Questions and Comments 6 11-10-2008 11:46 AM
HELP! I'm getting spammed! AshMCairo Questions and Comments 113 11-04-2008 02:58 PM
Single step registration + Confirmation e-mail v0.3 onis Questions and Comments 1 01-17-2008 12:23 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development