ILIAS
Release_4_2_x_branch Revision 61807
|
This class handles all operations on files (attachments) in directory ilias_data/mail. More...
Public Member Functions | |
ilFileDataMail ($a_user_id=0) | |
Constructor call base constructors checks if directory is writable and sets the optional user_id. | |
initDirectory () | |
init directory overwritten method public | |
getUploadLimit () | |
getMailPath () | |
get mail path public | |
getAttachmentPathByMD5Filename ($a_filename, $a_mail_id) | |
get the path of a specific attachment | |
getAttachmentPath ($a_filename, $a_mail_id) | |
get the path of a specific attachment | |
adoptAttachments ($a_attachments, $a_mail_id) | |
adopt attachments (in case of forwarding a mail) | |
checkReadWrite () | |
check if directory is writable overwritten method from base class private | |
getUserFilesData () | |
get all attachments of a specific user public | |
getUnsentFiles () | |
get all files which are not sent find them in directory data/mail/ private | |
storeAsAttachment ($a_filename, $a_content) | |
Store content as attachment. | |
storeUploadedFile ($a_http_post_file) | |
store uploaded file in filesystem | |
copyAttachmentFile ($a_abs_path, $a_new_name) | |
Copy files in mail directory. | |
rotateFiles ($a_path) | |
rotate files with same name recursive method | |
unlinkFiles ($a_filenames) | |
unlink files: expects an array of filenames e.g. | |
unlinkFile ($a_filename) | |
unlink one uploaded file expects a filename e.g 'foo' | |
getAbsolutePath ($a_path) | |
get absolute path of filename | |
saveFiles ($a_mail_id, $a_attachments) | |
save all attachment files in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/... | |
saveFile ($a_mail_id, $a_attachment) | |
save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/... | |
checkFilesExist ($a_files) | |
check if files exist | |
assignAttachmentsToDirectory ($a_mail_id, $a_sent_mail_id) | |
assign attachments to mail directory | |
deassignAttachmentFromDirectory ($a_mail_id) | |
dassign attachments from mail directory | |
__deleteAttachmentDirectory ($a_rel_path) | |
__initAttachmentMaxSize () | |
_lookupDiskUsageOfUser ($user_id) | |
Returns the number of bytes used on the harddisk for mail attachments, by the user with the specified user id. | |
Public Member Functions inherited from ilFileData | |
ilFileData () | |
Constructor class bas constructor and read path of directory from ilias.ini setup an mail object public. | |
checkPath ($a_path) | |
check if path exists and is writable | |
getPath () | |
get Path public | |
Public Member Functions inherited from ilFile | |
ilFile () | |
Constructor get ilias object public. | |
deleteTrailingSlash ($a_path) | |
delete trailing slash of path variables |
Static Public Member Functions | |
static | getStorage ($a_mail_id, $a_usr_id) |
Data Fields | |
$user_id | |
$mail_path | |
$mail_maxsize_attach |
This class handles all operations on files (attachments) in directory ilias_data/mail.
Definition at line 14 of file class.ilFileDataMail.php.
ilFileDataMail::__deleteAttachmentDirectory | ( | $a_rel_path | ) |
Definition at line 540 of file class.ilFileDataMail.php.
References ilUtil\delDir().
Referenced by deassignAttachmentFromDirectory().
ilFileDataMail::__initAttachmentMaxSize | ( | ) |
Definition at line 546 of file class.ilFileDataMail.php.
Referenced by ilFileDataMail().
ilFileDataMail::_lookupDiskUsageOfUser | ( | $user_id | ) |
Returns the number of bytes used on the harddisk for mail attachments, by the user with the specified user id.
int | user id. |
Definition at line 590 of file class.ilFileDataMail.php.
References $ilDB, $lng, $row, $size, $user_id, DB_FETCHMODE_ASSOC, ilUtil\dirsize(), and ilUtil\getDataDir().
ilFileDataMail::adoptAttachments | ( | $a_attachments, | |
$a_mail_id | |||
) |
adopt attachments (in case of forwarding a mail)
array | attachments |
integer | mail_id public |
Definition at line 172 of file class.ilFileDataMail.php.
References $file, ilFile\$path, getAttachmentPath(), and getMailPath().
ilFileDataMail::assignAttachmentsToDirectory | ( | $a_mail_id, | |
$a_sent_mail_id | |||
) |
assign attachments to mail directory
integer | mail_id |
integer | key for directory assignment public |
Definition at line 482 of file class.ilFileDataMail.php.
References $ilDB, $res, and getStorage().
ilFileDataMail::checkFilesExist | ( | $a_files | ) |
check if files exist
array | filenames to check public |
Definition at line 460 of file class.ilFileDataMail.php.
References $file.
ilFileDataMail::checkReadWrite | ( | ) |
check if directory is writable overwritten method from base class private
Definition at line 198 of file class.ilFileDataMail.php.
Referenced by ilFileDataMail().
ilFileDataMail::copyAttachmentFile | ( | $a_abs_path, | |
$a_new_name | |||
) |
Copy files in mail directory.
This is used for sending ILIAS generated mails with attachments
array | Array with files. Absolute path required public |
Definition at line 321 of file class.ilFileDataMail.php.
References getMailPath().
ilFileDataMail::deassignAttachmentFromDirectory | ( | $a_mail_id | ) |
dassign attachments from mail directory
integer | mail_id public |
Definition at line 507 of file class.ilFileDataMail.php.
References $ilDB, ilFile\$path, $res, $row, __deleteAttachmentDirectory(), and DB_FETCHMODE_OBJECT.
ilFileDataMail::getAbsolutePath | ( | $a_path | ) |
get absolute path of filename
string | relative path public |
Definition at line 385 of file class.ilFileDataMail.php.
ilFileDataMail::getAttachmentPath | ( | $a_filename, | |
$a_mail_id | |||
) |
get the path of a specific attachment
string | filename |
integer | mail_id public |
Definition at line 137 of file class.ilFileDataMail.php.
References $ilDB, ilFile\$path, $query, $row, and getMailPath().
Referenced by adoptAttachments().
ilFileDataMail::getAttachmentPathByMD5Filename | ( | $a_filename, | |
$a_mail_id | |||
) |
get the path of a specific attachment
string | md5 encrypted filename |
integer | mail_id public |
Definition at line 94 of file class.ilFileDataMail.php.
References $file, $files, $ilDB, ilFile\$path, $query, $row, ilUtil\getDir(), and getMailPath().
ilFileDataMail::getMailPath | ( | ) |
get mail path public
Definition at line 82 of file class.ilFileDataMail.php.
References $mail_path.
Referenced by adoptAttachments(), copyAttachmentFile(), getAttachmentPath(), getAttachmentPathByMD5Filename(), storeAsAttachment(), and storeUploadedFile().
|
static |
Definition at line 420 of file class.ilFileDataMail.php.
Referenced by assignAttachmentsToDirectory(), and saveFile().
ilFileDataMail::getUnsentFiles | ( | ) |
get all files which are not sent find them in directory data/mail/ private
Definition at line 225 of file class.ilFileDataMail.php.
References $file, $files, and $rest.
Referenced by getUserFilesData().
ilFileDataMail::getUploadLimit | ( | ) |
Definition at line 72 of file class.ilFileDataMail.php.
References $mail_maxsize_attach.
ilFileDataMail::getUserFilesData | ( | ) |
get all attachments of a specific user public
Definition at line 214 of file class.ilFileDataMail.php.
References $files, and getUnsentFiles().
ilFileDataMail::ilFileDataMail | ( | $a_user_id = 0 | ) |
Constructor call base constructors checks if directory is writable and sets the optional user_id.
integereger | user_id public |
Definition at line 39 of file class.ilFileDataMail.php.
References __initAttachmentMaxSize(), checkReadWrite(), ilFileData\getPath(), and ilFileData\ilFileData().
ilFileDataMail::initDirectory | ( | ) |
init directory overwritten method public
Definition at line 57 of file class.ilFileDataMail.php.
References ilFileData\getPath().
ilFileDataMail::rotateFiles | ( | $a_path | ) |
rotate files with same name recursive method
string | filename private |
Definition at line 337 of file class.ilFileDataMail.php.
Referenced by storeAsAttachment(), and storeUploadedFile().
ilFileDataMail::saveFile | ( | $a_mail_id, | |
$a_attachment | |||
) |
save attachment file in a specific mail directory .../mail/<calculated_path>/mail_<mail_id>_<user_id>/...
integer | mail id of mail in sent box |
array | filenames to save public |
Definition at line 440 of file class.ilFileDataMail.php.
References getStorage().
Referenced by 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>/...
integer | mail id of mail in sent box |
array | filenames to save public |
Definition at line 397 of file class.ilFileDataMail.php.
References saveFile().
ilFileDataMail::storeAsAttachment | ( | $a_filename, | |
$a_content | |||
) |
Store content as attachment.
object | $a_filename | |
object | $a_content |
Definition at line 259 of file class.ilFileDataMail.php.
References ilUtil\_sanitizeFilemame(), getMailPath(), and rotateFiles().
ilFileDataMail::storeUploadedFile | ( | $a_http_post_file | ) |
store uploaded file in filesystem
array | HTTP_POST_FILES public |
Definition at line 290 of file class.ilFileDataMail.php.
References ilUtil\_sanitizeFilemame(), getMailPath(), ilUtil\moveUploadedFile(), and rotateFiles().
ilFileDataMail::unlinkFile | ( | $a_filename | ) |
unlink one uploaded file expects a filename e.g 'foo'
string | filename to delete public |
Definition at line 372 of file class.ilFileDataMail.php.
Referenced by unlinkFiles().
ilFileDataMail::unlinkFiles | ( | $a_filenames | ) |
unlink files: expects an array of filenames e.g.
array('foo','bar')
array | filenames to delete public |
Definition at line 352 of file class.ilFileDataMail.php.
References $file, and unlinkFile().
ilFileDataMail::$mail_maxsize_attach |
Definition at line 30 of file class.ilFileDataMail.php.
Referenced by getUploadLimit().
ilFileDataMail::$mail_path |
Definition at line 28 of file class.ilFileDataMail.php.
Referenced by getMailPath().
ilFileDataMail::$user_id |
Definition at line 21 of file class.ilFileDataMail.php.
Referenced by _lookupDiskUsageOfUser().