commit 15a736b810e64381319d1e94cd45ad017e0c1508
Author: david Activar tu cuenta
+
+
+ + + \ No newline at end of file diff --git a/admin/adduser.php b/admin/adduser.php new file mode 100644 index 0000000..bec2f2d --- /dev/null +++ b/admin/adduser.php @@ -0,0 +1,160 @@ + + +//prevents caching +header("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); +header("Cache-Control: post-check=0, pre-check=0",false); +session_cache_limiter(); + +session_start(); + +//require the config file +require ("../config.php"); +require ("../functions.php"); + +if ($page == ""){$page = 1;} +if ($max_results == ""){$max_results = 5;} + + +//check required fields +if (($_POST[username] == "")) +{ + echo "The Username Field can not be left blank. Please Go Back and re-enter the information"; + exit; +} + + + +//check the password length +$pass_len = password_check($min_pass, $max_pass, $_POST[password]); +if ($pass_len == "no") +{ + + + echo "You must use a password between $min_pass and $max_pass characters in length, please Go Back and try again.
"; + exit; +} + +//check for authority to view this page +if (allow_access(Administrators) != "yes") +{ + echo "not authorized to perform this function"; +} + +//make the connection to the database +$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error()); +$db = @mysql_select_db($db_name,$connection)or die(mysql_error()); + +//make query to database +$sql ="SELECT * FROM $table_name WHERE username= '$_POST[username]'"; +$result = @mysql_query($sql,$connection) or die(mysql_error()); + +//get the number of rows in the result set +$num = mysql_num_rows($result); + +//check if that username already exists +if ($num != 0){ + +echo "Sorry, that username already exists.
"; +echo ""; +echo "$_POST[username]"; +exit; + +}else{ + +//or add it to the database +$sql_add = "INSERT INTO $table_name (firstname, lastname, username, password, group1, group2, group3, + pchange, email, redirect, verified, last_login) VALUES + ('$_POST[firstname]', '$_POST[lastname]', '$_POST[username]', password('$_POST[password]'), + '$_POST[group1]', '$_POST[group2]', '$_POST[group3]', '$_POST[pchange]', '$_POST[email]', + '$_POST[redirect]', '1', 'last_login()')"; + +$result = @mysql_query($sql_add,$connection) or die(mysql_error()); +} + +if ($_POST[email_user] == "Yes") +{ + $mailheaders = "From: $domain\n"; + $mailheaders .= "Dear $_POST[firstname] $_POST[lastname],\n"; + $mailheaders .= "\n"; + $mailheaders .= "An account has been created for you at $domain.\n"; + $mailheaders .= "Please log in with the following account information:\n"; + $mailheaders .= "Username: $_POST[username]\n"; + $mailheaders .= "Password: $_POST[password]\n"; + $mailheaders .= "\n"; + $mailheaders .= "Please login at:\n"; + $mailheaders .= "$base_dir/login.html\n"; + $mailheaders .= "Should you have any complications, please email the System Administrator at:\n"; + $mailheaders .= "$adminemail\n"; + + $to = "$_POST[email]"; + $subject = "Your account has been created !!"; + + mail($to, $subject, $mailheaders, "From: No Reply <$adminemail>\n"); + +} +?> + + + + + + + + +User Added:
+| First Name: | ++ |
| Last Name: | ++ |
| Username: | ++ |
| Password: | ++ |
| E-Mail: | ++ | Group Memberships: | ++ + |
| + | + |
| + | + |
| Redirect to: | ++ |
| Password Change Req'd: | ++ |
| User E-Mailed: | ++ |
+
"; + while ($sql = mysql_fetch_object($result)) + { + $e_addr = $sql -> email; + $e_user = $sql -> username; + $subject = $_POST[e_subject]; + $mailheaders = $_POST[e_message]; + mail($e_addr, $subject, $mailheaders, "From: No Reply <$adminemail>\n"); + echo "$e_user "; + } + +?> \ No newline at end of file diff --git a/admin/mod_user.php b/admin/mod_user.php new file mode 100644 index 0000000..921b2c9 --- /dev/null +++ b/admin/mod_user.php @@ -0,0 +1,264 @@ + firstname; + $last = $sql -> lastname; + $uname = $sql -> username; + $pass = $sql -> password; + $gr1 = $sql -> group1; + $gr2 = $sql -> group2; + $gr3 = $sql -> group3; + $change = $sql -> pchange; + $e_mail = $sql -> email; + $re_direct = $sql -> redirect; + $ver_d = $sql -> verified; + $last_log = $sql -> last_login; + $del_dat = last_login(); + } + + $trash_user = "INSERT INTO trash (firstname, lastname, username, password, group1, group2, group3, + pchange, email, redirect, verified, last_login, del_date)VALUES + ('$first', '$last', '$uname', '$pass', '$gr1', '$gr2', '$gr3', + '$change', '$e_mail', '$re_direct', '$ver_d', '$last_log', '$del_dat')"; + + $del = "DELETE FROM $table_name WHERE username = '$_POST[del_user]'"; + + $result = @mysql_query($del,$connection) or die(mysql_error()); + $result1 = @mysql_query($trash_user,$connection) or die(mysql_error()); + + $msg .= "User $_POST[del_user] has been trashed from the database. "; + }else{ + $msg .= "User $_POST[del_user] could not be located in the database. "; + } + + $del_banned = "DELETE FROM banned WHERE no_access = '$_POST[del_user]'"; + $result = @mysql_query($del_banned,$connection) or die(mysql_error()); + + +} + +if (($_POST[username] != "") && ($_POST[mod_pass] == "Same as Old")) +{ +$sql = "SELECT * FROM $table_name WHERE username = '$_POST[username]'"; +$result = @mysql_query($sql,$connection) or die(mysql_error()); +while ($sql = mysql_fetch_object($result)) + { + $pass = $sql -> password; + $last = $sql -> last_login; + } + $sql = "DELETE FROM $table_name WHERE username = '$_POST[username]'"; + $result = @mysql_query($sql,$connection) or die(mysql_error()); + $sql = "INSERT INTO $table_name (firstname, lastname, username, password, group1, group2, group3, + pchange, email, redirect, verified, last_login) VALUES ('$_POST[mod_first]', '$_POST[mod_last]', + '$_POST[username]', '$pass', '$_POST[mod_group1]', '$_POST[mod_group2]', + '$_POST[mod_group3]', '$_POST[mod_chng]', '$_POST[mod_email]', '$_POST[mod_redirect]', + '1', '$last')"; + $result = @mysql_query($sql,$connection) or die(mysql_error()); + $msg .= "The information for $_POST[username] has been changed updated. "; +} + +if (($_POST[username] != "") && ($_POST[mod_pass] != "Same as Old")) +{ +$sql = "SELECT * FROM $table_name WHERE username = '$_POST[username]'"; +$result = @mysql_query($sql,$connection) or die(mysql_error()); +while ($sql = mysql_fetch_object($result)) + { + $pass = $sql -> password; + $last = $sql -> last_login; + } + $sql = "DELETE FROM $table_name WHERE username = '$_POST[username]'"; + $result = @mysql_query($sql,$connection) or die(mysql_error()); + $sql = "INSERT INTO $table_name (firstname, lastname, username, password, group1, group2, group3, + pchange, email, redirect, verified, last_login) VALUES ('$_POST[mod_first]', '$_POST[mod_last]', + '$_POST[username]', password('$_POST[mod_pass]'), '$_POST[mod_group1]', '$_POST[mod_group2]', + '$_POST[mod_group3]', '$_POST[mod_chng]', '$_POST[mod_email]', '$_POST[mod_redirect]', + '1', '$last')"; + $result = @mysql_query($sql,$connection) or die(mysql_error()); + $msg .= "The information for $_POST[username] has been changed updated. "; +} + +if ($_POST[ban_user] != "") +{ + + $ban = "INSERT INTO banned (no_access, type) VALUES ('$_POST[ban_user]', 'user')"; + $result = @mysql_query($ban,$connection) or die(mysql_error()); + $msg .= "User $_POST[ban_user] has been banned. "; + +} + +$ip_addr = "$_POST[oct1].$_POST[oct2].$_POST[oct3].$_POST[oct4]"; + +if ($ip_addr != "...") +{ + $ban_ip = "INSERT INTO banned (no_access, type) VALUES ('$ip_addr', 'ip')"; + $result = @mysql_query($ban_ip,$connection) or die(mysql_error()); + $msg .= "IP Address $ip_addr has been banned. "; +} + +if ($_POST[lift_user_ban] != "") +{ + + $lift_user = "DELETE FROM banned (no_access, type) WHERE no_access = '$_POST[lift_user_ban]'"; + $result = @mysql_query($lift_user,$connection) or die(mysql_error()); + $msg .= "The Ban for user $_POST[lift_user_ban] has been lifted. "; + +} + +if ($_POST[lift_ip_ban] != "") +{ + + $lift_ip = "DELETE FROM banned (no_access, type) WHERE no_access = '$_POST[lift_ip_ban]'"; + $result = @mysql_query($lift_ip,$connection) or die(mysql_error()); + $msg .= "The Ban for IP Address $_POST[lift_ip_ban] has been lifted. "; + +} + +if ($_POST[restore] != "") +{ + $ruser = "SELECT * FROM trash WHERE username = '$_POST[restore]'"; + + $result0 = @mysql_query($ruser, $connection) or die(mysql_error()); + + //get the number of rows in the result set + $num = mysql_num_rows($result0); + + //set session variables if there is a match + if ($num != 0) + { + while ($ruser = mysql_fetch_object($result0)) + { + $rfirst = $ruser -> firstname; + $rlast = $ruser -> lastname; + $runame = $ruser -> username; + $rpass = $ruser -> password; + $rgr1 = $ruser -> group1; + $rgr2 = $ruser -> group2; + $rgr3 = $ruser -> group3; + $rchange = $ruser -> pchange; + $re_mail = $ruser -> email; + $rre_direct = $ruser -> redirect; + $rver_d = $ruser -> verified; + $rlast_log = $ruser -> last_login; + } + + $r_user = "INSERT INTO $table_name (firstname, lastname, username, password, group1, group2, group3, + pchange, email, redirect, verified, last_login) VALUES + ('$rfirst', '$rlast', '$runame', '$rpass', '$rgr1', '$rgr2', '$rgr3', + '$rchange', '$re_mail', '$rre_direct', '$rver_d', '$rlast_log')"; + + $del = "DELETE FROM trash WHERE username = '$_POST[restore]'"; + + $result = @mysql_query($del,$connection) or die(mysql_error()); + $result1 = @mysql_query($r_user,$connection) or die(mysql_error()); + + $msg .= "User $_POST[restore] has been restored. "; + }else{ + $msg .= "User $_POST[restore] could not be located in the database. "; + } +} + +if ($_POST[empt_trash] == "yes") +{ + + $empty = "DELETE FROM trash"; + $gone = @mysql_query($empty, $connection) or die(mysql_error()); + + $msg .= "The trash has been emptied. "; +} + +if ($_POST[amt_time] != "" && $_POST[incr_time] != "") +{ + $msg .= "The following accounts were inactive for $amt_time $incr_time or more and have been moved to the trash. "; + $killtime = "NOW() - INTERVAL $_POST[amt_time] $_POST[incr_time]"; + $xfer = "SELECT * FROM $table_name WHERE last_login < $killtime"; + $resultp1 = @mysql_query($xfer, $connection) or die(mysql_error()); + while ($xfer = mysql_fetch_object($resultp1)) + { + $pfirst = $xfer -> firstname; + $plast = $xfer -> lastname; + $puname = $xfer -> username; + $ppass = $xfer -> password; + $pgr1 = $xfer -> group1; + $pgr2 = $xfer -> group2; + $pgr3 = $xfer -> group3; + $ppchange = $xfer -> pchange; + $pe_mail = $xfer -> email; + $pre_direct = $xfer -> redirect; + $pver_d = $xfer -> verified; + $plast_log = $xfer -> last_login; + $pdel_date = last_login(); + + $msg .= "$puname "; + $xfer2 = "INSERT INTO trash (firstname, lastname, username, password, group1, group2, group3, + pchange, email, redirect, verified, last_login, del_date) VALUES ('$pfirst', ' $plast', '$puname', + '$ppass', '$pgr1', '$pgr2', '$pgr3', '$ppchange', '$pe_mail', '$pre_direct', '$pver_d', '$plast_log', '$pdel_date')"; + $resultp2 = @mysql_query($xfer2, $connection) or die(mysql_error()); + } + $purge = "DELETE FROM $table_name WHERE last_login < $killtime"; + $resultp3 = @mysql_query($purge, $connection) or die(mysql_error()); + +} + + +echo ""; + +echo $msg; + +if ($_POST[username] == $_SESSION[user_name]) +{ +session_destroy(); +echo ""; +echo ""; +echo ""; +echo " YOU'VE BEEN BANNED + + + + diff --git a/check_login.php b/check_login.php new file mode 100644 index 0000000..49f3464 --- /dev/null +++ b/check_login.php @@ -0,0 +1,23 @@ + + +session_start(); + +//check to see if the user already has an open session +if (($_SESSION[user_name] != "") && ($_SESSION[password] != "")) +{ + header("Location:$_SESSION[redirect]"); + exit; +} + +//check to see if cookies have been set previously +if(($lr_user != "") && ($lr_pass != "")) +{ + header("Location:redirect.php"); + exit; +} + +//if neither is true, redirect to login + header("Location:login.html"); + + +?> diff --git a/config.php b/config.php new file mode 100644 index 0000000..2180e97 --- /dev/null +++ b/config.php @@ -0,0 +1,46 @@ + + +//set up the names of the database and table +$db_name ="dqxjaadh_factoriaverde"; +$table_name ="authorize"; + +//connect to the server and select the database +$server = "localhost"; +$dbusername = "dqxjaadh_factori"; +$dbpassword = "q3gm78v69f"; + +//domain information +$domain = ".lafactoriaverde.es"; + +//Change to "0" to turn off the login log +$log_login = "1"; + +//base_dir is the location of the files, ie http://www.yourdomain/login +$base_dir = "http://www.rodax-software.net/lafactoriaverde.es/"; + +//length of time the cookie is good for - 7 is the days and 24 is the hours +//if you would like the time to be short, say 1 hour, change to 60*60*1 +$duration = time()+(60*60*24*30); + +//the site administrator\'s email address +$adminemail = "info@rodax-software.com"; + +//sets the time to EST +$zone=3600*+1; + +//do you want the verify the new user through email if the user registers themselves? +//yes = "0" : no = "1" +$verify = "0"; + +//default redirect, this is the URL that all self-registered users will be redirected to +$default_url = "http://www.rodax-software.net/lafactoriaverde.es/"; + +//minimum and maximum password lengths +$min_pass = 4; +$max_pass = 8; + + +$num_groups = 0+2; +$group_array = array("Usuarios","Administradores"); + +?> \ No newline at end of file diff --git a/email_change.html b/email_change.html new file mode 100644 index 0000000..415b573 --- /dev/null +++ b/email_change.html @@ -0,0 +1,34 @@ + + + + +Request Your Username & Password+ + + \ No newline at end of file diff --git a/emailpass.php b/emailpass.php new file mode 100644 index 0000000..ad5af9e --- /dev/null +++ b/emailpass.php @@ -0,0 +1,83 @@ + + +//prevents caching +header("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); +header("Cache-Control: post-check=0, pre-check=0",false); +session_cache_limiter(); + +session_start(); + +//require the config file +require ("config.php"); + +//make the connection to the database +$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error()); +$db = @mysql_select_db($db_name,$connection)or die(mysql_error()); + +//build and issue the query +$sql ="SELECT * FROM $table_name WHERE email = '$_POST[email]'"; +$result = @mysql_query($sql,$connection) or die(mysql_error()); + +//get the number of rows in the result set +$num = mysql_num_rows($result); + +//If match was found, get username and email from database +if ($num != 0) +{ + while ($sql = mysql_fetch_object($result)) + { + $email = $sql -> email; + $uname = $sql -> username; + } + +//Update database with new password + $newpass = rand(10000000,99999999); + $chng = "UPDATE $table_name SET + password = password('$newpass'), pchange = '1' + WHERE email = '$email'"; + + $result2 = @mysql_query($chng,$connection) or die(mysql_error()); + +//create message to user + $msg = "Your username & temporary password has been emailed to you. "; + $msg .= "You must change this password immediately after your next login. "; + $msg .= ""; + $msg .= ""; + +//create mail message + $mailheaders = "From: www$domain\n"; + $mailheaders .= "Your username is $uname.\n"; + $mailheaders .= "Your password is $newpass.\n"; + $mailheaders .= "$base_dir/login.html"; +} +else +{ + +//If no email was found in the database send a notification to the admin + $email = $adminemail; + $msg = "Your email address could not be located "; + $msg .="The Website Administrator has been emailed, you should contacted by them shortly. "; + + $mailheaders = "From: www$domain\n"; + $mailheaders .= "A user with the email address of $_POST[email] has requested a username and password reminder.\n"; + $mailheaders .= "$_POST[email] could not be located in the database.\n"; +} + +//Email the request +$to = "$email"; +$subject = "Your Username & Password for www$domain"; + +mail($to, $subject, $mailheaders, "From: No Reply <$adminemail>\n"); + +?> + + +There was an error logging you +in, please try again...+ ++Click here if would like your username and password to be +e-mailed to the address we have on file. + + \ No newline at end of file diff --git a/favorites/edit_links.php b/favorites/edit_links.php new file mode 100644 index 0000000..30477c6 --- /dev/null +++ b/favorites/edit_links.php @@ -0,0 +1,86 @@ + + + + + + +"; +} + +?> diff --git a/favorites/make_favorites.php b/favorites/make_favorites.php new file mode 100644 index 0000000..4b03caa --- /dev/null +++ b/favorites/make_favorites.php @@ -0,0 +1,37 @@ +Your Favorites table has been created. "; +} + +?> + + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..a0b936b --- /dev/null +++ b/functions.php @@ -0,0 +1,80 @@ + firstname; + $_SESSION[last_name] = $sql -> lastname; + $_SESSION[user_name] = $sql -> username; + $_SESSION[password] = $sql -> password; + $_SESSION[group1] = $sql -> group1; + $_SESSION[group2] = $sql -> group2; + $_SESSION[group3] = $sql -> group3; + $_SESSION[pchange] = $sql -> pchange; + $_SESSION[email] = $sql -> email; + $_SESSION[redirect] = $sql -> redirect; + $_SESSION[verified] = $sql -> verified; + $_SESSION[last_login] = $sql -> last_login; + } + }else{ + $_SESSION[redirect] = "$base_dir/errorlogin.html"; + } +} + +//functions that will determine if access is allowed +function allow_access($group) +{ + if ($_SESSION[group1] == "$group" || $_SESSION[group2] == "$group" || $_SESSION[group3] == "$group" || + $_SESSION[group1] == "Administrators" || $_SESSION[group2] == "Administrators" || $_SESSION[group3] == "Administrators" || + $_SESSION[user_name] == "$group") + { + $allowed = "yes"; + }else{ + $allowed = "no"; + } + return $allowed; +} + +//function to check the length of the requested password +function password_check($min_pass, $max_pass, $pass) +{ + + $valid = "yes"; + if ($min_pass > strlen($pass) || $max_pass < strlen($pass)) + { + $valid = "no"; + } + + return $valid; +} + +?> \ No newline at end of file diff --git a/images/lr_13_header_01.gif b/images/lr_13_header_01.gif new file mode 100644 index 0000000..67ed83e Binary files /dev/null and b/images/lr_13_header_01.gif differ diff --git a/images/lr_13_header_02.gif b/images/lr_13_header_02.gif new file mode 100644 index 0000000..b1d7259 Binary files /dev/null and b/images/lr_13_header_02.gif differ diff --git a/images/lr_13_header_03.gif b/images/lr_13_header_03.gif new file mode 100644 index 0000000..ca476ee Binary files /dev/null and b/images/lr_13_header_03.gif differ diff --git a/images/lr_13_header_04.gif b/images/lr_13_header_04.gif new file mode 100644 index 0000000..6f1c76b Binary files /dev/null and b/images/lr_13_header_04.gif differ diff --git a/images/lr_13_header_05.gif b/images/lr_13_header_05.gif new file mode 100644 index 0000000..b0cd857 Binary files /dev/null and b/images/lr_13_header_05.gif differ diff --git a/images/lr_13_header_06.gif b/images/lr_13_header_06.gif new file mode 100644 index 0000000..3037411 Binary files /dev/null and b/images/lr_13_header_06.gif differ diff --git a/images/mpdolan_logo.gif b/images/mpdolan_logo.gif new file mode 100644 index 0000000..32f84d4 Binary files /dev/null and b/images/mpdolan_logo.gif differ diff --git a/images/mpdolan_logo_bottom.gif b/images/mpdolan_logo_bottom.gif new file mode 100644 index 0000000..92d8cc6 Binary files /dev/null and b/images/mpdolan_logo_bottom.gif differ diff --git a/images/mpdolan_logo_top.gif b/images/mpdolan_logo_top.gif new file mode 100644 index 0000000..76e672c Binary files /dev/null and b/images/mpdolan_logo_top.gif differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..c10d867 --- /dev/null +++ b/index.html @@ -0,0 +1,312 @@ + + + + + +
This script is not only a secure login script, +it also allows great control and can be integrated easily into most sites as +well as the following features: +Redirection based on the users login information Requirements:
* - indicates that this page is customizable How-to restrict access to your pages: For a more precise sample of the code you should +use, please Click Here. +That should do it... + + + + diff --git a/install/create_admin.php b/install/create_admin.php new file mode 100644 index 0000000..5a19d7f --- /dev/null +++ b/install/create_admin.php @@ -0,0 +1,61 @@ + + +session_start(install); + +include ('../config.php'); + +?> + + + + + + +Create Your Administrator Account: + + + + + \ No newline at end of file diff --git a/install/header.html b/install/header.html new file mode 100644 index 0000000..6922291 --- /dev/null +++ b/install/header.html @@ -0,0 +1,31 @@ + + + + +
+ + + + diff --git a/install/install_1.php b/install/install_1.php new file mode 100644 index 0000000..51d562c --- /dev/null +++ b/install/install_1.php @@ -0,0 +1,70 @@ +"; +include ('header.html'); + +if (!$_POST[dbase_name] || !$_POST[dbase_server] || !$_POST[dbase_username] || !$_POST[dbase_password] || + !$_POST[install_dir] || !$_POST[time_zone] || + !$_POST[default_url] || !$_POST[min_pass_len] || !$_POST[max_pass_len] || !$_POST[dom_name] || !$_POST[admin_email]) +{ + echo " You must complete all of the fields, please Go Back and complete all of the fields. "; + exit; +} + + +?> + + + + + + + ++(Do not use Administrators or Users as a Group Name as there are pre-configured groups) + + + + + + \ No newline at end of file diff --git a/install/install_2.php b/install/install_2.php new file mode 100644 index 0000000..f3b84ab --- /dev/null +++ b/install/install_2.php @@ -0,0 +1,233 @@ +"; + +include ('header.html'); + +$group_array = array(); + +$i = 1; +while ($i <= $_SESSION[group_number]) +{ + $group = "group$i"; + array_push($group_array, "$_POST[$group]"); + $i++; +} + +$i = 1; + +//test connection to dbase verifing dbase name, server, username and password + +$connection = @mysql_connect($_SESSION[dbase_server], $_SESSION[dbase_username], $_SESSION[dbase_password]) + or die(mysql_error()); + +$db = @mysql_select_db($_SESSION[dbase_name],$connection) + or die(mysql_error()); + +//create a message to be displayed at the end of the installation +if ($db) +{ + echo "Connection to Database $_SESSION[dbase_name] Successful. "; +}else{ + echo " There was an error connecting to the database. "; + echo "Please go back and check your Database information. "; + exit; +} + +//create a table in that dbase +$sql =" +CREATE TABLE IF NOT EXISTS $_SESSION[table_name] +( + firstname VARCHAR(20), + lastname VARCHAR(20), + username VARCHAR(20), + password VARCHAR(50), + group1 VARCHAR(20), + group2 VARCHAR(20), + group3 VARCHAR(20), + pchange VARCHAR(1), + email VARCHAR(100), + redirect VARCHAR(100), + verified VARCHAR(1), + last_login DATE +)"; + +$result = @mysql_query($sql,$connection) + or die(mysql_error()); + +if ($result) +{ + echo "Table $_SESSION[table_name] has been created."; +}else{ + echo " There was an error creating the table. "; + echo "Please go back and check your information. "; + exit; +} + +//create a table in that dbase +$sql_log =" +CREATE TABLE IF NOT EXISTS log_login +( + username VARCHAR(20), + date VARCHAR(20), + time VARCHAR(20), + ip_addr VARCHAR(20), + oper_sys VARCHAR(20), + brow VARCHAR(20) +) +"; + +$result_log = @mysql_query($sql_log,$connection) + or die(mysql_error()); + +if ($result_log) +{ + echo "Table log_login has been created."; +}else{ + echo " There was an error creating the table. "; + echo "Please go back and check your information. "; + exit; +} + +//create a table in that dbase +$sql_ban =" +CREATE TABLE IF NOT EXISTS banned +( + no_access VARCHAR(30), + type VARCHAR(10) +) +"; + +$result_ban = @mysql_query($sql_ban,$connection) + or die(mysql_error()); + +if ($result_ban) +{ + echo "Table banned has been created."; +}else{ + echo " There was an error creating the table. "; + echo "Please go back and check your information. "; + exit; +} + +//create a table in that dbase +$sql_trash =" +CREATE TABLE IF NOT EXISTS trash +( + firstname VARCHAR(20), + lastname VARCHAR(20), + username VARCHAR(20), + password VARCHAR(50), + group1 VARCHAR(20), + group2 VARCHAR(20), + group3 VARCHAR(20), + pchange VARCHAR(1), + email VARCHAR(100), + redirect VARCHAR(100), + verified VARCHAR(1), + last_login DATE, + del_date DATE + ) +"; + +$result_trash = @mysql_query($sql_trash,$connection) + or die(mysql_error()); + +if ($result_trash) +{ + echo "Table trash has been created."; +}else{ + echo " There was an error creating the table. "; + echo "Please go back and check your information. "; + exit; +} + + +?> + + + + + + +
You must use a password between $_SESSION[min_pass_len] and $_SESSION[max_pass_len] characters in length, please Go Back and try again. "; + exit; +} + +//make connection to dbase +$connection = @mysql_connect($_SESSION[dbase_server], $_SESSION[dbase_username], $_SESSION[dbase_password]) + or die(mysql_error()); + +$db = @mysql_select_db($_SESSION[dbase_name],$connection) + or die(mysql_error()); + +$check_name = "SELECT * FROM $_SESSION[table_name] WHERE username = '$_POST[user_name]'"; +$name_result = @mysql_query($check_name,$connection) or die(mysql_error()); + +//get the number of rows in the result set +$num = mysql_num_rows($name_result); + +if ($num != 0) +{ + echo "That username already exists. Please Go Back and enter a different username. "; + exit; +} + +$date = last_login(); + +//enter information into table +$sql = "INSERT INTO $_SESSION[table_name] VALUES + ('$_POST[first_name]', '$_POST[last_name]', '$_POST[user_name]', + password('$_POST[password]'), 'Administrators', '', '', '0', '$_SESSION[admin_email]', + '$_POST[redirect_to]', '1', '$date')"; + +$result = @mysql_query($sql,$connection) or die(mysql_error()); + +if($result) +{ +?> + + + + + +The last step is to create a file named config.php. For a sample of the header of each secure page, please Click Here "; + echo "Should you have any difficulties, please visit the Help Forum:";
+ echo " Please login as with the Adminstrator's Account to complete testing.";
+ echo " "; +} + + +?> + + \ No newline at end of file diff --git a/install/message.php b/install/message.php new file mode 100644 index 0000000..5c4b586 --- /dev/null +++ b/install/message.php @@ -0,0 +1,21 @@ + + +session_start(install); + +?> + + + + + + + + + + + \ No newline at end of file diff --git a/install/sessions.php b/install/sessions.php new file mode 100644 index 0000000..3963ed0 --- /dev/null +++ b/install/sessions.php @@ -0,0 +1,11 @@ + +session_start(install); + +echo $_SESSION[dbase_name]; +echo $_SESSION[dbase_server]; +echo $_SESSION[dbase_username]; +echo $_SESSION[dbase_password]; +echo $_SESSION[table_name]; +echo $_SESSION[install_dir]; + +?> \ No newline at end of file diff --git a/login.html b/login.html new file mode 100644 index 0000000..b00df9a --- /dev/null +++ b/login.html @@ -0,0 +1,24 @@ + + +Login to Secure Area+ ++Click here if would like your username and password to be +e-mailed to the address we have on file. + + \ No newline at end of file diff --git a/loglogin.php b/loglogin.php new file mode 100644 index 0000000..ad078fa --- /dev/null +++ b/loglogin.php @@ -0,0 +1,60 @@ + + +session_start(); + +//include config file +include ('config.php'); + +//sets date and time variables +$last = gmdate("Y-m-d"); +$time = gmdate("H:i", time() + $zone); + +$viewer = $HTTP_USER_AGENT; + +//checks to see if the browser the user is using is determinable +$browser = "unknown"; +if (preg_match("/Netscape/", $viewer)) +{ + $browser = "Netscape"; +} +else if (preg_match("/Opera/", $viewer)) +{ + $browser = "Opera"; +}else if (preg_match("/Firefox/", $viewer)) +{ + $browser = "FireFox"; +}else if (preg_match("/MSIE/", $viewer)) +{ + $browser = "Internet Explorer"; +} + +//checks to see if the OS the user is using is determinable +$platform = "unknown"; +if (preg_match("/Windows NT/", $viewer)) +{ + $platform = "Windows"; +} +else if (preg_match("/Windows CE/", $viewer)) +{ + $platform = "Windows PPC"; +} +else if (preg_match("/Linux/", $viewer)) +{ + $platform = "Linux"; +} +else if (preg_match("/Mac/", $viewer)) +{ + $platform = "MAC"; +} + +//make the connection to the database +$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error()); +$db = @mysql_select_db($db_name,$connection)or die(mysql_error()); + +//build and issue the query +$sql ="INSERT INTO log_login VALUES + ('$_SESSION[user_name]', '$last', '$time', '$REMOTE_ADDR', '$platform', '$browser')"; +$result = @mysql_query($sql,$connection) or die(mysql_error()); + + +?> \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..64e146c --- /dev/null +++ b/logout.php @@ -0,0 +1,13 @@ + +include ("config.php"); + +//destroys the session, the variables are not longer set +session_start(); +session_destroy(); + +?> + + + + + diff --git a/logs/index.php b/logs/index.php new file mode 100644 index 0000000..e6451dc --- /dev/null +++ b/logs/index.php @@ -0,0 +1,34 @@ + + + + + + +
Usuario: $user Please login with proper +credentials: + ++ + + + diff --git a/not_activated.html b/not_activated.html new file mode 100644 index 0000000..6025afb --- /dev/null +++ b/not_activated.html @@ -0,0 +1,15 @@ + + + + + Your account must be activated before you can log in, please visit the +activation page that was included in the email we sent you. + + + + diff --git a/pass_change.html b/pass_change.html new file mode 100644 index 0000000..b8a936b --- /dev/null +++ b/pass_change.html @@ -0,0 +1,36 @@ + + + + ++Register+ + + \ No newline at end of file diff --git a/register.php b/register.php new file mode 100644 index 0000000..6052112 --- /dev/null +++ b/register.php @@ -0,0 +1,98 @@ + + +//prevents caching +header("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); +header("Cache-Control: post-check=0, pre-check=0",false); +session_cache_limiter(); + +session_start(); + +//require the config file +require ("config.php"); +require ("functions.php"); + +//checks password length +if (password_check($min_pass, $max_pass, $_POST[password]) == "no") +{ +?> + + + + + +Sorry, that username already exists. "; +echo ""; +exit; + +}else{ +$sql = "INSERT INTO $table_name VALUES +('$_POST[firstname]', '$_POST[lastname]', '$_POST[username]', password('$_POST[password]'), 'Users', '', '', '$pchange', +'$_POST[email]', '$default_url', '$verify', '')"; + +$result = @mysql_query($sql,$connection) or die(mysql_error()); +} + +//checks to see if the user needs to verify their email address before accessing the site +if ($verify == "0") +{ + $mailheaders = "From: www$domain\n"; + $mailheaders .= "Your account has been created.\n"; + $mailheaders .= "Please activate your account now by visiting this page:\n"; + $mailheaders .= "$base_dir/activate.html\n"; + + + $to = "$_POST[email]"; + $subject = "Please activate your account"; + +mail($to, $subject, $mailheaders, "From: No Reply <$adminemail>\n"); + +}else{ + header('Location:login.html'); +} + + + +?> + + + +Please check your email to activate your account.+ + \ No newline at end of file diff --git a/smpl_sec_header.php b/smpl_sec_header.php new file mode 100644 index 0000000..0932284 --- /dev/null +++ b/smpl_sec_header.php @@ -0,0 +1,51 @@ ++//prevents caching +header(\"Expires: Sat, 01 Jan 2000 00:00:00 GMT\"); +header(\"Last-Modified: \".gmdate(\"D, d M Y H:i:s\").\" GMT\"); +header(\"Cache-Control: post-check=0, pre-check=0\",false); +session_cache_limiter(); +session_start(); + "; + +if (preg_match("/Windows NT/", $viewer)) +{ + echo "require('$abs\config.php'); + + require('$abs\functions.php'); + "; +} +else +{ + echo "require('$abs/config.php'); + + require('$abs/functions.php'); + "; +} + +echo " +//this is group name or username of the group or person that you wish to allow access to +// - please be advise that the Administrators Groups has access to all pages. +if (allow_access(Administrators) != \"yes\") +{ +"; +if (preg_match("/Windows NT/", $viewer)) +{ + echo " + include ('$abs\\no_access.html'); + "; +} +else +{ + echo "include ('$abs/no_access.html'); "; +} +echo " +exit; +} +?>"; + +?> diff --git a/style.css b/style.css new file mode 100644 index 0000000..9fb19af --- /dev/null +++ b/style.css @@ -0,0 +1,72 @@ +body { + font-family: Verdana; + font-size: 11px; +} + +a:hover { + color: #0000ff; + font-family: Tahoma; + text-decoration: underline overline; +} + +a:visited, a:active { + color: #0000ff; + font-family: Tahoma; + text-decoration: none; +} + +a:link { + color: #0000ff; + font-family: Tahoma; + text-decoration: overline underline; +} + +td { + font-family: Verdana; + font-size: 8pt; +} + +a { + font-family: Tahoma; +} + +h1 { + font-family: Tahoma; +} + +h2 { + font-family: Tahoma; +} + +h3 { + font-family: Tahoma; +} + +h4 { + font-family: Tahoma; +} + +h5 { + font-family: Tahoma; +} + +h6 { + font-family: Tahoma; +} + +p { + font-family: Tahoma; +} + +tr { + font-family: Tahoma; +} + + | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||