Location: PHPKode > projects > Warp.cms - php/mysql content management > warp_121/usr_reg.php
<?php

// [user registration module v.1.2.1]
// xantis.warp.cms - version 1.2
// (c) 2002 xantis - all rights reserved
// this code is registered and protected by international copyrights laws


//####### Register Globals !

extract($HTTP_ENV_VARS);
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);

//#########################

$xnt_control_var = 'xnt2002warp.cms';

if (empty($yfilename)) {
	$yfilename = 'usr_reg.php';
} //end if

require("lib_adv.php");


//check session
if (strlen($wpsid) < '32') {
	$hlocal_sess_req_redr = "$ywebsite_addr".'xindex.php';
	header("Location: $hlocal_sess_req_redr");
} //end if


//#######################################


function xuser_register () {

global	$warp_user_can_register, $warp_user_regby_email, $wpsid, 
	$arr_var_result, $PHP_AUTH_USER, $PHP_AUTH_PW ;

global 	$ybar_color, $ymain_color, $ybar_menu_color, $ysmall_text_color, $ywarp_max_display_cfg,
	$y_warp_back_text_x ;

global	$y_warp_back_text, $y_warp_next_step, $ywusr_new_profile, $ywusr_status_txt, $ywusr_process_txt,
	$ywebsite_addr, $y_warp_picts_dir, $ywusr_user_id, $ywusr_user_pass, $ywusr_user_repass, 
	$y_warp_post_text_hint, $ywusr_register_title, $ywusr_add_step_one, $ywusr_add_step_two, $ywusr_add_step_one_e, 
	$ywusr_must_logout, $ywusr_already_logon, $ywusr_already_logon_title, $ywusr_email, $y_warp_post_text_mark,
	$ywusr_user_zz_user, $ywusr_hint_regwithemlverif ;

//---------------------------------------------------------page header
xheader ("$ywusr_register_title", '');
xcenter_start ();
xshow_page_title ("$ywusr_register_title", "$wpsid");
xnewline ();
//---------------------------------------------------------


//------------------------ get user auth (if already)
//read from users
$WARP_B64_ENC_AUTH_PASSW = base64_encode($PHP_AUTH_PW);
xmysql_read_data ("SELECT id FROM users WHERE ( (usr_name='$PHP_AUTH_USER') AND (usr_pass='$WARP_B64_ENC_AUTH_PASSW') )");
$yh_local_usrreg_usr_id = $arr_var_result[0];
//------------------------ 


if (empty($yh_local_usrreg_usr_id)) {
	if ($warp_user_regby_email == 'y') {
		$ylocal_title_msg = $ywusr_add_step_one_e;
		$op_var = 'uadde';
		$op_frm = 'eml';
	} //end if
	else {
		$ylocal_title_msg = $ywusr_add_step_one;
		$op_var = 'uaddx';
		$op_frm = 'x';
	} //end else
} //end if
else {
	$ylocal_title_msg = $ywusr_already_logon_title;
} //end else


//==================== where bar

	xtable_start ("$ywarp_max_display_cfg");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$ywusr_register_title</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php"."?wpsid=$wpsid", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

//=====================================

	$w_license_user_agreement_file = @fopen ('user_agreement.txt', "r");
	$w_license_user_agreement_content = @fread ($w_license_user_agreement_file, filesize('user_agreement.txt'));
	@fclose ($w_license_user_agreement_file);

	$w_license_user_agreement_content = htmlspecialchars($w_license_user_agreement_content);
	$w_license_user_agreement_content = str_replace ("\r", "\n", $w_license_user_agreement_content);
	$w_license_user_agreement_content = str_replace ("\n", '<br>', $w_license_user_agreement_content);

xtable_start ("$ywarp_max_display_cfg");

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ybar_color");
			xtext_title ("&nbsp;"."$ylocal_title_msg");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xvline ('100%');

			if (empty($yh_local_usrreg_usr_id)) {
			xcenter_start();
			xtable_start ('50%');
				xtable_row_start ();
					xtable_column_start ('1', '', "$ymain_color");
						xtext_small ('<br>'.$w_license_user_agreement_content.'<br>');
					xtable_column_end ();
				xtable_row_end ();
			xtable_end();
			xcenter_end();
			xvline ('100%');
			} //end if

		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xnewline();
			xcenter_start ();

			if (empty($yh_local_usrreg_usr_id)) {

					xwriteflash_nobg_var ("$ywebsite_addr"."usrreg_frm.swf",
						"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
						"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
						"&flash_form_text_back=".rawurlencode($y_warp_back_text).
						"&flash_form_text_next=".rawurlencode($y_warp_next_step).
						"&flash_form_text_bttn=".rawurlencode($ywusr_new_profile).
						"&flash_form_text_status=".rawurlencode($ywusr_status_txt." : ").
						"&flash_form_text_process=".rawurlencode($ywusr_process_txt).
						"&yformop=".rawurlencode($op_frm).
						"&usr_id_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_id".' :').
						"&usr_pass_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_pass".' :').
						"&usr_repass_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_repass".' :').
						"&email_txt=".rawurlencode("$y_warp_post_text_mark"."$ywusr_user_zz_user".' '."$ywusr_email".' :').
						"&hint_txt=".rawurlencode("$y_warp_post_text_hint").
						"&hint_eml_txt=".rawurlencode("$ywusr_hint_regwithemlverif").
						"&usr_id_var=".rawurlencode('').
						"&usr_pass_var=".rawurlencode('').
						"&usr_repass_var=".rawurlencode('').
						"&email_var=".rawurlencode('').
						"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/usr_accnt.jpg').
						"&flash_form_op=".rawurlencode("$op_var").
						"&xurl=".rawurlencode("$ywebsite_addr"."usr_op.php").
						"&xnexturl=".rawurlencode("$ywebsite_addr"."usr_prof.php?wpsid=$wpsid").
						"&"
					, '450', '250');

			} //end if
			else {
				xcenter_start ();
					xtable_start ('400');
						xtable_row_start ();
							xtable_column_start_vcenter ('1', '40', "$ymain_color");
								xwriteflash_nobg_var ('flagger.swf',
								"&xaction=".rawurlencode('err').
								"&"
								, '30', '30');
							xtable_column_end ();

							xtable_column_start_vcenter ('1', '', "$ymain_color");
								xtext_small ("$ywusr_already_logon".' : '.'<b>'."$PHP_AUTH_USER".'</b>');
								xnewline ();
								xtext_small ("$ywusr_must_logout");
							xtable_column_end ();
						xtable_row_end ();
					xtable_end ();
				xcenter_end ();
			} //end else

			xcenter_end ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '100%', "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();

xtable_end ();


//---------------------------------------------------------page footer
xcenter_end ();
xfooter ();
//---------------------------------------------------------

} //end function


//-------------------------------

if ($warp_user_can_register == 'y') {
	xuser_register ();
} //end if
else {
	$xnt_control_var = 'xx';
	xhalt_hack ();
} //end else

//-------------------------------



// end of php code
?>
Return current item: Warp.cms - php/mysql content management