Exemple #1
0
<?php

error_reporting(1);
header('Content-type: text/html; charset=utf-8');
include "_plugins/smarty/Smarty.class.php";
include "_configs/config.php";
function __autoload($class_name)
{
    require_once '_classes/' . $class_name . '.php';
}
$smarty = new Smarty();
$sesja = new cSession();
$grupa = new cGroup();
$user = new cUser();
$finger = new cFinger();
$log = new cLog();
$czytnik = new cCzytnik();
$smarty->template_dir = '_skins/first';
$smarty->compile_dir = '_var/tmp_c';
$smarty->cache_dir = '_var/cache';
$smarty->config_dir = '_configs';
$smarty->caching = 0;
$smarty->compile_check = true;
//sprawdza czy plik szablonu lub konfiguracja uleg�y zmienie
$smarty->cache_lifetime = 3600;
//czas �ycia pliku w cache 1 godzina
$sesja->start();
$opcja = $_GET[opcja];
$rodzaj = $_GET[rodzaj];
$sortuj = '';
if ($_GET[sortuj]) {
Exemple #2
0
<?php

require_once 'dslWEb_Library/Class/Documents.php';
require_once 'dslWEb_Library/Class/Session.php';
/**
 * Object instances 
 * Document Class->objDoc, Session Class->objSes 
 * $sData - path to directory ( cDocuments class)-> f:fileCreate	 
 */
$objDoc = new cDocuments();
$objSes = new cSession();
$objSes->sesStart();
/*##################################################################*/
/* the switch option evaluates what value is used from the POSTED name 
 * submitted in the formUpload.php form 
 */
if (isset($_POST['Submit'])) {
    switch ($_POST['Submit']) {
        case 'Segregate':
            if (!empty($_FILES["fileUpload"]) && $_FILES['fileUpload']['error'] == 0) {
                //Сheck that we have a file
                $filename = basename($_FILES['fileUpload']['name']);
                $ext = substr($filename, strrpos($filename, '.') + 1);
                //echo 'File extension:  '.$ext."</br>";
                if ($ext == "xml" && $_FILES["fileUpload"]["type"] == "text/xml") {
                    $file = $_FILES['fileUpload']['name'];
                    $testObj = $objDoc->fileExist($file);
                    /* @check to see if there is a similar file located in uploads_temp
                     * -> proceed to delete the file if it exists 
                     *  */
                    if ($testObj == 'TRUE') {
Exemple #3
0
<?php

session_start();
$pid = $_SESSION['pid'];
$sub = $_POST['subStop'];
$prcName = $_SESSION['dslImageName'];
switch ($sub) {
    case 'Terminate process':
        include_once 'dslWEb_Library/Class/Session.php';
        $objSes = new cSession();
        if ($objSes->pidDel($pid) == "TRUE") {
            $outEcho .= $prcName . ': [PID] ' . $pid . ' terminated. </br>';
            $_SESSION['outEcho'] = $outEcho;
            HEADER("Location:webHtml.php");
        } else {
            $outEcho .= 'ERROR:failed to stop [PID]' . $pid . ' Please contact administrator</br>';
            $_SESSION['outEcho'] = $outEcho;
            HEADER("Location:webHtml.php");
        }
        break;
    default:
        $outEcho .= 'ERROR:A process is still running in the background.</br> ';
        $_SESSION['outEcho'] = $outEcho;
        HEADER("Location:webHtml.php");
        break;
}
Exemple #4
0
<?php

require_once 'dslWEb_Library/Class/Documents.php';
require_once 'dslWEb_Library/Class/Session.php';
$objSes = new cSession();
$objSes->sesStart();
/* before starting. make sure that no process is currently running in the background */
$dslImageName = 'dslexe.exe';
//
$_SESSION['dslImageName'] = $dslImageName;
$pid = $objSes->pidGet($dslImageName);
/* check if the process id exists on the system. */
if ($pid) {
    $_SESSION['pid'] = $pid;
    include 'dslWeb_Html/form/formStopProcess.php';
} else {
    session_destroy();
    unset($_SESSION['$outEcho']);
    $objDoc = new cDocuments();
    //include_once 'dslWeb_Html/form/formUpload.php';
    include_once 'dslWeb_Html/form/formUpload.php';
}
Exemple #5
0
<?php

session_start();
header('Content-type: text/html; charset=UTF-8');
include_once "_plugins/smarty/Smarty.class.php";
include_once "_configs/config.php";
include_once "include/funkcje.php";
function __autoload($class_name)
{
    require_once '_classes/' . $class_name . '.php';
}
$sesja = new cSession();
$sesja->start();
$sesja->set('login', 'Administrator');
$sql = new cSQL(CONF_DB_HOST, CONF_DB_LOGIN, CONF_DB_PASS, CONF_DB_NAME);
//  WYBIERAM ODPOWIEDNIA STRONĘ
// sprawdz czy czy podano paramatr `page` poprzez GET
if (isset($_GET['page'])) {
    // sprawdz czy wybrano grupy (grupy.html)
    if (strcmp($_GET['page'], 'groups') == 0) {
        // pobieram ilość rekordów z tabeli grupa
        $q = "SELECT COUNT(id) FROM grupa";
        $sql->query($q);
        $rekordow = $sql->get_rows();
        // zmienne pomocnicze przy stronnicowaniu
        if (isset($_GET['str'])) {
            if ($_GET['str'] > 0 and $_GET['str'] % ITEMS_ON_PAGE == 0 and $_GET['str'] < $rekordow[0]) {
                $strona = (int) $_GET['str'];
            } else {
                $strona = 0;
            }