Example #1
0
<?php

/**
 * Script to display switches
 *
 */
/* verify that user is authenticated! */
isUserAuthenticated();
/* get all unique switches */
$settings = getAllSettings();
/* get all selected fields for IP print */
$setFieldsTemp = getSelectedIPaddrFields();
/* format them to array! */
$setFields = explode(";", $setFieldsTemp);
?>



<h4><?php 
print _('Tools');
?>
</h4>
<ul class="nav nav-tabs nav-stacked nav-tools">
	<li <?php 
if ($_REQUEST['toolsId'] == "ipCalc") {
    print "class='active'";
}
?>
>
		<a href="tools/ipCalc/"><i class="icon-chevron-right pull-right icon-gray"></i> <?php 
print _('IP calculator');
require_once '../../functions/functions.php';
?>

<!-- header -->
<div class="pHeader"><?php 
print _("Select fields to export");
?>
</div>


<!-- content -->
<div class="pContent">

<?php 
/* verify that user is authenticated! */
isUserAuthenticated(false);
/* get all selected fields for IP print */
$setFieldsTemp = getSelectedIPaddrFields();
/* format them to array! */
$setFields = explode(";", $setFieldsTemp);
/* get all site settings */
$settings = getAllSettings();
# permissions
$permission = checkSubnetPermission($_POST['subnetId']);
if ($permission < 1) {
    die("<div class='alert alert-danger'>" . _('You cannot access this subnet') . "!</div>");
}
# print
print '<form id="selectExportFields">';
# table
print "\t<table class='table table-striped table-condensed'>";
<?php

/*
 * Discover new hosts with ping
 *******************************/
/* required functions */
require_once '../../../functions/functions.php';
/* verify that user is logged in */
isUserAuthenticated(true);
/* filter input */
$_POST = filter_user_input($_POST, true, true, false);
/* subnet Id must be a integer */
if (!is_numeric($_POST['subnetId']) || $_POST['subnetId'] == 0) {
    die("<div class='alert alert-danger'>Invalid subnetId!</div>");
}
/* verify that user has write permissions for subnet */
$subnetPerm = checkSubnetPermission($_POST['subnetId']);
if ($subnetPerm < 2) {
    die('<div class="alert alert-danger">' . _('You do not have permissions to modify hosts in this subnet') . '!</div>');
}
# verify post
CheckReferrer();
# ok, lets get results form post array!
foreach ($_POST as $key => $line) {
    // IP address
    if (substr($key, 0, 2) == "ip") {
        $res[substr($key, 2)]['ip_addr'] = $line;
    }
    // description
    if (substr($key, 0, 11) == "description") {
        $res[substr($key, 11)]['description'] = $line;
Example #4
0
        $message = $_GET['message'];
    }
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $emailid = trim($_POST['email']);
    $password = trim($_POST['password']);
    if (!empty($emailid) && !empty($password)) {
        //echo "</br> Not empty Fields";
        //----------------------------------
        if (emailValidation($emailid)) {
            //echo "</br> Valid email";
            //------------------------------
            if (isMailRegistered($emailid)) {
                //echo "</br> email Registered";
                //--------------------------
                if (isUserAuthenticated($emailid, $password)) {
                    //check if email and password is correct
                    /*Now we should Redirect to Home Page */
                    redirect("index.php");
                } else {
                    $message = "Wrong Password...</br>Please Try Again..!";
                }
            } else {
                $message = "Dear " . $emailid . "</br>Your Account Does Not Exist. Please Register";
            }
        } else {
            $message = "Invalid email";
        }
    } else {
        $message = "All Fields Are REQUIRED..!";
    }