<?php
namespace carabi_office;

/**
 * Рабочий стол офиса -- выбор схемы БД для перенаправления в CMS
 *
 * @author sasha
 */
class pagehandler_desktop extends \carabi_cms\pagehandler_desktop {
	public function process() {
		if (\lib_office::hasPermission($this->user(), \lib_office::PERMISSION_ANY)) {
			$this->executeAction();
		} else {
			header("Location: " . \lib_office::OFFICE_ROOT() . "/login");
		}
	}
	
	public function index() {
		$tpl = $this->createTemplate("content.desktop.tpl");
		$tpl->assign("schemasList", \lib_office::getSchemasList());
		$tpl->assign("pagehandler", $this);
		$tpl->display();
	}
}
?>
