예제 #1
0
/**
 * Display authentication log.
 *
 * @param array $vars
 * @return none
 *
 */
function print_authlog($vars)
{
    $authlog = get_authlog_array($vars);
    if (!$authlog['count']) {
        // There have been no entries returned. Print the warning. Shouldn't happen, how did you get here without auth?!
        print_warning('<h4>No authentication entries found!</h4>');
    } else {
        $string = generate_box_open($vars['header']);
        // Entries have been returned. Print the table.
        $string .= '<table class="' . OBS_CLASS_TABLE_STRIPED_MORE . '">' . PHP_EOL;
        $cols = array('date' => array('Date', 'style="width: 150px;"'), 'user' => 'User', 'from' => 'From', 'ua' => array('User-Agent', 'style="width: 200px;"'), 'NONE' => 'Action');
        if ($vars['page'] == 'preferences') {
            unset($cols['user']);
        }
        $string .= get_table_header($cols);
        //, $vars); // Currently sorting is not available
        $string .= '<tbody>' . PHP_EOL;
        foreach ($authlog['entries'] as $entry) {
            if (strlen($entry['user_agent']) > 1) {
                $entry['detect_browser'] = detect_browser($entry['user_agent']);
                //r($entry['detect_browser']);
                $entry['user_agent'] = '<i class="' . $entry['detect_browser']['icon'] . '"></i>&nbsp;' . $entry['detect_browser']['browser_full'];
                if ($entry['detect_browser']['platform']) {
                    $entry['user_agent'] .= ' (' . $entry['detect_browser']['platform'] . ')';
                }
            }
            if (strstr(strtolower($entry['result']), 'fail', true)) {
                $class = " class=\"error\"";
            } else {
                $class = "";
            }
            $string .= '
      <tr' . $class . '>
        <td>' . $entry['datetime'] . '</td>';
            if (isset($cols['user'])) {
                $string .= '
        <td>' . escape_html($entry['user']) . '</td>';
            }
            $string .= '
        <td>' . ($_SESSION['userlevel'] > 5 ? generate_popup_link('ip', $entry['address']) : preg_replace('/^\\d+/', '*', $entry['address'])) . '</td>
        <td>' . $entry['user_agent'] . '</td>
        <td>' . $entry['result'] . '</td>
      </tr>' . PHP_EOL;
        }
        $string .= '  </tbody>' . PHP_EOL;
        $string .= '</table>';
        $string .= generate_box_close();
        // Add pagination header
        if ($authlog['pagination_html']) {
            $string = $authlog['pagination_html'] . $string . $authlog['pagination_html'];
        }
        // Print authlog
        echo $string;
    }
}
/**
 * Display authentication log.
 *
 * @param array $vars
 * @return none
 *
 */
