403Webshell
Server IP : 185.252.147.100  /  Your IP : 216.73.216.43
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/TaskImportController.php
<?php

namespace Kanboard\Controller;

use Kanboard\Core\Csv;
use Kanboard\Import\TaskImport;

/**
 * Task Import controller
 *
 * @package  Kanboard\Controller
 * @author   Frederic Guillot
 */
class TaskImportController extends BaseController
{
    /**
     * Upload the file and ask settings
     *
     * @param array $values
     * @param array $errors
     * @throws \Kanboard\Core\Controller\PageNotFoundException
     */
    public function show(array $values = array(), array $errors = array())
    {
        $project = $this->getProject();

        $this->response->html($this->template->render('task_import/show', array(
            'project' => $project,
            'values' => $values,
            'errors' => $errors,
            'max_size' => get_upload_max_size(),
            'delimiters' => Csv::getDelimiters(),
            'enclosures' => Csv::getEnclosures(),
        )));
    }

    /**
     * Process CSV file
     */
    public function save()
    {
        $project = $this->getProject();
        $values = $this->request->getValues();
        $filename = $this->request->getFilePath('file');

        if (! file_exists($filename)) {
            $this->show($values, array('file' => array(t('Unable to read your file'))));
        } else {
            $taskImport = new TaskImport($this->container);
            $taskImport->setProjectId($project['id']);

            $csv = new Csv($values['delimiter'], $values['enclosure']);
            $csv->setColumnMapping($taskImport->getColumnMapping());
            $csv->read($filename, array($taskImport, 'importTask'));

            if ($taskImport->getNumberOfImportedTasks() > 0) {
                $this->flash->success(t('%d task(s) have been imported successfully.', $taskImport->getNumberOfImportedTasks()));
            } else {
                $this->flash->failure(t('Nothing has been imported!'));
            }

            $this->response->redirect($this->helper->url->to('TaskImportController', 'show', array('project_id' => $project['id'])), true);
        }
    }

    /**
     * Generate template
     *
     */
    public function template()
    {
        $taskImport = new TaskImport($this->container);
        $this->response->withFileDownload('tasks.csv');
        $this->response->csv(array($taskImport->getColumnMapping()));
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit