コード例 #1
0
<!DOCTYPE html>
<?php 
session_start();
require_once "configuration/db.php";
require_once ROOT . '/function/funcs.php';
if (checkInstallation()) {
    echo "\n    <head>\n    <title>OpenTroubleTicketing: " . getBoardName() . "</title>\n    <meta charset='utf-8'>\n    <meta name='viewport' content='width=device-width, initial-scale=1'>\n    <link rel='icon' href='icon/icon.png'/>\n    <link rel='stylesheet' href='style/bootstrap.min.css'>\n    <link rel='stylesheet' href='login/loginStyle.css'>\n    <link rel='stylesheet' href='style/defaultStyle.css'>\n    <script src='js/jquery.min.js'></script>\n    <script src='js/bootstrap.min.js'></script>\n    <script src='login/loginScript.js'></script>\n    <script src='js/defaultScript.js'></script>\n    </head>\n    <body>\n    <div class='container-fluid title text-center'>\n    <h1>Welcome to " . getBoardName() . "</h1>\n    <h2>managed by " . getOrgName() . "</h2>\n    </div>\n    <div class='container-fluid defaultWidth text-center loginForm'>\n    <h3>Login Form</h3>\n    <form role='form' method='post'>\n    <div class='form-group'>\n    <label for='userName'>Enter your username:</label>\n    <input type='text' placeholder='who are you?' id='username'>\n    </div>\n    <div class='form-group'>\n    <label for='password'>Enter your password:</label>\n    <input type='password' placeholder='your secret password?' id='password'>\n    </div>\n    <input type='submit' class='btn btn-warning btn-sm' value='send' id='send'>\n    </form>\n    </div>\n    </body>\n    </html>";
}
?>

コード例 #2
0
<script src='board/boardScript.js'></script>
<script src='js/defaultScript.js'></script>
</head>
<body>

<nav class="navbar navbar-default" role="navigation">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#"><?php 
echo getBoardName();
?>
</a>
  </div>
  <?php 
if (!checkFirstSetup()) {
    echo "\n  <!-- Collect the nav links, forms, and other content for toggling -->\n  <div class='collapse navbar-collapse navbar-ex1-collapse'>\n    <ul class='nav navbar-nav'>\n      <li class='dropdown'>\n        <a href='#' class='dropdown-toggle' data-toggle='dropdown'>New..<b class='caret'></b></a>\n        <ul class='dropdown-menu'>\n            <li><a href='#' id='tktNew'>Ticket</a></li>\n            ";
    if ($user->getPosition() == 'admin' || $user->getPosition() == 'superuser') {
        echo "\n            <li><a href='#' id='customerNew'>Customer</a></li>\n            <li><a href='#' id='assetNew'>Asset</a></li>";
    }
    echo "      \n        </ul>\n      </li>\n      <li class='dropdown'>\n        <a href='#' class='dropdown-toggle' data-toggle='dropdown'>List Custom<b class='caret'></b></a>\n        <ul class='dropdown-menu'>\n          <li><a href='#'>list</a></li>\n          <li><a href='#'>something</a></li>\n          <li><a href='#'>custom</a></li>\n          <li><a href='#'>TO DO</a></li>\n        </ul>\n      </li>\n    </ul>\n    <form class='navbar-form navbar-left' role='search'>\n      <div class='form-group'>\n        <input type='text' class='form-control' data-toggle='tooltip' data-placement='bottom' title='You can use any parameter to search a ticket' id='ticketField' placeholder='Search Ticket'>\n      </div>\n      <button type='submit' id='searchTicket' class='btn btn-default'>Go</button>\n    </form>\n    <form class='navbar-form navbar-left' role='search'>\n      <div class='form-group'>\n        <input type='text' class='form-control' data-toggle='tooltip' data-placement='bottom' title='You can use any parameter to search a customer' id='customerField' placeholder='Search Customer'>\n      </div>\n      <button type='submit' id='searchCustomer' class='btn btn-default'>Go</button>\n    </form>\n     <form class='navbar-form navbar-left' role='search'>\n      <div class='form-group'>\n        <input type='text' class='form-control'data-toggle='tooltip' data-placement='bottom' title='You can use any parameter to search an asset' id='assetField' placeholder='Search Asset'>\n      </div>\n      <button type='submit' id='searchAsset' class='btn btn-default'>Go</button>\n    </form>\n    ";
} else {
    doAlert('An admin must complete the first setup procedure.\\nUse the control panel on the right!');
}
?>
    <ul class='nav navbar-nav navbar-right'>
