Example #1
0
              WHERE
                  `d1`.`unternehmenid` = ?
              ORDER BY
                  `unternehmenid` ASC,
                  `name` ASC', 1);
DB::setParam($_SESSION['unternehmenid'], 'int');
DB::exec();
DB::moveCurrentResultToBuffer('sms');
if ($this->_getExists('editmode')) {
    DB::query('SELECT
                     `baseurl`,
                     `apibase`,
                     `authurl`,
                     `requesturl`,
                     `accessurl`,
                     `searchurl`
                 FROM
                     `streamurls`
                 WHERE
                     `streamurlid` = 1', 0);
    DB::exec();
    DB::nextResult();
    $twitter = array('baseurl' => DB::result('baseurl'), 'apibase' => DB::result('apibase'), 'authurl' => DB::result('authurl'), 'requesturl' => DB::result('requesturl'), 'accessurl' => DB::result('accessurl'), 'searchurl' => DB::result('searchurl'));
    $this->addJavascript('connections');
    $this->addJavascript('layer');
    $this->addJavascriptBlank('var gConnections = new ConnectionManagement(\'newconnection\');');
    $this->addJavascriptBlank('gSample = ' . json_encode($twitter) . ';');
    $this->addJavascriptBlank('gConnections.setSample(gSample);');
    $this->addJavascriptBlank('gConnections.init();');
    $this->addJavascriptBlank('editOver();');
}
Example #2
0
    public function output()
    {
        // init global Vars
        $this->_initGlobalVars();
        # HTTP-Document-Status ausgeben
        if ($this->_getDocumentStatus() != 200) {
            $this->_httpStatusHandling();
            exit;
        }
        # Weiche stellen, wenn Login benötigt ist, aber Nutzer nicht eingeloggt ist
        if ($this->_getAuthorizationLevel() != -1) {
            if (isset($_SESSION['UISauthLevel']) && $this->_getAuthorizationLevel() < $_SESSION['UISauthLevel']) {
                $login = new Site(true);
                $login->setContent('denied');
                $login->output();
                exit;
            } else {
                if (!isset($_SESSION['UISauthLevel'])) {
                    $login = new Site(true);
                    $login->setTitle('MOSD - Middleware For Open Source Devices');
                    $login->setWithoutMenu();
                    if ($this->_postExists()) {
                        $login->_setPostVars($this->getPostVars(), false);
                    }
                    #$login->setContentParam('authLevel', $this->authorizationLevel);
                    $login->setFunction('login');
                    $login->setContent('login');
                    $login->addJavascriptBlank('$(\'focusele\').focus();');
                    $login->output();
                    exit;
                }
            }
        }
        $this->_importFiles();
        if (!empty($_SESSION['unternehmenid'])) {
            # Fehler-Logging abfragen
            DB::query('SELECT
                        COUNT(*) AS `gesamt`
                    FROM
                        `fehler_log`
                    WHERE
                        `unternehmenid` = ?', 1);
            DB::setParam($_SESSION['unternehmenid'], 'int');
            DB::exec();
            DB::nextResult();
            $fehlerAnzahl = DB::result('gesamt');
        }
        # Standardseitenfunktion importieren (sofern gesetzt)
        if (!empty($this->pageFunction)) {
            require INCLUDE_PATH . '/functions/' . $this->pageFunction . '.php';
        }
        # Seite bauen
        $this->_printHeader();
        if (!$this->withoutMenu) {
            ?>
      <div id="header">
         <img src="<?php 
            print IMAGE_PATH;
            ?>
uis.jpg" alt="Ubimic Information Systems"/>
         <span>company: <em>TU Chemnitz - Ireko Projekt</em></span>
         <a href="<?php 
            print HTTPS_HOST;
            ?>
/logout">Logout</a>
      </div>
      <div id="main">
         <div id="menu">
            <span><a href="<?php 
            print HTTP_HOST;
            ?>
/start<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">Main page</a></span>
            <span>Device settings</span>
            <ul>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/start/editmode">create a new device</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/conditions<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">notification conditions</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/accounts<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">notification accounts</a>
               </li>
            </ul>
            <span>Logging</span>
            <ul>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/dashboard<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">dashboard</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/values">logged device data</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/log/messages">published messages</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/log/events<?php 
            print $this->_getExists('editmode') ? '/0/editmode' : '';
            ?>
">executed events</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/log/errors<?php 
            print $this->_getExists('editmode') ? '/0/editmode' : '';
            ?>
" class="<?php 
            print $fehlerAnzahl > 0 ? 'fehler' : 'ok';
            ?>
">recognized errors<?php 
            print $fehlerAnzahl > 0 ? ' (' . $fehlerAnzahl . ')' : '';
            ?>
</a>
               </li>
            </ul>
            <span>Client data</span>
            <ul>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/connections<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">publish connection types</a>
               </li>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/settings<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">client settings</a>
               </li>
            </ul>
            <span>Administration</span>
            <ul>
               <li>
                  <a href="<?php 
            print HTTP_HOST;
            ?>
/clients<?php 
            print $this->_getExists('editmode') ? '/editmode' : '';
            ?>
">clients</a>
               </li>
            </ul>
            <div id="loginlogosmall">
               <img src="<?php 
            print IMAGE_PATH;
            ?>
esf.jpg" alt="sponsored by ESF" width="190" height="46"/><br />
               The first version is being developed within the scope of the project <a href="http://ireko.tu-chemnitz.de/index.html.en" target="_blank" title="IREKO">IREKO</a> which is
               funded by the European Social Fund and the Free State of Saxony.<br /><br />
               <span>
                  <a href="http://creativecommons.org/licenses/by-sa/3.0/" target="_blank" style="border: none;">
                     <img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png"/>
                  </a>
               </span>
               This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/" target="_blank">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
            </div>
         </div>
         <div id="content">
<?php 
        }
        $this->_messageHandling();
        require INCLUDE_PATH . '/content/' . $this->pageContent . '.php';
        if (!$this->withoutMenu) {
            ?>
         </div>
      </div>
<?php 
        }
        $this->_printFooter();
    }
Example #3
0
if (count($keywords) > 0) {
    foreach ($keywords as $k => $v) {
        $keywordsEs[$k] = '"' . addslashes($v) . '"';
    }
    DB::query('SELECT
                     `keywordid`,
                     `keyword`
                 FROM
                     `keywords`
                 WHERE
                     `keyword` IN (' . implode(',', $keywordsEs) . ')', 0);
    DB::exec();
    $keyTmp = array();
    $keywordAnz = 0;
    $qstr = ' AND (';
    while (DB::nextResult()) {
        $qstr .= ($keywordAnz > 0 ? ' OR ' : ' ') . '`d2`.`keywordid` = ' . DB::result('keywordid');
        $keyTmp[] = DB::result('keyword');
        $keywordAnz++;
    }
    $qstr .= ')';
    $keywords =& $keyTmp;
    sort($keywords);
    if ($keywordAnz > 0) {
        $qstr2 = ' HAVING COUNT(*) = ' . $keywordAnz;
    } else {
        $qstr = '';
    }
}
DB::query('SELECT
                  `d1`.`messageid`,
Example #4
0
 public static function checkAccountName($name, $allowontype = '', $allowonid = '')
 {
     DB::query('SELECT
                  `emailid`
              FROM
                  `email`
              WHERE
                  `name` = ?
              AND
                  `unternehmenid` = ?', 2);
     DB::setParam($name, 'str');
     DB::setParam($_SESSION['unternehmenid'], 'int');
     DB::exec();
     if (DB::numRows() == 1) {
         DB::nextResult();
         if ($allowontype == 1 && $allowonid == DB::result('emailid')) {
             return true;
         } else {
             return false;
         }
     }
     DB::query('SELECT
                 `streamid`
              FROM
                 `streaming`
              WHERE
                 `name` = ?
              AND
                 `unternehmenid` = ?', 2);
     DB::setParam($name, 'str');
     DB::setParam($_SESSION['unternehmenid'], 'int');
     DB::exec();
     if (DB::numRows() == 1) {
         DB::nextResult();
         if ($allowontype == 0 && $allowonid == DB::result('streamid')) {
             return true;
         } else {
             return false;
         }
     }
     DB::query('SELECT
                  `d1`.`nummerid`
              FROM
                  `sms` `d1`
              INNER JOIN
                  `sms_gateways` `d2`
              ON
                  `d1`.`gatewayid` = `d2`.`gatewayid`
              WHERE
                  `d1`.`name` = ?
              AND
                  `d2`.`unternehmenid` = ?', 2);
     DB::setParam($name, 'str');
     DB::setParam($_SESSION['unternehmenid'], 'int');
     DB::exec();
     if (DB::numRows() == 1) {
         DB::nextResult();
         if ($allowontype == 2 && $allowonid == DB::result('nummerid')) {
             return true;
         } else {
             return false;
         }
     }
     return true;
 }