$sql = “SELECT
app_name,
priv_access,
priv_insert,
priv_delete,
priv_update,
priv_export,
priv_print
FROM sec_groups_apps
WHERE group_id IN
(SELECT
group_id
FROM
sec_users_groups
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();
if(sc_logged({login})):
sc_log_add('login', {lang_login_ok});
sc_user_logout('logged_user', 'logout', 'app_Login');
//aqui para baixo foi minha implementação
$check_sql = “SELECT description”
. " FROM seg_groups"
. " WHERE group_id IN
(SELECT
group_id
FROM
seg_users_groups
WHERE
login = ‘". [usr_login] ."’)";
sc_lookup(rs, $check_sql);
if({description} == ‘Administrador’)
{
sc_redir(‘MenuAdmin’);
}
elseif({description} == ‘Operador’) {
sc_redir(‘MenuUser’);
}
massagem de erro:
Parse error: syntax error, unexpected ‘}’ in C:\Program Files (x86)\NetMake\v7\wwwroot\scriptcase\app\ProjetoCadOcorrencias\app_Login\app_Login_apl.php on line 1772