Our goal is to build a FreeBSD server Captive Portal as it is in hotels and airports. Guest joins to wifi without entering a username or password, but when trying to join internet the user will be asked for username and password. If the username and password is true, the guest will be able to use internet. In my environment I used AP ubiquiti(official site: https://www.ubnt.com/). It is cheaper, stable and have open source wireless controller. The network structure will be as follows:
It is assumed that you have already configured FAMP and Apache PHP is stable. Apache web server is working on a group and user named unixmen which is created before. (In other words, in httpd.conf file directives are available: User unixmen and Group unixmen)
In all Access Points IP addresses is configured as it is shown in picture and DHCP server and ROUTER, FreeBSD Server’s internal network card’s IP address is shown. In Apache configured VirtualHost and it operates under the domain name wifi.unixmen.com
VirtualHost’s Public_html folder is the address of /usr/local/www/wifi/, and the membership and authority of folder is unixmen. And same as /usr/local/etc/apache24/httpd.conf configured file Listen 80 and Listen 443 defined. /usr/local/domen/wifi.unixmen.com virtualhos content of the file are as follows:
<strong> RewriteEngine on</strong>
<strong> ReWriteCond %{SERVER_PORT} !^443$</strong>
<strong> RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]</strong>
<strong></VirtualHost></strong>
<strong><VirtualHost *:443></strong>
<strong> SSLEngine on</strong>
<strong> SSLCertificateFile /usr/local/etc/apache24/ssl/wifi.pem</strong>
<strong> SSLCertificateKeyFile /usr/local/etc/apache24/ssl/wifi.key</strong>
<strong> DocumentRoot /usr/local/www/wifi/</strong>
<strong><Directory "/usr/local/www/wifi"></strong>
<strong> AllowOverride All</strong>
<strong> Require all granted</strong>
<strong></Directory></strong>
<strong></VirtualHost></strong>
It is needed to install pear for php and create database and its user at MySQL We install pear and configure for php.
# <strong>make -DBATCH install</strong> - install
After we copy php file and change properly the changes of the context.
We do the changes in the file /usr/local/etc/php.ini:
<strong>include_path = '.:/usr/local/share/pear'</strong>
Now lets create MySQL database and define a user for this database. And create a schedule for wifi users
mysql> <strong>grant all privileges on wifi.* to wifidbuser@localhost identified by 'wifidbpassword';</strong>
mysql> <strong>use</strong> <strong>wifi</strong>;
mysql> <strong>CREATE TABLE `users` (</strong>
<strong> `id` int(10) unsigned NOT NULL auto_increment,</strong>
<strong> `username` varchar(50) default NULL,</strong>
<strong> `password` varchar(50) default NULL,</strong>
<strong> `created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,</strong>
<strong> `time_begin` timestamp NOT NULL default '0000-00-00 00:00:00',</strong>
<strong> `time_end` timestamp NOT NULL default '0000-00-00 00:00:00',</strong>
<strong> `status` tinyint(4) NOT NULL default '0',</strong>
<strong> `rule_num` smallint(5) unsigned NOT NULL,</strong>
<strong> PRIMARY KEY (`id`),</strong>
<strong> KEY `rule_num` (`rule_num`)</strong>
<strong>) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=6 ;</strong>
/etc/rc.conf the configuration file will be as follows
<strong>ifconfig_em0="inet 88.8.9.10 netmask 255.255.255.0"</strong>
<strong>ifconfig_em1="inet 10.0.0.1 netmask 255.255.255.0"</strong>
<strong>defaultrouter="88.8.9.1"</strong>
<strong>sshd_enable="YES"</strong>
<strong>dumpdev="NO"</strong>
#### Local Disabled Services ####
sendmail_enable=”NO”
sendmail_submit_enable=”NO”
sendmail_outbound_enable=”NO”
sendmail_msp_queue_enable=”NO”
sendmail_rebuild_aliases=”NO”
syslogd_enable=”YES”
syslogd_program=”/usr/sbin/syslogd”
syslogd_flags=”-ss”
#### Local worked services ####
tcp_drop_synfin=”YES”
icmp_drop_redirects=”YES”
dhcpd_enable=”YES”
dhcpd_ifaces=”em1″
dhcpd_conf=”/usr/local/etc/dhcpd.conf”
gateway_enable=”YES”
natd_enable=”YES”
natd_interface=”em0″
firewall_enable=”YES”
firewall_type=”UNKNOWN”
firewall_script=”/etc/ipfw.conf”
#### Third Party Services ####
apache24_enable=”YES”
mysql_enable=”YES”
we add the following lines to the file /etc/ipfw.conf in order our configured firewall to run after reboot.
<strong>ipfw add 10800 allow ip from any to 88.8.9.58</strong>
<strong>ipfw add 10900 allow ip from 88.8.9.58 to any</strong>
<strong>ipfw add 11000 allow ip from any to 88.8.9.59</strong>
<strong>ipfw add 12000 allow ip from 88.8.9.59 to any</strong>
<strong>ipfw add 60000 fwd 10.0.0.1,80 tcp from any to any dst-port 80 via em1</strong>
<strong>ipfw add 60001 fwd 10.0.0.1,443 tcp from any to any dst-port 443 via em1</strong>
<strong>ipfw add 65000 allow ip from any to any</strong>
<strong>ipfw add 65535 deny ip from any to any</strong>
Minimize system kernel and compile the following options:
<strong>options IPFIREWALL</strong>
<strong>options IPFIREWALL_VERBOSE</strong>
<strong>options IPFIREWALL_VERBOSE_LIMIT=3</strong>
<strong>options DUMMYNET</strong>
<strong>options IPFIREWALL_FORWARD</strong>
<strong>options IPFIREWALL_NAT</strong>
<strong>options LIBALIAS</strong>
Install DHCP server from ports
# <strong>make config</strong> - Choose the required modules
<a href="http://unixmen.com/wp-content/uploads/2016/01/dhcp-port.png" rel="attachment wp-att-43181"><img class="aligncenter size-full wp-image-43181" src="http://unixmen.com/wp-content/uploads/2016/01/dhcp-port.png" alt="dhcp-port" width="535" height="184" /></a>
# <strong>make -DBATCH install</strong> - install
/usr/local/etc/dhcpd.conf we make installation file content as following:
<strong>option domain-name-servers ns1.unixmen.com, ns2.unixmen.com;</strong>
<strong>default-lease-time 3600;</strong>
<strong>max-lease-time 86400;</strong>
<strong>ddns-update-style none;</strong>
<strong>authoritative;</strong>
<strong>subnet 10.0.0.0 netmask 255.255.255.0 {</strong>
<strong> range 10.0.0.50 10.0.0.254;</strong>
<strong> option routers 10.0.0.1;</strong>
<strong>}</strong>
# we reserve Access Points for the IP addresses shown in the picture
<strong>host Wifi-1f.1 {</strong>
<strong> hardware ethernet 04:18:76:8c:9a:a3;</strong>
<strong> fixed-address 10.0.0.10;</strong>
<strong>}</strong>
<strong>host Wifi-2f.1 {</strong>
<strong> hardware ethernet 04:18:66:43:11:11;</strong>
<strong> fixed-address 10.0.0.20;</strong>
<strong>}</strong>
<strong>host Wifi-3f.1 {</strong>
<strong> hardware ethernet 04:18:36:68:a9:9b;</strong>
<strong> fixed-address 10.0.0.30;</strong>
we create a journal file for DHCP and filter from Syslog(/var/db/dhcpd/dhcpd.leases (you can look in this file)
We add the follofing lines to the end of /etc/syslog.conf file:
<strong>*.* /var/log/dhcp.log</strong>
We run the DHCP and check listening:
# <strong>sockstat -l|grep dhcp</strong>
dhcpd dhcpd 4695 7 udp4 *:67 *:*
dhcpd dhcpd 4695 20 udp4 *:8997 *:*
Install Sudo from the ports:
# <strong>make config</strong> - choose required modules
<a href="http://unixmen.com/wp-content/uploads/2016/01/sudo-port.png" rel="attachment wp-att-43189"><img class="aligncenter size-full wp-image-43189" src="http://unixmen.com/wp-content/uploads/2016/01/sudo-port.png" alt="sudo-port" width="654" height="270" /></a>
# <strong>make -DBATCH install</strong> - install
Add to /usr/local/etc/sudoers file the following lines(it is required for access of web server to firewall):
/usr/local/www/wifi/config.php the content of configuration file will be as following lines(the registration and stop registered users is fulfill by adding or removing the rules of IPFW):
<strong><?php</strong>
<strong>define('DEBUG', true);</strong>
<strong>define('conf_DB_HOST', 'localhost');</strong> //Database IP
<strong>define('conf_DB_USER', 'wifidbuser');</strong> //username of database
<strong>define('conf_DB_PASS', 'wifidbpassword');</strong> //the password of database
<strong>define('conf_DB_NAME', 'wifi');</strong> //the name of database
<strong>define('RULE_NUM_MIN', 400); </strong>//IPFW rules begin from 400
<strong>define('RULE_NUM_MAX', 600); </strong>//IPFW rule finishs with 600
<strong>define('CLIENTS_IP_BEGIN', '10.0.0.50');</strong> // the clients will start IP adress from
<strong>define('CLIENTS_IP_COUNT', '200');</strong>
<strong>define('CLIENTS_TIME', '3600');</strong> //the period of internet access for users(an hour)
<strong>define('RULE_ADD_IP', 'sudo ipfw add %s allow ip from any to %s');</strong>
<strong>define('RULE_ADD_IP2', 'sudo ipfw add %s allow ip from %s to any');</strong>
<strong>define('RULE_DEL_IP', 'sudo ipfw del %s');</strong>
<strong>define('RULE_DEL_IP2', 'sudo ipfw del %s');</strong>
<strong>/*</strong>
STATUS:
<strong>0</strong> – If the information of connection is true you are connected, otherwise the rule is not added!
<strong>1</strong> - You have already connected
<strong>2</strong> – The username has been already used.
<strong>3</strong> – The user is stopped.
<strong>*/</strong>
<strong>$db_link = mysql_connect(conf_DB_HOST, conf_DB_USER, conf_DB_PASS);</strong>
<strong>if (!$db_link) return cms_errors('The connection to database is failed!);</strong>
<strong>if (!mysql_select_db(conf_DB_NAME, $db_link)) return cms_errors('The connection to database is failed!!!');</strong>
<strong>function cms_errors($text)</strong>
<strong>{</strong>
<strong> if (DEBUG) echo $text;</strong>
<strong> return false;</strong>
<strong>}</strong>
<strong>function dumpVarX(&$Var, $Var_s = null)</strong>
<strong>{</strong>
<strong> echo "<div align='left' class='debug'>";</strong>
<strong> dumpVar($Var, 0, $Var_s);</strong>
<strong> echo "<div>";</strong>
<strong> return true;</strong>
<strong>}</strong>
<strong>function dumpVar(&$Var, $Level = 0, $Var_s = null)</strong>
<strong>{</strong>
<strong> if ($Level > 4)</strong>
<strong> {</strong>
<strong> echo "<b>...</b> LEVEL > 4<br>\n";</strong>
<strong> return;</strong>
<strong> }</strong>
<strong> $is_ob_ar = false;</strong>
<strong> $Type = gettype($Var);</strong>
<strong> if (is_array($Var)) {$is_ob_ar = true; $Type = "Array[".count($Var)."]";}</strong>
<strong> if (is_object($Var)) $is_ob_ar = true;</strong>
<strong> if ($Level == 0)</strong>
<strong> {</strong>
<strong> if ($Var_s) echo "\n<br>\n<b><span style="color:#ff0000">".$Var_s." = {</span></b>";</strong>
<strong> if ($is_ob_ar && count($Var)) echo "<pre>\n";</strong>
<strong> else echo "\n<tt>";</strong>
<strong> $Level_zero = 0;</strong>
<strong> }</strong>
<strong> if ($is_ob_ar)</strong>
<strong> {</strong>
<strong> echo "<span style="color:#05a209">$Type</span>\n";</strong>
<strong> for (Reset($Var), $Level++; list($k, $v)=each($Var);)</strong>
<strong> {</strong>
<strong> if (is_array($v) && $k==="GLOBALS") continue;</strong>
<strong> for ($i=0; $i<$Level*3; $i++) echo " ";</strong>
<strong> echo "<b>".HtmlSpecialChars($k)."</b> => ";</strong>
<strong> dumpVar($v, $Level);</strong>
<strong> }</strong>
<strong> }</strong>
<strong> else</strong>
<strong> {</strong>
<strong> if (is_string($Var) && strlen($Var)>400)</strong>
<strong> echo '('.$Type.') <span style="color:#35BBFA">strlen = '.strlen($Var).'</span>'."\n";</strong>
<strong> else echo '('.$Type.') "<span style="color:#0000FF">',HtmlSpecialChars($Var),'</span>"'."\n";</strong>
<strong> }</strong>
<strong> if (isset($Level_zero))</strong>
<strong> {</strong>
<strong> if ($is_ob_ar && count($Var)) echo "</pre>";</strong>
<strong> else echo "</tt>";</strong>
<strong> if ($Var_s) echo "<b><span style="color:#ff0000">}</span></b><br>\n";</strong>
<strong> }</strong>
<strong> return true;</strong>
<strong>}</strong>
<strong>?></strong>
User’s registration script: /usr/local/www/wifi/add.php file will be as follows:
<strong><?php</strong>
<strong>require_once('config.php');</strong>
<strong>$user = get_user($_GET['login'], $_GET['pass']);</strong>
<strong>if ($user)</strong>
<strong>{</strong>
<strong> switch ($user['status'])</strong>
<strong> {</strong>
<strong> case 0:</strong>
<strong> if (add_rule($user)) echo '<h2>You are connected!</h2>';</strong>
<strong> else echo 'The wrong rule is not added!';</strong>
<strong> break;</strong>
<strong> case 1: echo '<h2>You have already connected</h2>'; break;</strong>
<strong> case 2: echo '<h2>Username has already been used</h2>'; break;</strong>
<strong> case 2: echo '<h2>Username is stopped</h2>'; break;</strong>
<strong> default: echo 'Error'; break;</strong>
<strong> }</strong>
<strong>} else echo '<h2>Username or password is wrong</h2>';</strong>
// Registration
function get_user($login, $pass)
{
$user = null;
if (!$login || !$pass) return null;
$login = addslashes($login);
$sql = ‘SELECT * FROM users WHERE username=”‘.$login.'” AND password=”‘.$pass.'” LIMIT 1’;
$res = mysql_query($sql);
if ($res) $user = mysql_fetch_assoc($res);
return $user;
}
// Adding the rule
function add_rule($user)
{
$user_ip = $_SERVER[‘REMOTE_ADDR’];
$current_date = time();
if (!checkip($user_ip)) return false;
$temp = 0;
$sql = ‘SELECT rule_num FROM users WHERE status=1 ORDER BY rule_num’;
$res = mysql_query($sql);
if ($res)
{
$t = mysql_fetch_array($res);
if (!$t) $rule_num = RULE_NUM_MIN;
else {
while ($temp = mysql_fetch_array($res))
{
if (($t[0]+1) < $temp[0]) break;
$t = $temp;
}
if ($t[0] < RULE_NUM_MAX) $rule_num = $t[0]+1; else return false;
}
} else return false;
$command = sprintf(RULE_ADD_IP, $rule_num, $user_ip);
exec($command);
$command2 = sprintf(RULE_ADD_IP2, $rule_num+100, $user_ip);
exec($command2);
$sql = ‘UPDATE users SET status=1, time_begin=NOW(), rule_num=’.$rule_num.’ WHERE id=’.$user[‘id’];
mysql_query($sql);
return true;
}
function checkip($ip)
{
if (!$ip) return false;
$user_ip = explode(‘.’, $ip);
$check_ip = explode(‘.’, CLIENTS_IP_BEGIN);
if (($check_ip[0] != $user_ip[0]) && $check_ip[0] != “*”) return false;
if (($check_ip[1] != $user_ip[1]) && $check_ip[1] != “*”) return false;
if (($check_ip[2] != $user_ip[2]) && $check_ip[2] != “*”) return false;
if (!(($check_ip[3] <= $user_ip[3] && ($check_ip[3] + CLIENTS_IP_COUNT) >= $user_ip[3])) && $check_ip[3] != “*”) return false;
return true;
}
?>
User’s closed script according to the end of time /usr/local/www/wifi/cron.php:
<strong><?php</strong>
<strong>require_once('config.php');</strong>
<strong>check_users();</strong>
<strong>function check_users()</strong>
<strong>{</strong>
<strong> $sql = 'SELECT * FROM users WHERE status=1 AND time_begin > 0 AND (TIME_TO_SEC(TIMEDIFF(NOW(), time_begin)) > '.CLIENTS_TIME.')';</strong>
<strong> $res = mysql_query($sql);</strong>
<strong> if ($res)</strong>
<strong> {</strong>
<strong> while ($user = mysql_fetch_assoc($res))</strong>
<strong> {</strong>
<strong> $command = sprintf(RULE_DEL_IP, $user['rule_num']);</strong>
<strong> exec($command);</strong>
<strong> $command2 = sprintf(RULE_DEL_IP2, $user['rule_num']+100);</strong>
<strong> exec($command2);</strong>
<strong> $sql = 'UPDATE users SET status=2, time_end=NOW() WHERE id='.$user['id'];</strong>
<strong> mysql_query($sql);</strong>
<strong> }</strong>
<strong> }</strong>
<strong> return true;</strong>
<strong>}</strong>
<strong>?></strong>
The form for adding username and pasword (such as index.html file):
<strong><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"</strong>
<strong> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></strong>
<strong><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></strong>
<strong><head></strong>
<strong> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></strong>
<strong> <title>Administration</title></strong>
<strong> <link rel="stylesheet" type="text/css" href="admin.css" /></strong>
<strong> <!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="style-ie.css" /><![endif]--></strong>
<strong></head></strong>
<strong><body></strong>
<strong><div class="login"></strong>
<strong><div class="form"></strong>
<strong><form method="get" action="add.php"></strong>
<strong> <p><label>Login:</label><input class="text" name="login" type="text" size="17"/></p></strong>
<strong> <p><label>Password:</label><input class="text" name="pass" type="password" size="16"/></p></strong>
<strong> <p><input class="submit" type="submit" value="Everything is OK!"/></strong>
<strong></form></strong>
<strong></div></strong>
<strong><div class="rules"></strong>
<strong> <h1>Wi-Fi how to use</h1></strong>
<strong> <ol></strong>
<strong> <li>It is free for guests!</li></strong>
<strong> <li>Come to reception</li></strong>
<strong> <li>Get username and password</li></strong>
<strong> <li>Use wifi</li></strong>
<strong> </ol></strong>
<strong> </div></strong>
<strong> </div></strong>
<strong> </body></strong>
<strong> </html></strong>
Administration panel will be in /usr/local/www/wifi/admin folder. We must protect this folder with htpasswd for security. The content of file /usr/local/www/wifi/admin/admin.php will be as follows:
<strong> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></strong>
<strong><html></strong>
<strong> <head></strong>
<strong> <title>Administration panel</title></strong>
<strong> <link type="text/css" rel="stylesheet" href="style.css"></strong>
<strong> </head></strong>
<strong><body></strong>
<strong><form method="post" action="admin.php"></strong>
<strong> The amount of users: <input type="text" value="" name="num" size=2> count.<br><br></strong>
<strong> <input type="submit" value="Generate"></strong>
<strong></form><hr></strong>
<strong><?php</strong>
<strong> require_once('/usr/local/www/wifi/config.php');</strong>
<strong> $n = (int) $_POST['num'];</strong>
<strong> if ($n > 10) { echo '</strong><strong>The number of users that can be created is over limited!</strong> <strong><br><br>'; $n=0; }</strong>
<strong> function generate_password($number=10)</strong>
<strong> {</strong>
<strong> $arr = array('1','2','3','4','5','6',</strong>
<strong> '7','8','9','0');</strong>
<strong> // Generate the password</strong>
<strong> $pass = "";</strong>
<strong> for($i = 0; $i < $number; $i++)</strong>
<strong> {</strong>
// Calculate random index of massive
<strong>$index = rand(0, count($arr) - 1);</strong>
<strong> $pass .= $arr[$index];</strong>
<strong> }</strong>
<strong> return $pass;</strong>
<strong> }</strong>
<strong> for ($i=0; $i<$n; $i++)</strong>
<strong> {</strong>
<strong> $login = generate_password(4);</strong>
<strong> $pass = generate_password(6);</strong>
<strong> $sql = 'INSERT INTO users (username, password, status, rule_num) VALUES("apt'.$login.'", "'.$pass.'", 0, 0)';</strong>
<strong> $res = mysql_query($sql);</strong>
<strong> }</strong>
<strong> if ($res) echo 'Count of users <b>'.$n.'</b> is added.<br><br>';</strong>
<strong> $sql = 'SELECT * FROM users';</strong>
<strong> $res = mysql_query($sql);</strong>
<strong> echo '<table width=\'30%\'><td><b>Username</b></td><td><b>Password</b></td><td><b>Status</b></td><td><b>Rule</b></td>';</strong>
<strong> while ($data = mysql_fetch_assoc($res))</strong>
<strong> {</strong>
<strong> echo '<tr>';</strong>
<strong> echo '<td>'.$data['username'].'</td>';</strong>
<strong> echo '<td>'.$data['password'].'</td>';</strong>
<strong> if ($data['status'] == 0) { echo '<td class=\'blue\'>Is not active</td>'; }</strong>
<strong> if ($data['status'] == 1) { echo '<td class=\'green\'>Used</td>';</strong>
<strong> echo '<td>'.$data['rule_num'].'</td>';}</strong>
<strong> if ($data['status'] == 2) { echo '<td class=\'reds\'>Was used</td>'; }</strong>
<strong> if ($data['status'] == 3) { echo '<td><b>Was stopped</b></td>'; }</strong>
<strong> echo '</tr>';</strong>
<strong> }</strong>
<strong> echo '</table>';</strong>
<strong>?></strong>
<strong></body></strong>
<strong></html></strong>
<strong>.reds {color:#f30;}</strong>
<strong>.blue {color:#0000cc;}</strong>
<strong>.green {color:#0f0;}</strong>
In the folder /usr/local/www/wifi we will create file named .htaccess and add the following lines.
<strong>AuthName "Soft Admin"</strong>
<strong>AuthType Basic</strong>
<strong>Require valid-user</strong>
We create user name and password in /usr/local/www/wifi folder:
– Write admin username and freebsd password in .htpasswd file
-b take username and password from the command line.
-c –Create the file which is shown and add to it(if it exists,it will remove and rewrite)
To check users limits we will add cron file our global /etc/crontab configuration file. This will check users each 1 minutes interval.
# <strong>/etc/rc.d/cron restart</strong>
/usr/local/www/wifi/admin.css file’s content will be as follows(This file set the pictures which are in background). But the pictures is read from /usr/local/www/wifi/img/ folder. Pictures are /usr/local/www/wifi/img/gp.gif and /usr/local/www/wifi/img/logo.png (You can change these pictures to anywhere you want):
<strong>.login .form {margin:120px 0 0 450px;}</strong>
<strong>.login .form p {position:relative; margin:0 0 30px 0;}</strong>
<strong>.login .form label {font:normal 18px arial; position:absolute; margin:3px 0 0 0; color:#aaa;}</strong>
<strong>.login .form input {margin:0 0 0 100px; padding:2px; font:normal 18px arial;}</strong>
<strong>.login .form input.text {border-right:solid 1px #ccc; border-bottom:solid 1px #ccc; border-left:solid 1px #888; border-top:solid 1px #888;}</strong>
<strong>.login .rules {padding:10px 20px; margin:50px 30px; background:url(img/gp.gif) 420px 20px no-repeat #ececec;}</strong>
<strong>h1 {margin:10px 0; font:normal 20px tahoma; color:#c00;}</strong>
<strong>ol {margin:20px 0 0 30px; padding:0;}</strong>
<strong>ol li {margin:0 0 10px 15px; font: normal 16px arial; }</strong>
We update all authorites in the folder, in order to set to all new files:
As we enter the page We will be asked for username and password(we type admin username and password that we created before and then push enter):
The administrator interface will be as follows:
The user interface will be so:
The source of used PHP codes is from http://lissyara.su
You can download source codes from here