コード例 #3
0
//setup step: adding first group
if (isset($_POST['addingFirstGroupName'])) {
    include_once 'db.php';
    include_once '../function/funcs.php';
    if (checkFirstSetup()) {
        $connection = new mysqli(HOST, USER, PSW, DB);
        if ($connection->error) {
            echoResponse('no', $connection->error);
        }
        $addingField = 'ALTER TABLE board ADD firstSetup SMALLINT UNSIGNED';
        $added = $connection->query($addingField);
        if (!$added) {
            echoResponse('no', $added->error);
        } else {
            //echoResponse('yes','Field Added!');
            $settingFirstSetup = "UPDATE board SET firstSetup='1' WHERE boardName='" . getBoardName() . "'";
            $settedFirstSetup = $connection->query($settingFirstSetup);
            if (!$settedFirstSetup) {
                echoResponse('no', $settedFirstSetup->error);
            } else {
                //echoResponse('yes','First Setup Done!');
                $remoteGroupName = sanitizeInput($_POST['remoteGroupName']);
                if (addGroupName($remoteGroupName)) {
                    $addingField = 'ALTER TABLE users ADD groupName varchar(20)';
                    $added = $connection->query($addingField);
                    //groupName added to users table
                    $data = getAdminData('admin');
                    $queryModifyAdmin = "UPDATE users SET groupName='{$remoteGroupName}' WHERE username='" . $data[0] . "'";
                    //binding first admin to remote group
                    $executeModifyAdmin = $connection->query($queryModifyAdmin);
                    $seedingFirstGroup = "INSERT INTO " . $remoteGroupName . " (`username`, `name`, `surname`) VALUES ('" . $data[0] . "','" . $data[1] . "','" . $data[2] . "')";
コード例 #4
0
function create_sefurl($url)
{
    global $boardurl, $modSettings, $PortaMxSEF;
    if (!empty($modSettings['pmxportal_disabled']) || !empty($modSettings['pmxsef_disabled'])) {
        return $url;
    }
    // Init..
    $sefstring = $sefstring1 = $sefstring2 = '';
    $query_parts = array();
    // Get the query string
    $params = array();
    $url_parts = parse_url($url);
    // security .. check illegal url's
    parse_str(!empty($url_parts['query']) ? preg_replace('~&(\\w+)(?=&|$)~', '&$1=', strtr($url_parts['query'], array('&amp;' => '&', ';' => '&'))) : '', $params);
    if (!empty($params)) {
        // check ingnore actions
        if (!empty($params['action']) && in_array($params['action'], $PortaMxSEF['ignoreactions'])) {
            return $url;
        }
        // check ingnore requests
        $tmp = array_intersect(array_keys($params), array_keys($PortaMxSEF['ignorerequests']));
        if (count($tmp) == 1 && ($tmp = current($tmp)) && $params[$tmp] == $PortaMxSEF['ignorerequests'][$tmp]) {
            return $url;
        }
        // boards or topics
        if (isset($params['board'])) {
            $sefstring .= getBoardName($params['board']);
            unset($params['board']);
        } elseif (isset($params['topic'])) {
            $sefstring .= getTopicName($params['topic']);
            unset($params['topic']);
        }
        // actions
        if (isset($params['action'])) {
            if (in_array($params['action'], array_values($PortaMxSEF['aliasactions']))) {
                $acts = array_flip($PortaMxSEF['aliasactions']);
                $params['action'] = $acts[$params['action']];
            } elseif (!in_array($params['action'], array_merge($PortaMxSEF['actions'], array('theme', 'language')))) {
                preg_match('/[a-zA-Z0-9\\_\\-]+/', $params['action'], $action);
                if (!empty($action[0])) {
                    $PortaMxSEF['actions'][] = $action[0];
                }
            }
            $sefstring .= $params['action'] . '/';
            unset($params['action']);
            // user
            if (isset($params['u'])) {
                $sefstring .= $params['u'] == 'all' ? $params['u'] . '.0/' : getUserName($params['u']);
                unset($params['u']);
            }
        } elseif (isset($params['cat'])) {
            // root cat
            if (isset($params['cat'])) {
                $sefstring .= getCategoryName($params['cat']);
                unset($params['cat']);
            }
            //child cat?
            if (isset($params['child'])) {
                $sefstring .= getCategoryName($params['child'], true);
                unset($params['child']);
            }
            // have article?
            if (isset($params['art'])) {
                $sefstring .= getArticleName($params['art']);
                unset($params['art']);
            }
        } elseif (isset($params['art'])) {
            $sefstring .= getArticleName($params['art']);
            unset($params['art']);
        } elseif (isset($params['spage'])) {
            $sefstring .= getPageName($params['spage']);
            unset($params['spage']);
        }
        // single request token
        foreach ($PortaMxSEF['singletoken'] as $key) {
            if (array_key_exists($key, $params) && $params[$key] == '') {
                $sefstring2 .= $key . '/';
                unset($params[$key]);
            }
        }
        // do the rest
        foreach ($params as $key => $value) {
            if ($key == 'start') {
                $sefstring2 .= $value != '' ? $key . '/' . $value . '/' : '';
            } elseif (is_array($value)) {
                $sefstring1 .= $key . '[' . key($value) . ']/' . $value[key($value)] . '/';
            } else {
                $sefstring1 .= $key . '/' . $value . '/';
            }
        }
        // Build the URL
        if (isset($query_parts['action'])) {
            $sefstring .= $query_parts['action'] . '/';
        }
        $sefstring .= $sefstring1 . $sefstring2;
    }
    return $boardurl . '/' . $sefstring . (!empty($url_parts['fragment']) ? '#' . $url_parts['fragment'] : '');
}