Esempio n. 1
0
 public function GetBars($id)
 {
     $dbAccessor = new DbAccessor();
     $username = "******";
     $password = "******";
     $dbname = "scoutdecvopuma";
     $host = "scoutdecvopuma.postgresql.db";
     $dbAccessor->CreateDbConnection($username, $password, $dbname, $host);
 }
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if (isset($config->logMinutes)) {
         $this->logMinutes = $config->logMinutes;
     }
 }
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if (isset($config->sessionClearTimeout)) {
         $this->sessionClearTimeout = $config->sessionClearTimeout;
     }
 }
 public function __construct(Language $language = null, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if ($language === null) {
         $shortName = false;
         if (isset($_GET['language']) && $this->languageExists($_GET['language'])) {
             $shortName = $_GET['language'];
         } elseif (isset($_SESSION['language']) && $this->languageExists($_SESSION['language'])) {
             $shortName = $_SESSION['language'];
         } elseif (isset($_COOKIE['language']) && $this->languageExists($_COOKIE['language'])) {
             $shortName = $_COOKIE['language'];
         }
         if ($shortName !== false) {
             $language = Language::getLanguage($shortName);
         } else {
             $language = $this->getDefaultLanguage();
         }
     }
     if ($language instanceof Language) {
         $this->language = $language;
         $this->setLanguage($language);
     } else {
         throw new InvalidArgumentException("Argument should be instanse of Language");
     }
 }
Esempio n. 5
0
 public function __construct($dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->remoteIp = $_SERVER["REMOTE_ADDR"];
     if (empty($this->remoteIp) and !Cgi::getMode()) {
         throw new RuntimeException("Could not determine client ip address.");
     }
 }
Esempio n. 6
0
 public function __construct(Host $host, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     if (empty($host->host)) {
         throw new InvalidArgumentException("\$host have to be non empty Host object");
     }
     $this->host = $host;
 }
Esempio n. 7
0
 public function __construct($lang_id = null, $cacheMinutes = null)
 {
     parent::__construct();
     if ($lang_id !== null) {
         if (!is_numeric($lang_id)) {
             throw new InvalidIntegerArgumentException("lang_id argument should be an integer.");
         }
         $this->query->exec("SELECT * FROM `" . Tbl::get('TBL_LANGUAGES') . "` WHERE `id` = '{$lang_id}'", $cacheMinutes);
         if ($this->query->countRecords()) {
             $data = $this->query->fetchRecord();
             static::setData($data, $this);
         } else {
             throw new RuntimeException("Wrong languge id is given. No record with id: {$lang_id} in table " . Tbl::get('TBL_LANGUAGES'));
         }
     }
 }
Esempio n. 8
0
 public function __construct($lang_id = null, $cacheMinutes = null)
 {
     parent::__construct();
     if ($lang_id !== null) {
         if (!is_numeric($lang_id)) {
             throw new InvalidIntegerArgumentException("lang_id argument should be an integer.");
         }
         $qb = new QueryBuilder();
         $qb->select(new Field('*'))->from(Tbl::get('TBL_LANGUAGES'))->where($qb->expr()->equal(new Field('id'), $lang_id));
         $this->query->exec($qb->getSQL(), $cacheMinutes);
         if ($this->query->countRecords()) {
             $data = $this->query->fetchRecord();
             static::setData($data, $this);
         } else {
             throw new RuntimeException("Wrong languge id is given. No record with id: {$lang_id} in table " . Tbl::get('TBL_LANGUAGES'));
         }
     }
 }
Esempio n. 9
0
 public function __construct($dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
 }
Esempio n. 10
0
 /**
  * 
  * @param string $newName
  * The string that you want the name of the page to be changed to
  * @param int $pageID
  * The id of the page you would like to change the name of
  */
 static function changeName($newName, $pageID)
 {
     $dba = new DbAccessor('db/dbSettings.ini');
     $dba->update("pages", array("page" => $newName), "pageID", $pageID);
     $dba = NULL;
 }
Esempio n. 11
0
<nav class="top-bar" data-topbar role="navigation">
  <ul class="title-area">
    <li class='name'><h1><a href='index.php?page=1'>CMS v0.1</a></h1></li>
  </ul>
  <section class="top-bar-section">
      <ul class="right">
<?php 
$dba = new DbAccessor('db/dbSettings.ini');
$pageResult = $dba->selectAll("pages");
while ($row = $pageResult->fetch()) {
    $page = $row['page'];
    $pageID = $row['pageID'];
    ?>
          <li><a href="index.php?page=<?php 
    echo $pageID;
    ?>
"><?php 
    echo $page;
    ?>
</a></li>
    <?php 
}
$dba = NULL;
?>
      </ul>
  </section>
</nav>
 public function __construct($tableName, $dbConnection = null)
 {
     parent::__construct($dbConnection);
     $this->tableName = $tableName;
 }
 public function __construct(UserManagement $um, Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->um = $um;
     $this->config = $config;
 }
 /**
  * Class contructor
  * @param var $usr
  * @param var $sessionVar
  */
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->authYubikey = new Yubikey($config->yubico_id, $config->yubico_key);
 }
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->config = $config;
 }
Esempio n. 16
0
 public function __construct(Host $host, Language $language, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->host = $host;
     $this->language = $language;
 }
Esempio n. 17
0
 public function __construct(Config $config, $dbInstanceKey = null)
 {
     parent::__construct($dbInstanceKey);
     $this->config = $config;
     $this->um = Reg::get(ConfigManager::getConfig("Users", "Users")->Objects->UserManager);
 }