function print_authlog($vars)
{
    $authlog = get_authlog_array($vars);
    if (!$authlog['count']) {
        // There have been no entries returned. Print the warning. Shouldn't happen, how did you get here without auth?!
        print_warning('<h4>没有发现任何认证项目!</h4>');
    } else {
        // Entries have been returned. Print the table.
        $string = '<table class="table table-bordered table-striped table-hover table-condensed table-rounded">' . PHP_EOL;
        $cols = array('date' => array('Date', 'style="width: 200px;"'), 'user' => '用户', 'from' => 'From', 'ua' => array('User-Agent', 'style="width: 200px;"'), 'NONE' => 'Action');
        $string .= get_table_header($cols);
        //, $vars); // Currently sorting is not available
        $string .= '<tbody>' . PHP_EOL;
        foreach ($authlog['entries'] as $entry) {
            if (strlen($entry['user_agent']) > 1) {
                $entry['detect_browser'] = detect_browser($entry['user_agent'], TRUE);
                $entry['user_agent'] = $entry['detect_browser']['browser'];
                if ($entry['detect_browser']['platform']) {
                    $entry['user_agent'] .= ' (' . $entry['detect_browser']['platform'] . ')';
                }
            }
            if (strstr(strtolower($entry['result']), 'fail', true)) {
                $class = " class=\"error\"";
            } else {
                $class = "";
            }
            $string .= '
      <tr' . $class . '>
        <td>' . $entry['datetime'] . '</td>
        <td>' . escape_html($entry['user']) . '</td>
        <td>' . $entry['address'] . '</td>
        <td>' . $entry['user_agent'] . '</td>
        <td>' . $entry['result'] . '</td>
      </tr>' . PHP_EOL;
        }
        $string .= '  </tbody>' . PHP_EOL;
        $string .= '</table>';
        // Add pagination header
        if ($authlog['pagination_html']) {
            $string = $authlog['pagination_html'] . $string . $authlog['pagination_html'];
        }
        // Print authlog
        echo $string;
    }
}
예제 #3
0
$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('email');
require $GO_CONFIG->class_path . "imap.class.inc";
require $GO_MODULES->class_path . "email.class.inc";
require $GO_CONFIG->class_path . 'filetypes.class.inc';
$filetypes = new filetypes();
$mail = new imap();
$email = new email();
$account = $email->get_account($_REQUEST['account_id']);
if ($mail->open($account['host'], $account['type'], $account['port'], $account['username'], $GO_CRYPTO->decrypt($account['password']), $_REQUEST['mailbox'], 0, $account['use_ssl'], $account['novalidate_cert'])) {
    $file = $mail->view_part($_REQUEST['uid'], $_REQUEST['part'], $_REQUEST['transfer'], $_REQUEST['mime']);
    $mail->close();
    $filename = smartstrip($_REQUEST['filename']);
    $extension = get_extension($filename);
    $type = $filetypes->get_type($extension);
    $browser = detect_browser();
    //header('Content-Length: '.strlen($file));
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    if ($browser['name'] == 'MSIE') {
        header('Content-Type: application/download');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
    } else {
        header('Content-Type: ' . $type['mime']);
        header('Pragma: no-cache');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
    }
    header('Content-Transfer-Encoding: binary');
    echo $file;
} else {
예제 #4
0
<?php

// inc_logger HTML include for use in dynamic websites
//
// Version 0.3 16 October 2001 - Philip Lee
// Determine browser
include "{$site_root}/libs/lib_browser.php";
// Get connection to database
$link_id = db_connect();
// Get browser information
$browser = detect_browser($link_id);
// Create the SQL query string
$sql = "INSERT DELAYED INTO logging_log " . "(day,hour,session_id,site_id,user_id,browser,ver,platform,time,page,ip_address,remote_host,referrer,exit_page) " . "VALUES (" . date('Ymd', mktime()) . ",'" . date('H', mktime()) . "','" . $PHPSESSID . "','" . $site_id . "','" . $user_id . "','" . $browser[1] . "','" . $browser[2] . "','" . $browser[0] . "','" . time() . "','" . $PHP_SELF . "','" . $REMOTE_ADDR . "','" . $REMOTE_HOST . "','" . $HTTP_REFERER . "','" . $exit_page . "'" . ");";
// Insert into database
$res_logger = mysql_query($sql, $link_id);
if (!$res_logger) {
    echo "Logging insert failed";
}
/**
 * platform_launch_ip_authorization_checks: used for IP authorizations
 * @param void
 *
 * @return void
 */
function platform_launch_ip_authorization_checks()
{
    platform_launch_php('global');
    $ip = network_get_real_ip();
    $browser = detect_browser();
    switch ($ip) {
        // allowed ip addresses
        // from localhost
        case '127.0.0.1':
        case '127.0.1.1':
            // from starbright
            //case '10.10.50.121':
        // from starbright
        //case '10.10.50.121':
        case '10.10.50.192':
        case '10.10.50.193':
            // from ehonet
        // from ehonet
        case '192.168.43.1':
        case '192.168.43.2':
        case '192.168.43.42':
        case '192.168.43.65':
        case '192.168.43.174':
            // from ehonet-wifi
        // from ehonet-wifi
        case '10.10.2.200':
        case '10.10.2.210':
        case '10.10.2.220':
        case '10.10.2.222':
        case '10.10.2.225':
        case '10.10.2.230':
        case '10.10.2.240':
            //redirect_to('http://'.$_SERVER['HTTP_HOST'].'/platform/');
            break;
        default:
            redirect_to('http://www.entilda.com?api=' . base64_encode(base64_encode(base64_encode(time()))) . '&encdata=true&tracking=enabled&cryptocheck=' . base64_encode(base64_encode(base64_encode($ip))) . '&detected=' . $ip . '&client=' . $browser);
            break;
    }
}
예제 #6
0
function generate_graph_tag($args)
{
    if (empty($args)) {
        return '';
    }
    // Quick return if passed empty array
    $style = 'max-width: 100%; width: auto; vertical-align: top;';
    if (isset($args['style'])) {
        if (is_array($args['style'])) {
            $style .= implode("; ", $args['style']) . ';';
        } else {
            $style .= $args['style'] . ';';
        }
        unset($args['style']);
    }
    // Detect allowed screen ratio for current browser
    $ua_info = detect_browser();
    $zoom = $ua_info['screen_ratio'];
    if ($zoom >= 2) {
        // Add img srcset for HiDPI screens
        $args_x = $args;
        $args_x['zoom'] = $zoom;
        $srcset = ' srcset="' . generate_graph_url($args_x) . ' ' . $args_x['zoom'] . 'x"';
    } else {
        $srcset = '';
    }
    return '<img src="' . generate_graph_url($args) . '"' . $srcset . ' style="' . $style . '" alt="" />';
}
예제 #7
0
 function browser_info()
 {
     backtrace(detect_browser(), 'p', 'Browser');
 }
function overlib_link($url, $text, $contents, $class = NULL, $escape = FALSE)
{
    global $config, $link_iter;
    $link_iter++;
    if ($escape) {
        $text = escape_html($text);
    }
    // Allow the Grinch to disable popups and destroy Christmas.
    if ($config['web_mouseover'] && detect_browser() != 'mobile') {
        $output = '<a href="' . $url . '" class="tooltip-from-data ' . $class . '" data-tooltip="' . escape_html($contents) . '">' . $text . '</a>';
    } else {
        $output = '<a href="' . $url . '" class="' . $class . '">' . $text . '</a>';
    }
    return $output;
}
예제 #9
0
/**
 * Returns icon tag (by default) or icon name for current device array
 *
 * @param array $device Array with device info (from DB)
 * @param bool $base_icon Return complete img tag with icon (by default) or just base icon name
 *
 * @return string Img tag with icon or base icon name
 */
function get_device_icon($device, $base_icon = FALSE)
{
    global $config;
    $icon = 'generic';
    $device['os'] = strtolower($device['os']);
    $model = $config['os'][$device['os']]['model'];
    if ($device['icon'] && is_file($config['html_dir'] . '/images/os/' . $device['icon'] . '.png')) {
        // Custom device icon from DB
        $icon = $device['icon'];
    } else {
        if ($model && isset($config['model'][$model][$device['sysObjectID']]['icon']) && is_file($config['html_dir'] . '/images/os/' . $config['model'][$model][$device['sysObjectID']]['icon'] . '.png')) {
            // Per model icon
            $icon = $config['model'][$model][$device['sysObjectID']]['icon'];
        } else {
            if ($config['os'][$device['os']]['icon'] && is_file($config['html_dir'] . '/images/os/' . $config['os'][$device['os']]['icon'] . '.png')) {
                // Icon defined in os definition
                $icon = $config['os'][$device['os']]['icon'];
            } else {
                if ($device['distro']) {
                    // Icon by distro name
                    $distro = safename(strtolower(trim($device['distro'])));
                    if (is_file($config['html_dir'] . '/images/os/' . $distro . '.png')) {
                        $icon = $distro;
                    }
                }
                if ($icon == 'generic' && is_file($config['html_dir'] . '/images/os/' . $device['os'] . '.png')) {
                    // Icon by OS name
                    $icon = $device['os'];
                }
            }
        }
    }
    if ($icon == 'generic' && $config['os'][$device['os']]['vendor']) {
        // Icon by vendor name
        $vendor = safename(strtolower(trim($config['os'][$device['os']]['vendor'])));
        if (is_file($config['html_dir'] . '/images/os/' . $vendor . '.png')) {
            $icon = $vendor;
        }
    }
    if ($base_icon) {
        // return base name for os icon
        return $icon;
    } else {
        // return image html tag
        $srcset = '';
        if (is_file($config['html_dir'] . '/images/os/' . $icon . '_2x.png')) {
            // Detect allowed screen ratio for current browser
            $ua_info = detect_browser();
            if ($ua_info['screen_ratio'] > 1) {
                $srcset = ' srcset="' . $config['base_url'] . '/images/os/' . $icon . '_2x.png' . ' 2x"';
            }
        }
        // Image tag -- FIXME re-engineer this code to do this properly. This is messy.
        $image = '<img src="' . $config['base_url'] . '/images/os/' . $icon . '.png"' . $srcset . ' alt="" />';
        return $image;
    }
}
예제 #10
0
/**
 * Generate Bootstrap-format navigation bar
 *
 *   A little messy, but it works and lets us move to having no navbar markup on pages :)
 *   Examples:
 *   print_navbar(array('brand' => "Apps", 'class' => "navbar-narrow", 'options' => array('mysql' => array('text' => "MySQL", 'url' => generate_url($vars, 'app' => "mysql")))))
 *
 * @param array $vars
 * @return none
 *
 */
function print_navbar($navbar)
{
    global $config;
    if (OBSERVIUM_EDITION == 'community' && isset($navbar['community']) && $navbar['community'] === FALSE) {
        // Skip nonexistant features on community edition
        return;
    }
    $id = strgen();
    // Detect allowed screen ratio for current browser, cached!
    $ua_info = detect_browser();
    ?>

  <div class="navbar <?php 
    echo $navbar['class'];
    ?>
" style="<?php 
    echo $navbar['style'];
    ?>
">
    <div class="navbar-inner">
      <div class="container">
        <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target="#nav-<?php 
    echo $id;
    ?>
">
          <span class="oicon-bar"></span>
        </button>

  <?php 
    if (isset($navbar['brand'])) {
        echo ' <a class="brand">' . $navbar['brand'] . '</a>';
    }
    echo '<div class="nav-collapse" id="nav-' . $id . '">';
    //rewrite navbar (for class pull-right)
    $newbar = array();
    foreach (array('options', 'options_right') as $array_name) {
        if (isset($navbar[$array_name])) {
            foreach ($navbar[$array_name] as $option => $array) {
                if (isset($array['userlevel']) && isset($_SESSION['userlevel']) && $_SESSION['userlevel'] < $array['userlevel']) {
                    // skip not permitted menu items
                    continue;
                }
                if (OBSERVIUM_EDITION == 'community' && isset($array['community']) && $array['community'] === FALSE) {
                    // Skip not exist features on community
                    continue;
                }
                if (strstr($array['class'], 'pull-right') || $array_name == 'options_right' || $array['right'] == TRUE) {
                    $array['class'] = str_replace('pull-right', '', $array['class']);
                    $newbar['options_right'][$option] = $array;
                } else {
                    $newbar['options'][$option] = $array;
                }
            }
        }
    }
    foreach (array('options', 'options_right') as $array_name) {
        if ($array_name == 'options_right') {
            if (!$newbar[$array_name]) {
                break;
            }
            echo '<ul class="nav pull-right">';
        } else {
            echo '<ul class="nav">';
        }
        foreach ($newbar[$array_name] as $option => $array) {
            // if($array['divider']) { echo '<li class="divider"></li>'; break;}
            if (!is_array($array['suboptions'])) {
                echo '<li class="' . $array['class'] . '">';
                $link_opts = '';
                if (isset($array['link_opts'])) {
                    $link_opts .= ' ' . $array['link_opts'];
                }
                if (isset($array['alt'])) {
                    $link_opts .= ' data-rel="tooltip" data-tooltip="' . $array['alt'] . '"';
                }
                if (isset($array['id'])) {
                    $link_opts .= ' id="' . $array['id'] . '"';
                }
                if (empty($array['url']) || $array['url'] == '#') {
                    $array['url'] = 'javascript:void(0)';
                }
                echo '<a href="' . $array['url'] . '" ' . $link_opts . '>';
                if (isset($array['icon'])) {
                    echo '<i class="' . $array['icon'] . '"></i>&nbsp;';
                    $array['text'] = '<span>' . $array['text'] . '</span>';
                    // Added span for allow hide by class 'icon'
                }
                if (isset($array['image'])) {
                    if (isset($array['image_2x']) && $ua_info['screen_ratio'] > 1) {
                        // Add hidpi image set
                        $srcset = ' srcset="' . $array['image_2x'] . ' 2x"';
                    } else {
                        $srcset = '';
                    }
                    echo '<img src="' . $array['image'] . '"' . $srcset . ' alt="" /> ';
                }
                echo $array['text'] . '</a>';
                echo '</li>';
            } else {
                echo '  <li class="dropdown ' . $array['class'] . '">';
                $link_opts = '';
                if (isset($array['link_opts'])) {
                    $link_opts .= ' ' . $array['link_opts'];
                }
                if (isset($array['alt'])) {
                    $link_opts .= ' data-rel="tooltip" data-tooltip="' . $array['alt'] . '"';
                }
                if (isset($array['id'])) {
                    $link_opts .= ' id="' . $array['id'] . '"';
                }
                if (empty($array['url']) || $array['url'] == '#') {
                    $array['url'] = 'javascript:void(0)';
                }
                echo '    <a class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown" href="' . $array['url'] . '" ' . $link_opts . '>';
                if (isset($array['icon'])) {
                    echo '<i class="' . $array['icon'] . '"></i> ';
                }
                echo $array['text'] . '
            <strong class="caret"></strong>
          </a>
        <ul class="dropdown-menu">';
                foreach ($array['suboptions'] as $suboption => $subarray) {
                    if (isset($subarray['divider']) && $subarray['divider']) {
                        echo '<li class="divider"></li>';
                    } else {
                        echo '<li class="' . $subarray['class'] . '">';
                        $link_opts = '';
                        if (isset($subarray['link_opts'])) {
                            $link_opts .= ' ' . $subarray['link_opts'];
                        }
                        if (isset($subarray['alt'])) {
                            $link_opts .= ' data-rel="tooltip" data-tooltip="' . $subarray['alt'] . '"';
                        }
                        if (isset($subarray['id'])) {
                            $link_opts .= ' id="' . $subarray['id'] . '"';
                        }
                        if (empty($subarray['url']) || $subarray['url'] == '#') {
                            $subarray['url'] = 'javascript:void(0)';
                        }
                        echo '<a href="' . $subarray['url'] . '" ' . $link_opts . '>';
                        if (isset($subarray['icon'])) {
                            echo '<i class="' . $subarray['icon'] . '"></i>&nbsp;';
                            $subarray['text'] = '<span>' . $subarray['text'] . '</span>';
                            // Added span for allow hide by class 'icon'
                        }
                        echo $subarray['text'] . '</a>';
                        echo '</li>';
                    }
                }
                echo '    </ul>
      </li>';
            }
        }
        echo '</ul>';
    }
    ?>
        </div>
      </div>
    </div>
  </div>

 <?php 
}
예제 #11
0
    echo "</table><BR>";
    if ($fred[0] != 'unknown' && $fred[1] != 'unknown' && $fred[2] != 'unknown') {
        $pass++;
    }
}
echo "Total tests:  {$total}<BR>";
echo "Passed tests: {$pass}<BR><BR>";
// Define WebTV browsers
echo "Setting up list of Netbox browsers<BR>";
$netbox = array("[Mozilla/3.01 (compatible; Netbox/3.5 R93rc3; Linux 2.2)]");
$total = count($netbox);
$pass = 0;
echo "<hr>";
echo "<h2>Netbox Tests</h2>";
foreach ($netbox as $key => $value) {
    $fred = detect_browser($link_id, $netbox[$key]);
    echo "<table width='100%' cellpadding='0' cellspacing='0' border='1'>";
    echo "<tr colspan='3'>";
    echo "<td>{$netbox[$key]}</td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td width='50%'>{$fred['1']}</td><td width='25%'>{$fred['2']}</td><td width='25%'>{$fred['0']}</td>";
    echo "</tr>";
    echo "</tr>";
    echo "</table><BR>";
    if ($fred[0] != 'unknown' && $fred[1] != 'unknown' && $fred[2] != 'unknown') {
        $pass++;
    }
}
echo "Total tests:  {$total}<BR>";
echo "Passed tests: {$pass}<BR><BR>";
예제 #12
0
/**
 * Affiche un tableau html des connexions d'un utilisateur
 * 
 * $duree
 * -   7 -> "une semaine"
 * -  15 -> "quinze jours"
 * -  30 -> "un mois"
 * -  60 -> "deux mois"
 * - 183 -> "six mois"
 * - 365 -> "un an"
 * - all -> "le début"
 *
 * @param string $login Login de l'utilisateur
 * @param int|string $duree
 * @param string $page 'mon_compte' pour afficher ses propres connexions
 * @param string $pers_id Permet d'avoir une balise <input type='hidden' personnelle
 * @todo On pourrait utiliser $_SESSION['login'] plutôt que $page
 */
