public function mime($file, $mime)
 {
     // If mime is calculated at upload, we have it already..
     if ($mime) {
         return $mime;
     }
     // For older versions with no mime type, attempt to get mime type..
     $e = substr(strrchr(strtolower($file), '.'), +1);
     $a = msDownload::browser();
     $t = msDownload::mime_types();
     // Check for PECL extension..
     if (function_exists('finfo_file') && file_exists($file)) {
         $info = @finfo_open(FILEINFO_MIME_TYPE);
         $type = @finfo_file($info, $file);
         if ($type) {
             return $type;
         }
     }
     // Check mime array..
     if (isset($t[$e])) {
         return $t[$e];
     }
     // Fallback..
     return in_array($a, array('IE', 'OPERA')) ? 'application/octetstream' : 'application/octet-stream';
 }
Beispiel #2
0
  
  This File: attachman.php
  Description: System File

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
if (!defined('PARENT')) {
    $HEADERS->err403(true);
}
// Access..
if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') {
    $HEADERS->err403(true);
}
// Download attachment..
if (isset($_GET['fattachment'])) {
    include REL_PATH . 'control/classes/class.download.php';
    $D = new msDownload();
    $D->faqAttachment((int) $_GET['fattachment'], $SETTINGS, true);
    exit;
}
// Class..
include_once PATH . 'control/classes/class.faq.php';
$FAQ = new faqCentre();
$FAQ->settings = $SETTINGS;
// Enable/disable (Ajax)..
if (isset($_GET['changeState'])) {
    $FAQ->enableDisableAtt();
    echo $JSON->encode(array('ok'));
    exit;
}
// Delete..
if (isset($_POST['delete']) && USER_DEL_PRIV == 'yes') {
  Programmed & Designed by: David Ian Bennett
  E-Mail: support@maianscriptworld.co.uk
  Software Website: http://www.maiansupport.com
  Script Portal: http://www.maianscriptworld.co.uk

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
  API - Create Ticket(s)

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
if (!defined('PARENT') || !defined('MS_PERMISSIONS') || !defined('API_LOADER')) {
    $HEADERS->err403();
}
// Load download class for mime types..
include PATH . 'control/classes/class.download.php';
$DL = new msDownload();
// Load mailer params..
include PATH . 'control/mail-data.php';
// Ticket data array from API..
$added = 0;
$ticketData = $MSAPI->ticket($read, $levelPrKeys);
// Loop data..
if (!empty($ticketData['tickets'])) {
    $countOfTickets = count($ticketData['tickets']);
    $MSAPI->log('[' . strtoupper($MSAPI->handler) . '] ' . $countOfTickets . ' ticket(s) found in incoming data. Preparing to loop ticket(s)..');
    for ($i = 0; $i < $countOfTickets; $i++) {
        $name = trim($ticketData['tickets'][$i]['name']);
        $email = trim($ticketData['tickets'][$i]['email']);
        $deptID = trim($ticketData['tickets'][$i]['dept']);
        $subject = trim($ticketData['tickets'][$i]['subject']);
        $comments = trim($ticketData['tickets'][$i]['comments']);
            $allow = 'no';
            // Is the ticket that this attachment relates to a ticket belonging to logged in user?
            // If not, does this person have access to the ticket because of a dispute?
            $T = mswGetTableData('tickets', 'id', $A->ticketID, 'AND `visitorID` = \'' . $LI_ACC->id . '\' AND `spamFlag` = \'no\'');
            if (isset($T->ts)) {
                $allow = 'yes';
            } else {
                $DS = mswGetTableData('disputes', 'ticketID', $A->ticketID, 'AND `visitorID` = \'' . $LI_ACC->id . '\'');
                if (isset($DS->ticketID)) {
                    $allow = 'yes';
                }
            }
            // If allowed, download..
            if ($allow == 'yes') {
                include PATH . 'control/classes/class.download.php';
                $D = new msDownload();
                $D->ticketAttachment($_GET['attachment'], $SETTINGS);
                exit;
            }
        }
    }
    $HEADERS->err403();
    exit;
}
// For redirection..
if (MS_PERMISSIONS == 'guest' && isset($_GET['t']) && (int) $_GET['t'] > 0) {
    $_SESSION['ticketAccessID'] = (int) $_GET['t'];
}
// Load account globals..
include PATH . 'control/system/accounts/account-global.php';
// Check log in..
Beispiel #5
0
}
// Department info..
$DP = mswGetTableData('departments', 'id', $IMDT->im_dept, '', '`manual_assign`');
// Check department..
if (!isset($DP->manual_assign)) {
    die($pipeID . ' has not been assigned to any department. Update in set');
}
// Is debug enabled?
if ($SETTINGS->imap_debug == 'yes') {
    if (!is_dir(PATH . 'logs') || !is_writeable(PATH . 'logs')) {
        die('Imap debug enabled in settings, but "logs" folder either doesn`t exist or isn`t writeable. Please update.');
    }
}
// Load download class for mime types..
include PATH . 'control/classes/class.download.php';
$DL = new msDownload();
// Load mailer params..
include PATH . 'control/mail-data.php';
// Read mailbox and run..
$MSIMAP = new imapRoutine($IMDT);
$MSIMAP->settings = $SETTINGS;
$MSIMAP->datetime = $MSDT;
$mailbox = $MSIMAP->connectToMailBox();
// Load spam b8 filter if enabled..
if ($IMDT->im_spam == 'yes') {
    include PATH . 'control/lib/b8/call_b8.php';
    if (isset($b8_err)) {
        $MSIMAP->log('B8 spam filter fatal error: ' . $b8_err);
    } else {
        if (class_exists('b8')) {
            $MSIMAP->log('B8 spam filter successfully loaded');
Beispiel #6
0
  Description: System File

  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
if (!defined('PARENT')) {
    $HEADERS->err403(true);
}
include REL_PATH . 'control/classes/class.backup.php';
// Access..
if (!in_array($cmd, $userAccess) && $MSTEAM->id != '1') {
    $HEADERS->err403(true);
}
// Load mail params
include REL_PATH . 'control/mail-data.php';
// Classes..
include_once REL_PATH . 'control/classes/class.download.php';
$MSDL = new msDownload();
// Backup..
if (isset($_POST['process'])) {
    if (!is_writeable(REL_PATH . 'backups') || !is_dir(REL_PATH . 'backups')) {
        die('"<b>' . REL_PATH . 'backups' . '</b>" folder must exist and be writeable. Please check directory and permissions..');
    }
    $time = date('H:i:s', $MSDT->mswTimeStamp());
    $download = isset($_POST['download']) ? 'yes' : 'no';
    $compress = isset($_POST['compress']) ? 'yes' : 'no';
    // Force download if off and no emails..
    if ($download == 'no' && $_POST['emails'] == '') {
        $download = 'yes';
    }
    // File path..
    if ($compress == 'yes') {
        $filepath = REL_PATH . 'backups/' . $msg_script33 . '-' . date('dMY', $MSDT->mswTimeStamp()) . '-' . date('His', $MSDT->mswTimeStamp()) . '.gz';