Introduction to Database Technology - DT Results Introduction to Database Technology - DT Results YearStudentsPassFail (no resit)ResitWithdrawn 2012/1360407310 2013/1445255150...

1 answer below »
School project


Introduction to Database Technology - DT Results Introduction to Database Technology - DT Results YearStudentsPassFail (no resit)ResitWithdrawn 2012/1360407310 2013/1445255150 2014/155035375 2015/164830837 Problem Solving for Programming – PfP Results Problem Solving for Programming – PfP Results YearStudentsPassFail (no resit)ResitWithdrawn 2012/1365457310 2013/1455355150 2014/1560452103 2015/163830837 PHP Task The Department of Computer Science (DCS) at Birkbeck College, have requested that you develop a prototype main page and link this page to prototype secure intranet pages. Your system should include the following aspects: 7. Main index page, which should provide some dummy content, as an introduction to DCS, plus the following links: Intranet: links to a secure page which provides access to module results via a login 
 Administrator: links to a registration page/form via admin password, which if successful, allows an administrator to set up new members of staff. 
 8. Log-in: A member of staff should be able to log-in to the intranet by entering a valid username and password in a form. 
 9. Log-out: A logged in member of staff will be able to log-out of the system from any page, and a message will be displayed to this effect returning the user to the index page. 
 10. Admin page: A page for an administrator to register a new member of staff to allow them to login to the intranet. The data required for a member of staff to be registered as a user is: 
