<?php

/* ========================================================================
 * $Id: init.php 1107 2019-06-13 16:58:59Z onez $
 * 
 * Email: www@onez.cn
 * QQ: 6200103
 * HomePage: http://www.onezphp.com
 * ========================================================================
 * Copyright 2016-2017 佳蓝科技.
 * 
 * ======================================================================== */

!defined('IN_ONEZ') && exit('Access Denied');
onez('admin')->theme($G['this']->option('theme_admin','skin-red'));#自定义皮肤

$login=onez('login')->init('chat_group',0);
if($login['id']){
  $G['user']=$G['this']->data()->open('member')->one("id='$login[id]'");
  if(!$G['user']){
    onez('cache')->cookie('chat_group','del',-1);
    exit('登录超时');
  }
}
if($G['user']['grade']!='admin'){
  onez('cache')->cookie('chat_group','del',-1);
  onez()->location(onez()->homepage());
}
$G['userid']=$G['user']['id'];

$G['nickname']=$G['user']['nickname'];
$G['avatar']=$G['this']->avatar($G['userid']);
$G['gradename']='超级管理平台';
onez('admin')->menu_top_right.='<ul class="nav navbar-nav">
  <li><a href="'.onez('chat.group.common')->href('/admin/common/setpwd.php').'" class="onez-miniwin">修改密码</a></li>
</ul>';
$Menu=array();
onez('admin.menu')->init('admin',$Menu);
onez('admin')->menu=$Menu;
onez('onez')->init('admin');
$G['footer-js'].=<<<ONEZ
$('.content-wrapper').css({'min-height':Math.max($('.main-sidebar').outerHeight(),$('.content').outerHeight())+'px'});
ONEZ;

