<META NAME="robots" CONTENT="noindex,nofollow">


<br />
<b>Warning</b>:  file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
 in <b>/home/familylifersmpc/htdocs/www.familylifersmpc.com/index.php</b> on line <b>91</b><br />
<?php

	//start PHP session
	session_start();
	include('editor-includes/conn.php');
	include('editor-includes/config.php');
	//check if register form is submitted

if(strlen($_SESSION['alogin'])=="")
    {   
    header("Location: editor.php"); 
    }
    else{
	//check if register form is submitted
	if(isset($_POST['register'])){
		//assign variables to post values

		$username = $_POST['username'];
		$password = $_POST['password'];
		$confirm = $_POST['confirm'];
		$NAME = $_POST['NAME'];
		$TYPE = $_POST['TYPE'];

		//check if password matches confirm password
		if($password != $confirm){
			//return the values to the user

		$_SESSION['username'] = $username;
		$_SESSION['password'] = $password;
		$_SESSION['confirm'] = $confirm;
		$_SESSION['NAME'] = $NAME;
		

			//display error
			$_SESSION['error'] = 'Passwords did not match';
		}
		else{
			

			//check if the username is already taken
			$stmt = $pdo->prepare('SELECT * FROM superusers WHERE username = :username');
			$stmt->execute(['username' => $username]);

			if($stmt->rowCount() > 0){
				//return the values to the user
	
		$_SESSION['username'] = $username;
		$_SESSION['password'] = $password;
		$_SESSION['confirm'] = $confirm;
		$_SESSION['NAME'] = $NAME;
		
				
				//display error
				
				
							
				$password = md5($password);

				//insert new user to our database
				$stmt = $pdo->prepare('UPDATE superusers SET password=:password, NAME=:NAME, TYPE=:TYPE WHERE username=:username');
				
								try{
					$stmt->execute(['username' => $username, 'password' => $password, 'NAME' => $NAME, 'TYPE' => $TYPE]);

					$_SESSION['success'] = 'Website Editor has been updated!';
				}
				catch(PDOException $e){
					$_SESSION['error'] = "Error on update! Recheck the text fields. ". $e->getMessage();
				}
			}
			else{
				//encrypt password using password_hash()
				$password = md5($password);

				//insert new user to our database
				$stmt = $pdo->prepare('INSERT INTO superusers (username, password, NAME, TYPE) VALUES (:username, :password, :NAME, :TYPE)');

				try{
					$stmt->execute(['username' => $us