diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-19 17:56:41 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-19 17:56:41 +0000 |
| commit | 58aee2faa7ab32edcedaf68d346593de9ddb3cb6 (patch) | |
| tree | 703f8e4d30b297df78d6123e4186045d4020c32f /frontends/php/include/profiles.inc.php | |
| parent | 8777958dc979627061016a85ad846507edf395e6 (diff) | |
| download | zabbix-58aee2faa7ab32edcedaf68d346593de9ddb3cb6.tar.gz zabbix-58aee2faa7ab32edcedaf68d346593de9ddb3cb6.tar.xz zabbix-58aee2faa7ab32edcedaf68d346593de9ddb3cb6.zip | |
- [DEV-139] added transaction functionality to frontend (Artem)
- many small fixes (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5505 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/profiles.inc.php')
| -rw-r--r-- | frontends/php/include/profiles.inc.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/frontends/php/include/profiles.inc.php b/frontends/php/include/profiles.inc.php index dfd913a1..46685bf9 100644 --- a/frontends/php/include/profiles.inc.php +++ b/frontends/php/include/profiles.inc.php @@ -68,10 +68,12 @@ function update_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN){ if($type==PROFILE_TYPE_ARRAY && !is_array($value)) $value = array($value); if(PROFILE_TYPE_ARRAY == $type){ + DBstart(); $sql='DELETE FROM profiles WHERE userid='.$USER_DETAILS["userid"].' and idx='.zbx_dbstr($idx); DBExecute($sql); - - insert_profile($idx,$value,$type); + + $result = insert_profile($idx,$value,$type); + DBend($result); } else{ $row = DBfetch(DBselect('SELECT value FROM profiles WHERE userid='.$USER_DETAILS["userid"].' AND idx='.zbx_dbstr($idx))); @@ -94,18 +96,19 @@ return true; function insert_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN){ global $USER_DETAILS; + $result = true; if(is_array($value)){ foreach($value as $key => $val){ - insert_profile($idx,$val,$type); // recursion!!! + $result&=insert_profile($idx,$val,$type); // recursion!!! } } else{ $profileid = get_dbid('profiles', 'profileid'); $sql='INSERT INTO profiles (profileid,userid,idx,value,valuetype)'. ' VALUES ('.$profileid.','.$USER_DETAILS["userid"].','.zbx_dbstr($idx).','.zbx_dbstr($value).','.$type.')'; - DBexecute($sql); + $result = DBexecute($sql); } - +return $result; } /***********************************/ |
