ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilFileDataMail Class Reference

This class handles all operations on files (attachments) in directory ilias_data/mail. More...

+ Inheritance diagram for ilFileDataMail:
+ Collaboration diagram for ilFileDataMail:

Public Member Functions

 __construct ($a_user_id=0)
 Constructor call base constructors checks if directory is writable and sets the optional user_id. More...
 
 initDirectory ()
 init directory overwritten method @access public More...
 
 getUploadLimit ()
 
 getAttachmentsTotalSizeLimit ()
 
 getMailPath ()
 get mail path @access public More...
 
 getAttachmentPathByMD5Filename ($a_filename, $a_mail_id)
 get the path of a specific attachment More...
 
 getAttachmentPath ($a_filename, $a_mail_id)
 get the path of a specific attachment More...
 
 adoptAttachments ($a_attachments, $a_mail_id)
 adopt attachments (in case of forwarding a mail) More...
 
 checkReadWrite ()
 check if directory is writable overwritten method from base class @access private More...
 
 getUserFilesData ()
 get all attachments of a specific user @access public More...
 
 storeAsAttachment ($a_filename, $a_content)
 Store content as attachment. More...
 
 storeUploadedFile ($file)
 
 copyAttachmentFile ($a_abs_path, $a_new_name)
 Copy files in mail directory. More...
 
 rotateFiles ($a_path)
 rotate files with same name recursive method More...
 
 unlinkFiles ($a_filenames)
 unlink files: expects an array of filenames e.g. More...
 
 unlinkFile ($a_filename)
 unlink one uploaded file expects a filename e.g 'foo' More...
 
 getAbsolutePath ($a_path)
 get absolute path of filename More...
 
 saveFiles ($a_mail_id, $a_attachments)
 save all attachment files in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/... More...
 
 saveFile ($a_mail_id, $a_attachment)
 save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/... More...
 
 checkFilesExist ($a_files)
 check if files exist More...
 
 assignAttachmentsToDirectory ($a_mail_id, $a_sent_mail_id)
 assign attachments to mail directory More...
 
 deassignAttachmentFromDirectory ($a_mail_id)
 dassign attachments from mail directory More...
 
 __deleteAttachmentDirectory ($a_rel_path)
 
 _lookupDiskUsageOfUser ($user_id)
 Returns the number of bytes used on the harddisk for mail attachments, by the user with the specified user id. More...
 
- Public Member Functions inherited from ilFileData
 ilFileData ()
 Constructor class bas constructor and read path of directory from ilias.ini setup an mail object @access public. More...
 
 checkPath ($a_path)
 check if path exists and is writable More...
 
 getPath ()
 get Path @access public More...
 
- Public Member Functions inherited from ilFile
 ilFile ()
 Constructor get ilias object @access public. More...
 
 deleteTrailingSlash ($a_path)
 delete trailing slash of path variables More...
 

Static Public Member Functions

static getStorage ($a_mail_id, $a_usr_id)
 

Data Fields

 $user_id
 
 $mail_path
 
- Data Fields inherited from ilFile
 $path
 
 $ilias
 

Protected Member Functions

 initAttachmentMaxUploadSize ()
 

Protected Attributes

 $mail_max_upload_file_size
 

Detailed Description

This class handles all operations on files (attachments) in directory ilias_data/mail.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$ Class ilFileDataMail

Definition at line 18 of file class.ilFileDataMail.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileDataMail::__construct (   $a_user_id = 0)

Constructor call base constructors checks if directory is writable and sets the optional user_id.

Parameters
integeregeruser_id @access public

Definition at line 46 of file class.ilFileDataMail.php.

47 {
48 define('MAILPATH','mail');
49 parent::__construct();
50 $this->mail_path = parent::getPath()."/".MAILPATH;
51 $this->checkReadWrite();
52 $this->user_id = $a_user_id;
53
55 }
checkReadWrite()
check if directory is writable overwritten method from base class @access private

References checkReadWrite(), and initAttachmentMaxUploadSize().

+ Here is the call graph for this function:

Member Function Documentation

◆ __deleteAttachmentDirectory()

ilFileDataMail::__deleteAttachmentDirectory (   $a_rel_path)

