<?php
// Error Message, copyright 2012-2018, Silver Dolphin Solutions, LLC, Ed Lemmers
// For licensing, see license.txt.

	$doc_root = $_SERVER['DOCUMENT_ROOT'];
	if (file_exists("../connect/config.php"))	// Default installation
		$connect_path = "../connect/";
	elseif (file_exists($doc_root . "/connect/config.php"))	// Custom userfile folders
		$connect_path = $doc_root . "/connect/";
	else	{	// Must be installeed in sub domain or sub folder with non-standard userfile folders.
		$php_self = $_SERVER["PHP_SELF"];
		$self_parts = explode('/', $php_self);
		$this_script = $self_parts[count($self_parts) - 1];
		$sub_dir = str_replace(array($doc_root, $this_script), "", $php_self);
		$sub_dir_parts = explode('/', $sub_dir);
		$connect_path = $doc_root . '/' . $sub_dir_parts[0] . "/connect/";
	}
	include($connect_path . "config.php");
	include($connect_path . "db_connect.php");
	
	if (BWB_BASE_DIR == "")
		$rel_path = "/";
	else
		$rel_path = "/" . BWB_BASE_DIR . "/";
		
	$query = "SELECT title FROM " . BWB_TABLE_PREFIX . "page_titles WHERE page_name='_default_'";
	$result = $bwb_dbh->query($query);
	$row = $result->fetch(PDO::FETCH_ASSOC);
	$title = $row["title"];
	$title = stripslashes($title);
	
	$go_back = str_replace("password_reset=1", "password_reset=0", $go_back);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">

<?php
echo "<link rel=\"stylesheet\" href=\"" . $rel_path . BWB_CSS_DIR . "/site.css\" type=\"text/css\">\n";
?>
</head>

<body>
	<div class="wrap" id="wrap">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
    		<tr>
    			<td valign="top" class="content_td" id="content_td">
   					<div class="content_div" id="content_div">
    
                        <div class="popup_msg_div">
                        <table class="popup_msg_table">
                          <tr>          
                            <td class="popup_msg_td_top">
                                <?php echo $err; ?>
                            </td>
                          </tr>
                          <tr>
                            <td class="popup_msg_td_bottom">
                            <a href="<?php echo $go_back; ?>">
                              <input type="button" name="go_back" value="<?php echo $button_label; ?>"  class="popup_msg_button" onclick="window.location='<?php echo $go_back; ?>';" />
                            </a>
                            </td>
                          </tr>
                        </table>
                        </div>
                        
					</div>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>