Title, First name, Surname, Email, Username and Password 
 11. The administrator user name should be “admin” and the password should be “dcsadmin01” for testing purposes). 
 12. Secure intranet content pages: An intranet index page which links to 3 module results pages (data provided in the FMA resources folder in Moodle). These three pages should show module results for the following modules: Web Programming using PHP - P1 Results 
 Introduction to Database Technology – DT Results 
 Problem Solving for Programming – PfP Results 
 13. The user should be able to browse between pages while maintaining their logged-in or out state, regardless of their browser settings. N.B. the module results pages should only be accessible if a member of staff has successfully logged in (including the administrator user), otherwise only the index page should be available. 
 14. All pages should display a link or form to log-in or out depending on the current user status. If the user is logged in, the page should display the username of the logged in user and if a user logs out they should be redirected to the index page. 
 A user navigating to any of the public content pages should be able to view the content directly whether they are logged-in or logged-out. The pages should clearly display their user status (apart from the URL links to https://www.dcs.bbk.ac.uk/... pages). If a logged out user tries to access the intranet pages, they should be politely requested to log-in. There is no specific requirement to apply any CSS or other formatting to your html output, however, you may do so, if you feel that it adds to the presentation of your solution. However, the output should use htmlentities and validate correctly under the DOCTYPE you have specified. Hints Your solution should be as robust as possible while providing a usable experience for users; remember the motto of form submission "Never trust user input". Any security flaws in your final design should be clearly outlined in a learning/development log, which you will need to submit as one of your deliverables. It may also be helpful to carefully consider the following before you begin any coding: · ⚫Consider what data you will need to store, what the validation criteria is for it and where you will store it. You are not permitted to use a MySQL (or other) database for this assignment, so you will probably want to store user data in an external file. Consider the security implications of using such a file and set appropriate permissions settings on the server. 
 · ⚫Remember the quickest way to write this application is to avoid repeating any PHP or HTML code. Thus, you will need to do a design and plan out some useful functions and/or include files that you could write once and then reuse throughout your project. 
 · ⚫You will need to maintain state between pages. It would, therefore be useful to review the class slides on PHP security and session and cookie management. 
 · ⚫You will need to modify the given module results data files to facilitate secure access and maintain a session; you are allowed to rename them to have a .php extension to facilitate this. 
 __MACOSX/._k k/.DS_Store __MACOSX/k/._.DS_Store k/index.php Home - Computer Science Department Birbeck






Birkbeck University


Department of Computer Science



Welcome to Birkbeck University Computer Science Department.


The Department of Computer Science and Information Systems at Birkbeck is one of the first computing departments established in the UK, celebrating our 60th anniversary in 2017. We provide a stimulating teaching and research environment for both part-time and full-time students, and a friendly, inclusive space for learning, working and collaborating.


__MACOSX/k/._index.php __MACOSX/k/._css k/webprogramming.php Web Programming using PHP - P1 Results






Birkbeck University


Department of Computer Science







Web Programming using PHP - P1 Results













































YearStudentsPassFail (no resit)ResitWithdrawn
2012/1350305510
2013/1460355128
2014/1545203715
2015/164025357


You cannot access this page without logging in

"; } ?> __MACOSX/k/._webprogramming.php __MACOSX/k/._includes k/intranet.php Home - Computer Science Department Birbeck







Birkbeck University


Department of Computer Science




Welcolme to the Intranet page, click on the link to see the results:





Each of the pages contain the results for the related module.


You cannot access this page without logging in

"; } ?> __MACOSX/k/._intranet.php k/admin.php Home - Computer Science Department Birbeck







Birkbeck University


Department of Computer Science



As the administrator you are able to set up new users.


Remember that you need to fill in all of the fields.


You can only register a user once.


You cannot access this page without logging in as an administator

"; } ?> __MACOSX/k/._admin.php k/databasetech.php Introduction to Database Technology - DT Results







Birkbeck University


Department of Computer Science







Introduction to Database Technology - DT Results













































YearStudentsPassFail (no resit)ResitWithdrawn
2012/1360407310
2013/1445255150
2014/155035375
2015/164830837


You cannot access this page without logging in

"; } ?> __MACOSX/k/._databasetech.php k/css/results.css table { font-family: arial, sans-serif; border-collapse: collapse; width: 50%; } td, th { border: 2px solid #dddddd; text-align: left; padding: 5px; } tr:nth-child(even) { background-color: #dddddd; } .tables{ margin-bottom: 30px; } body{ font-family: Arial, Helvetica, sans-serif; background-color: #f2f2ef; margin: auto; width: 70%; border: 2px solid darkgrey; border-radius: 5px; padding: 2em; } h1{ margin: 20px 5px 0px 10px; color: #651c65; } h2{ padding: 5px; margin: 10px; } h3{ color: #651c65; padding: 5px; margin: 10px; } h4{ text-align: right; color: #651c65; } li{ color:#651c65; text-align: right; list-style-position: inside; } h5{ text-align: right; color: darkgrey; } p{ padding: 5px; margin: 10 15px; } .nav ul { list-style-type: none; margin: 5px; padding: 0; overflow: hidden; } .nav li { float: left; background-color: white; border: 1px solid darkgrey; } .nav li a

Answered Same DayDec 20, 2021

Answer To: Introduction to Database Technology - DT Results Introduction to Database Technology - DT Results...

Arun Shankar answered on Jan 04 2021
136 Votes
k/.DS_Store
k/addstaff.php
/* This file has the logic to add a new staff member.
It gets the staff member details via the submission of the
form in the admin page. All that it does is to append the username
and password to the file users.txt. */
$uname = $_POST["user"];
$pass = $_POST["pass"];
$uname = trim($uname);
$pass = trim($pass);
if(strpos($pass,'staff')==false)
{
    echo "The password must follow the syntax dcsstaffXY";
    return;
}
// Check if a user with that name exists already
$file = fopen("includes/users.txt","r");
//Output lines until EOF is reached
while(!feof($file))
{
$line = fgets($file, 1024);
$bits = explode(',', $line);
$bits[0] = trim($bits[0]);
if($uname==$bits[0])
{
    echo "A user with that
username exists already. Please give a new username.";
    fclose($file);
    return;
}
}
fclose($file);
$fp = fopen("includes/users.txt","a");//opens file in append mode
fwrite($fp,"\n".$uname.",".$pass);
fclose($fp);
header('location:admin.php');
?>
k/admin.php
    require 'includes/functions.php';
    session_start();
    if(!isset($_SESSION["type"]))
    {
        echo "You are not authorized to access this page.";
        return;
    }
    if($_SESSION["type"]!=1)    // The user is not an admin
    {
        echo "Only admins authorized to access this page.";
        return;
    }
?>



    
        Admin - CS Dept. Birbeck
        
    

    
    
        
            
        
        
            
        
    

                

Department of Computer Science, Birkbeck University


                

                

Welcome to the admin page.


                

You can add a new staff member by filling this form:


            

                
    

    
         style="height:30px; border-radius: 5px; border-color: blue"/>
        
         style="height:30px; border-radius: 5px; border-color: blue;" />
    
         style="height:30px; border-radius: 5px; border-color: blue"/>
        
         style="height:30px; border-radius: 5px; border-color: blue;" />
    
         style="height:30px; border-radius: 5px; border-color: blue"/>
        
         style="height:30px; border-radius: 5px; border-color: blue;" />
    
    
    
                    if(isset($_SESSION["type"]))
                {
                    ?>
                    

                    
                    
                        
                    

                                    }
                ?>
            

            // require the footer
        include 'includes/footer.php';
    ?>


k/authenticate.php
/* This file has the logic to validate a login. This code
is executed when a user clicks on the Login button in the
index.php page. This page gets the username and password as
POST variables, and then checks whether a username, password
combo matches it. If yes, login is successful, the session variables are
set accordingly, and the user is redirected to the appropriate page.
If not, the user is taken back to the index.php page. */
$uname = $_POST["user"];
$pass = $_POST["pass"];
$uname = trim($uname);
$pass = trim($pass);
// Read the file that stores all usernames and passwords.
$bits = "";
$file = fopen("includes/users.txt","r");
//Output lines until EOF is reached
while(!feof($file))
{
$line = fgets($file, 1024);
$bits = explode(',', $line);
$bits[0] = trim($bits[0]);
$bits[1] = trim($bits[1]);
if(($uname==$bits[0]) && ($pass==$bits[1]))
{
        session_start();
        $_SESSION["fname"] = $uname;
        $_SESSION["password"] = $pass;
        // Find out what sort of a user this is - Admin, or staff ?
        if(strpos($pass,'admin') !==false)
            $_SESSION["type"] = 1;    
        else if(strpos($pass,'staff') !==false)
            $_SESSION["type"] = 2;    
        echo "successful login";
        echo $_SESSION["type"] ;
        header('location:index.php');
}
}
fclose($file);
// No user found with that username and password. Invalid credentials.     
header('location:index.php');
?>
k/css/results.css
table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 50%;            
}
td, th {
    border: 2px solid #dddddd;
    text-align: left;
    padding: 5px;
    
}
tr:nth-child(even) {
    background-color: #dddddd;
}
.tables{
    margin-bottom: 30px;
}
body{
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f2f2ef;
    margin: auto;
    width: 70%;
    border: 2px solid darkgrey;
    border-radius: 5px;
    padding: 2em;
}
h1{
    margin: 20px 5px 0px 10px;
    color: #651c65;
}
h2{    
    padding: 5px;
    margin: 10px;
}
h3{
    color: #651c65;
    padding: 5px;
    margin: 10px;
}
h4{
    text-align: right;
    color: #651c65;
}
li{
    color:#651c65;
    text-align: right;
    list-style-position: inside;
}
h5{
    text-align: right;
    color: darkgrey;
}
p{
    padding: 5px;
    margin: 10 15px;
}
.nav ul {
    list-style-type: none;
    margin: 5px;
    padding: 0;
    overflow: hidden;
}
.nav li {
    float: left;
    background-color: white;
    border: 1px solid darkgrey;
}
.nav li a {
    display: block;
    color: black;
    text-align: center;
    padding: 18px 20px;
    text-decoration: none;
}
.nav li a:hover {
    background-color: #651c65;
}
.subnav li{
    text-align: left;
}
.subnav a{
    text-decoration: none;
    font-size: 20px;
    color:#651c65;
}
.subnav a:hover{
    color: darkgrey;
}
input[type=text], select {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid darkgrey;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type=Password]{
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid darkgrey;
    border-radius: 4px;
    box-sizing:...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here