/**
  * @see ConfigValueProvider::getVariables()
  */
 public function getVariables()
 {
     $variables = array();
     foreach ($this->dao->searchAll() as $row) {
         $variables[$row['name']] = $row['value'];
     }
     return $variables;
 }
Exemplo n.º 2
0
 /**
  * @author Tuzki
  * @param integer
  */
 public function __construct($account_group_id)
 {
     $config_model = new ConfigDao();
     $config_list = $config_model->getConfigListByAccountGroupId($account_group_id);
     if (count($config_list) > 0) {
         foreach ($config_list as $config) {
             if (array_key_exists($config['name'], $this->config)) {
                 $this->config[$config['name']] = format_val($config['value']);
             }
         }
     }
 }
Exemplo n.º 3
0
 public function putAction()
 {
     $account_group_dao = new AccountGroupDao('account_group');
     $account_group = array();
     $account_group['id'] = $this->getRequest()->getParam('id');
     $account_group['name'] = $this->getRequest()->getParam('name');
     $config_list = $this->getRequest()->getParam('config');
     $config_dao = new ConfigDao();
     foreach ($config_list as $key => $value) {
         $config_dao->insert_update(array('value' => $value, 'name' => $key, 'account_group_id' => $account_group['id']));
     }
     $account_group_dao->update($account_group);
     $this->redirect('/account-group');
 }
 public function updateLabels($authenticated_label, $registered_label)
 {
     $this->config_dao->save(User_ForgeUGroup::CONFIG_AUTHENTICATED_LABEL, $authenticated_label);
     $this->config_dao->save(User_ForgeUGroup::CONFIG_REGISTERED_LABEL, $registered_label);
 }
Exemplo n.º 5
0
<?php

require $_SERVER['DOCUMENT_ROOT'] . '/_/inc/init.php';
if (isset($_POST['key']) && isset($_POST['value']) && isset($_POST['gv']) && $_COOKIE['cv'] == $_POST['gv']) {
    $cdao = new ConfigDao();
    $cdao->save(new ConfigObj($_POST['key'], $_POST['value']));
    echo "Config saved";
}
$fdao = new FilesDao();
$searchname = isset($_GET['s']) ? $_GET['s'] : "";
$searchfid = isset($_GET['fid']) ? $_GET['fid'] : "";
$start = is_numeric($_GET['start']) ? $_GET['start'] : 0;
$end = is_numeric($_GET['end']) ? $_GET['end'] : 50;
$filenb = $fdao->countFiles();
if ($searchfid != "") {
    $filesList = array($fdao->getByFid($searchfid));
} else {
    if ($searchname != "") {
        $filesList = $fdao->searchByName($searchname);
    } else {
        $filesList = $fdao->getLastFiles($start, $end);
    }
}
$filesTotalSize = $fdao->filesTotalSize() / 1000000;
$fullurl = get_full_url() . '/';
$sdao = new SessionsDao();
$sessionscount = $sdao->countSessions();
$usercount = $sdao->countUsers();
$sessionstoday = $sdao->getSessionToday();
$action = isset($_GET['dis']) ? $_GET['dis'] : 1;
?>
Exemplo n.º 6
0
<?php

date_default_timezone_set('UTC');
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT']);
require "_/inc/functions.php";
require "_/inc/db/dbinit.php";
require "_/inc/vendor/logboost/logboost-api-php/LogboostAPI.php";
//Config dbpath for unit test
SqliteDb::$dbpath = isset($test_dbpath) ? $test_dbpath : "";
//Constants
define("FROM_EMAIL", "localhost <webform@localhost>");
$cdao = new ConfigDao();
//ANTI CSRF
if (!isset($_COOKIE['cv'])) {
    setcookie("cv", generateRandomString(30), time() + 3600);
}
//OpenID client configuration
$Logboost_clientID = $cdao->getValueByKey("openid_clientid");
$Logboost_clientSecret = $cdao->getValueByKey("openid_clientsecret");
//Hoster configuration
$Hoster_name = $cdao->getValueByKey("hoster_name");
$Hoster_maxfilesize = $cdao->getValueByKey("maxfilesize");
//Setup Variable for tracking VirtualPageViews in analytics.
$VirtualPageView = "";
//Variables to store Site/URL information
$ServerName = $_SERVER['SERVER_NAME'];
$SiteSection = "";
$SubSection = "";
$RequestMethod = $_SERVER['REQUEST_METHOD'];
$FormErrors = array();
setSectionInfo();