Definition at line 548 of file class.ilFileDataMail.php.

549 {
550 ilUtil::delDir($this->mail_path."/".$a_rel_path);
551
552 return true;
553 }
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

References ilUtil\delDir().

Referenced by deassignAttachmentFromDirectory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupDiskUsageOfUser()

ilFileDataMail::_lookupDiskUsageOfUser (   $user_id)

Returns the number of bytes used on the harddisk for mail attachments, by the user with the specified user id.

Parameters
intuser id.
Returns
array{'count'=>integer,'size'=>integer} // an associative array with the disk // usage in bytes and the count of attachments.

Definition at line 600 of file class.ilFileDataMail.php.

601 {
602 // XXX - This method is extremely slow. We should
603 // use a cache to speed it up, for example, we should
604 // store the disk space used in table mail_attachment.
605 global $ilDB, $lng;
606
607 $mail_data_dir = ilUtil::getDataDir('filesystem').DIRECTORY_SEPARATOR."mail";
608
609 $q = "SELECT path ".
610 "FROM mail_attachment ma ".
611 "JOIN mail m ON ma.mail_id=m.mail_id ".
612 "WHERE m.user_id = ".$ilDB->quote($user_id);
613 $result_set = $ilDB->query($q);
614 $size = 0;
615 $count = 0;
616 while($row = $result_set->fetchRow(DB_FETCHMODE_ASSOC))
617 {
618 $attachment_path = $mail_data_dir.DIRECTORY_SEPARATOR.$row['path'];
619 $attachment_size = ilUtil::dirsize($attachment_path);
620 if ($attachment_size != -1)
621 {
622 $size += $attachment_size;
623 }
624 $count++;
625 }
626 return array('count'=>$count, 'size'=>$size);
627 }
$size
Definition: RandomTest.php:79
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
static getDataDir()
get data directory (outside webspace)
static dirsize($directory)
get size of a directory or a file.
global $lng
Definition: privfeed.php:40
global $ilDB

References $ilDB, $lng, $row, $size, $user_id, DB_FETCHMODE_ASSOC, ilUtil\dirsize(), and ilUtil\getDataDir().

Referenced by ilObjMailAccess\_lookupDiskUsageOfUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adoptAttachments()

ilFileDataMail::adoptAttachments (   $a_attachments,
  $a_mail_id 
)

adopt attachments (in case of forwarding a mail)

Parameters
arrayattachments
integermail_id @access public
Returns
string error message

Definition at line 196 of file class.ilFileDataMail.php.

197 {
198 if(is_array($a_attachments))
199 {
200 foreach($a_attachments as $file)
201 {
202 $path = $this->getAttachmentPath($file,$a_mail_id);
203 if(!copy($path,$this->getMailPath().'/'.$this->user_id.'_'.$file))
204 {
205 return "ERROR: $this->getMailPath().'/'.$this->user_id.'_'.$file cannot be created";
206 }
207 }
208 }
209 else
210 {
211 return "ARRAY REQUIRED";
212 }
213 return '';
214 }
print $file
getAttachmentPath($a_filename, $a_mail_id)
get the path of a specific attachment
getMailPath()
get mail path @access public

References $file, ilFile\$path, getAttachmentPath(), and getMailPath().

+ Here is the call graph for this function:

◆ assignAttachmentsToDirectory()

ilFileDataMail::assignAttachmentsToDirectory (   $a_mail_id,
  $a_sent_mail_id 
)

assign attachments to mail directory

Parameters
integermail_id
integerkey for directory assignment @access public
Returns
bool

Definition at line 490 of file class.ilFileDataMail.php.

491 {
492 global $ilDB;
493
494/* $query = "INSERT INTO mail_attachment ".
495 "SET mail_id = ".$ilDB->quote($a_mail_id).", ".
496 "path = ".$ilDB->quote($this->user_id."_".$a_sent_mail_id)." ";
497 $res = $this->ilias->db->query($query);
498*/
499
500 $oStorage = self::getStorage($a_sent_mail_id, $this->user_id);
501 $res = $ilDB->manipulateF('
502 INSERT INTO mail_attachment
503 ( mail_id, path) VALUES (%s, %s)',
504 array('integer', 'text'),
505 array($a_mail_id, $oStorage->getRelativePathExMailDirectory())
506 );
507
508 }
static getStorage($a_mail_id, $a_usr_id)

