From cd43c8678e84c078ba9ff1f6da7741bb5ee73ee4 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sat, 12 Aug 2006 18:43:14 +0000 Subject: [PATCH] Bug when reload the page --- html/user_sec.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/html/user_sec.php b/html/user_sec.php index dda0c65be..5f3f3297f 100644 --- a/html/user_sec.php +++ b/html/user_sec.php @@ -123,8 +123,11 @@ if ( $action == "change_act" ) { "delete from user_sec_act where ua_login='".$_GET['login']."' and ua_act_id=$act"); } else { echo_debug('user_sec.php',__LINE__,"insert right"); - $Res=ExecSql($cn_dossier, - "insert into user_sec_act(ua_login,ua_act_id) values( '$login' ,$act)"); + if ( CountSql($cn_dossier,"select * from user_sec_act where ua_login='$login' and ua_act_id=$act") < 1 ) + { + $Res=ExecSql($cn_dossier, + "insert into user_sec_act(ua_login,ua_act_id) values( '$login' ,$act)"); + } } $action="view"; }