diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-01-07 22:43:03 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-01-07 22:43:03 +0000 |
commit | 86d9c9e82f10c2c89a58ed3785c6b00a1bf5bc85 (patch) | |
tree | 5b0c805e979c6d369e518fcbe11b0221f8c6f69a /frontends/php/include/config.inc.php | |
parent | 254ac7ebef85b8e1230d8979afa4d117234f8d58 (diff) | |
download | zabbix-86d9c9e82f10c2c89a58ed3785c6b00a1bf5bc85.tar.gz zabbix-86d9c9e82f10c2c89a58ed3785c6b00a1bf5bc85.tar.xz zabbix-86d9c9e82f10c2c89a58ed3785c6b00a1bf5bc85.zip |
Finished form for image management.
git-svn-id: svn://svn.zabbix.com/trunk@1590 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r-- | frontends/php/include/config.inc.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 1060655f..4aa07b0f 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2354,6 +2354,38 @@ echo "</head>"; } + function add_image($name,$imagetype,$files) + { + global $ERROR_MSG; + + if(isset($files)) + { + if($files["image"]["error"]==0) + if($files["image"]["size"]<1024*1024) + { + $image=addslashes(fread(fopen($files["image"]["tmp_name"],"r"),filesize($files["image"]["tmp_name"]))); + $sql="insert into images (name,imagetype,image) values ('$name',$imagetype,'$image')"; + return DBexecute($sql); + } + else + { + $ERROR_MSG="Image size must be less than 1Mb"; + return FALSE; + } + } + else + { + $ERROR_MSG="Select image to download"; + return FALSE; + } + } + + function delete_image($imageid) + { + $sql="delete from images where imageid=$imageid"; + return DBexecute($sql); + } + function add_service_link($servicedownid,$serviceupid,$softlink) { global $ERROR_MSG; |