Exemple #1
0
return call_user_func(function () {
    $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
    $publicDir = __DIR__ . '/';
    $uri = urldecode($uri);
    $uri = str_replace('/static', '', $uri);
    $requested = $publicDir . '/' . $uri;
    if (isset($_GET['p'])) {
        $uri = $_GET['p'];
    } else {
        $uri = '/';
    }
    if ($uri === '/') {
        echo json_encode(array('result' => array()));
    } else {
        if (strpos($uri, '/services') !== false) {
            echo get_services($_GET);
        } else {
            if (strpos($uri, '/change_service') !== false) {
                echo edit_service($_POST);
            } else {
                if (strpos($uri, '/tasks') !== false) {
                    echo get_tasks($_GET);
                } else {
                    if (strpos($uri, '/change_tasks') !== false) {
                        echo edit_task($_POST);
                    } else {
                        if (strpos($uri, '/discussions') !== false) {
                            echo get_discussions($_GET);
                        } else {
                            if (strpos($uri, '/projects') !== false) {
                                echo get_projects($_GET);
            <div class="col-md-8 col-sm-6 dmbs-main">

                <?php 
// theloop
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
                    <h2 class="title-services"><?php 
        the_title();
        ?>
</h2>
                    <div class="services-landing-page">
                        <?php 
        print get_services();
        ?>
                    </div>
                <?php 
    }
    ?>
                <?php 
} else {
    ?>

                    <?php 
    get_404_template();
    ?>

                <?php 
}
        case 'relayd':
            relayd_configure(true);
            break;
        case 'squid':
            configd_run("proxy restart");
            break;
        case 'suricata':
            configd_run("ids restart");
            break;
        default:
            log_error(sprintf(gettext("Could not restart unknown service `%s'"), $name));
            break;
    }
    return sprintf(gettext("%s has been restarted."), htmlspecialchars($name));
}
$services = get_services();
if (count($services) > 0) {
    uasort($services, "service_name_compare");
}
include "head.inc";
?>

<body>
<?php 
include "fbegin.inc";
?>
  <section class="page-content-main">
    <div class="container-fluid">
      <div class="row">
        <?php 
if (isset($savemsg)) {
##|*DESCR=Allow access to the 'Add Service Watchdog Services' page.
##|*MATCH=services_servicewatchdog.php-add*
##|-PRIV
require "guiconfig.inc";
require_once "service-utils.inc";
require_once "servicewatchdog.inc";
if (!is_array($config['installedpackages']['servicewatchdog']['item'])) {
    $config['installedpackages']['servicewatchdog']['item'] = array();
}
$a_pwservices =& $config['installedpackages']['servicewatchdog']['item'];
// Pre-load "cron" into this array to blacklist it from being offered as a choice.
$a_pwservice_names = array("cron");
foreach ($a_pwservices as $svc) {
    $a_pwservice_names[] = $svc['name'];
}
$system_services = get_services();
unset($input_errors);
if ($_POST) {
    if (!is_numeric($_POST['svcid'])) {
        return;
    }
    if (!isset($system_services[$_POST['svcid']])) {
        $input_errors[] = gettext("The supplied service appears to be invalid.");
    }
    if (!$input_errors) {
        $a_pwservices[] = $system_services[$_POST['svcid']];
        servicewatchdog_cron_job();
        write_config();
        header("Location: services_servicewatchdog.php");
        return;
    }
Exemple #5
0
function get_service_by_id($service_id)
{
    $services = get_services();
    foreach ($services as $service) {
        if ($service[SR_TABLE_FIELDNAME::SERVICE_ID] == $service_id) {
            return $service;
        }
    }
    return null;
}
    require 'scraperwiki.php';
}
require 'scraperwiki/simple_html_dom.php';
$url = "http://wiki.open311.org/GeoReport_v2/Servers";
$link_list = get_link_list($url);
//$alldata = $link_list;
$alldata = array();
$count = 1;
foreach ($link_list as $link) {
    //if(!strpos($link['services'], '.gov')) {
    //    continue;
    //}
    if ($run_environment == 'prod') {
        get_services($link);
    } else {
        $alldata[] = get_services($link);
    }
    $count++;
    if ($run_environment == 'dev' && $count > $max_records) {
        break;
    }
}
// if testing
if ($run_environment == 'dev') {
    header('Content-type: application/json');
    print json_encode($alldata);
}
function get_link_list($url)
{
    global $run_environment;
    global $max_records;
Exemple #7
0
function lookup_attribute($am_url, $attr_name)
{
    $services = get_services();
    $am_service = null;
    foreach ($services as $service) {
        if (array_key_exists(SR_ARGUMENT::SERVICE_URL, $service) && $service[SR_ARGUMENT::SERVICE_URL] == $am_url) {
            $am_service = $service;
            break;
        }
    }
    if ($am_service) {
        return lookup_service_attribute($am_service, $attr_name);
    } else {
        return null;
    }
}
Exemple #8
0
function draw_shipper_config()
{
    global $_TABLES, $_CONF, $LANG_ECOM;
    $id = COM_applyFilter($_GET['id']);
    //General information about shipper
    $res = DB_query("SELECT * FROM {$_TABLES['ecom_shipper']} WHERE id = {$id}");
    $row = DB_fetchArray($res);
    $T = new Template($_CONF['path'] . 'plugins/ecommerce/templates/admin');
    $T->set_file(array('shipper_config' => 'shipper_config.thtml', 'shipper_config_row' => 'shipper_config_row.thtml'));
    $T->set_var('site_url', $PHP_SELF);
    $T->set_var('shipper_name', $row['name']);
    $T->set_var('user_name', $row['user_name']);
    $T->set_var('password', $row['password']);
    $T->set_var('msg_8', $LANG_ECOM[8]);
    $T->set_var('msg_9', $LANG_ECOM[9]);
    $T->set_var('msg_107', $LANG_ECOM[107]);
    //Shipper for national only
    $service_res = DB_query("SELECT * FROM {$_TABLES['ecom_shipper_service']} WHERE ecom_shipper_id = {$id} AND ecom_shipper_service_international = false");
    $services_national = get_services($service_res, $T, 'national');
    $T->set_var('msg_108', $LANG_ECOM[108]);
    // Services for international only
    $service_res = DB_query("SELECT * FROM {$_TABLES['ecom_shipper_service']} WHERE ecom_shipper_id = {$id} AND ecom_shipper_service_international = true");
    $services_international = get_services($service_res, $T, 'international');
    $T->set_var('msg_109', $LANG_ECOM[109]);
    $T->parse('output', 'shipper_config');
    echo $T->finish($T->get_var('output'));
}