summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-01-14 12:16:49 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-01-14 12:16:49 +0000
commit6d1c51d9ae6e65a0619b6cb9d2ccefb4a972707f (patch)
tree6e6b00f51f858f9ddc84dc469d9f61086acb7961 /src
parent6d47f4278d61e0efde9cafab7d4dd5477f974891 (diff)
- [DEV-95] added user status enabled/disabled (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5241 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_server/operations.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/zabbix_server/operations.c b/src/zabbix_server/operations.c
index c266b272..8edbcb27 100644
--- a/src/zabbix_server/operations.c
+++ b/src/zabbix_server/operations.c
@@ -128,12 +128,19 @@ void op_notify_user(DB_EVENT *event, DB_ACTION *action, DB_OPERATION *operation)
if(operation->object == OPERATION_OBJECT_USER)
{
- send_to_user_medias(event, operation, operation->objectid);
+ result = DBselect("SELECT count(u.userid) as user_cnt FROM users u WHERE u.userid= " ZBX_FS_UI64 " and status=%d",
+ operation->objectid, USER_STATUS_ACTIVE);
+ row = DBfetch(result);
+ if(row && DBis_null(row[0])!=SUCCEED)
+ {
+ send_to_user_medias(event, operation, operation->objectid);
+ }
+ DBfree_result(result);
}
else if(operation->object == OPERATION_OBJECT_GROUP)
{
- result = DBselect("select u.userid from users u, users_groups ug where ug.usrgrpid=" ZBX_FS_UI64 " and ug.userid=u.userid",
- operation->objectid);
+ result = DBselect("select u.userid from users u, users_groups ug where ug.usrgrpid=" ZBX_FS_UI64 " and ug.userid=u.userid and u.status=%d",
+ operation->objectid,USER_STATUS_ACTIVE);
while((row=DBfetch(result)))
{
ZBX_STR2UINT64(userid, row[0]);