Firewall welcome page

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

evilgenius82
New php-forum User
New php-forum User
Posts: 14
Joined: Mon Jun 11, 2012 10:55 am

Firewall welcome page

Postby evilgenius82 » Wed Sep 26, 2012 10:50 pm

Hi everyone,

We are using a firewall at work which displays a php welcome screen when being accessed. Im quite fresh with php, but was requested to add a email field so when the user continues to access the network, the email address will be sent via email.

The problem is when looking at the php code, there seems to be no form in which I can modify. I cant seem to grasp how the welcome page functions. Is the form stored in a database?

The code is posted below, all I need is an explanation to how the system functions and ill try my best to do the rest.

Index.php

Code: Select all

<?php

include "lib.php";
session_cache_limiter('nocache');
session_start();

$_SESSION["init"] = true;
if ( $_REQUEST["method"] != null ) {
    if ( $_REQUEST["method"] == "GET" ) {
        $_SESSION["server_name"] = $_REQUEST["server_name"];
        $_SESSION["path"] = $_REQUEST["path"];
        $_SESSION["ssl"] = $_REQUEST["ssl"];
    } else {
        $_SESSION["server_name"] = null;
        $_SESSION["path"] = null;
    }
}
$logout_success = false;
if ($_REQUEST["logout"]=='Y'){
    $logout_success = true;
}
session_write_close();

open_db_connection();
$skin_settings = get_uvm_settings("skin");
$branding_settings = get_node_settings('untangle-node-branding');
$cpd_settings = get_cpd_settings();

$redirectUrl = $cpd_settings["redirect_url"];

switch ( $cpd_settings["page_type"] ) {
case "BASIC_MESSAGE":
    include "basicmessage.php";
    break;

case "BASIC_LOGIN":
    include "basiclogin.php";
    break;

case "CUSTOM":
    include "custom.php";
    break;
}

?>


Basiclogin.php

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="X-UA-Compatible" content="IE=7.0000"/>
  <link href="/images/favicon-captive-portal.png" type="image/png" rel="icon"></link>
  <script type="text/javascript">
     var redirectUrl = "<?= get_redirect_url() ?>";
  </script>
  <script src="json2-min.js" type="text/javascript"></script>
  <script src="portal.js?nocache=2" type="text/javascript"></script>
  <title>
    <?= trim( $branding_settings["companyName"] ) ?> | Captive Portal
  </title>
  <link type="text/css" rel="stylesheet" href="/skins/<?= trim( $skin_settings["skinName"] ) ?>/css/user.css"></link>

  </head>
  <body class="captive-portal" id="simple">
    <div id="content">
      <div id="header">
        <a href="<?= trim( $branding_settings["companyUrl"] ) ?>"><img alt="" src="/images/BrandingLogo.gif"/></a>
        <div class="title">
          <?= trim( $cpd_settings["basicLoginPageTitle"] ) ?>
        </div>
      </div>
      <div id="main">
        <p class="icon-captive-portal">
          <br/>
        </p>
          <p id="logout-success" class="success" <?php if($logout_success===true){echo 'style="display:block"';}?>>You have successfully logged out.</p>
        <p class="description">
          <span>
            <b>
              <?= trim( $cpd_settings["basicLoginPageWelcome"] ) ?>
            </b>
          </span>
        </p>
          <p id="login-error" class="error">Unable to authenticate you, please try again.</p>
        <div class="info-list-captive-portal">
          <div class="u-form-item">
            <label class="u-form-item-label cpd-label">
              <?= trim( $cpd_settings["basicLoginUsername"] ) ?>
            </label>
          </div>
          <div class="u-form-item text-field">
            <input class="u-form-text u-form-field" type="text" id="username"/>
          </div>



          <div class="u-form-item text-field">
          <input class="u-form-text u-form-field" type="email" id="email"/>
          </div>
   


          <div class="u-form-item">
            <label class="u-form-item-label cpd-label">
              <?= trim( $cpd_settings["basicLoginPassword"] ) ?>
            </label>

          </div>
          <div class="u-form-item text-field">
            <input class="u-form-text u-form-field" type="password" id="password"/>
          </div>
          <div class="u-form-item">
              <a href="#" onclick="return authenticateUserWrapper('login-error')" class="img-background" id="authenticateUser">
              Login
            </a>
            <span id="please-wait" style="display:none">
                Please Wait ...
            </span>
          </div>
          <div class="message-text">
              <p>
              <?= $cpd_settings["basicLoginMessageText"] ?>
              </p>
          </div>
        </div>
        <p class="contact">
          <span>
            <?= trim( $cpd_settings["basicLoginFooter"] ) ?>
          </span>
        </p>
      </div>
      <div id="footer">
        <p>
          <span>
            <?= trim( $branding_settings["companyName"] ) ?> Captive Portal
          </span>
        </p>
      </div>
      <div id="extra-div-1">
        <span/>
      </div>
      <div id="extra-div-2">
        <span/>
      </div>
      <div id="extra-div-3">
        <span/>
      </div>
      <div id="extra-div-4">
        <span/>
      </div>
      <div id="extra-div-5">
        <span/>
      </div>
      <div id="extra-div-6">
        <span/>
      </div>
    </div>
    <script type="text/javascript">
        document.getElementsByTagName('body')[0].onkeyup = submitOnEnter;
    </script>
  </body>
