a:6:{i:0;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:9:"app_Login";s:4:"nome";s:8:"has_priv";s:4:"tipo";s:1:"M";s:5:"parms";s:10:"$param,,, ";s:6:"codigo";s:38:"return ($param == 'Y' ? 'on' : 'off');";}i:1;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:9:"app_Login";s:4:"nome";s:17:"onApplicationInit";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:81:"sc_reset_apl_conf("app_form_add_users");
sc_reset_apl_conf("app_retrieve_pswd");";}i:2;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:9:"app_Login";s:4:"nome";s:6:"onInit";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:73:"


sc_reset_apl_status();
sc_reset_global ([usr_login], [usr_email]);";}i:3;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:9:"app_Login";s:4:"nome";s:9:"onLoadAll";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:50:"sc_apl_conf('app_form_add_users', 'start', 'new');";}i:4;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:9:"app_Login";s:4:"nome";s:10:"onValidate";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:652:"$slogin = sc_sql_injection({login});
$spswd = sc_sql_injection(({pswd}));


$sql = "SELECT 
		active, 
		name, 
		email 
	      FROM sec_users 
	      WHERE login = $slogin
		AND pswd = ".$spswd;
sc_lookup(rs, $sql);

if(count({rs}) == 0)
{
	sc_log_add('login Fail', {lang_login_fail} . {login});
	sc_error_message({lang_error_login});
	sc_error_exit();
}
else if({rs[0][0]} == 'Y')
{
	$usr_login		= {login};
	$usr_name		= {rs[0][1]};
	$usr_email		= {rs[0][2]};
	sc_set_global($usr_login);
	sc_set_global($usr_name);
	sc_set_global($usr_email);
	
}
else
{
	sc_error_message({lang_error_not_active});
	sc_error_exit();
}";}i:5;a:7:{s:7:"cod_prj";s:7:"Veratex";s:6:"versao";s:1:"1";s:7:"cod_apl";s:9:"app_Login";s:4:"nome";s:17:"onValidateSuccess";s:4:"tipo";s:1:"E";s:5:"parms";s:0:"";s:6:"codigo";s:1332:"$sql = "SELECT 
		app_name,
		priv_access,
		priv_insert,
		priv_delete,
		priv_update,
		priv_export,
		priv_print
	      FROM sec_users_apps
	      WHERE login = '". [usr_login] ."'";
		
	
sc_select(rs, $sql);
if ({rs} !== false)
{
	while (!$rs->EOF)
	{
		if( $rs->fields[1] == 'Y' )
		{
		    sc_apl_status($rs->fields[0], 'on');
		}
		else
		{
		    sc_apl_status($rs->fields[0], 'off');
		}


		sc_apl_conf($rs->fields[0], 'insert', has_priv($rs->fields[2]));
		sc_apl_conf($rs->fields[0], 'delete', has_priv($rs->fields[3]));
		sc_apl_conf($rs->fields[0], 'update', has_priv($rs->fields[4]));
		//export
		$export_permission = 'btn_display_'. has_priv($rs->fields[5]);
		sc_apl_conf($rs->fields[0], $export_permission, 'xls');
		sc_apl_conf($rs->fields[0], $export_permission, 'word');
		sc_apl_conf($rs->fields[0], $export_permission, 'pdf');
		sc_apl_conf($rs->fields[0], $export_permission, 'xml');
		sc_apl_conf($rs->fields[0], $export_permission, 'csv');
		sc_apl_conf($rs->fields[0], $export_permission, 'rtf');
		//export
		
		$export_permission = 'btn_display_'. has_priv($rs->fields[6]);
		sc_apl_conf($rs->fields[0], $export_permission, 'print');
		$rs->MoveNext();	
	}
	$rs->Close();
	
	
		sc_log_add('login', {lang_login_ok});
		
		sc_redir('MainVeratex');	
	

}";}}