function contact_page_controller()
{
    global $cssFilePaths;
    global $javascriptFilePaths;
    $scripts = array($javascriptFilePaths["variableInputWidth"], $javascriptFilePaths["main"], $javascriptFilePaths["uploadResume"], $javascriptFilePaths["contact"]);
    display_header("Contact", array($cssFilePaths["contact"]), 5);
    contact_page_view();
    display_footer($scripts);
}
Exemple #2
0
function error($message, $type, $custom_message = "")
{
    $msg = "UNSPECIFIED ERROR OCCURED";
    if ($custom_message != "") {
        $msg = $custom_message;
    }
    //append_message($msg,$type);
    // TODO : DEGAGER LE PRINT ET FOUTRE CA DANS UN FIC. DE LOG
    echo htmlentities($message);
    if ($type == "SECURITY") {
        exit(1);
    }
    if ($type == "CRITICAL") {
        display_header();
        display_footer();
        exit(1);
    }
}
Exemple #3
0
</p>

<?php 
        display_setup_form();
        break;
    case 2:
        if (!empty($language) && load_default_textdomain($language)) {
            $loaded_language = $language;
            $GLOBALS['wp_locale'] = new WP_Locale();
        } else {
            $loaded_language = 'en_US';
        }
        if (!empty($wpdb->error)) {
            wp_die($wpdb->error->get_error_message());
        }
        display_header();
        // Fill in the data we gathered
        $weblog_title = isset($_POST['weblog_title']) ? trim(wp_unslash($_POST['weblog_title'])) : '';
        $user_name = isset($_POST['user_name']) ? trim(wp_unslash($_POST['user_name'])) : '';
        $admin_password = isset($_POST['admin_password']) ? wp_unslash($_POST['admin_password']) : '';
        $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash($_POST['admin_password2']) : '';
        $admin_email = isset($_POST['admin_email']) ? trim(wp_unslash($_POST['admin_email'])) : '';
        $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0;
        // Check e-mail address.
        $error = false;
        if (empty($user_name)) {
            // TODO: poka-yoke
            display_setup_form(__('Please provide a valid username.'));
            $error = true;
        } elseif ($user_name != sanitize_user($user_name, true)) {
            display_setup_form(__('The username you provided has invalid characters.'));
Exemple #4
0
<?php

/*
Copyright (©) 2003-2014 Teus Benschop.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include "utils.php";
display_header(true);
display_active();
display_paragraph("Creating and upgrading the confirmation database.");
display_footer();
/**
 * Summary of profiling
 */
require_once "WEB-INF/php/inc.php";
$profile = @new Java("com.caucho.profile.Profile");
$mbeanServer = new MBeanServer();
$server = $mbeanServer->lookup("resin:type=Server");
$title = "Resin: Profile {$server->Id}";
if (!$profile) {
    $title .= " - not available";
}
?>

<?php 
display_header("profile.php", $title, $server->Id);
?>

<?php 
if ($profile) {
    if ($_POST['action'] == 'stop') {
        $profile->stop();
    } else {
        if ($_POST['action'] == 'start') {
            $profile->start();
            if ($_POST['period'] >= 10) {
                $profile->setPeriod($_POST['period']);
            }
            if ($_POST['depth'] >= 1) {
                $profile->setDepth($_POST['depth']);
            }
Exemple #6
0
function make_redir($params)
{
    unset($params["make_redir"]);
    unset($params["do_redir"]);
    $qstring = arr2qstring($params);
    $domain = $_SERVER['SERVER_NAME'];
    $script = $_SERVER['SCRIPT_NAME'];
    $url = "http://{$domain}{$script}?{$qstring}";
    # Create tiny URLs for the permalinks
    $query = "SELECT permalink_id FROM permalinks WHERE permalink = '{$url}'";
    $id = select_scalar($query);
    if (is_null($id)) {
        $query = "SELECT nextval('permalinks_permalink_id_seq')";
        $id = select_scalar($query);
        $insert = "INSERT INTO " . "permalinks (permalink_id, permalink) " . "VALUES ('{$id}', '{$url}');";
        do_pg_query($insert);
    }
    $tinyurl = "http://{$domain}{$script}?do_redir={$id}";
    # Print tiny link in a tiny window
    $t = 50;
    print "<html>\n" . display_header("Tiny link") . "<body>\n<div align=center>\n<p>The original permalink was " . strlen($url) . " chars long.\nHere's a tiny link that is only {$t} chars long:</p>\n\n<p><form name=url_form><code>\n<input type=text name=url value='{$tinyurl}' size={$t}\n    onFocus=\"this.value='{$tinyurl}';\" readonly>\n</code>\n</form></p>\n\n<script language='javascript' type='text/javascript'>\ndocument.url_form.url.focus();\ndocument.url_form.url.select();\n</script>\n\n<p><form>\n<input type=button value='Close this window' onClick='javascript:window.close();'>\n</form></p>\n\n</div>\n</body>\n</html>";
    exit;
}
Exemple #7
0
<?php

// officers.php
// info on club officers
// TODO:  fill in content
include_once './global/includes.php';
display_header("Officers", "");
echo "The officers of RPI Ambulance are listed below.";
display_footer();
Exemple #8
0
<?php

include_once "./global/includes.php";
display_header("Edit User", "");
if (logged_in()) {
    ?>

<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.validate.js" type="text/javascript"></script>
<script src="additional-methods.js" type="text/javascript"></script>
<script src="jquery.validate.password.js" type="text/javascript"></script>

<script>
$(document).ready(function(){
    $("#editUserForm").validate();
});
</script>
</head>

<body>
<?php 
    $newuser = FALSE;
    include "global/processuser.php";
    ?>

  <div id="new_user_form">
  <form class="cmxform" id="editUserForm" method="post" action="">
 <fieldset>
   <legend>Edit user information</legend>
   <p>
     <label for="name">First Name</label>
Exemple #9
0
<?php

// events.php
// page for event scheduling
// TODO:  fill in content
include_once "./global/includes.php";
display_header("Events", "");
display_footer();
 * Summary of caching
 */
require_once "WEB-INF/php/inc.php";
$mbeanServer = new MBeanServer();
$resin = $mbeanServer->lookup("resin:type=Resin");
$server = $mbeanServer->lookup("resin:type=Server");
$block_cache = $mbeanServer->lookup("resin:type=BlockManager");
$proxy_cache = $mbeanServer->lookup("resin:type=ProxyCache");
$title = "Resin: Cache";
if (!empty($server->Id)) {
    $title = $title . " for server " . $server->Id;
}
?>

<?php 
display_header("cache.php", $title, $server->Id);
?>

<h2>Server: <?php 
echo $server->Id;
?>
</h2>

<table class="data">
  <tr title="Percentage of requests that have been served from the proxy cache:">
    <th>Proxy cache miss ratio:</th>
    <td><?php 
echo format_miss_ratio($proxy_cache->HitCountTotal, $proxy_cache->MissCountTotal);
?>
</td>
  </tr>
Exemple #11
0
<?php

/*
Copyright (©) 2003-2014 Teus Benschop.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include "utils.php";
display_header(false);
display_paragraph("Welcome to the Bibledit-Web installation.");
open_paragraph();
display_link("step.php", "Go!");
close_paragraph();
display_footer();
Exemple #12
0
<?php

/**
 * the index file.
 *
 * It displays the login form or the user's menu/mainpage
 *
 * \author Kevin Richardson <*****@*****.**>
 * \version $Id: index.php,v 1.3 2006/07/19 19:54:52 borismalcov Exp $
 */
include "lib/main.php";
display_header("phpmygrades: main");
if (is_logged_in() == TRUE) {
    display_mainpage();
} else {
    print "\n<div class=\"title\">phpmygrades</div>\n\n<div class=\"container2\">\n<div class=\"right\"><a href=\"news.php?xml&amp;class=0\" title=\"RSS feed for global news\"><img src=\"images/xml.gif\" alt=\"RSS Feed\" /></a></div>\n<div class=\"news_background\">\n";
    print_news_html(0, 3);
    print "\n</div>\n<hr class=\"mainpagehr\" />\n<table>\n<form action=\"login.php\" method=\"post\" name=\"login_form\">\n<tr><td>username:</td><td><input type=\"text\" name=\"user\" maxlength=\"30\" /></td></tr>\n<tr><td>password:</td><td><input type=\"password\" name=\"pass\" maxlength=\"70\" /></td></tr>\n<tr><td><input type=\"submit\" name=\"login\" value=\"login\" /></td></tr>\n<tr><td colspan=\"2\" class=\"right\"><small><i><a href=\"recoverpass.php\" title=\"forget your password?\">Forget your password</a>?</i></small></td></tr>\n</form>\n</table>\n</div>\n";
    display_copyright();
    display_footer();
}
Exemple #13
0
<?php

/**
 * the attendance tracking script
 *
 * \author Kevin Richardson <*****@*****.**>
 * \version $Id: attendance.php,v 1.6 2006/07/19 19:54:52 borismalcov Exp $
 * \todo turn some of the following into functions; a lot of it is reused a lot
 */
include "lib/main.php";
if (track_attendance == 0) {
    $_SESSION['not_this_page'] = 1;
    cust_die("The attendance features are currently disabled by the administrator.");
}
display_header("attendance");
display_menu();
print "<div class=\"container2\">";
if (user_type() == "user") {
    // I suppose we can show 'em the days they were absent on...
    $ID = $_SESSION['id'];
    connect_sql();
    $absences = @query("SELECT * FROM `absences` WHERE `user_ID`='{$ID}'");
    $number_of_absences = num_rows($absences);
    print "<table id=\"absencestable\">\n";
    print "<tr><th>You have been absent {$number_of_absences} time";
    if ($number_of_absences != 1) {
        print "s";
    }
    if ($number_of_absences != 0) {
        print ":";
    }
Exemple #14
0
function main_page()
{
    display_header();
    ?>
              
        <div id="xinfo">
            <div id="infotxt">Enter a ticker symbol to get various analyses. Currently supports S&P 500 companies only.</div>
        </div>
    <?php 
    display_footer();
}
Exemple #15
0
<?php

/**
 * allows a user to recover his or her password
 *
 * \author Kevin Richardson <*****@*****.**>
 * \version $Id: recoverpass.php,v 1.5 2006/07/19 19:54:52 borismalcov Exp $
 */
include "lib/main.php";
display_header("phpmygrades: forget your password?");
print "<div class=\"title\">recover your password</div>\n<div class=\"container2\">";
if (isset($_GET['email'])) {
    print "Type your e-mail address into the box below and click on the send button.  You'll be sent an e-mail containing information on how to reset your password.<br /><br /><table><form action=\"recoverpass.php\" method=\"post\"><tr><th>E-mail address:</th><td><input type=\"text\" name=\"email\" /></td></tr><tr><td><input type=\"submit\" name=\"sendemail\" value=\"send\" /></td></tr></form></table>";
} elseif (isset($_POST['sendemail'])) {
    $email = escape_string($_POST['email']);
    if (is_valid_email($email) == FALSE) {
        cust_die("That is not a valid e-mail address.");
    }
    // see if it's in the database
    connect_sql();
    $query = "SELECT 1 FROM `users` WHERE `email`='{$email}' LIMIT 1";
    $query = @query($query) or die("Error checking the database.");
    if (num_rows($query) == 0) {
        cust_die("No user has that e-mail address.");
    }
    $string = gen_string($email);
    $there = "SELECT 1 FROM `pass_recovery` WHERE `email`='{$email}' LIMIT 1";
    $there = @query($there) or die("Error checking the database.");
    if (num_rows($there) == 0) {
        $query = "INSERT INTO `pass_recovery` (`email`, `hash`) VALUES ('{$email}', 'string')";
    } else {
Exemple #16
0
        continue;
    }
    if ($fileInfo->isDir()) {
        $basename = $fileInfo->getFilename();
        $filename = "{$folder}/{$basename}";
        if (!is_writable($filename)) {
            $folders[] = $filename;
        }
    }
}
$writable = count($folders) == 0;
if (count($folders) > 5) {
    $folders = array_slice($folders, 0, 5);
    $folders[] = "and so on ...";
}
display_header($writable);
if ($writable) {
    display_okay();
    display_paragraph("Write access okay.");
} else {
    $message = "Bibledit-Web needs write access to the following folders and the files in them:";
    display_paragraph($message);
    foreach ($folders as $folder) {
        display_paragraph("<code>{$folder}</code>");
    }
    display_paragraph("Provide write access, or ask your hosting provider to do that for you.");
    open_paragraph();
    display_link("writable1.php", "Retry");
    close_paragraph();
}
display_footer();
Exemple #17
0
                echo 'Сообщение разослано всему клану в онлайн';
                echo '<meta http-equiv="refresh" content="1;url=act.php?func=pm&new">';
            }
        } else {
            if (!isset($komu)) {
                $komu = '';
            }
            echo '<table border="0" cellpadding="3"><form action="" method="post"';
            echo '<tr><td align="right">Тема:</td><td><input type="text" name="theme"></td><td></td></tr>';
            echo '<tr><td valign="top" align="right">Сообщение:</td><td><textarea id="post" onkeypress="if(event.ctrlKey&&((event.keyCode==10)||(event.keyCode==13))){postmsg.click();}" name="post" rows="10" cols="80"></textarea></td><td valign="top" align="left"><input type="button" value="+" id="add" style="background-color: black; color: white; text-align:center; font-size:14px; font-weight:bold; width:25px; height:25px; border:1px solid darkgold; padding:0px; margin:0px;" onClick="plus();"><br><input type="button" value="-" id="del" style="background-color:black; color:white; text-align:center; font-size:14px; font-weight:bold; width:25px; height:25px; border:1px solid darkgold; padding:2px; margin:2px;" onClick="minus();"></td></tr>';
            echo '<tr><td><input type="hidden" name="pos" value=""></td><td align="left"><input type="submit" id="postmsg" value="Отправить сообщение клану"></td><td></td></tr>';
            echo '</form></table>';
        }
    }
} else {
    display_header(1);
    if (isset($arx)) {
        $prov = myquery("SELECT COUNT(*) FROM game_pm WHERE id='{$arx}' and komu='{$user_id}'");
        if (mysql_num_rows($prov)) {
            $arx = (int) $arx;
            $result = myquery("update game_pm set view=2 where id='{$arx}' and komu='{$user_id}'");
            echo 'Сообщение перенесено в архив';
        }
    }
    if (isset($_GET['folder'])) {
        $folder = (int) $_GET['folder'];
    }
    if (isset($_GET['new'])) {
        $folder = 0;
    }
    if (isset($_GET['old'])) {
Exemple #18
0
function template_message($message, $url)
{
    display_header($url, 3);
    print "{$message}<BR>";
    if ($url != null) {
        print "<A HREF=\"{$url}\">You will be redirected in 3 seconds...</A><BR>";
    }
    display_footer();
}
Exemple #19
0
            ?>
</p>
		</td>
	</tr>
</table>

<p class="step"><a href="../manage/login.php" class="button button-large"><?php 
            _e('Log In');
            ?>
</a></p>

<?php 
        }
        break;
    case 99:
        display_header($notice);
        include_once 'setup-check.php';
        ?>
	<p class="step"><a href="setup-install.php?step=check&amp;<?php 
        echo $step_language;
        ?>
" class="button"><?php 
        _e('Check again');
        ?>
</a>  
	<?php 
        if ($disabled == true && $notice !== '') {
            ?>
		<a href="setup-install.php?<?php 
            echo $step_language;
            ?>
Exemple #20
0
    // redirect to authenticated homepage
    header("Location: index.php");
}
// check to see if the user is trying to log in
if (isset($_POST['username'])) {
    $login_result = login($_POST['username'], $_POST['password']);
    switch ($login_result) {
        case "1":
            // form not filled in completely
            $status .= "Please fill in all fields completely. ";
            break;
        case "2":
            // no such user
            $status .= "The user you have specified does not exist. ";
            break;
        case "3":
            // wrong password
            $status .= "The username/password combination you have entered is incorrect.";
            break;
        case "4":
            // succeeded
            header("Location: index.php");
            break;
        default:
            break;
    }
}
// otherwise, display normal login form
display_header("Login", $status);
display_login_form();
display_footer();
Exemple #21
0
<?php

/**
 * Provides a simple forum for class discussion.
 *
 * \author Kevin Richardson <*****@*****.**>
 * \version $Id: forum.php,v 1.7 2006/07/19 19:54:52 borismalcov Exp $
 */
include "lib/main.php";
display_header("forum");
if (is_logged_in() == FALSE) {
    $_SESSION['not_this_page'] = 1;
    cust_die("You'll need to login to access the page you've requested.");
}
if (enable_forums == 0) {
    $_SESSION['not_this_page'] = 1;
    cust_die("Forums are not currently enabled.");
}
display_menu();
print "<div class=\"container2\">";
connect_sql();
// has the user posted something?
if (isset($_POST['addtopic'])) {
    if (isset($_POST['subject']) && $_POST['subject'] != "") {
        $subject = escape_string(htmlspecialchars($_POST['subject']));
        if (strlen($subject) > 50) {
            cust_die("Your subject's length must be less than 50 characters.");
        }
    } else {
        cust_die("You must submit a subject.");
    }
require_once "WEB-INF/php/inc.php";
$heap = @new Java("com.caucho.profile.Heap");
$mbeanServer = new MBeanServer();
$server = $mbeanServer->lookup("resin:type=Server");
$server_id = $server->Id;
if (!$server_id) {
    $server_id = "default";
}
$title = "Resin: Heap {$server_Id}";
if (!$heap) {
    $title .= " - not available";
}
?>

<?php 
display_header("heap.php", $title, $server_Id);
?>

<?php 
$is_heap_available_heap = false;
if ($heap) {
    echo "<form action='heap.php' method='post'>";
    echo "<input type='submit' name='action' value='dump heap'>";
    echo "</form>";
    if ($_POST['action'] == 'dump heap') {
        $entries = $heap->dump();
        $is_heap_available = sizeof($entries) > 0;
    } else {
        $entries = $heap->lastDump();
        $is_heap_available = true;
    }
<?php

include 'inc-assess01-student.php';
?>


<!DOCTYPE html>
<html>
<head>
	<title>Assessment Summary</title>
	<link rel="stylesheet" href="../css/site.css" />
</head>
<body>
	<main id="assess-student" class="rounded">
		<!--  display the header -->
		<?php 
display_header('Online Assesor');
display_question_section();
?>
	</main>
	
	<script src="../js/jquery-2.1.4.min.js"></script>
	<script src="../js/assess01-student.js"></script>
</body>
</html>
function display_abstract($filename)
{
    $fp = fopen("abstract_list.csv", "r");
    $abstract_data = fgetcsv($fp);
    do {
        $counter = count($abstract_data);
        if ($counter != 5) {
            continue;
        }
        if ($abstract_data[4] == $filename) {
        }
        break;
        /* CSV are saved as Principal Author Name, email, Title, abstract filename
            Therefore
            [0] = principal author
            [1] = names,
            [2] = email
            [3] = Title
            [4] = abstract filename
          */
    } while ($abstract_data = fgetcsv($fp));
    display_header($abstract_data[3]);
    print <<<EOT
  <p class="navigation"><a href="../index.html">Home</a> &gt;
   <a href="papers.php">Abstract Submission</a> &gt; <a href="papers.php?list">Abstract List</a> &gt; Abstract </p>
  <div class="section even">
  <h2>Abstract: {$abstract_data[3]}</h2>
  <h3>By {$abstract_data[1]}</h3>
  <strong>Principal Author: </strong>{$abstract_data[0]}<br/>
  <strong>Contact email:</strong>{$abstract_data[2]}<br/>
    <strong>Authors:</strong> {$abstract_data[1]}<br/>
    <br/>
    <h3>Abstract text</h3>
    <div class="section odd">
EOT;
    readfile($filename);
    print <<<EOT
    </div><a class="button" href="papers.php?list" title="Return to list of papers">Abstract Directory</a></div>
EOT;
    fclose($fp);
}
Exemple #25
0
function display_send_files_form($error_filename)
{
    display_header("Could not save config file");
    $hidden = get_hidden_vars();
    global $root_dir;
    $files = get_config_files();
    $conf = htmlentities($files[0]);
    print <<<CUT
    <p><b>Installation script is unable to save file <i>{$error_filename}</i></b>. <br>
    For complete setup you may download new config files to your computer and upload
    it back to your server.</p>

    <p>File <i>config.inc.php</i>. Upload it to your FTP:
    <br><i>{$root_dir}/config.inc.php</i><br>
    <form name=f1 method=post>
    <input type=submit value="Download config.inc.php">
    <input type=hidden name=step value=9>
    <input type=hidden  name=file value=0>
    {$hidden}
    </form>
    </p>

    <p><font color=red><b>Internet Expolorer sometimes rename <br>
    files when save it. For example, it may rename <i>config.inc.php</i><br>
    to <i>config[1].inc.php</i>. Don't forget to  fix it before uploading!
    </b></font></p>
<script language="JavaScript">
function copyc(){
    holdtext = document.getElementById('conf');
    Copied = holdtext.createTextRange();
    Copied.execCommand("Copy");
}    
</script>    
    
    
    Or, alternatively, you may copy&paste this text to amember/config.inc.php 
    file.<br/>
    <textarea rows="10" cols="80" readonly name="conf" id="conf"
    >{$conf}</textarea>
    <br>
    <a href="javascript:copyc()">Copy to clipboard</a>
    <br><br><br>
    
    <b>When the file is copied or created, 
    <a href="index.php?a=cce">click this link to continue</a>.

    <br><br><br>
    <br><br><br>
CUT;
    display_footer();
}
Exemple #26
0
<?php

// contact.php
// contact information
// TODO:  fill in content
include_once './global/includes.php';
display_header("Contact", "");
echo "Come by our office at 92 College Ave!";
display_footer();
<?php

//link to functions and database models
require_once "includes/initialize.php";
// set up url query strign driven variables - defines parameters fe dinto funcitons
$portal_id = !empty($_GET['p']) ? (int) $_GET['p'] : 156;
$topic_id = !empty($_GET['t']) ? (int) $_GET['t'] : 156;
$sub_topic_1_id = !empty($_GET['st1']) ? (int) $_GET['st1'] : 156;
$sub_topic_2_id = !empty($_GET['st2']) ? (int) $_GET['st2'] : 156;
$sub_topic_3_id = !empty($_GET['st3']) ? (int) $_GET['st3'] : 156;
$sub_topic_4_id = !empty($_GET['st4']) ? (int) $_GET['st4'] : 156;
$category_id = !empty($_GET['c']) ? (int) $_GET['c'] : 156;
//header
//- <head meta data, title>; global navigation log & bar plus header title bar
// include this as last line in display header function return - wrapper start -: echo "<div class=\"container\"">;
display_header($portal_id, $topic_id, $sub_topic_1_id, $sub_topic_2_id, $sub_topic_3_id, $sub_topic_4_id, $category_id);
// local navigation & breadcrumb
display_local_nav($portal_id, $topic_id, $sub_topic_1_id, $sub_topic_2_id, $sub_topic_3_id, $sub_topic_4_id, $category_id);
//main section content
//- intro-box/ content-box, tabbed-pannel, quick-links-sidebar
display_main_content($portal_id, $topic_id, $sub_topic_1_id, $sub_topic_2_id, $sub_topic_3_id, $sub_topic_4_id, $category_id);
// footer
display_footer($portal_id, $topic_id, $sub_topic_1_id, $sub_topic_2_id, $sub_topic_3_id, $sub_topic_4_id, $category_id);
<?php

require_once "WEB-INF/php/inc.php";
$title = "Resin Admin Login";
display_header("login.php", $title, null);
if ($GLOBAL["error"]) {
    echo "<h3 class='fail'>Error: {$error}</h3>";
}
?>
<h2><?php 
echo gettext('Login');
?>
</h2>

<form method="POST" action="j_security_check?j_uri=index.php">
<table border='0'>
<tr>
  <th><label for="j_username"><?php 
echo gettext('Username');
?>
</label>: </th>
  <td>
    <input id="j_username" name="j_username" width="40"/>
  </td>
</tr>
<tr>
  <th><label for="j_password"><?php 
echo gettext('Password');
?>
</label>: </th>
  <td>
Exemple #29
0
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
include "utils.php";
ob_start();
require_once "../database/sqlite.php";
require_once "../database/history.php";
$database_history = Database_History::getInstance();
$database_history->create();
$okay = !ob_get_flush();
display_header($okay);
if ($okay) {
    display_okay();
    display_paragraph("History database okay.");
} else {
    display_paragraph("Errors creating or upgrading the history database");
    open_paragraph();
    display_link("history1.php", "Retry");
    close_paragraph();
}
display_footer();
Exemple #30
0
    connect_sql();
    $results = @query("SELECT `ID`, `type`, `firstname`, `surname` FROM `users` WHERE `username`='{$user}' AND `password`='{$pass}' LIMIT 1") or die("Error.");
    // if the login failed, log it and tell the user
    if (num_rows($results) == 0) {
        $timestamp = time();
        $ip = $_SERVER['REMOTE_ADDR'];
        @query("INSERT INTO `failed` (`user`, `timestamp`, `ip`) VALUES ('{$user}', '{$timestamp}', '{$ip}')");
        cust_die("Your login attempt failed.  Please try again.");
    }
    // if it did not fail, let the user access the system
    $timestamp = time();
    $ip = $_SERVER['REMOTE_ADDR'];
    @query("INSERT INTO `logins` (`user`, `timestamp`, `ip`) VALUES ('{$user}', '{$timestamp}', '{$ip}')");
    while ($row = result($results)) {
        $_SESSION['type'] = $row->type;
        $_SESSION['id'] = $row->ID;
        $_SESSION['name'] = stripslashes($row->firstname) . " " . stripslashes($row->surname);
        $_SESSION['username'] = $user;
    }
    header("Location: index.php");
    print "You are now logged in.  If you aren't transferred automatically, please <a href=\"index.php\">click here</a>.";
    disconnect_sql();
} else {
    display_header("phpmygrades: login");
    print "<div class=\"title\">login</div><div class=\"container2\">";
    any_errors();
    print "\n<table>\n<form action=\"login.php\" method=\"post\" name=\"login_form\">\n<tr><td>username:</td><td><input type=\"text\" name=\"user\" maxlength=\"30\" /></td></tr>\n<tr><td>password:</td><td><input type=\"password\" name=\"pass\" maxlength=\"70\" /></td></tr>\n<tr><td><input type=\"submit\" name=\"login\" value=\"login\" /></td></tr>\n<tr><td colspan=\"2\" class=\"right\"><small><i><a href=\"recoverpass.php\" title=\"forget your password?\">Forget your password</a>?</i></small></td></tr>\n</form>\n</table>\n";
}
print "</div>";
display_copyright();
display_footer();