<?php

namespace Server\ucenter\web;

use Server\ucenter\UcenterService;

class RegsetController extends UcenterService {

    public function main(){
        global $_GPC;
        if (checksubmit('savedata')){
            $data = post_var(array('grouplevel','passport'), $_GPC['data']);
            $data['grouplevel'] = intval($data['grouplevel']);
            $ucsync = $_GPC['ucsync'];
            $ucsync['sync_user'] = boolval($ucsync['sync_user']);
            $ucsync['sync_credit'] = boolval($ucsync['sync_credit']);
            $ucsync['sync_user_url'] = trim($ucsync['sync_user_url']);
            $ucsync['sync_credit_url'] = trim($ucsync['sync_credit_url']);
            $data['ucsync'] = $ucsync;
            foreach ($data as $key=>$set){
                $this->SettingSave($key, $set, $this->uniacid);
            }
            message("保存成功", referer(), "success");
        }
        $this->View(array('title'=>'参数设置','setting'=>$this->getSetting()));
    }

}
