Esempio n. 1
0
 /**
  * Initialises this controller, does some basic checks and setups
  *
  * @access protected
  * @return void
  */
 protected function _init()
 {
     parent::_init();
     App()->getComponent('bootstrap');
     $sUpdateLastCheck = getGlobalSetting('updatelastcheck');
     // echo "111111";
     $this->_sessioncontrol();
     if (Yii::app()->getConfig('buildnumber') != "" && Yii::app()->getConfig('updatecheckperiod') > 0 && $sUpdateLastCheck < dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", "-" . Yii::app()->getConfig('updatecheckperiod') . " days")) {
         updateCheck();
     }
     //unset(Yii::app()->session['FileManagerContext']);
     App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . "admin_core.js");
     $this->user_id = Yii::app()->user->getId();
     if (!Yii::app()->getConfig("surveyid")) {
         Yii::app()->setConfig("surveyid", returnGlobal('sid'));
     }
     //SurveyID
     if (!Yii::app()->getConfig("ugid")) {
         Yii::app()->setConfig("ugid", returnGlobal('ugid'));
     }
     //Usergroup-ID
     if (!Yii::app()->getConfig("gid")) {
         Yii::app()->setConfig("gid", returnGlobal('gid'));
     }
     //GroupID
     if (!Yii::app()->getConfig("qid")) {
         Yii::app()->setConfig("qid", returnGlobal('qid'));
     }
     //QuestionID
     if (!Yii::app()->getConfig("lid")) {
         Yii::app()->setConfig("lid", returnGlobal('lid'));
     }
     //LabelID
     if (!Yii::app()->getConfig("code")) {
         Yii::app()->setConfig("code", returnGlobal('code'));
     }
     // ??
     if (!Yii::app()->getConfig("action")) {
         Yii::app()->setConfig("action", returnGlobal('action'));
     }
     //Desired action
     if (!Yii::app()->getConfig("subaction")) {
         Yii::app()->setConfig("subaction", returnGlobal('subaction'));
     }
     //Desired subaction
     if (!Yii::app()->getConfig("editedaction")) {
         Yii::app()->setConfig("editedaction", returnGlobal('editedaction'));
     }
     // for html editor integration
 }
Esempio n. 2
0
 /**
  * Initialises this controller, does some basic checks and setups
  *
  * @access protected
  * @return void
  */
 protected function _init()
 {
     parent::_init();
     $updatelastcheck = '';
     $this->_sessioncontrol();
     if (Yii::app()->getConfig('buildnumber') != "" && Yii::app()->getConfig('updatecheckperiod') > 0 && $updatelastcheck < dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", "-" . Yii::app()->getConfig('updatecheckperiod') . " days")) {
         updateCheck();
     }
     //unset(Yii::app()->session['FileManagerContext']);
     $this->user_id = Yii::app()->user->getId();
     Yii::app()->setConfig('adminimageurl', Yii::app()->getConfig('styleurl') . Yii::app()->getConfig('admintheme') . '/images/');
     Yii::app()->setConfig('adminstyleurl', Yii::app()->getConfig('styleurl') . Yii::app()->getConfig('admintheme') . '/');
     if (!Yii::app()->getConfig("surveyid")) {
         Yii::app()->setConfig("surveyid", returnGlobal('sid'));
     }
     //SurveyID
     if (!Yii::app()->getConfig("ugid")) {
         Yii::app()->setConfig("ugid", returnGlobal('ugid'));
     }
     //Usergroup-ID
     if (!Yii::app()->getConfig("gid")) {
         Yii::app()->setConfig("gid", returnGlobal('gid'));
     }
     //GroupID
     if (!Yii::app()->getConfig("qid")) {
         Yii::app()->setConfig("qid", returnGlobal('qid'));
     }
     //QuestionID
     if (!Yii::app()->getConfig("lid")) {
         Yii::app()->setConfig("lid", returnGlobal('lid'));
     }
     //LabelID
     if (!Yii::app()->getConfig("code")) {
         Yii::app()->setConfig("code", returnGlobal('code'));
     }
     // ??
     if (!Yii::app()->getConfig("action")) {
         Yii::app()->setConfig("action", returnGlobal('action'));
     }
     //Desired action
     if (!Yii::app()->getConfig("subaction")) {
         Yii::app()->setConfig("subaction", returnGlobal('subaction'));
     }
     //Desired subaction
     if (!Yii::app()->getConfig("editedaction")) {
         Yii::app()->setConfig("editedaction", returnGlobal('editedaction'));
     }
     // for html editor integration
 }
 public function updatecheck()
 {
     updateCheck();
     $this->getController()->redirect(array('admin/globalsettings'));
 }
