Пример #1
0
     $upath = "files/" . CL_CONFIG . "/{$id}" . $absfolder;
 } else {
     $upath = "files/" . CL_CONFIG . "/{$id}";
     $upfolder = 0;
 }
 //how many files to upload
 $num = count($_FILES);
 $chk = 0;
 //Loop through uploaded files
 foreach ($_FILES as $file) {
     //encrypt files in their tmp location
     $myfile->encryptFile($file["tmp_name"], $settings["filePass"]);
     //upload them to the files folder and add to the database
     $fid = $myfile->uploadAsync($file["name"], $file["tmp_name"], $file["type"], $file["size"], $upath, $id, $upfolder);
     //get the new file object
     $fileprops = $myfile->getFile($fid);
     //send mail notifications
     if ($settings["mailnotify"]) {
         $sendto = getArrayVal($_POST, "sendto");
         $usr = (object) new project();
         $pname = $usr->getProject($id);
         $users = $usr->getProjectMembers($id, 10000);
         if ($sendto[0] == "all") {
             $sendto = $users;
             $sendto = reduceArray($sendto);
         } elseif ($sendto[0] == "none") {
             $sendto = array();
         }
         //loop through the users in the project
         foreach ($users as $user) {
             if (!empty($user["email"])) {