function journal_connexions($login, $duree, $page = 'mon_compte', $pers_id = NULL)
{
    global $active_hostbyaddr;
    switch ($duree) {
        case 7:
            $display_duree = "une semaine";
            break;
        case 15:
            $display_duree = "quinze jours";
            break;
        case 30:
            $display_duree = "un mois";
            break;
        case 60:
            $display_duree = "deux mois";
            break;
        case 183:
            $display_duree = "six mois";
            break;
        case 365:
            $display_duree = "un an";
            break;
        case 'all':
            $display_duree = "le début";
            break;
    }
    if ($page == 'mon_compte') {
        echo "<h2>Journal de vos connexions depuis <strong>" . $display_duree . "</strong>**</h2>\n";
    } else {
        echo "<h2>Journal des connexions de " . civ_nom_prenom($login) . " depuis <strong>" . $display_duree . "</strong>**</h2>\n";
    }
    $requete = '';
    if ($duree != 'all') {
        $requete = "and START > now() - interval " . $duree . " day";
    }
    $sql = "select START, SESSION_ID, REMOTE_ADDR, USER_AGENT, AUTOCLOSE, END from log where LOGIN = '******' " . $requete . " order by START desc";
    //echo "$sql<br />";
    $day_now = date("d");
    $month_now = date("m");
    $year_now = date("Y");
    $hour_now = date("H");
    $minute_now = date("i");
    $seconde_now = date("s");
    $now = mktime($hour_now, $minute_now, $seconde_now, $month_now, $day_now, $year_now);
    echo "<ul>\n<li>Les lignes en <span style='color:red; font-weight:bold;'>rouge</span> signalent une tentative de connexion avec un <span style='color:red; font-weight:bold;'>mot de passe erroné</span>.</li>\n<li>Les lignes en <span style='color:orange; font-weight:bold;'>orange</span> signalent une session close pour laquelle vous ne vous êtes <span style='color:orange; font-weight:bold;'>pas déconnecté correctement</span>.</li>\n<li>Les lignes en <span style='color:black; font-weight:bold;'>noir</span> signalent une <span style='color:black; font-weight:bold;'>session close normalement</span>.</li>\n<li>Les lignes en <span style='color:green; font-weight:bold;'>vert</span> indiquent les <span style='color:green; font-weight:bold;'>sessions en cours</span> (<em>cela peut correspondre à une connexion actuellement close mais pour laquelle vous ne vous êtes pas déconnecté correctement</em>).</li>\n</ul>\n<table class='boireaus' style='width: 90%; margin-left: auto; margin-right: auto; margin-bottom: 32px;' cellpadding='5' cellspacing='0' summary='Connexions'>\n\t<tr>\n\t\t<th class='col'>Début session</th>\n\t\t<th class='col'>Fin session</th>\n\t\t<th class='col'>Adresse IP et nom de la machine cliente</th>\n\t\t<th class='col'>Navigateur</th>\n\t</tr>\n";
    $tab_browser = array();
    $tab_host = array();
    $res = sql_query($sql);
    if ($res) {
        $alt = 1;
        for ($i = 0; $row = sql_row($res, $i); $i++) {
            $annee_b = mb_substr($row[0], 0, 4);
            $mois_b = mb_substr($row[0], 5, 2);
            $jour_b = mb_substr($row[0], 8, 2);
            $heures_b = mb_substr($row[0], 11, 2);
            $minutes_b = mb_substr($row[0], 14, 2);
            $secondes_b = mb_substr($row[0], 17, 2);
            $date_debut = $jour_b . "/" . $mois_b . "/" . $annee_b . " à " . $heures_b . " h " . $minutes_b;
            $annee_f = mb_substr($row[5], 0, 4);
            $mois_f = mb_substr($row[5], 5, 2);
            $jour_f = mb_substr($row[5], 8, 2);
            $heures_f = mb_substr($row[5], 11, 2);
            $minutes_f = mb_substr($row[5], 14, 2);
            $secondes_f = mb_substr($row[5], 17, 2);
            $date_fin = $jour_f . "/" . $mois_f . "/" . $annee_f . " à " . $heures_f . " h " . $minutes_f;
            $end_time = mktime($heures_f, $minutes_f, $secondes_f, $mois_f, $jour_f, $annee_f);
            $temp1 = '';
            $temp2 = '';
            if ($end_time > $now) {
                $temp1 = "<font color='green'>";
                $temp2 = "</font>";
            } else {
                if ($row[4] == 1 or $row[4] == 2 or $row[4] == 3 or $row[4] == 10) {
                    //$temp1 = "<font color=orange>\n";
                    $temp1 = "<font color='#FFA500'>";
                    $temp2 = "</font>";
                } else {
                    if ($row[4] == 4) {
                        $temp1 = "<strong><font color='red'>";
                        $temp2 = "</font></strong>";
                    }
                }
            }
            $alt = $alt * -1;
            echo "<tr class='lig{$alt} white_hover'>\n";
            echo "<td class=\"col\">" . $temp1 . $date_debut . $temp2 . "</td>\n";
            if ($row[4] == 4) {
                echo "<td class=\"col\">" . $temp1 . $date_fin . "<br />Tentative de connexion<br />avec mot de passe erroné." . $temp2 . "</td>\n";
            } else {
                echo "<td class=\"col\">" . $temp1 . $date_fin . $temp2 . "</td>\n";
            }
            if (!isset($active_hostbyaddr) or $active_hostbyaddr == "all") {
                //$result_hostbyaddr = " - ".@gethostbyaddr($row[2]);
                if (!in_array($row[2], $tab_host)) {
                    $tab_host[$row[2]] = @gethostbyaddr($row[2]);
                }
                $result_hostbyaddr = " - " . $tab_host[$row[2]];
            } else {
                if ($active_hostbyaddr == "no_local") {
                    if (mb_substr($row[2], 0, 3) == 127 or mb_substr($row[2], 0, 3) == 10.0 or mb_substr($row[2], 0, 7) == 192.168) {
                        $result_hostbyaddr = "";
                    } else {
                        $tabip = explode(".", $row[2]);
                        if ($tabip[0] == 172 && $tabip[1] >= 16 && $tabip[1] <= 31) {
                            $result_hostbyaddr = "";
                        } else {
                            //$result_hostbyaddr = " - ".@gethostbyaddr($row[2]);
                            if (!in_array($row[2], $tab_host)) {
                                $tab_host[$row[2]] = @gethostbyaddr($row[2]);
                            }
                            $result_hostbyaddr = " - " . $tab_host[$row[2]];
                        }
                    }
                } else {
                    $result_hostbyaddr = "";
                }
            }
            echo "<td class=\"col\"><span class='small'>" . $temp1 . $row[2] . $result_hostbyaddr . $temp2 . "</span></td>\n";
            //echo "<td class=\"col\">".$temp1. detect_browser($row[3]) .$temp2. "</td>\n";
            if (!in_array($row[3], $tab_browser)) {
                $tab_browser[$row[3]] = detect_browser($row[3]);
            }
            echo "<td class=\"col\">" . $temp1 . $tab_browser[$row[3]] . $temp2 . "</td>\n";
            echo "</tr>\n";
            flush();
        }
    }
    echo "</table>\n";
    echo "<form action=\"" . $_SERVER['PHP_SELF'] . "#connexion\" name=\"form_affiche_log\" method=\"post\">\n";
    if ($page == 'modify_user') {
        echo "<input type='hidden' name='user_login' value='{$login}' />\n";
        echo "<input type='hidden' name='journal_connexions' value='y' />\n";
    } elseif ($page == 'modify_eleve') {
        echo "<input type='hidden' name='eleve_login' value='{$login}' />\n";
        echo "<input type='hidden' name='journal_connexions' value='y' />\n";
    } elseif ($page == 'modify_resp') {
        echo "<input type='hidden' name='pers_id' value='{$pers_id}' />\n";
        echo "<input type='hidden' name='journal_connexions' value='y' />\n";
    }
    echo "Afficher le journal des connexions depuis : <select name=\"duree\" size=\"1\">\n";
    echo "<option ";
    if ($duree == 7) {
        echo "selected";
    }
    echo " value=7>Une semaine</option>\n";
    echo "<option ";
    if ($duree == 15) {
        echo "selected";
    }
    echo " value=15 >Quinze jours</option>\n";
    echo "<option ";
    if ($duree == 30) {
        echo "selected";
    }
    echo " value=30>Un mois</option>\n";
    echo "<option ";
    if ($duree == 60) {
        echo "selected";
    }
    echo " value=60>Deux mois</option>\n";
    echo "<option ";
    if ($duree == 183) {
        echo "selected";
    }
    echo " value=183>Six mois</option>\n";
    echo "<option ";
    if ($duree == 365) {
        echo "selected";
    }
    echo " value=365>Un an</option>\n";
    echo "<option ";
    if ($duree == 'all') {
        echo "selected";
    }
    echo " value='all'>Le début</option>\n";
    echo "</select>\n";
    echo "<input type=\"submit\" name=\"Valider\" value=\"Valider\" />\n";
    echo "</form>\n";
    echo "<p class='small'>** Les renseignements ci-dessus peuvent vous permettre de vérifier qu'une connexion pirate n'a pas été effectuée sur votre compte.\n\tDans le cas d'une connexion inexpliquée, vous devez immédiatement en avertir l'<a href=\"mailto:" . getSettingValue("gepiAdminAdress") . "\">administrateur</a>.</p>\n";
}
예제 #13
0
function is_safari()
{
    return detect_browser('safari');
}
예제 #14
0
function navbar_entry($entry, $level = 1)
{
    global $cache;
    if ($entry['divider']) {
        echo str_pad('', ($level - 1) * 2) . '                <li class="divider"></li>' . PHP_EOL;
    } elseif ($entry['locations']) {
        // Workaround until the menu builder returns an array instead of echo()
        echo str_pad('', ($level - 1) * 2) . '                <li class="dropdown-submenu">' . PHP_EOL;
        echo str_pad('', ($level - 1) * 2) . '                  ' . generate_menu_link(generate_url(array('page' => 'locations')), '<i class="menu-icon oicon-building-hedge"></i> Locations') . PHP_EOL;
        navbar_location_menu($cache['locations']);
        echo str_pad('', ($level - 1) * 2) . '                </li>' . PHP_EOL;
    } else {
        $entry_text = '<i class="menu-icon ' . $entry['icon'] . '"></i> ';
        if (isset($entry['image'])) {
            // Detect allowed screen ratio for current browser, cached!
            $ua_info = detect_browser();
            if (isset($entry['image_2x']) && $ua_info['screen_ratio'] > 1) {
                // Add hidpi image set
                $srcset = ' srcset="' . $entry['image_2x'] . ' 2x"';
            } else {
                $srcset = '';
            }
            $entry_text .= '<img src="' . $entry['image'] . '"' . $srcset . ' alt="" /> ';
        }
        $entry_text .= $entry['title'];
        echo str_pad('', ($level - 1) * 2) . '                <li>' . generate_menu_link($entry['url'], $entry_text, $entry['count']) . '</li>' . PHP_EOL;
    }
}
예제 #15
0
파일: index.php 프로젝트: skive/observium
  {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,        menubar=0,resizable=1,width=550,height=600');");
  }
  // End -->
  </script>

  <script src="js/bootstrap.min.js"></script>