References $ilDB, $res, and getStorage().

+ Here is the call graph for this function:

◆ checkFilesExist()

ilFileDataMail::checkFilesExist (   $a_files)

check if files exist

Parameters
arrayfilenames to check @access public
Returns
bool

Definition at line 468 of file class.ilFileDataMail.php.

469 {
470 if($a_files)
471 {
472 foreach($a_files as $file)
473 {
474 if(!file_exists($this->mail_path.'/'.$this->user_id.'_'.$file))
475 {
476 return false;
477 }
478 }
479 return true;
480 }
481 return true;
482 }

References $file.

◆ checkReadWrite()

ilFileDataMail::checkReadWrite ( )

check if directory is writable overwritten method from base class @access private

Returns
bool

Definition at line 222 of file class.ilFileDataMail.php.

223 {
224 if(is_writable($this->mail_path) && is_readable($this->mail_path))
225 {
226 return true;
227 }
228 else
229 {
230 $this->ilias->raiseError("Mail directory is not readable/writable by webserver: ".$this->mail_path,$this->ilias->error_obj->FATAL);
231 }
232 }
redirection script todo: (a better solution should control the processing via a xml file)

Referenced by __construct().

+ Here is the caller graph for this function:

◆ copyAttachmentFile()

ilFileDataMail::copyAttachmentFile (   $a_abs_path,
  $a_new_name 
)

Copy files in mail directory.

This is used for sending ILIAS generated mails with attachments

Parameters
arrayArray with files. Absolute path required @access public
Returns

Definition at line 329 of file class.ilFileDataMail.php.

330 {
331 @copy($a_abs_path,$this->getMailPath()."/".$this->user_id."_".$a_new_name);
332
333 return true;
334 }

References getMailPath().

+ Here is the call graph for this function:

◆ deassignAttachmentFromDirectory()

ilFileDataMail::deassignAttachmentFromDirectory (   $a_mail_id)

dassign attachments from mail directory

Parameters
integermail_id @access public
Returns
bool

Definition at line 515 of file class.ilFileDataMail.php.

