<?php

class Plugin_backlink extends Plugin
{
	function do_url()
	{
		$post = KinoWiki::getinstance()->getPOST();
		$smarty = new PluginSmarty('backlink');
		
		$ret['title'] = '逆リンクの再生成';
		
		if(isset($post['password'])){
			if(md5($post['password']) == ADMINPASS){
				BackLink::getinstance()->refreshall();
				$ret['body'] = $smarty->fetch('finish.tpl.htm');
			}
			else{
				$smarty->assign('error', true);
				$ret['body'] = $smarty->fetch('password.tpl.htm');
			}
		}
		else{
			$ret['body'] = $smarty->fetch('password.tpl.htm');
		}
		
		return $ret;
	}
}

?>