<?php 
// No dropdowns on touch gadgets
if ($_SESSION['touch'] != 'yes') {
    echo '<script type="text/javascript" src="js/twitter-bootstrap-hover-dropdown.min.js"></script>';
}
// Same as in overlib_link()
if ($config['web_mouseover'] && detect_browser() != 'mobile') {
    echo '<script type="text/javascript" src="js/jquery.qtip.min.js"></script>';
}
?>

  <script type="text/javascript" src="js/bootstrap-datetimepicker.min.js"></script>
  <script type="text/javascript" src="js/bootstrap-select.min.js"></script>
  <script type="text/javascript">$('.selectpicker').selectpicker();</script>

  <script type="text/javascript" src="js/bootstrap-switch.min.js"></script>
  <script type="text/javascript" src="js/observium.js"></script>

  </body>
</html>
예제 #16
0
            } else {
                $result_hostbyaddr = "";
            }
        }
        echo "<td class=\"col\"><span class='small'>" . $temp1 . $row[4] . $result_hostbyaddr . $temp2 . "</span></td>\n";
        echo "<td class=\"col\"><span class='small'>" . $temp1 . detect_browser($row[5]) . $temp2 . "</span></td>\n";
        //echo "<td class=\"col\"><span class='small'>".$temp1. $row[6] .$temp2. "</span></td>\n";
        echo "<td class=\"col\"><span class='small'>";
        if ($row[6] == "") {
            echo "&nbsp;";
        } else {
            echo $temp1 . $row[6] . $temp2;
        }
        echo "</span></td>\n";
        //$ligne_csv[$nb_ligne] .= "$date_fin_f;$result_hostbyaddr;".detect_browser($row[5]).";$row[6]\n";
        $ligne_csv[$nb_ligne] .= my_ereg_replace("&nbsp;", " ", "{$date_fin_f};{$result_hostbyaddr};" . detect_browser($row[5]) . ";{$row['6']}\n");
        echo "</tr>\n";
        $nb_ligne++;
        flush();
    }
}
$_SESSION['donnees_export_csv_log'] = $ligne_csv;
?>
</table>
<p>
	<em>NOTES :</em>
</p>
<p>
	La résolution d'adresse IP en nom DNS peut ralentir l'affichage de cette page.
	<br />
	Dans le cas d'un serveur situé sur un réseau local, il se peut qu'aucun serveur DNS ne soit en mesure d'assurer