示例#1
0
 *
 * Öppnar filen Kalender.txt och stoppar i en editerbar textruta.
 * När man är nöjd och trycker på submit-knappen kommer man tillbaka till 
 * samma sida och filen sparas igen.
 * Som editor används nicedit.js.
 *
 */
/*
 * Check if allowed to access.
 * If $nextPage is not set, the page is not reached via the page controller.
 * Then check if the viewer is signed in.
 */
if (!isset($nextPage)) {
    die('Direct access to the page is not allowed.');
}
$intFilter = new CAccessControl();
$intFilter->UserIsSignedInOrRedirect();
$intFilter->UserIsAuthorisedOrDie('fnk');
$calendarFileName = "Kalender.txt";
$calendarPath = TP_DOCUMENTS . $calendarFileName;
$mainTextHTML = "";
if (isset($_POST['submitBtn'])) {
    // If the submit button has been pressed, process the form information.
    // Get calendar from the form.
    $calendar = $_POST['calendar'];
    //Open the file and write the calendar.
    $fh = fopen($calendarPath, "wt");
    fwrite($fh, $calendar);
    fclose($fh);
    if ($debugEnable) {
        // Om debug så visa formuläret färdigifyllt.
示例#2
0
<?php

///////////////////////////////////////////////////////////////////////////////////////////////////
//
// PSaveUser.php
// Called by 'save_user' from index.php.
// The page saves user information for idUser.
// Input: 'firstName', 'familyName', 'eMail1', 'eMail2', 'id', 'redirect' as POST.
// Output:
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Check that the page is reached from the front controller and authority etc.
$intFilter = new CAccessControl();
$intFilter->FrontControllerIsVisitedOrDie();
$intFilter->UserIsSignedInOrRedirectToSignIn();
$intFilter->UserIsAuthorisedOrDie('adm');
///////////////////////////////////////////////////////////////////////////////////////////////////
// Prepare the database and clean input and query the database.
//
$dbAccess = new CdbAccess();
$tableUser = DB_PREFIX . 'User';
$idUser = isset($_POST['id']) ? $_POST['id'] : NULL;
$firstNameUser = isset($_POST['firstName']) ? $_POST['firstName'] : NULL;
$familyNameUser = isset($_POST['familyName']) ? $_POST['familyName'] : NULL;
$eMail1User = isset($_POST['eMail1']) ? $_POST['eMail1'] : NULL;
$eMail2User = isset($_POST['eMail2']) ? $_POST['eMail2'] : NULL;
$redirect = isset($_POST['redirect']) ? $_POST['redirect'] : NULL;
$idUser = $dbAccess->WashParameter($idUser);
$firstNameUser = $dbAccess->WashParameter(strip_tags($firstNameUser));
$familyNameUser = $dbAccess->WashParameter(strip_tags($familyNameUser));
$eMail1User = $dbAccess->WashParameter(strip_tags($eMail1User));
示例#3
0
<?php

///////////////////////////////////////////////////////////////////////////////////////////////////
//
// PLinks.php
// Anropas med 'links' från index.php.
// Sidan innehåller en massa länkar.
// Input:
// Output:
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Kolla behörighet med mera.
$intFilter = new CAccessControl();
$intFilter->FrontControllerIsVisitedOrDie();
///////////////////////////////////////////////////////////////////////////////////////////////////
// Skriv ut sidan.
$page = new CHTMLPage();
$pageTitle = "Länkar";
$mainTextHTML = <<<HTMLCode
<h2>{$pageTitle}</h2>
<h3>Sofia Distans</h3>
<p>Sofia Distansundervisning bedriver undervisning för årskurserna 6-9. Undervisningen sker via 
dator och de erbjuder undervisning i samtliga ämnen. Eftersom svenska skolföreningen inte ger några
betyg i svenska är Sofia Distans ett alternativ för de äldre barnen som behöver ett svenskabetyg för
att få gymnasiebehörighet.</p>
<a href='http://www.sofiadistans.nu/'>www.sofiadistans.nu</a>

<h3>Värmdö Distans</h3>
<p>Värmdö Distans har sedan 1999 haft Skolverkets uppdrag att anordna distansutbildning för svenska 
gymnasieungdomar utomlands.</p>
<a href='http://www.varmdodistans.se/'>www.varmdodistans.se</a>
示例#4
0
/**
 * Show picture (show_picture).
 *
 * This is not a complete webpage only a page for showing pictures in the iframe of
 * PShowAlbum. Input is the id of the picture to be displayed.
 */
/*
 * Check if allowed to access.
 * If $nextPage is not set, the page is not reached via the page controller.
 * Then check if the viewer is signed in.
 */
if (!isset($nextPage)) {
    die('Direct access to the page is not allowed.');
}
$intFilter = new CAccessControl();
$intFilter->UserIsSignedInOrRedirect();
// Input idPicture.
$idPicture = isset($_GET['id']) ? $_GET['id'] : NULL;
$stylesheet = WS_STYLESHEET;
$mainTextHTML = <<<HTMLCode
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <link href="{$stylesheet}" rel="stylesheet" type="text/css" />
   <title> </title>
</head>
<body id="if">   
HTMLCode;
if ($idPicture) {
    // Prepare the database.