{{vtScript}} {{vtInclude: includes/initialize.html}} {{vtIf: {vtGlobal:pxtcPathLores} .bw. /}} {{vtElseIf: {vtGlobal:pxtcPathLores} .bw. .}} {{vtElse}} {{vtSet: pixtacyBaseURL="./{vtGlobal:pxtcPathLores}"}} {{vtEndIf}} {{vtInclude:includes/checkdownloadallowed.html}} {{vtIf: {vtGetValue:rule} .neq. }} {{vtRepeat: {vtGlobal:pxtcImagingRules} }} {{vtIf: {vtItem:name} .eq. {vtGetValue:rule} }} {{vtIf: {vtUser:admin} .eq. 1 .or. {vtItem:privilege} .eq. 1 .or. {vtGet:HiresDownloadAllowed} .eq. 1 .or. {vtItem:privilege} .eq. 1 .and. {vtUser:name} .gt. 0 .or. {vtItem:privilege} .eq. 3 .and. {vtItem:groups} .cn1of. {vtUser:groups} }} {{vtSet: File="{vtGlobal:pxtcPathHires}/{Verzeichnis}/./{Dateiname}"}} {{vtSet: Notify="{vtItem:notify}"}} {{vtSet: LogPath="{Verzeichnis}/{Dateiname}"}} {{vtSet: LogType="{vtGetValue:rule}"}} {{vtExit}} {{vtEndIf}} {{vtEndIf}} {{vtEndRepeat}} {{vtElseIf: {vtGetValue:v} .neq. }} {{vtIf: {vtGet:HiresDownloadAllowed} .eq. 1 }} {{vtSet: File="{vtGlobal:pxtcPathHires}/{Verzeichnis}/./{vtGetValue:v}"}} {{vtSet: Notify="{vtGlobal:pxtcNotifyHiresDownload}"}} {{vtSet: LogPath="{Verzeichnis}{vtGetValue:v}"}} {{vtIf: {vtGlobal:pxtcDownloadLogHires} .eq. 1 }} {{vtIf: {vtGetValue:rule} .neq. }} {{vtSet: LogType="{vtGetValue:rule}"}} {{vtElse}} {{vtSet: LogType="hires"}} {{vtEndIf}} {{vtEndIf}} {{vtEndIf}} {{vtElse}} {{vtIf: {vtGet:LoresDownloadAllowed} .eq. 1 }} {{vtSet: File="{vtGlobal:pxtcPathLores}/{Verzeichnis}/./{vtName}"}} {{vtSet: Notify="{vtGlobal:pxtcNotifyLoresDownload}"}} {{vtSet: LogPath="{Verzeichnis}/{vtName}"}} {{vtIf: {vtGlobal:pxtcDownloadLogLores} .eq. 1 }} {{vtSet: LogType="lores"}} {{vtEndIf}} {{vtEndIf}} {{vtEndIf}} {{vtIf: {vtGet:File} .neq.}} {{vtIf: {vtGet:File} .bw. ftp://}} {{vtElse}} {{vtIf: {vtGet:File} .bw. / }} {{vtElse}} {{vtSet: File = "{vtConfig:pathToVirthos}{vtGet:File,raw}" }} {{vtEndIf}} {{vtCalc: realpath( '{vtGet:File,escaped}' ) }} {{vtSet:File}} {{vtEndIf}} {{vtCalc: basename( '{vtGet:File,escaped}' ) }} {{vtSet: FileName }} {{vtIf: {vtGetValue:rule} .neq.}} {{vtCalc: substr( '{vtGet:FileName,escaped}', 0, -4 ) . '_' . strtolower('{vtGetValue:rule}') . '.jpg' }} {{vtSet: FileName}} {{vtCalc: generate_image_file( '{vtGet:File,escaped}', '{vtGetValue:rule}', '{vtId}' ) }} {{vtSet: File }} {{vtSet: DeleteFile }} {{vtIf: {vtGet:File} .bw. - }} {{vtCode: die( 'Could not generate image [' . v::vtget('File:escaped') . ']' ); }} {{vtEndIf}} {{vtEndIf}} {{vtCalc: @apache_setenv( 'no-gzip', 1 ) && @ini_set( 'zlib.output_compression', 0 ) }} {{vtDeliver: {vtGet:File}, {vtGet:FileName} }} {{vtIf: {vtResult} .lt. 0 }} {{vtReturn}} {{vtEndIf}} {{vtIf: {vtGlobal:mailRecipient} .neq. .or. {vtGlobal:pxtcNotifyRecipient} .neq. }} {{vtIf: {vtGet:Notify} .eq. 1}} {{vtIf: {vtUser:realname}.neq.}} {{vtSet: User="{vtUser:realname}"}} {{vtElse}} {{vtSet: User="Benutzer '{vtUser:name}'"}} {{vtEndIf}} {{vtIf: {vtGlobal:pxtcNotifyRecipient} .neq. }} {{vtSet: Recipient = "{vtGlobal:pxtcNotifyRecipient}" }} {{vtElse}} {{vtSet: Recipient = "{vtGlobal:mailRecipient}" }} {{vtEndIf}} {{vtDo: -act="mail", -to="{vtGet:Recipient}", -subject="Pixtacy-Download von {vtGet:User}", -message="{vtGet:User} ({vtEcho: getenv( 'REMOTE_ADDR' ) }) hat am {vtDate|d.m.Y} um {vtDate|H:i} Uhr die Bilddatei '{vtGet:LogPath}' ({vtGet:LogType}) heruntergeladen." }} {{vtEndIf}} {{vtEndIf}} {{vtIf: {vtGet:LogType} .neq. }} {{vtDbQuery: INSERT INTO {vtDbTable:table_downloads_log} SET `timestamp` = CURRENT_TIMESTAMP, `ip_address` = '{vtEcho: getenv( 'REMOTE_ADDR' ) }', `session_id` = '{vtSession:id}', `type` = '{vtGet:LogType}', `user` = '{vtUser:name}', `realname` = '{vtUser:realname}', `organization` = '{vtUser:Contact_Company}', `image_path` = '{vtGet:LogPath}' }} {{vtEndIf}} {{vtIf: {vtGet:DeleteFile} .neq. }} {{vtCalc: unlink('{vtGet:DeleteFile,escaped}') }} {{vtEndIf}} {{vtEndIf}} {{vtEndScript}}