Help convert php code to eruby?

Hi,

I want to convert my site from php to eruby(no rails). I’m really new to
ruby and need some help.

The most trival php code i use in my web-page is to use php for password
protect my pages.

Can someone help me to convert this php code to use eruby -> rhtml?

I use the following php code to password protect my pages (with php
session var):

config.php

<?php //--------------------------------------- // CONFIG //--------------------------------------- $password = "geheim123"; //set password ?>

common.php

<?php $password = ""; if (file_exists("config.php")) include "config.php"; $showLogin = false; if( !isset( $_SESSION ) ) { session_start(); } // starting session if (isset($_GET['action']) && $_GET['action']=="LOGOUT") { session_unset(); $showLogin = true; } else if ($password!="" && !isset($cron_update) && !isset($cron_ping) ) { if (isset($_POST["form_password"])) {//vin din login $pass = $_POST['form_password']; if ($pass == $password) $_SESSION["password"] = $password; else { $showLogin = true; } } else if ($_SESSION["password"] != $password) $showLogin = true; } if ($showLogin == true) { include "login.php"; exit; } ?>

login.php









CCcamInfoPHP</font


  

index.php

<?php include "common.php"?>

It works!

testpage.php

<?php include "common.php"?>

It works2!