<?php
namespace admin\Controller;
use Think\Controller;
class LogapiController extends CommonController {

 
	public function qq(){
		$map['alias']='qq';
		$oauth = M('Oauth')->where($map)->find();
		$oauth['config']=unserialize($oauth['config']);
		$this->assign('oauth',$oauth);
		$this->display();
	}
	public function sina(){
		$map['alias']='sina';
		$oauth = M('Oauth')->where($map)->find();
		$oauth['config']=unserialize($oauth['config']);
		$this->assign('oauth',$oauth);
		$this->display();
	}
	public function edit(){
	
		F('oauth',NULL);
		if(IS_POST)
		{
			$data = D("Oauth");
			if (!$array=$data->create()){
				$this->error($data->getError());
			}
			else
			{
				$cfg['app_id']=I('request.app_id');
				$cfg['app_key']=I('request.app_key');
				$array['config']=serialize($cfg);
				$data->save($array);
				$this->success('保存完成');				
			}
		}
			 
	}
}
?>