Location: PHPKode > projects > Content*Builder > modules/community/activateAccount.inc.php
<?php
/**
 * Modul dient zum registrieren von neuen Benutzern
 * 
 * @author Jörg Stöber <hide@address.com> 
 * @version $Id: activateAccount.inc.php,v 1.2 2004/03/08 23:58:50 cb_fog Exp $
 * @copyright 2003 Jörg Stöber
 **/
 
$communityOption = new CBOption();
$communityOption->setModule("community");
$communityOption->getOptionList();

if($communityOption->getSingleOption("requireUserActivation") && $communityOption->getSingleOption("requireUserActivationPerMail")) {
	if(isset($_POST[activationForm]) && isset($_POST[activationCode])) {
		$userActivationQuery = mysql_query("SELECT * FROM ".TABLE."_community_user AS user, ".TABLE."_community_activation AS activation WHERE user.userID = activation.userID AND activation.activationCode = '".$_POST[activationCode]."'");
		if(mysql_num_rows($userActivationQuery) == 1) {
			$userActivationRow = mysql_fetch_assoc($userActivationQuery);
			$userOptions = $userActivationRow[options];
			$userID      = $userActivationRow[userID];
			
			$userOptions |= 1;
			
			mysql_query("UPDATE ".TABLE."_community_user SET options = '$userOptions' WHERE userID = '$userID'");
			mysql_query("DELETE FROM ".TABLE."_community_activation WHERE userID = '$userID'");
			$activationSuccess = 1;
		} else {
			$tpl->assign("showActivationForm", "1");
			$activationError = 1;
		}
		
		$tpl->assign("activationError",   $activationError);
		$tpl->assign("activationSuccess", $activationSuccess);
		$tpl->display("activation.template");
	} else {
		$tpl->assign("showActivationForm", "1");
		$tpl->display("activation.template");
	}
}
?>
Return current item: Content*Builder