今更ですが、訂正。
function window.onload() {
if(self != top){
top.location = self.location;
location.replace("index.php");
}
}
location.replace()は不要。
<form name="login" action="<?php print $this->url() ?>" method="post">
から
<form name="login" action="index.php" method="post" >
に変更すれば、よろしいかと。
望月