<?php 
require_once('scripts/sb_functions.php');
global $logged_in;
$logged_in = logged_in( true, false );
	
$ok = create_password( sb_stripslashes( $_POST[ 'user' ] ), sb_stripslashes( $_POST[ 'pass' ] ) );
$logged_in = $ok;

//////////////////////////////////////////////////////////
// joerg 2005/09/11 --> make install scripts unaccessible

if ($ok){
  if (!@chmod('install00.php',0000)){
    $problems .= "Couldn't change file mode of install00.php - Do it by hand or delete this file!<br>";
  }
  if (!@chmod('install01.php',0000)){
    $problems .= "Couldn't change file mode of install01.php - Do it by hand or delete this file!<br>";
  }
  if (!@chmod('install02.php',0000)){
    $problems .= "Couldn't change file mode of install02.php - Do it by hand or delete this file!<br>";
  }
  if (!@chmod('install03.php',0000)){
    $problems .= "Couldn't change file mode of install03.php - Do it by hand or delete this file!<br>";
  }
  if (!@chmod('install03_cgi.php',0000)){
    $problems .= "Couldn't change file mode of install03_cgi.php - Do it by hand or delete this file!<br>";
  }
}

	
read_config();
	
global $blog_config;
if ( isset( $_GET[ 'blog_language' ] ) ) {	
    $blog_config[ 'blog_language' ] = $_GET[ 'blog_language' ];
}
sb_language( 'install03' );

html_header('',false);

function page_content() {
    global $lang_string, $user_colors, $ok, $blog_config,$problems;
		
    if ( $ok === true ) {
	echo( $lang_string[ 'success' ] );
	echo( '<a href="setup.php?blog_language=' . $blog_config[ 'blog_language' ] . '">' . $lang_string[ 'btn_setup' ] . '</a><br /><br />' );
	if (isset($problems)){
	    echo '<p>'.$problems;
	}
    } else {
	echo( $lang_string[ 'wrong_password' ] );
    }
		
    // echo( '<div class="hr"><hr /></div>' );
}
theme_pagelayout();
html_footer();

?>
