403Webshell
Server IP : 185.252.147.100  /  Your IP : 216.73.217.33
Web Server : nginx/1.27.3
System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64
User : mitr ( 1000)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/html/kanboard/app/Controller/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/html/kanboard/app/Controller/TaskAjaxController.php
<?php

namespace Kanboard\Controller;

use Kanboard\Filter\TaskIdExclusionFilter;
use Kanboard\Filter\TaskIdFilter;
use Kanboard\Filter\TaskProjectsFilter;
use Kanboard\Filter\TaskStartsWithIdFilter;
use Kanboard\Filter\TaskStatusFilter;
use Kanboard\Filter\TaskTitleFilter;
use Kanboard\Model\TaskModel;

/**
 * Task Ajax Controller
 *
 * @package  Kanboard\Controller
 * @author   Frederic Guillot
 */
class TaskAjaxController extends BaseController
{
    /**
     * Task auto-completion (Ajax)
     *
     */
    public function autocomplete()
    {
        $search = $this->request->getStringParam('term');
        $project_ids = $this->projectPermissionModel->getActiveProjectIds($this->userSession->getId());
        $exclude_task_ids = $this->request->getStringParam('exclude_task_ids');
        $exclude_task_ids = array_filter(array_map('trim', explode(',', $exclude_task_ids)));

        if (empty($project_ids)) {
            $this->response->json(array());
        } else {

            $filter = $this->taskQuery->withFilter(new TaskProjectsFilter($project_ids));

            if (! empty($exclude_task_ids)) {
                $filter->withFilter(new TaskIdExclusionFilter($exclude_task_ids));
            }

            if (ctype_digit((string) $search)) {
                $filter->withFilter(new TaskIdFilter($search));
            } else {
                $filter->withFilter(new TaskTitleFilter($search));
            }

            $this->response->json($filter->format($this->taskAutoCompleteFormatter));
        }
    }

    /**
     * Task ID suggest menu
     */
    public function suggest()
    {
        $taskId = $this->request->getIntegerParam('search');
        $projectIds = $this->projectPermissionModel->getActiveProjectIds($this->userSession->getId());

        if (empty($projectIds)) {
            $this->response->json(array());
        } else {
            $filter = $this->taskQuery
                ->withFilter(new TaskProjectsFilter($projectIds))
                ->withFilter(new TaskStatusFilter(TaskModel::STATUS_OPEN))
                ->withFilter(new TaskStartsWithIdFilter($taskId));

            $this->response->json($filter->format($this->taskSuggestMenuFormatter));
        }
    }

    /**
     * Task edit preview
     */
    public function preview()
    {
        $text = $this->request->getRawValue('text');

        if (empty($text)) {
            $this->response->json(array());
        } else {
            $preview = $this->helper->text->markdown($text);
            $this->response->json(array($preview));
        }
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit