예제 #1
0
 public function index()
 {
     if ('' === KEY_PREFIX) {
         $db_size = $this->redis_model->get_db_size();
     } else {
         $redis_keys = $this->redis_model->get_all_keys(KEY_PREFIX);
         $db_size = count($redis_keys);
         unset($redis_keys);
     }
     $db_size_critical = get_custom_config('config_global', 'db_size_critical');
     $hide_tree = $db_size_critical > 0 && $db_size >= $db_size_critical;
     $page_data = $this->get_default_page_data();
     $page_data['server_list'] = $this->server_list;
     $page_data['db_size'] = $db_size;
     $page_data['db_size_critical'] = $db_size_critical;
     $page_data['html_key_tree'] = FALSE;
     if (!$hide_tree) {
         $page_data['html_key_tree'] = $this->get_key_tree(TRUE);
     }
     if (!$this->_current_method) {
         $page_data['iframe_url'] = manager_site_url('overview', 'index');
     } else {
         $query = $this->input->get();
         $query['c'] = $this->_current_method;
         $query['m'] = 'index';
         $page_data['iframe_url'] = site_url(http_build_query($query));
     }
     $page_data['title'] = PROJECT_NAME;
     $this->load->view('index', $page_data);
 }
예제 #2
0
 /**
  * 获取验证码
  */
 public function seccode()
 {
     if (!SECCODE_ENABLE) {
         die;
     }
     $this->load->library('SeccodeImageCaptcha');
     $config = get_custom_config('config_auth', 'seccode_config');
     $text_len = get_custom_config('config_auth', 'seccode_len');
     $lang = get_custom_config('config_auth', 'seccode_lang');
     $seccode_img = new SeccodeImageCaptcha();
     $seccode_img->init($config, $text_len, $lang);
     $seccode = $seccode_img->createSeccode();
     $_SESSION['seccode'] = $seccode;
     $seccode_img->output();
 }
예제 #3
0
 protected function _do_login($username, $password)
 {
     $auth_user = get_custom_config('config_auth', 'auth_user');
     if (!isset($auth_user[$username]) || $auth_user[$username] !== $password) {
         return FALSE;
     }
     $_SESSION['username'] = $username;
     return TRUE;
 }
예제 #4
0
 public function __construct()
 {
     parent::__construct();
     $this->_idle_key = get_custom_config('config_global', 'idle_key');
 }