5 LIMIT 1") or die(mysql_error()); $valid = mysql_num_rows($check); if(!empty($form_name) && !empty($form_pass)){ if($valid > 0){ $row = mysql_fetch_assoc($check); $_SESSION['acp'] = true; $_SESSION['hkusername'] = $row['name']; $_SESSION['hkpassword'] = $form_pass; $my_id = $row['id']; // Log them in on the site as well if needed if(!session_is_registered(username)){ $_SESSION['username'] = $row['name']; $_SESSION['password'] = $form_pass; } header("Location: index.php?p=dashboard"); mysql_query("INSERT INTO system_stafflog (action,message,note,userid,targetid,timestamp) VALUES ('Housekeeping','".$_SESSION['hkusername']." authenticated from ".$remote_ip."','login.php','".$my_id."','','".$date_full."')") or die(mysql_error()); exit; } else { $msg = "Invalid username, password, or access level."; } } else { $msg = "Please fill in all fields."; } } elseif($notify_logout == true){ $msg = "You have been logged out successfully."; } else { $msg = "No housekeeping session found."; } include('subheader.php'); ?>
|
|