From f30223788e98d275259ea0883789e8c089767f51 Mon Sep 17 00:00:00 2001 From: kamz Date: Mon, 25 Jan 2016 19:31:43 +0100 Subject: [PATCH] app +clasa emialer i uploader --- include/class.emailer.php | 46 ++++++++++++++++++++++++++++++++++++ include/class.uploadfile.php | 9 +++++-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 include/class.emailer.php diff --git a/include/class.emailer.php b/include/class.emailer.php new file mode 100644 index 0000000..58b5e96 --- /dev/null +++ b/include/class.emailer.php @@ -0,0 +1,46 @@ +setFileName('./include/config/account.ini'); + $cfg->load(); + $this->userMail = $cfg->getElementValue('user','mail'); + // ładowanie konfiguracji + + } + + + private function setEmailContet($adressArray) + { + + } + + private function send() + { + + } + + private function token() + { + return md5(time()); + } +} +?> \ No newline at end of file diff --git a/include/class.uploadfile.php b/include/class.uploadfile.php index 2e505a2..256a074 100644 --- a/include/class.uploadfile.php +++ b/include/class.uploadfile.php @@ -8,7 +8,7 @@ class UploadFile private $size; private $error; private - static $AllowedExt = array("csv","xml","application/vnd.ms-excel"); + private $AllowedExt = array("csv","xml","application/vnd.ms-excel"); static $maxSize = 5120; public @@ -31,7 +31,7 @@ public function startUplod() $this->errorAlert(); $fileExt=pathinfo(strtolower($this->name), PATHINFO_EXTENSION); - if (!in_array($this->mime, UploadFile::$AllowedExt, true)) { + if (!in_array($this->mime, $this->$AllowedExt, true)) { exit("Niedozwolone rozszerzenie pliku."); } @@ -89,6 +89,11 @@ public function remove() } } + public function setAllowedExt($ext) + { + $this->AllowedExt[] = $ext; + } + } ?> \ No newline at end of file