a:8:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:8:"act_code";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:253:"$chars = 'abcdefghijklmnopqrstuvxywz';
$chars .= 'ABCDEFGHIJKLMNOPQRSTUVXYWZ';
$chars .= '0123456789!@$*.,;:';
$max = strlen($chars)-1;
$act_code = "new_";
for($i=0; $i < 28; $i++)
{
	$act_code .= $chars{mt_rand(0, $max)};
}

return $act_code;";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:13:"onAfterInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:181:"$sql = "INSERT INTO sec_users_apps(login, app_name)
	     SELECT '". {login}."', app_name FROM sec_apps ";
sc_exec_sql($sql);





sc_commit_trans();
sc_redir('app_Login');";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:17:"onApplicationInit";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:217:"if(isset($_GET['a']) && substr($_GET['a'],0,4) == 'new_')
{
	sc_exec_sql("UPDATE sec_users SET active = 'Y', activation_code ='' WHERE activation_code = ". sc_sql_injection($_GET['a']) );
	sc_redir('app_Login');
}";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:14:"onBeforeInsert";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:112:"if({pswd} != {confirm_pswd})
{
	sc_error_message({lang_error_pswd});
	sc_error_exit();
}
{pswd} = ({pswd});";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:14:"onBeforeUpdate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:10:"onValidate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:0:"";}i:6;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:18:"send_mail_to_admin";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1235:"$sql = "SELECT
		email
	FROM
		sec_users
	WHERE
		priv_admin = 'Y'";
		
sc_lookup(rs,$sql);

$emails_admin = array();
if({rs} !== FALSE && count({rs}) != 0)
{
	foreach({rs} as $value)
		$emails_admin[] = $value[0];
}
$emails_admin = implode(', ', $emails_admin);

/**
 * Send a simple email
 */

// Email parameters
$mail_smtp_server = 'smtp.mail.yahoo.com.br';        // SMTP server name or IP address
$mail_smtp_user   = 'scriptcase@yahoo.com.br';                   // SMTP user name
$mail_smtp_pass   = 'Netmake32';			// SMTP password
$mail_from        = 'scriptcase@yahoo.com.br';          // From email
$mail_to          = $emails_admin;         // To email

$mail_message     = sprintf({lang_new_user_sign_in}, {name}, {email}, {email});

$mail_subject     = {lang_subject_mail_new_user}; 
$mail_format      = 'H';                       // Message format: (T)ext or (H)tml

// Send email
sc_mail_send($mail_smtp_server,
             $mail_smtp_user,
             $mail_smtp_pass,
             $mail_from,
             $mail_to,
             $mail_subject,
             $mail_message,
             $mail_format,
             '','', '587');
sc_log_add("New user", {lang_send_mail_admin});";}i:7;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:18:"app_form_add_users";s:4:"nome";s:21:"send_mail_to_new_user";s:4:"tipo";s:1:"M";s:5:"parms";s:0:"";s:6:"codigo";s:1359:"$act_code = act_code();
$message = " <a href='http://". $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']. "?a=" . $act_code ."'> http://".$_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']. "?a=" . $act_code ." </a>";

// Update record
$update_sql = 'UPDATE sec_users'
    . ' SET activation_code = ' . sc_sql_injection($act_code)
    . ' WHERE login = '. sc_sql_injection({login});
sc_exec_sql($update_sql);


/**
 * Send a simple email
 */
// Email parameters
$mail_smtp_server = 'smtp.mail.yahoo.com.br';        // SMTP server name or IP address
$mail_smtp_user   = 'scriptcase@yahoo.com.br';                   // SMTP user name
$mail_smtp_pass   = 'Netmake32';			// SMTP password
$mail_from        = 'scriptcase@yahoo.com.br';          // From email
$mail_to          = {email};         // To email

$mail_message     = sprintf({lang_send_actcode_newuser}, $message);

$mail_subject     = {lang_subject_new_user}; 
$mail_format      = 'H';                       // Message format: (T)ext or (H)tml

// Send email
sc_mail_send($mail_smtp_server,
             $mail_smtp_user,
             $mail_smtp_pass,
             $mail_from,
             $mail_to,
             $mail_subject,
             $mail_message,
             $mail_format,
             '','', '587');
sc_log_add("Send active code", {lang_sended_active_code});
";}}