Beispiel #1
0
$app->get('/server/conf', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);
    $server = DB::queryFirstRow("SELECT * FROM config");
    $app->render('server/serverconf.phtml', compact('server'));
    # Demoeinstellungen
    $demo = new \core\demo\demomod();
    $demo->CheckDemo($app->config('demo_mod'));
})->name('not-restricted');
$app->get('/server/license', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);
    $app->render('server/licenseshow.phtml');
})->name('not-restricted');
$app->post('/server/conf', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);
    if (isset($_POST['saveserverconf']) and $app->config('demo_mod') == false) {
        $fromwork = new core\postget\postgetcoll();
        $mywork[] = $fromwork->collvars('POST');
        // TODO: [0] entfernen ;-)
        # Update ServerConf
        DB::update('config', array('server_ip' => $mywork[0]['server_ip'], 'root_user' => $mywork[0]['root_user'], 'ssh_port' => $mywork[0]['ssh_port'], 'sp_titel' => $mywork[0]['sp_titel'], 'doc_root' => $mywork[0]['doc_root'], 'default_local' => $mywork[0]['local'], 'wartungsmodus' => $mywork[0]['wartungsmodus'], 'adminMail' => $mywork[0]['adminMail']), "id=%s", '1');
        if (!empty($mywork[0]['root_password'])) {
            DB::update('config', array('root_password' => $mywork[0]['root_password']), "id=%s", '1');
        }
    }
    $server = DB::queryFirstRow("SELECT * FROM config");
    $app->render('server/serverconf.phtml', compact('server'));
})->name('doLogin');
Beispiel #2
0
 */
/*
 *
 *      POST Verarbeitung
 *
 */
/*
 *
 *      Add User
 *
 */
$app->post('/benutzerverwaltung/adduser', function () use($app) {
    $addUser = new core\usercontrol\user();
    $formwork = new core\postget\postgetcoll();
    if (isset($_POST['registeruser']) and !empty($_POST['vorname']) and !empty($_POST['nachname']) and !empty($_POST['password']) and !empty($_POST['mail'])) {
        $mywork[] = $formwork->collvars('POST');
        $addUser->addUserToDb($mywork, 'registeruser');
        $SPMenu = new SP\Menu\MenuInclusion();
        $SPMenu->MenuInclude($app);
        $Users = DB::query("SELECT * FROM accounts");
        $app->render('benutzerverwaltung/listuser.phtml', compact('Users'));
        $sp_growl = new core\sp_special\growl();
        $sp_growl->writeGrowl('success', _('Benutzer wurde angelegt'), '');
    } else {
        if (isset($_POST['registeruser']) and empty($_POST['vorname']) or empty($_POST['nachname']) or empty($_POST['password']) or empty($_POST['mail'])) {
            $SPMenu = new SP\Menu\MenuInclusion();
            $SPMenu->MenuInclude($app);
            $app->render('benutzerverwaltung/adduser.phtml');
        }
    }
})->name('doLogin');
Beispiel #3
0
 *      Admin Routes
 *
 */
# Neue Nachrichten anlegen  1/2
$app->get('/news/addnews', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);
    $app->render('news/addnews.phtml', compact('Users'));
})->name('addnews');
# Neue Nachrichten anlegen  2/2
$app->post('/news/addnews', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);
    if (isset($_POST['eintragen'])) {
        $form = new \core\postget\postgetcoll();
        $formData[] = $form->collvars('POST');
        // TODO: Datum bis wann angezeigt wird.
        unset($formData['0']['eintragen']);
        \DB::insert('news', $formData);
        echo "\n                 <script>\n                 \$.msgGrowl ({\n                        type: 'info'\n                        , title: '" . _('Nachricht hinzugefügt') . "'\n                        , text: ''\n                        , position: \$(this).attr ('rel')\n                    });\n\n                </script> ";
    }
    $app->render('news/viewlist.phtml', compact('Users'));
})->name('doLogin');
$app->get('/news/list', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);
    $app->render('news/viewlist.phtml', compact('Users'));
})->name('list');
$app->post('/news/list', function () use($app) {
    $SPMenu = new SP\Menu\MenuInclusion();
    $SPMenu->MenuInclude($app);