</html>


Basicmessage.php

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="X-UA-Compatible" content="IE=7.0000"/>
  <link href="/images/favicon-captive-portal.png" type="image/png" rel="icon"></link>
  <script type="text/javascript">
     var redirectUrl = "<?= get_redirect_url() ?>";
  </script>
  <script src="json2-min.js" type="text/javascript"></script>
  <script src="portal.js?nocache=2" type="text/javascript"></script>
  <title>
    <?= trim( $branding_settings["companyName"] ) ?> | Captive Portal
  </title>
  <link type="text/css" rel="stylesheet" href="/skins/<?= trim( $skin_settings["skinName"] ) ?>/css/user.css"></link>

  </head>
  <body class="captive-portal" id="simple">
    <div id="content">
      <div id="header">
        <a href="<?= trim( $branding_settings["companyUrl"] ) ?>"><img alt="" src="/images/BrandingLogo.gif"/></a>
        <div class="title">
          <?= trim( $cpd_settings["basicMessagePageTitle"] ) ?>
        </div>
      </div>
      <div id="main">
        <p class="icon-captive-portal">
          <br/>
        </p>
        <p id="logout-success" class="success" <?php if($logout_success===true){echo 'style="display:block"';}?>>You have successfully logged out.</p>
        <p class="description">
          <span>
            <b>
              <?= trim( $cpd_settings["basicMessagePageWelcome"] ) ?>
            </b>
          </span>
        </p>
        <p id="agree-error" class="error">In order to continue, you must check the box below.</p>
        <div class="info-list-captive-portal">
        <div id="basic-message-text" class="message-text">
          <?= trim( $cpd_settings["basicMessageMessageText"] ) ?>
        </div>

     <?php if ( $cpd_settings["basicMessageAgreeBox"] == true ) { ?>
          <div class="agree-checkbox">
                <input class="u-form-text u-form-field" type="checkbox"  id="agree"/>
              <label for="agree"> <?= trim( $cpd_settings["basicMessageAgreeText"] ) ?></label>
          </div>

     <?php } else { ?>

          <div class="u-form-item">
            <input class="u-form-text u-form-field" type="hidden" id="agree" value="on"/>
          </div>
     <?php } ?>
          <div id="agree-message" style="display: none">
            You must accept the conditions before continuing.
          </div>
          <div class="u-form-item continue-message">
            <a href="#" onclick="return acceptAgreement(false)" class="img-background" id="authenticateUser">
            Continue
            </a>
            <span id="please-wait" style="display:none">
                Please Wait ...
            </span>
          </div>


<form>
 <div id="email_add>
 <input name='email' type='text' />

 </div>
</form>





        </div>
        <p class="contact">
          <span>
            <?= trim( $cpd_settings["basicMessageFooter"] ) ?>
          </span>
        </p>
      </div>
      <div id="footer">
        <p>
          <span>
            <?= trim( $branding_settings["companyName"] ) ?> Captive Portal
          </span>
        </p>
      </div>
      <div id="extra-div-1">
        <span/>
      </div>
      <div id="extra-div-2">
        <span/>
      </div>
      <div id="extra-div-3">
        <span/>
      </div>
      <div id="extra-div-4">
        <span/>
      </div>
      <div id="extra-div-5">
        <span/>
      </div>
      <div id="extra-div-6">
        <span/>
      </div>
    </div>
  </body>
</html>


Any help will be much appreciated!

Ryan

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron