17 include_once (
"FDL/Class.Doc.php");
18 include_once (
"FDL/Class.DocAttr.php");
19 include_once (
"FREEDOM/freedom_mod.php");
20 include_once (
"VAULT/Class.VaultFile.php");
27 $docid = GetHttpVars(
"id", 0);
31 if (
$err !=
"") $action->AddWarningMsg(
$err);
34 $fileinfo = $_FILES[
"ifile"];
35 if (is_array($fileinfo)) {
37 if (($fileinfo[
'tmp_name'] ==
"none") || ($fileinfo[
'tmp_name'] ==
"") || ($fileinfo[
'size'] == 0)) {
43 if ($fileVaultInfo->public_access !==
"t") {
44 $action->
exitError(
"File cannot be used as icon");
46 $doc->changeIcon(sprintf(
"%s|%s|%s", $fileVaultInfo->mime_s, $fileVaultInfo->id_file, $fileVaultInfo->name));
48 $action->
addWarningMsg(_(
"no file specified : change icon aborted"));
51 if (!is_uploaded_file($fileinfo[
'tmp_name'])) $action->ExitError(_(
"file not expected : possible attack : update aborted"));
53 $imageSize = getimagesize($fileinfo[
'tmp_name']);
55 $action->
exitError(
"File is not recognized like an image");
61 $doc->changeIcon(sprintf(
"%s|%s|%s", $fileVaultInfo->mime_s, $fileVaultInfo->id_file, $fileVaultInfo->name));
66 redirect($action,
"FDL",
"FDL_CARD&sole=Y&id=" .
$doc->id);
exitError($texterr, $exit=true, $code="")
changeicon(Action &$action)
static getFileInfo($idfile, $teng_name="")
getHttpVars($name, $def="", $scope="all")
new_Doc($dbaccess, $id= '', $latest=false)
if($file) if($subject==""&&$file) if($subject=="") $err
static storeFile($filepath, $ftitle="", $public_access=false)