<?php

require_once 'includes/common.php';
use libAllure\FormHandler;
$handler = new FormHandler('FormUpdatePermission', $tpl);
$handler->setRedirect('listPermissions.php');
$handler->handle();
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormFlagEmails.php';
requirePrivOrRedirect('FLAG_EMAILS');
use libAllure\FormHandler;
$handler = new FormHandler('FormFlagEmails', $tpl);
$handler->handle();
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormUpdateFinanceAccount.php';
require_once 'libAllure/FormHandler.php';
use libAllure\FormHandler;
$handler = new FormHandler('FormUpdateSeatingPlan', $tpl);
$handler->setRedirect('listSeatingPlans.php');
$handler->handle();
    public function validateExtended()
    {
        if ($this->getElement('file')->wasAnythingUploaded()) {
            $this->validateFilename();
        }
    }
    public function process()
    {
        $filename = uniqid() . '.png';
        $this->getElement('file')->destinationFilename = 'full/' . $filename;
        $this->getElement('file')->savePng();
        $this->getElement('file')->resize(100, 100);
        $this->getElement('file')->destinationFilename = 'thumb/' . $filename;
        $this->getElement('file')->savePng();
        $gal = intval(str_replace('gallery', null, $this->getElementValue('dir')));
        if ($gal != null) {
            $sql = 'INSERT INTO images (filename, gallery, caption, published, user_uploaded) values (:filename, :gallery, :caption, 0, :user)';
            $stmt = DatabaseFactory::getInstance()->prepare($sql);
            $stmt->bindValue(':filename', $filename);
            $stmt->bindValue(':gallery', $gal);
            $stmt->bindValue(':caption', 'Uploaded by: ' . Session::getUser()->getUsername());
            $stmt->bindValue(':user', Session::getUser()->getId());
            $stmt->execute();
        }
        logActivity(Session::getUser()->getUsername() . ' uploaded image ' . $filename . ' to gallery: ' . $this->getElement('file')->destinationDir);
        redirect('account.php', 'Image has been uploaded, thanks!');
    }
}
$fh = new FormHandler('FormUploadImage');
$fh->handle();
require_once 'includes/widgets/footer.php';
Esempio n. 5
0
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormSurveyCreate.php';
require_once 'libAllure/FormHandler.php';
use libAllure\FormHandler;
$handler = new FormHandler('FormSurveyCreate');
$handler->setRedirect('listSurveys.php', 'Your survey has been created.');
$handler->handle();
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormUpdateFinanceAccount.php';
require_once 'libAllure/FormHandler.php';
use libAllure\FormHandler;
$handler = new FormHandler('FormUpdateFinanceAllocator', $tpl);
$handler->setRedirect('listFinanceAccounts.php');
$handler->handle();
Esempio n. 7
0
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormSudo.php';
require_once 'libAllure/FormHandler.php';
requirePrivOrRedirect('SUDO');
use libAllure\FormHandler;
use libAllure\Sanitizer;
$handler = new FormHandler('formSudo', $tpl);
$handler->setConstructorArgument(0, Sanitizer::getInstance()->filterString('username'));
$handler->setRedirect('index.php');
$handler->handle();
<?php

require_once 'includes/common.php';
require_once 'libAllure/Inflector.php';
use libAllure\Sanitizer;
use libAllure\FormHandler;
use libAllure\Inflector;
$sanitizer = new Sanitizer();
$gallery = $sanitizer->filterUint('gallery');
$filename = $sanitizer->filterString('filename');
$handler = new FormHandler('FormGalleryImageEdit', $tpl);
$handler->setConstructorArgument(0, $gallery);
$handler->setConstructorArgument(1, $filename);
$handler->setRedirect('viewGalleryImage.php?gallery=' . $gallery . '&amp;filename=' . $filename, 'Gallery image edited.');
$handler->handle();
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormSearchMachineAuthentications.php';
requirePrivOrRedirect('SEARCH_MACHINE_AUTHS');
use libAllure\FormHandler;
$handler = new FormHandler('SearchMachineAuthentications', $tpl);
$handler->handle();
if ($handler->getForm()->validate()) {
    echo 'list';
}
Esempio n. 10
0
<?php

require_once 'includes/common.php';
require_once 'includes/classes/FormCreateGallery.php';
require_once 'libAllure/FormHandler.php';
use libAllure\FormHandler;
$handler = new FormHandler('FormCreateGallery');
$handler->setRedirect('listGalleries.php');
$handler->handle();