This is an old revision of the document!


Custom PHP scripts can be automatically executed when the users perform one of the many monitored actions.

For example, to automatically run custom PHP code after a file is uploaded, you can simply place a PHP file named “upload.php” inside the folder “customizables/events/”.

Here's an example script:

Set file permissions after upload:

<?php
chmod($data['full_path'], 0644);

Debug $data for the available information.

The following can be used to find out what filename should you use for the event PHP script.

//more used
			'upload' => 'File uploaded',
			'receive_upload' => 'File received (via upload)',
			'receive_copy' => 'File received (via copy)',
			'receive_move' => 'File received (via move)',
			'folder_receive_copy' => 'Folder received (via copy)',
			'folder_receive_move' => 'Folder received (via move)',
			'download' => 'File downloaded',
			'provide_download' => 'File downloaded by another user',
			'preview' => 'File previewed',
			'weblink_access' => 'WebLink folder access',
			'weblink_download' => 'WebLink download',
			'weblink_upload' => 'File received (via WebLink)',
			'shared_folder_available' => 'New shared folder available',
			'shared_file_available' => 'New shared file available',
			'comment_added' => 'File comment added',
			'comment_received' => 'File comment received',
			'metadata_changed' => 'Metadata changed',
			'login' => 'Login',
			'folder_shared' => 'Folder shared',
			'file_shared' => 'File shared',
			'weblink_create' => 'WebLink created',
			'file_encrypted' => 'File encrypted',
			'file_decrypted' => 'File decrypted',
			'label_set' => 'Label changed',
			'label_received' => 'Label received',
			'star_set' => 'Star added',
			'star_removed' => 'Star removed',

			'collection_created' => 'Collection created',
			'collection_add_item' => 'Item added to collection',
			'collection_removed' => 'Collection removed',
			'collection_item_removed' => 'Item removed from collection',
			'collection_renamed' => 'Collection renamed',

//less used
			'weblink_update' => 'WebLink modified',
			'weblink_remove' => 'WebLink removed',
			'logout' => 'Logout',
			'login_failed' => 'Login failed',
			'login_failed_account_deactivated' => 'Account deactivated',
			'password_changed' => 'Password changed',
			'user_manually_activated' => 'User manual activation',
			'user_manually_deactivated' => 'User manual deactivation',
			'comment_removed' => 'File comment removed',
			'folder_unshared' => 'Folder unshared',
			'file_unshared' => 'File unshared',
//successful file actions
			'file_moved' => 'File moved',
			'file_copied' => 'File copied',
			'file_deleted' => 'File deleted',
			'deleted_file_restored' => 'Restored deleted file',
			'trash_delete_file' => 'File permanently deleted',
			'file_renamed' => 'File renamed',
			'zip_files'	=> 'Files zipped',
			'file_sent_by_email' => 'File sent by email',
			'file_locked' => 'File locked',
			'file_unlocked' => 'File unlocked',
			'version_restored' => 'File version restored',
			'version_deleted' => 'File version deleted',
			'archive_extracted' => 'Archive extracted',
//successful folder actions
			'new_folder' => 'New folder created',
			'folder_moved' => 'Folder moved',
			'folder_deleted' => 'Folder deleted',
			'deleted_folder_restored' => 'Restored deleted folder',
			'trash_delete_folder' => 'Folder permanently deleted',
			'folder_renamed' => 'Folder renamed',
			'folder_copied' => 'Folder copied',
			'trash_empty' => 'Trash emptied',
			'trash_empty_fail' => 'Failed to empty trash',
//failed file actions
			'upload_failed' => 'Upload failed',
			'download_failed' => 'Download failed',
			'weblink_upload_failed' => 'WebLink upload failed',
			'file_copy_failed' => 'Failed to copy file',
			'file_deletion_failed' => 'Failed to delete file',
			'file_move_failed' => 'Failed to move file',
			'failed_file_rename' => 'Failed to rename file',
			'zip_files_failed' => 'Failed to zip files',
			'file_lock_failed' => 'Failed to lock file',
			'file_unlock_failed' => 'Failed to unlock file',
			'failed_to_add_comment' => 'Failed to add comment to file',
			'failed_to_remove_comment' => 'Failed to remove comment from file',
			'version_restoration_failed' => 'Failed to restore file version',
			'version_deletion_failed' => 'Failed to delete file version',
//failed folder actions
			'new_folder_failed' => 'Failed to create new folder',
			'failed_folder_rename' => 'Failed to rename folder',
			'folder_copy_failed' => 'Failed to copy folder',
			'folder_deletion_failed' => 'Failed to delete folder',
			'folder_move_failed' => 'Failed to move folder',
//failed collection action
			'collection_create_failed' => 'Failed to create collection',
			'collection_add_item_failed' => 'Failed to add item to collection',
			'collection_removal_failed' => 'Collection removal failed',
			'collection_item_removal_failed' => 'Failed to remove collection item',
			'collection_rename_failed' => 'Failed to rename collection',
//misc
			'folder_notification_settings_changed' => 'Folder notification settings changed',
			'new_user_registration' => 'New user registration',
			'password_recovery' => 'Password recovery',
//administrative
			'user_added' => 'User added',
			'guest_user_added' => 'Guest user added',
			'user_edited' => 'User edited',
			'user_deleted' => 'User deleted',
			'role_added' => 'Role added',
			'role_edited' => 'Role edited',
			'role_deleted' => 'Role deleted',
			'space_quota_warning' => 'Space quota warning',
			'user_added_to_group' => 'User added to group',
			'user_removed_from_group' => 'User removed from group'