CODE STYLE, workflow/engine/methods/users/
FILES: data_usersList.php index.php myInfo.php myInfo_Ajax.php myInfo_Edit.php myInfo_Save.php usersAjax.php usersEdit.php usersGroups.php usersInit.php usersNew.php users_Ajax.php users_AuthSource.php users_AuthSourceSave.php users_Delete.php users_DeleteAssign.php users_DeleteReassign.php users_DeleteReassignEnd.php users_Edit.php users_Groups.php users_List.php users_New.php users_Reassign.php users_ReassignCases.php users_Save.php users_View.php users_ViewPhoto.php users_ViewPhotoGrid.php users_ViewResume.php
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* users_ViewPhoto.php
|
||||
*
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
@@ -12,87 +12,82 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $_REQUEST['pUID'] . ".gif";
|
||||
$direction = PATH_IMAGES_ENVIRONMENT_USERS . $_REQUEST['pUID'] . ".gif";
|
||||
// header('Pragma: ');
|
||||
// header('Cache-Control: cache');
|
||||
|
||||
if (!file_exists($direction))
|
||||
{
|
||||
|
||||
if (! file_exists( $direction )) {
|
||||
$direction = PATH_HOME . 'public_html/images/user.gif';
|
||||
}
|
||||
G::sendHeaders( $direction );
|
||||
|
||||
DumpHeaders($direction);
|
||||
}
|
||||
G::sendHeaders( $direction );
|
||||
|
||||
DumpHeaders( $direction );
|
||||
|
||||
/*
|
||||
* This function is verified to work with Netscape and the *very latest*
|
||||
* version of IE. I don't know if it works with Opera, but it should now.
|
||||
*/
|
||||
function DumpHeaders($filename)
|
||||
function DumpHeaders ($filename)
|
||||
{
|
||||
|
||||
global $root_path;
|
||||
|
||||
if (!$filename) return;
|
||||
if (! $filename)
|
||||
return;
|
||||
|
||||
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
$isIE = 0;
|
||||
|
||||
|
||||
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false &&
|
||||
strstr($HTTP_USER_AGENT, 'Opera') === false) {
|
||||
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE ' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
|
||||
$isIE = 1;
|
||||
}
|
||||
|
||||
if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false &&
|
||||
strstr($HTTP_USER_AGENT, 'Opera') === false) {
|
||||
if (strstr( $HTTP_USER_AGENT, 'compatible; MSIE 6' ) !== false && strstr( $HTTP_USER_AGENT, 'Opera' ) === false) {
|
||||
$isIE6 = 1;
|
||||
}
|
||||
|
||||
$aux = preg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
|
||||
$aux = explode ('_', $aux);
|
||||
$downloadName = $aux[ count($aux)-1 ];
|
||||
$aux = preg_replace( '[^-a-zA-Z0-9\.]', '_', $filename );
|
||||
$aux = explode( '_', $aux );
|
||||
$downloadName = $aux[count( $aux ) - 1];
|
||||
|
||||
if ($isIE && ! isset( $isIE6 )) {
|
||||
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
|
||||
// Do not have quotes around filename, but that applied to
|
||||
// "attachment"... does it apply to inline too?
|
||||
|
||||
|
||||
if ($isIE && !isset($isIE6)) {
|
||||
// http://support.microsoft.com/support/kb/articles/Q182/3/15.asp
|
||||
// Do not have quotes around filename, but that applied to
|
||||
// "attachment"... does it apply to inline too?
|
||||
// This combination seems to work mostly. IE 5.5 SP 1 has
|
||||
// known issues (see the Microsoft Knowledge Base)
|
||||
header( "Content-Disposition: inline; filename=$downloadName" );
|
||||
|
||||
// This combination seems to work mostly. IE 5.5 SP 1 has
|
||||
// known issues (see the Microsoft Knowledge Base)
|
||||
header("Content-Disposition: inline; filename=$downloadName");
|
||||
// This works for most types, but doesn't work with Word files
|
||||
header( "Content-Type: application/download; name=\"$downloadName\"" );
|
||||
|
||||
// This works for most types, but doesn't work with Word files
|
||||
header("Content-Type: application/download; name=\"$downloadName\"");
|
||||
|
||||
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
|
||||
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
|
||||
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
|
||||
}
|
||||
else {
|
||||
header("Content-Disposition: attachment; filename=\"$downloadName\"");
|
||||
header("Content-Type: application/octet-stream; name=\"$downloadName\"");
|
||||
//header("Content-Type: $type0/$type1; name=\"$downloadName\"");
|
||||
//header("Content-Type: application/x-msdownload; name=\"$downloadName\"");
|
||||
//header("Content-Type: application/octet-stream; name=\"$downloadName\"");
|
||||
} else {
|
||||
header( "Content-Disposition: attachment; filename=\"$downloadName\"" );
|
||||
header( "Content-Type: application/octet-stream; name=\"$downloadName\"" );
|
||||
}
|
||||
|
||||
//$filename = PATH_UPLOAD . "$filename";
|
||||
readfile($filename);
|
||||
readfile( $filename );
|
||||
}
|
||||
|
||||
|
||||
//G::header2( "location: /files/" .$_SESSION['ENVIRONMENT']. "/" .$appid, $filename);
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user