Esempio n. 4
0
     continue;
 }
 if ($_option == "--verbose") {
     $VERBOSE = "true";
 } else {
     if ($_option == "--quiet") {
         $QUIET = "true";
     } else {
         if ($_option == "--force") {
             $FORCE = "true";
         } else {
             if ($_option == "--update") {
                 runSelfUpdate();
             } else {
                 if ($_option == "--update-check") {
                     $returnValue = updateCheck();
                     exit($returnValue);
                 } else {
                     if (0 === strpos($_option, "--base=")) {
                         global $BASE;
                         $BASE = substr($_option, strpos($_option, "=") + 1);
                         consoleWriteLine("\$BASE was set to " . $BASE);
                     } else {
                         if ($_option == "--export-config") {
                             exportConfig();
                             exit(0);
                         } else {
                             if ($_option == "--extract-config") {
                                 extractConfig();
                                 exit(0);
                             } else {
Esempio n. 5
0
 /**
  * Update database
  */
 function db($continue = null)
 {
     $clang = $this->getController()->lang;
     Yii::app()->loadHelper("update/update");
     if (isset($continue) && $continue == "yes") {
         $aViewUrls['output'] = CheckForDBUpgrades($continue);
         updateCheck();
         $aData['display']['header'] = false;
     } else {
         $aData['display']['header'] = true;
         $aViewUrls['output'] = CheckForDBUpgrades();
     }
     $this->_renderWrappedTemplate('update', $aViewUrls, $aData);
 }
Esempio n. 6
0
} else {
    $body = messagebox($roster->locale->act['roster_cp_invalid'], $roster->locale->act['roster_cp'], 'sred');
}
// Build the pagebar from admin/pages.php
foreach ($config_pages as $pindex => $data) {
    $pagename = $roster->pages[0] . ($page != 'roster' ? '-' . $page : '');
    if (!isset($data['special']) || $data['special'] != 'hidden') {
        $roster->tpl->assign_block_vars('pagebar', array('SPECIAL' => isset($data['special']) ? $data['special'] : '', 'SELECTED' => isset($data['href']) ? $pagename == $data['href'] ? true : false : '', 'LINK' => isset($data['href']) ? makelink($data['href']) : '', 'NAME' => isset($data['title']) ? isset($roster->locale->act[$data['title']]) ? $roster->locale->act[$data['title']] : $data['title'] : ''));
    }
}
// Refresh the addon list because we may have installed/uninstalled something
$roster->get_addon_data();
$roster->tpl->assign_var('ADDON_PAGEBAR', (bool) count($roster->addon_data));
foreach ($roster->addon_data as $row) {
    $addon = getaddon($row['basename']);
    updateCheck($addon);
    if (file_exists($addon['ucp_dir'] . 'index.php')) {
        // Save current locale array
        // Since we add all locales for localization, we save the current locale array
        // This is in case one addon has the same locale strings as another, and keeps them from overwritting one another
        $localetemp = $roster->locale->wordings;
        foreach ($roster->multilanguages as $lang) {
            $roster->locale->add_locale_file(ROSTER_ADDONS . $row['basename'] . DIR_SEP . 'locale' . DIR_SEP . $lang . '.php', $lang);
        }
        $roster->tpl->assign_block_vars('addon_pagebar', array('SELECTED' => isset($roster->pages[2]) && $roster->pages[2] == $row['basename'] ? true : false, 'LINK' => makelink('ucp-addon-' . $row['basename']), 'NAME' => isset($roster->locale->act[$row['fullname']]) ? $roster->locale->act[$row['fullname']] : $row['fullname']));
        // Restore our locale array
        $roster->locale->wordings = $localetemp;
        unset($localetemp);
    }
}
// ----[ Render the page ]----------------------------------
Esempio n. 7
0
        // This is in case one addon has the same locale strings as another, and keeps them from overwritting one another
        $localetemp = $roster->locale->wordings;
        foreach ($roster->multilanguages as $lang) {
            $roster->locale->add_locale_file(ROSTER_ADDONS . $row['basename'] . DIR_SEP . 'locale' . DIR_SEP . $lang . '.php', $lang);
        }
        $roster->tpl->assign_block_vars('addon_pagebar', array('SELECTED' => isset($roster->pages[2]) && $roster->pages[2] == $row['basename'] ? true : false, 'LINK' => makelink('rostercp-addon-' . $row['basename']), 'NAME' => isset($roster->locale->act[$row['fullname']]) ? $roster->locale->act[$row['fullname']] : $row['fullname']));
        // Restore our locale array
        $roster->locale->wordings = $localetemp;
        unset($localetemp);
    }
}
$roster->get_plugin_data();
$roster->tpl->assign_var('PLUGIN_PAGEBAR', (bool) count($roster->plugin_data));
foreach ($roster->plugin_data as $row) {
    $plugin = getplugin($row['basename']);
    updateCheck($plugin);
    if (file_exists($plugin['admin_dir'] . 'index.php') || $plugin['config'] != '') {
        // Save current locale array
        // Since we add all locales for localization, we save the current locale array
        // This is in case one plugin has the same locale strings as another, and keeps them from overwritting one another
        if (!empty($plugin['config'])) {
            $localetemp = $roster->locale->wordings;
            foreach ($roster->multilanguages as $lang) {
                $roster->locale->add_locale_file(ROSTER_PLUGINS . $row['basename'] . DIR_SEP . 'locale' . DIR_SEP . $lang . '.php', $lang);
            }
            $roster->tpl->assign_block_vars('plugin_pagebar', array('SELECTED' => isset($roster->pages[2]) && $roster->pages[2] == $row['basename'] ? true : false, 'LINK' => makelink('rostercp-plugin-' . $row['basename']), 'NAME' => isset($roster->locale->act[$row['fullname']]) ? $roster->locale->act[$row['fullname']] : $row['fullname']));
            // Restore our locale array
            $roster->locale->wordings = $localetemp;
            unset($localetemp);
        }
    }
Esempio n. 8
0
    }
} elseif ($_GET['action'] == "addTemplate") {
    if (isset($_POST['insertTemplate'])) {
        insertTemplate();
    } else {
        addTemplate();
    }
} elseif ($_GET['action'] == "deleteTemplate") {
    deleteTemplate();
} elseif ($_GET['action'] == "list_checks") {
    displayAllChecks();
} elseif ($_GET['action'] == "showCheck") {
    displayCheck();
} elseif ($_GET['action'] == "editCheck") {
    if (isset($_POST['updateCheck'])) {
        updateCheck();
    } else {
        editCheck();
    }
} elseif ($_GET['action'] == "addCheck") {
    if (isset($_POST['insertCheck'])) {
        insertCheck();
    } else {
        addCheck();
    }
} elseif ($_GET['action'] == "deleteCheck") {
    deleteCheck();
} elseif ($_GET['action'] == "renderCheckReport") {
    renderCheckReport();
} elseif ($_GET['action'] == "renderCheckReportForm") {
    renderCheckReportForm();
Esempio n. 9
0
} else {
    $rcp_message .= messagebox($roster->locale->act['roster_cp_invalid'], $roster->locale->act['roster_cp'], 'sred');
}
// Build the pagebar from admin/pages.php
foreach ($config_pages as $pindex => $data) {
    $pagename = $roster->pages[0] . ($page != 'roster' ? '-' . $page : '');
    if (!isset($data['special']) || $data['special'] != 'hidden') {
        $roster->tpl->assign_block_vars('pagebar', array('SPECIAL' => isset($data['special']) ? $data['special'] : '', 'SELECTED' => isset($data['href']) ? $pagename == $data['href'] ? true : false : '', 'LINK' => isset($data['href']) ? makelink($data['href']) : '', 'NAME' => isset($data['title']) ? isset($roster->locale->act[$data['title']]) ? $roster->locale->act[$data['title']] : $data['title'] : ''));
    }
}
// Refresh the addon list because we may have installed/uninstalled something
$roster->get_addon_data();
$roster->tpl->assign_var('ADDON_PAGEBAR', (bool) count($roster->addon_data));
foreach ($roster->addon_data as $row) {
    $addon = getaddon($row['basename']);
    $rcp_message .= updateCheck($addon);
    if (file_exists($addon['admin_dir'] . 'index.php') || $addon['config'] != '') {
        // Save current locale array
        // Since we add all locales for localization, we save the current locale array
        // This is in case one addon has the same locale strings as another, and keeps them from overwritting one another
        $localetemp = $roster->locale->wordings;
        foreach ($roster->multilanguages as $lang) {
            $roster->locale->add_locale_file(ROSTER_ADDONS . $row['basename'] . DIR_SEP . 'locale' . DIR_SEP . $lang . '.php', $lang);
        }
        $roster->tpl->assign_block_vars('addon_pagebar', array('SELECTED' => isset($roster->pages[2]) && $roster->pages[2] == $row['basename'] ? true : false, 'LINK' => makelink('rostercp-addon-' . $row['basename']), 'NAME' => isset($roster->locale->act[$row['fullname']]) ? $roster->locale->act[$row['fullname']] : $row['fullname']));
        // Restore our locale array
        $roster->locale->wordings = $localetemp;
        unset($localetemp);
    }
}
// ----[ Render the page ]----------------------------------
Esempio n. 10
0
function session($configfile)
{
    if (get_magic_quotes_runtime()) {
        set_magic_quotes_runtime(0);
    }
    $ini = getConfig("" . $configfile . "", ";");
    // dabei ist ; das zeichen für einen kommentar. kann geändert werden.
    for ($i = 0; $i <= 7; $i++) {
        $_SESSION["color_ch" . $i] = $ini['plotter']['color_ch' . $i];
        $_SESSION["temp_min" . $i] = $ini['temp_min']['temp_min' . $i];
        $_SESSION["temp_max" . $i] = $ini['temp_max']['temp_max' . $i];
        $_SESSION["ch_name" . $i] = $ini['ch_name']['ch_name' . $i];
        $_SESSION["alert" . $i] = $ini['web_alert']['ch' . $i];
        $_SESSION["ch_show" . $i] = $ini['ch_show']['ch' . $i];
    }
    $_SESSION["color_pit"] = $ini['plotter']['color_pit'];
    $_SESSION["plot_start"] = $ini['ToDo']['plot_start'];
    $_SESSION["plotname"] = $ini['plotter']['plotname'];
    $_SESSION["plotsize"] = $ini['plotter']['plotsize'];
    $_SESSION["plot_pit"] = $ini['plotter']['plot_pit'];
    $_SESSION["plotbereich_min"] = $ini['plotter']['plotbereich_min'];
    $_SESSION["plotbereich_max"] = $ini['plotter']['plotbereich_max'];
    $_SESSION["keybox"] = $ini['plotter']['keybox'];
    $_SESSION["keyboxframe"] = $ini['plotter']['keyboxframe'];
    $_SESSION["pit_on"] = $ini['ToDo']['pit_on'];
    $_SESSION["pit_ch"] = $ini['Pitmaster']['pit_ch'];
    $_SESSION["webcam_start"] = $ini['webcam']['webcam_start'];
    $_SESSION["webcam_name"] = $ini['webcam']['webcam_name'];
    $_SESSION["webcam_size"] = $ini['webcam']['webcam_size'];
    $_SESSION["raspicam_start"] = $ini['webcam']['raspicam_start'];
    $_SESSION["raspicam_name"] = $ini['webcam']['raspicam_name'];
    $_SESSION["raspicam_size"] = $ini['webcam']['raspicam_size'];
    $_SESSION["raspicam_exposure"] = $ini['webcam']['raspicam_exposure'];
    $_SESSION["current_temp"] = $ini['filepath']['current_temp'];
    $_SESSION["pitmaster"] = $ini['filepath']['pitmaster'];
    $_SESSION["showcpulast"] = $ini['Hardware']['showcpulast'];
    $_SESSION["checkUpdate"] = $ini['update']['checkupdate'];
    if (isset($_SESSION["webGUIversion"])) {
        if ($_SESSION["checkUpdate"] == "True") {
            $check_update = updateCheck("" . $_SESSION["webGUIversion"] . "");
            $_SESSION["updateAvailable"] = $check_update;
        } else {
            $_SESSION["updateAvailable"] = "False";
        }
    } else {
        $_SESSION["updateAvailable"] = "";
    }
    if (!isset($_SESSION["websoundalert"])) {
        $_SESSION["websoundalert"] = "True";
    }
}