Esempio n. 1
0
<?php

/**
 * Loads the custom handlers for each section, and provides
 * access control between customers.
 */
namespace saasy;

// Authorize user
if (!App::authorize($page, $tpl)) {
    return;
}
$section = isset($this->params[0]) ? $this->params[0] : false;
// Redirect to internal handler if specified
if (in_array($section, array('account', 'api', 'login', 'search', 'signup', 'user'))) {
    echo $this->run('saasy/' . $section);
    return;
}
if (!$section) {
    $this->redirect(App::href() . '/' . App::first_section());
}
Section::set($section);
$page->title = Section::name();
echo Section::body();
Esempio n. 2
0
function deplacerFil()
{
    $reponse = array('statut' => 'ok');
    $idFil = convertDataSent($_REQUEST['idFil']);
    $idNouvelleSec = convertDataSent($_REQUEST['idNouvelleSec']);
    $arch = new Archiviste();
    $testSection = new Section();
    $testSection->set('id', $idNouvelleSec);
    $blobSection = $arch->restituer($testSection);
    if (count($blobSection) == 1) {
        $filAncien = new Fil();
        $filAncien->set('id', $idFil);
        $filNouveau = new Fil();
        $filNouveau->set('idSection', $idNouvelleSec);
        $arch->modifier($filAncien, $filNouveau);
    } else {
        $reponse = array('statut' => 'nok');
    }
    return $reponse;
}