-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.php
More file actions
69 lines (66 loc) · 1.66 KB
/
mail.php
File metadata and controls
69 lines (66 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
include_once('connection2.php');
include_once('session.php');
$_SESSION['salt']="kjsadhuqheiukjdsjkwrjlwe";
echo"-----Welcome to Mail Server-----".PHP_EOL;
echo"1)login\n2)Register\n";
echo"Type admin for administrator login(username-admin,password-admin)".PHP_EOL;
echo"Enter your option number or type exit to quit - ";
$handle = fopen("php://stdin","r");
$line = fgets($handle);
switch(trim($line))
{
case "1":
echo "Login page".PHP_EOL;
include ('loginmail.php');
// return include ('loginmail.php');
break;
case "2":
include('register.php');
case "exit":
// mysql_close($db);
break;
case "admin":
echo"Enter Username".PHP_EOL;
$handle = fopen("php://stdin","r");
$line = fgets($handle);
echo"Enter Password".PHP_EOL;
system('stty -echo');
$handle2 = fopen("php://stdin","r");
$line2 = fgets($handle2);
system('stty echo');
//echo"\n";
$username=trim($line);
$password=trim($line2);
if($username=="admin"&&$password=="admin")
{
echo"Login successfull".PHP_EOL;
echo "-----Welcome Administrator----".PHP_EOL;
echo "--Mail server system logs-- ".PHP_EOL;
$i='0';
$logg=mysql_query("select * from logdetails");
while($log=mysql_fetch_array($logg))
{
$logid=$log['logid'];
$senid=$log['senid'];
$recid=$log['recid'];
$msg=$log['msg'];
$status=$log['status'];
$parentst=$log['parentst'];
echo" LOGID SENDERID RECIPIENTID MESSAGE STATUS PARENTSTATUS".PHP_EOL;
echo"$logid $senid $recid $msg $status $parentst".PHP_EOL;
}
include('mail.php');
}
else
{
echo"Invalid login".PHP_EOL;
include('mail.php');
}
break;
default:
echo "Wrong option";
include('mail.php');
break;
}
?>