Example #1
0
if (Is_Error($EdeskID)) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'Edesks', 'StatusID' => 'Opened', 'RowsIDs' => $EdeskID));
#-------------------------------------------------------------------------------
switch (ValueOf($Comp)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return ERROR | @Trigger_Error(400);
    case 'array':
        #---------------------------------------------------------------------------
        $IEdeskMessage = array('UserID' => $__USER['ID'], 'EdeskID' => $EdeskID, 'Content' => $Message);
        #---------------------------------------------------------------------------
        $Upload = Upload_Get('EdeskMessageFile');
        #---------------------------------------------------------------------------
        switch (ValueOf($Upload)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                # No more...
                break;
            case 'array':
                #-----------------------------------------------------------------------
                $IEdeskMessage['FileName'] = $Upload['Name'];
                break;
            default:
                return ERROR | @Trigger_Error(101);
        }
        #---------------------------------------------------------------------------
Example #2
0
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Args = Args();
#-------------------------------------------------------------------------------
$IsDelete = (bool) @$Args['IsDelete'];
#-------------------------------------------------------------------------------
Header('Content-type: text/plain; charset=utf-8');
#-------------------------------------------------------------------------------
if (Is_Error(System_Load('modules/Authorisation.mod', 'libs/Upload.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Upload = Upload_Get('DataImport');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return 'Файл базы данных не был загружен';
    case 'array':
        #---------------------------------------------------------------------------
        $Data = $Upload['Data'];
        #---------------------------------------------------------------------------
        if ($gZip = @GzInflate(SubStr($Upload['Data'], 10))) {
            #-------------------------------------------------------------------------
            echo "Файл базы данных является сжатым файлом gzip\n";
            #-------------------------------------------------------------------------
            $Data = $gZip;
Example #3
0
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
} else {
    #-------------------------------------------------------------------------------
    $ServiceID = DB_Insert('Services', $IService);
    if (Is_Error($ServiceID)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $Answer['ServiceID'] = $ServiceID;
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Upload = Upload_Get('Emblem');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        # No more...
        break;
    case 'array':
        #-------------------------------------------------------------------------------
        $Emblem = Image_Resize($Upload['Data'], 72, 72);
        if (Is_Error($Emblem)) {
            return new gException('EMBLEM_RESIZE_ERROR', 'Ошибка изменения размеров эмблемы');
        }
        #-------------------------------------------------------------------------------
        if (!SaveUploadedFile('Services', $ServiceID, $Emblem)) {
}
#-------------------------------------------------------------------------------
if ($Count + 1 > IntVal($Settings['MaxMessages'])) {
    return new gException('TOO_MANY_MESSAGES', SPrintF('Тема содержит слишком большое количество сообщений. Максимальное число сообщений в одном тикете равно %u. Пожалуйста, опишите вашу проблему и создайте новый запрос.', IntVal($Settings['MaxMessages'])));
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($Message) {
    #-------------------------------------------------------------------------------
    $ITicketMessage = array('UserID' => $UserID > 0 && $__USER['IsAdmin'] ? $UserID : $__USER['ID'], 'EdeskID' => $Ticket['ID'], 'Content' => $Message);
    #-------------------------------------------------------------------------------
    if (isset($NotVisible)) {
        $ITicketMessage['IsVisible'] = FALSE;
    }
    #-------------------------------------------------------------------------------
    $Upload = Upload_Get('TicketMessageFile', isset($Args['TicketMessageFile']) ? $Args['TicketMessageFile'] : FALSE);
    #-------------------------------------------------------------------------------
    switch (ValueOf($Upload)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
        case 'exception':
            # No more...
            break;
        case 'array':
            #-------------------------------------------------------------------------------
            $ITicketMessage['FileName'] = $Upload['Name'];
            #-------------------------------------------------------------------------------
            break;
            #-------------------------------------------------------------------------------
        #-------------------------------------------------------------------------------
        default:
         break;
     default:
         return ERROR | @Trigger_Error(101);
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $UOrderField = array();
 #-------------------------------------------------------------------------------
 $FieldID = SPrintF('ID%u', $ServiceOrderField['ID']);
 #-------------------------------------------------------------------------------
 $Value = (string) @$Args[$FieldID];
 #-------------------------------------------------------------------------------
 switch ($ServiceField['TypeID']) {
     case 'File':
         #-------------------------------------------------------------------------------
         $Upload = Upload_Get($FieldID);
         #-------------------------------------------------------------------------------
         switch (ValueOf($Upload)) {
             case 'error':
                 return ERROR | @Trigger_Error(500);
             case 'exception':
                 $Value = NULL;
                 break;
             case 'array':
                 #-------------------------------------------------------------------------------
                 $UOrderField['FileName'] = $Upload['Name'];
                 #-------------------------------------------------------------------------------
                 $Value = Base64_Encode($Upload['Data']);
                 #-------------------------------------------------------------------------------
                 break;
                 #-------------------------------------------------------------------------------
Example #6
0
 #-------------------------------------------------------------------------
 if (!isset($Args[$ColumnID])) {
     continue;
 }
 #-------------------------------------------------------------------------
 $Column = $Args[$ColumnID];
 #-------------------------------------------------------------------------
 if ($Column == '[NULL]') {
     $Column = NULL;
 }
 #-------------------------------------------------------------------------
 $TypeID = $ColumnsTypes[$ColumnID]['Type'];
 #-------------------------------------------------------------------------
 if (Preg_Match('/blob/', $TypeID)) {
     #-----------------------------------------------------------------------
     $Upload = Upload_Get($ColumnID);
     #-----------------------------------------------------------------------
     switch (ValueOf($Upload)) {
         case 'error':
             return ERROR | @Trigger_Error(500);
         case 'exception':
             # No more...
             break;
         case 'array':
             $URow[$ColumnID] = GzCompress($Upload['Data']);
             break;
         default:
             return ERROR | @Trigger_Error(101);
     }
     #-----------------------------------------------------------------------
 } else {
Example #7
0
#-------------------------------------------------------------------------------
$Replace = Array_ToLine($Attribs, '%');
#-------------------------------------------------------------------------------
$ProfileName = $Template['ProfileName'];
#-------------------------------------------------------------------------------
foreach (Array_Keys($Replace) as $Key) {
    $ProfileName = Str_Replace($Key, $Replace[$Key], $ProfileName);
}
#-----------------------------TRANSACTION---------------------------------------
if (Is_Error(DB_Transaction($TransactionID = UniqID('ProfileEdit')))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$UProfile = array('Name' => $ProfileName, 'Attribs' => $Attribs);
#-------------------------------------------------------------------------------
$Upload = Upload_Get('Document');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        # No more...
        break;
    case 'array':
        #---------------------------------------------------------------------------
        $Format = SubStr($Upload['Name'], StrrPos($Upload['Name'], '.') + 1);
        #---------------------------------------------------------------------------
        $UProfile = Array_Merge($UProfile, array('Format' => StrToLower($Format)));
        break;
    default:
        return ERROR | @Trigger_Error(101);
Example #8
0
        $File = SPrintF('styles/%s/Images/dSign.bmp', HOST_ID);
        #-------------------------------------------------------------------------------
        $IsWrite = IO_Write(SPrintF('%s/%s', SYSTEM_PATH, $File), $Upload['Data'], TRUE);
        if (Is_Error($IsWrite)) {
            return ERROR | @Trigger_Error(500);
        }
        #-------------------------------------------------------------------------------
        break;
        #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Upload = Upload_Get('aSign');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        # No more...
        break;
    case 'array':
        #-------------------------------------------------------------------------------
        $File = SPrintF('styles/%s/Images/aSign.bmp', HOST_ID);
        #-------------------------------------------------------------------------------
        $IsWrite = IO_Write(SPrintF('%s/%s', SYSTEM_PATH, $File), $Upload['Data'], TRUE);
        if (Is_Error($IsWrite)) {
            return ERROR | @Trigger_Error(500);
        }
        continue;
    }
    #-------------------------------------------------------------------------------
    $Event = array('UserID' => $__USER['ID'], 'PriorityID' => 'Billing', 'Text' => $Message);
    #-------------------------------------------------------------------------------
    $Event = Comp_Load('Events/EventInsert', $Event);
    if (!$Event) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    unset($Message);
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Upload = Upload_Get('UserFoto');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        # No more...
        break;
    case 'array':
        #-------------------------------------------------------------------------------
        $Foto = $Upload['Data'];
        #-------------------------------------------------------------------------------
        $Foto = Image_Resize($Foto, 90, 110);
        #-------------------------------------------------------------------------------
        if (Is_Error($Foto)) {
            return new gException('FOTO_RESIZE_ERROR', 'Ошибка изменения размеров персональной фотографии');
Example #10
0
    case 'exception':
        # No more...
        return $ExecuteTime;
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
foreach ($Messages as $Message) {
    #-------------------------------------------------------------------------------
    $TargetUserID = (int) $Message['TargetUserID'];
    $TargetGroupID = (int) $Message['TargetGroupID'];
    #-------------------------------------------------------------------------------
    $Upload = Upload_Get('TicketMessageFile', $Message['FileName']);
    #-------------------------------------------------------------------------------
    switch (ValueOf($Upload)) {
        case 'error':
            return ERROR | @Trigger_Error(500);
        case 'exception':
            # No more...
            break;
        case 'array':
            #-------------------------------------------------------------------------------
            $Data = GetUploadedFile('EdesksMessages', $Message['ID']);
            #-------------------------------------------------------------------------------
            $EmailAttachments = array(array('Name' => $Upload['Name'], 'Size' => GetUploadedFileSize('EdesksMessages', $Message['ID']), 'Mime' => GetFileMimeType('EdesksMessages', $Message['ID']), 'Data' => Chunk_Split(Base64_Encode($Data['Data']))));
            #-------------------------------------------------------------------------------
            break;
            #-------------------------------------------------------------------------------
Example #11
0
/******************************************************************************/
/******************************************************************************/
$Args = Args();
#-------------------------------------------------------------------------------
$ClauseID = (int) @$Args['ClauseID'];
$Comment = (string) @$Args['Comment'];
#-------------------------------------------------------------------------------
if (Is_Error(System_Load('modules/Authorisation.mod', 'libs/Upload.php'))) {
    return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if (!$Comment) {
    return new gException('COMMENT_IS_EMPTY', 'Введите комментарий к файлу');
}
#-------------------------------------------------------------------------------
$Upload = Upload_Get('ClauseFile');
#-------------------------------------------------------------------------------
switch (ValueOf($Upload)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return $Upload;
    case 'array':
        #---------------------------------------------------------------------------
        $IClauseFile = array('ClauseID' => $ClauseID, 'FileName' => $Upload['Name'], 'FileData' => $Upload['Data'], 'Comment' => $Comment);
        #---------------------------------------------------------------------------
        $ClauseFileID = DB_Insert('ClausesFiles', $IClauseFile);
        if (Is_Error($ClauseFileID)) {
            return ERROR | @Trigger_Error(500);
        }
        #---------------------------------------------------------------------------