516 {
517 global $ilDB;
518 // IF IT'S THE LAST MAIL CONTAINING THESE ATTACHMENTS => DELETE ATTACHMENTS
519 $res = $ilDB->query("SELECT path FROM mail_attachment
520 WHERE mail_id = ".$ilDB->quote($a_mail_id,'integer'));
521
522 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
523 {
524 $path = $row->path;
525 }
526 if($path)
527 {
528 $res = $ilDB->query("SELECT COUNT(mail_id) count_mail_id FROM mail_attachment
529 WHERE path = ".$ilDB->quote($path,'text')) ;
530
531 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
532 {
533 $cnt_mail_id = $row->count_mail_id;
534 }
535 if($cnt_mail_id == 1)
536 {
538 }
539 }
540
541 $res = $ilDB->manipulateF("DELETE FROM mail_attachment
542 WHERE mail_id = %s",
543 array('integer'),
544 array($a_mail_id));
545 return true;
546 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
__deleteAttachmentDirectory($a_rel_path)

References $ilDB, ilFile\$path, $res, $row, __deleteAttachmentDirectory(), and DB_FETCHMODE_OBJECT.

+ Here is the call graph for this function:

◆ getAbsolutePath()

ilFileDataMail::getAbsolutePath (   $a_path)

get absolute path of filename

Parameters
stringrelative path @access public
Returns
string absolute path

Definition at line 393 of file class.ilFileDataMail.php.

394 {
395 return $this->mail_path.'/'.$this->user_id.'_'.$a_path;
396 }

◆ getAttachmentPath()

ilFileDataMail::getAttachmentPath (   $a_filename,
  $a_mail_id 
)

get the path of a specific attachment

Parameters
stringfilename
integermail_id @access public
Returns
string path

Definition at line 161 of file class.ilFileDataMail.php.

162 {
163 global $ilDB;
164
165/* $query = "SELECT path FROM mail_attachment ".
166 "WHERE mail_id = ".$ilDB->quote($a_mail_id)."";
167
168 $row = $this->ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
169 $path = $this->getMailPath().'/'.$row->path.'/'.$a_filename;
170*/
171 $query = $ilDB->query("SELECT path FROM mail_attachment ".
172 "WHERE mail_id = ".$ilDB->quote($a_mail_id, 'integer')."");
173
174 while($row = $ilDB->fetchObject($query))
175 {
176 $path = $this->getMailPath().'/'.$row->path.'/'.$a_filename;
177 }
178
179 if(file_exists($path))
180 {
181 if(is_readable($path))
182 {
183 return $path;
184 }
185 return '';
186 }
187 return '';
188 }

References $ilDB, ilFile\$path, $query, $row, and getMailPath().

Referenced by adoptAttachments().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttachmentPathByMD5Filename()

ilFileDataMail::getAttachmentPathByMD5Filename (   $a_filename,
  $a_mail_id 
)

get the path of a specific attachment

Parameters
stringmd5 encrypted filename
integermail_id @access public
Returns
string path

Definition at line 118 of file class.ilFileDataMail.php.

119 {
120 global $ilDB;
121
122/* $query = "SELECT path FROM mail_attachment ".
123 "WHERE mail_id = ".$ilDB->quote($a_mail_id)."";
124
125 $row = $this->ilias->db->getRow($query,DB_FETCHMODE_OBJECT);
126 $path = $this->getMailPath().'/'.$row->path;
127*/
128 $query = $ilDB->query("SELECT path FROM mail_attachment
129 WHERE mail_id = ".$ilDB->quote($a_mail_id,'integer')."");
130
131 $rel_path = "";
132 while($row = $ilDB->fetchObject($query))
133 {
134 $rel_path = $row->path;
135 $path = $this->getMailPath().'/'.$row->path;
136
137 }
138
139 $files = ilUtil::getDir($path);
140 foreach((array)$files as $file)
141 {
142 if($file['type'] == 'file' && md5($file['entry']) == $a_filename)
143 {
144 return array(
145 'path' => $this->getMailPath().'/'.$rel_path.'/'.$file['entry'],
146 'filename' => $file['entry']
147 );
148 }
149 }
150 return '';
151 }
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory

References $file, $ilDB, ilFile\$path, $query, $row, ilUtil\getDir(), and getMailPath().

+ Here is the call graph for this function:

◆ getAttachmentsTotalSizeLimit()

ilFileDataMail::getAttachmentsTotalSizeLimit ( )
Returns
float|null

Definition at line 90 of file class.ilFileDataMail.php.

91 {
92 $max_size = $this->ilias->getSetting('mail_maxsize_attach', '');
93 if(!strlen($max_size))
94 {
95 return null;
96 }
97
98 return (float)$this->ilias->getSetting('mail_maxsize_attach', 0) * 1024;
99 }

◆ getMailPath()

ilFileDataMail::getMailPath ( )

get mail path @access public

Returns
string path

Definition at line 106 of file class.ilFileDataMail.php.

107 {
108 return $this->mail_path;
109 }

References $mail_path.

Referenced by adoptAttachments(), copyAttachmentFile(), getAttachmentPath(), getAttachmentPathByMD5Filename(), storeAsAttachment(), and storeUploadedFile().

+ Here is the caller graph for this function:

◆ getStorage()

static ilFileDataMail::getStorage (   $a_mail_id,
  $a_usr_id 
)
static

Definition at line 428 of file class.ilFileDataMail.php.

429 {
430 static $fsstorage_cache = array();
431
432 if(!is_object($fsstorage_cache[$a_mail_id][$a_usr_id]))
433 {
434 include_once 'Services/Mail/classes/class.ilFSStorageMail.php';
435 $fsstorage_cache[$a_mail_id][$a_usr_id] = new ilFSStorageMail($a_mail_id, $a_usr_id);
436 }
437
438 return $fsstorage_cache[$a_mail_id][$a_usr_id];
439 }

Referenced by assignAttachmentsToDirectory(), and saveFile().

+ Here is the caller graph for this function:

◆ getUploadLimit()

ilFileDataMail::getUploadLimit ( )
Returns
int

Definition at line 82 of file class.ilFileDataMail.php.

References $mail_max_upload_file_size.

Referenced by storeAsAttachment().

+ Here is the caller graph for this function:

◆ getUserFilesData()

ilFileDataMail::getUserFilesData ( )

get all attachments of a specific user @access public

Returns
array

Definition at line 238 of file class.ilFileDataMail.php.

239 {
240 return $this->getUnsentFiles();
241 }

◆ initAttachmentMaxUploadSize()

ilFileDataMail::initAttachmentMaxUploadSize ( )
protected
Todo:
mjansen: Unfortunately we cannot reuse the implementation of ilFileInputGUI

Definition at line 558 of file class.ilFileDataMail.php.

559 {
562 // Copy of ilFileInputGUI: begin
563 // get the value for the maximal uploadable filesize from the php.ini (if available)
564 $umf = ini_get("upload_max_filesize");
565 // get the value for the maximal post data from the php.ini (if available)
566 $pms = ini_get("post_max_size");
567
568 //convert from short-string representation to "real" bytes
569 $multiplier_a = array("K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024);
570
571 $umf_parts = preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
572 $pms_parts = preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
573
574 if(count($umf_parts) == 2)
575 {
576 $umf = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
577 }
578 if(count($pms_parts) == 2)
579 {
580 $pms = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
581 }
582
583 // use the smaller one as limit
584 $max_filesize = min($umf, $pms);
585
586 if(!$max_filesize) $max_filesize = max($umf, $pms);
587 // Copy of ilFileInputGUI: end
588
589 $this->mail_max_upload_file_size = $max_filesize;
590 }
echo;exit;}function LogoutNotification($SessionID) { global $ilDB; $q="SELECT session_id, data FROM usr_session WHERE expires > (\w+)\|/" PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE

References PREG_SPLIT_DELIM_CAPTURE.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ initDirectory()

ilFileDataMail::initDirectory ( )

init directory overwritten method @access public

Returns
string path

Definition at line 63 of file class.ilFileDataMail.php.

64 {
65 if(is_writable($this->getPath()))
66 {
67 if(mkdir($this->getPath().'/'.MAILPATH))
68 {
69 if(chmod($this->getPath().'/'.MAILPATH,0755))
70 {
71 $this->mail_path = $this->getPath().'/'.MAILPATH;
72 return true;
73 }
74 }
75 }
76 return false;
77 }
getPath()
get Path @access public

References ilFileData\getPath().

+ Here is the call graph for this function:

◆ rotateFiles()

ilFileDataMail::rotateFiles (   $a_path)

rotate files with same name recursive method

Parameters
stringfilename @access private
Returns
bool

Definition at line 345 of file class.ilFileDataMail.php.

346 {
347 if(file_exists($a_path))
348 {
349 $this->rotateFiles($a_path.".old");
350 return \ilFileUtils::rename($a_path, $a_path . '.old');
351 }
352 return true;
353 }
rotateFiles($a_path)
rotate files with same name recursive method

References rotateFiles().

Referenced by rotateFiles(), storeAsAttachment(), and storeUploadedFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFile()

ilFileDataMail::saveFile (   $a_mail_id,
  $a_attachment 
)

save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/...

Parameters
integermail id of mail in sent box
arrayfilenames to save @access public
Returns
bool

Definition at line 448 of file class.ilFileDataMail.php.

449 {
450 $oStorage = self::getStorage($a_mail_id, $this->user_id);
451 $oStorage->create();
452 $storage_directory = $oStorage->getAbsolutePath();
453
454 if(@!is_dir($storage_directory))
455 {
456 return false;
457 }
458
459 return copy($this->mail_path.'/'.$this->user_id.'_'.$a_attachment,
460 $storage_directory.'/'.$a_attachment);
461 }

References getStorage().

Referenced by saveFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFiles()

ilFileDataMail::saveFiles (   $a_mail_id,
  $a_attachments 
)

save all attachment files in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/...

Parameters
integermail id of mail in sent box
arrayfilenames to save @access public
Returns
string error message

Definition at line 405 of file class.ilFileDataMail.php.

406 {
407 if(!$a_mail_id)
408 {
409 return "INTERNAL HERE ERROR: No valid mail_id given";
410 }
411 if(is_array($a_attachments))
412 {
413 foreach($a_attachments as $attachment)
414 {
415 if(!$this->saveFile($a_mail_id,$attachment))
416 {
417 return $attachment;
418 }
419 }
420 }
421 else
422 {
423 return "ARRAY REQUIRED";
424 }
425 return '';
426 }
saveFile($a_mail_id, $a_attachment)
save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>...

References saveFile().

+ Here is the call graph for this function:

◆ storeAsAttachment()

ilFileDataMail::storeAsAttachment (   $a_filename,
  $a_content 
)

Store content as attachment.

Parameters
object$a_filename
object$a_content
Returns

Definition at line 282 of file class.ilFileDataMail.php.

283 {
284 if(strlen($a_content) >= $this->getUploadLimit())
285 {
286 return 1;
287 }
288
289 $name = ilUtil::_sanitizeFilemame($a_filename);
290 $this->rotateFiles($this->getMailPath().'/'.$this->user_id.'_'.$name);
291
292 $abs_path = $this->getMailPath().'/'.$this->user_id.'_'.$name;
293
294 if(!$fp = @fopen($abs_path,'w+'))
295 {
296 return false;
297 }
298 if(@fwrite($fp,$a_content) === false)
299 {
300 @fclose($fp);
301 return false;
302 }
303 @fclose($fp);
304 return true;
305 }
static _sanitizeFilemame($a_filename)

References ilUtil\_sanitizeFilemame(), getMailPath(), getUploadLimit(), and rotateFiles().

+ Here is the call graph for this function:

◆ storeUploadedFile()

ilFileDataMail::storeUploadedFile (   $file)
Parameters
array$file

Definition at line 310 of file class.ilFileDataMail.php.

311 {
312 $file['name'] = ilUtil::_sanitizeFilemame($file['name']);
313
314 $this->rotateFiles($this->getMailPath() . '/' . $this->user_id . '_' . $file['name']);
315
317 $file['tmp_name'],
318 $file['name'],
319 $this->getMailPath() . '/' . $this->user_id . '_' . $file['name']
320 );
321 }
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file

References $file, ilUtil\_sanitizeFilemame(), getMailPath(), ilUtil\moveUploadedFile(), and rotateFiles().

+ Here is the call graph for this function:

◆ unlinkFile()

ilFileDataMail::unlinkFile (   $a_filename)

unlink one uploaded file expects a filename e.g 'foo'

Parameters
stringfilename to delete @access public
Returns
bool

Definition at line 380 of file class.ilFileDataMail.php.

381 {
382 if(file_exists($this->mail_path.'/'.basename($this->user_id.'_'.$a_filename)))
383 {
384 return unlink($this->mail_path.'/'.basename($this->user_id.'_'.$a_filename));
385 }
386 }

Referenced by unlinkFiles().

+ Here is the caller graph for this function:

◆ unlinkFiles()

ilFileDataMail::unlinkFiles (   $a_filenames)

unlink files: expects an array of filenames e.g.

array('foo','bar')

Parameters
arrayfilenames to delete @access public
Returns
string error message with filename that couldn't be deleted

Definition at line 360 of file class.ilFileDataMail.php.

361 {
362 if(is_array($a_filenames))
363 {
364 foreach($a_filenames as $file)
365 {
366 if(!$this->unlinkFile($file))
367 {
368 return $file;
369 }
370 }
371 }
372 return '';
373 }
unlinkFile($a_filename)
unlink one uploaded file expects a filename e.g 'foo'

References $file, and unlinkFile().

+ Here is the call graph for this function:

Field Documentation

◆ $mail_max_upload_file_size

ilFileDataMail::$mail_max_upload_file_size
protected

Definition at line 37 of file class.ilFileDataMail.php.

Referenced by getUploadLimit().

◆ $mail_path

ilFileDataMail::$mail_path

Definition at line 32 of file class.ilFileDataMail.php.

Referenced by getMailPath().

◆ $user_id

ilFileDataMail::$user_id

Definition at line 25 of file class.ilFileDataMail.php.

Referenced by _lookupDiskUsageOfUser().


The documentation for this class was generated from the following file: