<?php class autocms{
function postcalls ()
{
if(isset($_POST['submit'])) 	{ 		$this->engineemailcontact($_POST[Email],$_POST[Msg]); 	}
if(isset($_POST['update'])) 	{ 		$this->enginesavefile(); 	 	}
if(isset($_GET['login'])) 		{ 	 	$this->enginelogin();	 	}
if(isset($_POST['password'])) 	{ 		$this->enginepassword(); 	 }
	return;
}
function msgs($msg,$css) {
	echo "<div class='".$css."'>".$msg."</div>";
	}
private function show_block($block){ echo stripslashes($block);	return; }
function enginetemplate()
	{  if (current_template == "")  {  include "public_tpl/".default_template;  } else  { include "public_tpl/".current_template;  } return; 	}
function engineemailcontact($EMAIL,$Msg)
	{		if($Msg != NULL)
			{		$email = htmlentities(trim(strtolower($EMAIL)));
					if (strlen($email) <= 320 AND strlen($email)>0)
						{	$model = '/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])'.'(([a-z0-9-])*([a-z0-9]))+'.'(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i';
								if (preg_match ($model, $email) == TRUE)
									{ 	
										list($user, $domain) = explode("@", $email);
											$id = @fopen("http://".$domain,"r");
													echo "<div class='good_msg'>".email_thanks_msg."</div>";
														$mailheader  = 'MIME-Version:1.0'."\r\n";
														$mailheader .= 'Content-type:text/html; charset=UTF-8' . "\r\n";
														$Mssg = "".new_email_msg.":<b> ".$email."</b><br/>Message:<br/>".htmlentities($Msg);
														mail(admin_email, " ".contact_from." ".site_name, $Mssg, $mailheader);
														$mailheader2  = 'MIME-Version:1.0'."\r\n";
														$mailheader2 .= 'Content-type:text/html; charset=UTF-8'."\r\n";
														$mailheader2 .= "".email_from.":".admin_email."\r\n";
														$msg_to_client = email_thanks_msg." ".site_name;
														mail($email, " ".email_from." ".site_name, $msg_to_client, $mailheader2);
														return;	fclose($id);
									}
								else  { 	echo email_error_1; 	} 
					}
					else { 	if(strlen($lower)==NULL) { 	echo email_error_2; } 	else{ 	echo email_error_3; 	}  	}
			} else{  echo email_error_2; 	}
	}
}
?>