Beispiel #1
0
/**
 * Creates and returns a reference to a subclass of toiminto.
 * @param toiminto String
 * @return A subclass of Toiminto
 */
function &createToiminto($toiminto)
{
    $action = 0;
    $TOIMINNOT =& getToiminnot();
    $_SESSION['onkooikeuksia'] = false;
    // saa katsoa mutta ei muuttaa
    // Haetaan taulukosta luokan nimi ja tiedoston nimi
    // ja luodaan uusi luokka luokan nimellä.
    if (array_key_exists($toiminto, $TOIMINNOT)) {
        require_once $TOIMINNOT[$toiminto][1] . '.php';
        $className = $TOIMINNOT[$toiminto][0];
        $action = new $className();
        $action->asetaNykyinenTila($toiminto);
        // jos ei oikeudet riitä niin palataan pääsivulle
        $onkoOikeuksia = checkRights($action, $TOIMINNOT[$toiminto][2]);
        if ($action->LOGGED_IN == true) {
            if (!$onkoOikeuksia) {
                D("KATSOMIS oikeudeyt");
                $_SESSION['onkooikeuksia'] = false;
                // saa katsoa mutta ei muuttaa
                $onkoOikeuksia = true;
            } else {
                $_SESSION['onkooikeuksia'] = true;
                // saa myös muuttaa
            }
        }
        if (!$onkoOikeuksia) {
            $action = mainPage();
            if (array_key_exists('nimi', $_SESSION)) {
                $action->addError('Sulla ei oo oikeuksia kuules!!');
            } else {
                $action->addError('Loggaa sisälle!!');
            }
        }
    } else {
        // jos tulee virheellinen tilanne
        $action = mainPage();
    }
    $action->toiminnot =& array_keys($TOIMINNOT);
    return $action;
}
Beispiel #2
0
+--------------------------------------------------------+
| Author: Domi & fetloser
| www.venue.nu			     	      
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../../maincore.php";
require_once THEME . "theme.php";
echo "<link rel='stylesheet' href='" . THEME . "styles.css' type='text/css'>";
if (!checkRights("I")) {
    header("Location:../../../index.php");
    exit;
}
if (isset($game) && !isNum($game)) {
    fallback("index.php");
}
if (!defined("LANGUAGE")) {
    // PHPFusion environment
    $this_lang = str_replace("/", "", LOCALESET);
    if (file_exists(INFUSIONS . "varcade/locale/" . $this_lang . ".php")) {
        include INFUSIONS . "varcade/locale/" . $this_lang . ".php";
    } else {
        include INFUSIONS . "varcade/locale/English.php";
    }
} else {
 * 20110409 - franciscom - BUGID 4368: Provide WYSIWYG Editor
 * 20101101 - franciscom - refactoring to remove event viewer warnings
 *
**/
require_once "../../config.inc.php";
require_once "common.php";
require_once "csv.inc.php";
require_once "xml.inc.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('build');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$default_template = $templateCfg->default_template;
$args = init_args($db);
checkRights($db, $_SESSION['currentUser'], $args);
$gui = init_gui($db, $args);
$smarty = new TLSmarty();
$op = new stdClass();
$op->status = 0;
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$of->Value = getItemTemplateContents('platform_template', $of->InstanceName, $args->notes);
$platform_mgr = new tlPlatform($db, $args->tproject_id);
$action = $args->doAction;
switch ($action) {
    case "do_create":
    case "do_update":
    case "do_delete":
        if (!$gui->canManage) {
            break;
        }
  | Copyright (C) PHP-Fusion Inc
  | http://www.php-fusion.co.uk/
  +--------------------------------------------------------+
  | Filename: settings_messages.php
  | Author: Nick Jones (Digitanium)
  +--------------------------------------------------------+
  | This program is released as free software under the
  | Affero GPL license. You can redistribute it and/or
  | modify it under the terms of this license which you
  | can read by viewing the included agpl.txt or online
  | at www.gnu.org/licenses/agpl.html. Removal of this
  | copyright header is strictly prohibited without
  | written permission from the original author(s).
  +--------------------------------------------------------*/
require_once "../maincore.php";
if (!checkRights("S7") || !defined("iAUTH") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/settings.php";
$count = 0;
if (isset($_GET['error']) && isnum($_GET['error']) && !isset($message)) {
    if ($_GET['error'] == 0) {
        $message = $locale['900'];
    } elseif ($_GET['error'] == 1) {
        $message = $locale['901'];
    }
    if (isset($message)) {
        echo "<div id='close-message'><div class='admin-message alert alert-info m-t-10'>" . $message . "</div></div>\n";
    }
}
Beispiel #5
0
 /**
  * Restore the item (previously soft-deleted)
  *(if the model allows soft-deletes)
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function restore($id)
 {
     // check user rights (teachers and leaders can edit items of their own plan)
     $item = Item::onlyTrashed()->find($id);
     $plan_id = $item->plan_id;
     $plan = Plan::find($plan_id);
     if (!checkRights($plan)) {
         return redirect()->back();
     }
     // get item and restore it
     $item = restoreItem($id);
     if ($item) {
         // mark restored item as 'newest item'
         session()->put(['newest_item_id' => $id]);
         // back to full plan view
         return \Redirect::back();
     }
     flashError('Error! Item with ID "' . $id . '" not found! (F:restore)');
     return \Redirect::back();
 }
if (!isset($_SESSION["uid"])) {
    header("location:miniadm.logon.php");
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.user.inc";
include_once dirname(__FILE__) . 'ressources/class.templates.inc';
include_once dirname(__FILE__) . 'ressources/class.ldap.inc';
include_once dirname(__FILE__) . 'ressources/class.users.menus.inc';
include_once dirname(__FILE__) . 'ressources/class.artica.inc';
include_once dirname(__FILE__) . 'ressources/class.mimedefang.inc';
include_once dirname(__FILE__) . 'ressources/class.apache.inc';
include_once dirname(__FILE__) . 'ressources/class.lvm.org.inc';
include_once dirname(__FILE__) . 'ressources/class.user.inc';
if (!checkRights()) {
    header("location:miniadm.messaging.php");
    die;
}
if (isset($_GET["content"])) {
    content();
    exit;
}
if (isset($_GET["section-search"])) {
    section_search();
    exit;
}
if (isset($_GET["search-users"])) {
    users_search();
    exit;
}
Beispiel #7
0
 /**
  * Update a single field in the pivot table of the plan-attached resource
  */
 public function APIupdate(Request $request)
 {
     // check if all necessary elements are given
     if ($request->has('id') && $request->has('value')) {
         $field_name = explode('-', $request->id)[0];
         $item_id = explode('-', $request->id)[3];
     } else {
         return false;
     }
     //we need to find the actual resource as attached to the plan!
     $item = DB::table('plan_resource')->where('id', $item_id)->first();
     if ($item) {
         // check authentication
         $plan = Plan::find($item->plan_id);
         if (!checkRights($plan)) {
             return response()->json(['status' => 401, 'data' => 'Not authorized'], 401);
         }
         // update the given field with the given value
         DB::table('plan_resource')->where('id', $item_id)->update([$field_name => $request->value]);
         // return text to sender
         $result = DB::table('plan_resource')->where('id', $item_id)->first();
         return $result->{$field_name};
     }
     return response()->json(['status' => 404, 'data' => "APIupdate: item with id {$item_id} not found"], 404);
 }
Beispiel #8
0
 *  autoload
 * ===============================================
 */
require 'app/global.php';
/**
 * ===============================================
 *  set the mode
 * 
 *      prod : caching system enabled
 *      dev : force compile templates
 * ===============================================
 */
define('env', 'dev');
/**
 * ===============================================
 *  check rights for files/folders
 * ===============================================
 */
checkRights();
/**
 * ===============================================
 *  set locale
 * ===============================================
 */
setlocale(LC_ALL, 'en_US.UTF8');
/**
 * ===============================================
 *  start the engine
 * ===============================================
 */
app\Fastdoc::start();
Beispiel #9
0
 *
 * @internal revisions
 *       
 *
*/
require '../../config.inc.php';
require_once "common.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tplan_mgr = new testplan($db);
$build_mgr = new build_mgr($db);
$gui = new StdClass();
$gui->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
$gui->tplan_name = ' ';
$gui->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
checkRights($db, $_SESSION['currentUser'], $gui);
if ($gui->tplan_id > 0) {
    $dummy = $tplan_mgr->get_by_id($gui->tplan_id);
    $gui->tplan_name = $dummy['name'];
}
$gui->manageURL = "lib/plan/buildEdit.php?tproject_id={$gui->tproject_id}&tplan_id={$gui->tplan_id}";
$gui->editAction = $gui->manageURL . "&do_action=edit&build_id=";
$gui->deleteAction = $gui->manageURL . "&do_action=do_delete&build_id=";
$gui->createAction = $gui->manageURL . "&do_action=create";
$gui->buildSet = $tplan_mgr->get_builds($gui->tplan_id);
$gui->user_feedback = null;
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 * checkRights
Beispiel #10
0
+--------------------------------------------------------+
| Filename: news_cats.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/news-cats.php";
if (!checkRights("NC") || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
if (isset($_GET['status']) && !isset($message)) {
    if ($_GET['status'] == "sn") {
        $message = $locale['420'];
    } elseif ($_GET['status'] == "su") {
        $message = $locale['421'];
    } elseif ($_GET['status'] == "dn") {
        $message = $locale['422'] . "<br />\n<span class='small'>" . $locale['423'] . "</span>";
    } elseif ($_GET['status'] == "dy") {
        $message = $locale['424'];
    }
    if ($message) {
        echo "<div class='admin-message'>" . $message . "</div>\n";
    }