Saving Preordernotification and test email done

This commit is contained in:
Frank Schubert
2023-01-26 19:24:35 +01:00
parent 844e6ccd2a
commit d2ceb7ead8
14 changed files with 791 additions and 100 deletions

View File

@@ -46,6 +46,50 @@ class mfUpload {
}
}
public function getSavepath() {
return $this->savepath;
}
public function setSavepath($path) {
$this->savepath = $path;
return true;
}
public function getOriginalFilename() {
return $this->original_filename;
}
public function getFilename() {
return $this->filename;
}
public function setFilename($name) {
$this->filename = $name;
}
public function getSize() {
return $this->size;
}
public function getDirmode() {
return $this->dirmode;
}
public function setDirmode($mode) {
$this->dirmode = $mode;
}
public function getFilemode() {
return $this->filemode;
}
public function setFilemode($mode) {
$this->filemode = $mode;
}
public function getMimetype() {
return $this->upload->getMimetype();
}
public function save() {
if(!$this->savepath) {
@@ -95,7 +139,7 @@ class mfUpload {
$string = '';
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters))];
$string .= $characters[mt_rand(0, strlen($characters) -1)];
}
$rand = uniqid(md5(rand()), true);
@@ -133,44 +177,5 @@ class mfUpload {
return true;
}
public function getSavepath() {
return $this->savepath;
}
public function setSavepath($path) {
$this->savepath = $path;
return true;
}
public function getOriginalFilename() {
return $this->original_filename;
}
public function getFilename() {
return $this->filename;
}
public function setFilename($name) {
$this->filename = $name;
}
public function getSize() {
return $this->size;
}
public function getDirmode() {
return $this->dirmode;
}
public function setDirmode($mode) {
$this->dirmode = $mode;
}
public function getFilemode() {
return $this->filemode;
}
public function setFilemode($mode) {
$this->filemode = $mode;
}
}

View File

@@ -13,15 +13,30 @@ class mfUpload_TmpFile {
public function __construct($_file) {
$this->log = mfLoghandler::singleton();
if(is_array($_file) && count($_file) == 2) {
$upload_name = $_file[0];
$index = $_file[1];
$upload = [
'name' => $_FILES[$upload_name]['name'][$index],
'full_path' => $_FILES[$upload_name]['full_path'][$index],
'type' => $_FILES[$upload_name]['type'][$index],
'tmp_name' => $_FILES[$upload_name]['tmp_name'][$index],
'error' => $_FILES[$upload_name]['error'][$index],
'size' => $_FILES[$upload_name]['size'][$index],
];
} else {
$upload = $_FILES[$_file];
}
if(count($_FILES[$_file])) {
$this->_file = $_FILES[$_file];
if(count($upload)) {
$this->_file = $upload;
} else {
$this->errormessage = "Upload not found";
return false;
}
$this->filename = $this->_file['name'];
$this->error = $this->_file['error'];
$this->tmp_name = $this->_file['tmp_name'];
@@ -81,7 +96,7 @@ class mfUpload_TmpFile {
$ext = strtolower(array_pop($parts));
if(!preg_match('/^'.MFUPLOAD_ALLOWED_EXTENSIONS.'$/i',$ext)) {
$this->errormessage = "File type not allowed. Supported file types are ".ALLOWED_EXTENSIONS_STR;
$this->errormessage = "File type not allowed. Supported file types are ".MFUPLOAD_ALLOWED_EXTENSIONS_STR;
return false;
}