当前位置: 首页>>代码示例>>PHP>>正文


PHP Front_Controller::check_privilege方法代码示例

本文整理汇总了PHP中Front_Controller::check_privilege方法的典型用法代码示例。如果您正苦于以下问题:PHP Front_Controller::check_privilege方法的具体用法?PHP Front_Controller::check_privilege怎么用?PHP Front_Controller::check_privilege使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Front_Controller的用法示例。


在下文中一共展示了Front_Controller::check_privilege方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 /**
  * 删除
  */
 function delete($id)
 {
     parent::check_privilege('');
     if ($id) {
         //检查该数据是否是回收站数据
         $this->webserver->delete($id);
         redirect(site_url('webserver/index'));
     }
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:12,代码来源:webserver.php

示例2: save

 /**
  * 保存选项
  */
 public function save()
 {
     parent::check_privilege();
     if (isset($_POST['submit']) && $_POST['submit'] == 'save') {
         $post = $_POST;
         foreach ($post as $key => $val) {
             $data['value'] = $val;
             $this->settings->update($data, $key);
         }
         redirect(site_url('settings/index/save'));
     }
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:15,代码来源:settings.php

示例3: bigtable_chart

 public function bigtable_chart()
 {
     parent::check_privilege();
     $server_id = $this->uri->segment(3);
     $server_id = !empty($server_id) ? $server_id : "0";
     $table_name = $this->uri->segment(4);
     $table_name = !empty($table_name) ? $table_name : "";
     //表增长趋势图表
     $chart_reslut = array();
     for ($i = 0; $i < 30; $i++) {
         $timestamp = time() - 3600 * 24 * 30 + 3600 * 24 * $i;
         $time = date('Ymd', $timestamp);
         //echo $time.'<br/>';
         $chart_reslut[$i]['time'] = date('Y-m-d', $timestamp);
         $dbdata = $this->mysql->get_bigtable_chart_record($server_id, $table_name, $time);
         $chart_reslut[$i]['table_size'] = !empty($dbdata['table_size']) ? $dbdata['table_size'] : '0';
     }
     $data['chart_reslut'] = $chart_reslut;
     //print_r($chart_reslut);
     $data['cur_server_id'] = $server_id;
     $data['cur_table_name'] = $table_name;
     $data["cur_server"] = $this->server->get_servers($server_id);
     $this->layout->view('mysql/bigtable_chart', $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:24,代码来源:mysql.php

示例4: redirect

 /**
  * 彻底删除
  */
 function forever_delete($id)
 {
     parent::check_privilege();
     if ($id) {
         $this->user->delete($id);
         redirect(site_url('user/index'));
     }
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:11,代码来源:user.php

示例5: chart

 public function chart()
 {
     parent::check_privilege('');
     $server_id = $this->uri->segment(3);
     $server_id = !empty($server_id) ? $server_id : "0";
     $begin_time = $this->uri->segment(4);
     $begin_time = !empty($begin_time) ? $begin_time : "30";
     $time_span = $this->uri->segment(5);
     $time_span = !empty($time_span) ? $time_span : "min";
     //饼状图表
     $data = array();
     //线性图表
     $chart_reslut = array();
     for ($i = $begin_time; $i >= 0; $i--) {
         $timestamp = time() - 60 * $i;
         $time = date('YmdHi', $timestamp);
         $has_record = $this->oracle->check_has_record($server_id, $time);
         if ($has_record) {
             $chart_reslut[$i]['time'] = date('Y-m-d H:i', $timestamp);
             $dbdata = $this->oracle->get_status_chart_record($server_id, $time);
             $chart_reslut[$i]['session_total'] = $dbdata['session_total'];
             $chart_reslut[$i]['session_actives'] = $dbdata['session_actives'];
             $chart_reslut[$i]['session_waits'] = $dbdata['session_waits'];
             $chart_reslut[$i]['processes'] = $dbdata['processes'];
             $chart_reslut[$i]['session_logical_reads_persecond'] = $dbdata['session_logical_reads_persecond'];
             $chart_reslut[$i]['physical_reads_persecond'] = $dbdata['physical_reads_persecond'];
             $chart_reslut[$i]['physical_writes_persecond'] = $dbdata['physical_writes_persecond'];
             $chart_reslut[$i]['physical_read_io_requests_persecond'] = $dbdata['physical_read_io_requests_persecond'];
             $chart_reslut[$i]['physical_write_io_requests_persecond'] = $dbdata['physical_write_io_requests_persecond'];
             $chart_reslut[$i]['db_block_changes_persecond'] = $dbdata['db_block_changes_persecond'];
             $chart_reslut[$i]['os_cpu_wait_time'] = $dbdata['os_cpu_wait_time'];
             $chart_reslut[$i]['logons_persecond'] = $dbdata['logons_persecond'];
             $chart_reslut[$i]['logons_current'] = $dbdata['logons_current'];
             $chart_reslut[$i]['opened_cursors_persecond'] = $dbdata['opened_cursors_persecond'];
             $chart_reslut[$i]['opened_cursors_current'] = $dbdata['opened_cursors_current'];
             $chart_reslut[$i]['user_commits_persecond'] = $dbdata['user_commits_persecond'];
             $chart_reslut[$i]['user_rollbacks_persecond'] = $dbdata['user_rollbacks_persecond'];
             $chart_reslut[$i]['user_calls_persecond'] = $dbdata['user_calls_persecond'];
         }
     }
     $data['chart_reslut'] = $chart_reslut;
     //print_r($chart_reslut);
     $chart_option = array();
     if ($time_span == 'min') {
         $chart_option['formatString'] = '%H:%M';
     } else {
         if ($time_span == 'hour') {
             $chart_option['formatString'] = '%H:%M';
         } else {
             if ($time_span == 'day') {
                 $chart_option['formatString'] = '%m/%d %H:%M';
             }
         }
     }
     $data['chart_option'] = $chart_option;
     $data['begin_time'] = $begin_time;
     $data['cur_nav'] = 'chart_index';
     $data["server"] = $servers = $this->server->get_total_record_usage();
     $data['cur_server_id'] = $server_id;
     $data["cur_server"] = $this->server->get_servers($server_id);
     $this->layout->view('oracle/chart', $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:62,代码来源:oracle.php

示例6: memory_chart

 public function memory_chart()
 {
     parent::check_privilege();
     $server_id = $this->uri->segment(3);
     $server_id = !empty($server_id) ? $server_id : "0";
     $begin_time = $this->uri->segment(4);
     $begin_time = !empty($begin_time) ? $begin_time : "60";
     $time_span = $this->uri->segment(5);
     $time_span = !empty($time_span) ? $time_span : "hour";
     //图表
     $chart_reslut = array();
     for ($i = $begin_time; $i >= 0; $i--) {
         $timestamp = time() - 60 * $i;
         $time = date('YmdHi', $timestamp);
         $has_record = $this->mongodb->check_has_record($server_id, $time);
         if ($has_record) {
             $chart_reslut[$i]['time'] = date('Y-m-d H:i', $timestamp);
             $dbdata = $this->mongodb->get_status_chart_record($server_id, $time);
             $chart_reslut[$i]['mem_resident'] = $dbdata['mem_resident'];
             $chart_reslut[$i]['mem_virtual'] = $dbdata['mem_virtual'];
             $chart_reslut[$i]['mem_mapped'] = $dbdata['mem_mapped'];
             $chart_reslut[$i]['mem_mappedWithJournal'] = $dbdata['mem_mappedWithJournal'];
         }
     }
     $data['chart_reslut'] = $chart_reslut;
     $chart_option = array();
     if ($time_span == 'hour') {
         $chart_option['formatString'] = '%H:%M';
     } else {
         if ($time_span == 'day') {
             $chart_option['formatString'] = '%m/%d %H:%M';
         }
     }
     $data['chart_option'] = $chart_option;
     $data['begin_time'] = $begin_time;
     $data['cur_server_id'] = $server_id;
     $data["cur_server"] = $this->server->get_servers($server_id);
     $this->layout->view('mongodb/memory_chart', $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:39,代码来源:mongodb.php

示例7: replication

 public function replication()
 {
     parent::check_privilege();
     $datalist = $this->redis->get_replication_total_record();
     if (empty($_GET["search"])) {
         $datalist = get_redis_replication_tree($datalist);
     }
     $setval["role"] = isset($_GET["role"]) ? $_GET["role"] : "";
     $setval["order"] = isset($_GET["order"]) ? $_GET["order"] : "";
     $setval["order_type"] = isset($_GET["order_type"]) ? $_GET["order_type"] : "";
     $data["setval"] = $setval;
     $data['datalist'] = $datalist;
     $this->layout->view("redis/replication", $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:14,代码来源:redis.php

示例8: array

 /**
  * 批量添加
  */
 function batch_add()
 {
     parent::check_privilege();
     /*
      * 提交批量添加后处理
      */
     $data['error_code'] = 0;
     if (isset($_POST['submit']) && $_POST['submit'] == 'batch_add') {
         for ($n = 1; $n <= 10; $n++) {
             $host = $this->input->post('host_' . $n);
             $port = $this->input->post('port_' . $n);
             $password = $this->input->post('password_' . $n);
             $tags = $this->input->post('tags_' . $n);
             if (!empty($host) && !empty($port) && !empty($tags)) {
                 $data['error_code'] = 0;
                 $data = array('host' => $host, 'port' => $port, 'password' => $password, 'tags' => $tags, 'monitor' => $this->input->post('monitor_' . $n), 'send_mail' => $this->input->post('send_mail_' . $n), 'send_sms' => $this->input->post('send_sms_' . $n), 'alarm_connected_clients' => $this->input->post('alarm_connected_clients_' . $n), 'alarm_command_processed' => $this->input->post('alarm_command_processed_' . $n), 'alarm_blocked_clients' => $this->input->post('alarm_blocked_clients_' . $n));
                 $this->servers->insert($data);
             }
         }
         redirect(site_url('servers_redis/index'));
     }
     $this->layout->view("servers_redis/batch_add", $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:26,代码来源:servers_redis.php

示例9: array

 /**
  * 批量添加
  */
 function batch_add()
 {
     parent::check_privilege();
     /*
      * 提交批量添加后处理
      */
     $data['error_code'] = 0;
     if (isset($_POST['submit']) && $_POST['submit'] == 'batch_add') {
         for ($n = 1; $n <= 10; $n++) {
             $host = $this->input->post('host_' . $n);
             $port = $this->input->post('port_' . $n);
             $username = $this->input->post('username_' . $n);
             $password = $this->input->post('password_' . $n);
             $tags = $this->input->post('tags_' . $n);
             $dsn = $this->input->post('dsn_' . $n);
             if (!empty($host) && !empty($port) && !empty($username) && !empty($password) && !empty($dsn) && !empty($tags)) {
                 $data['error_code'] = 0;
                 $data = array('host' => $host, 'port' => $port, 'username' => $username, 'password' => $password, 'tags' => $tags, 'dsn' => $dsn, 'monitor' => $this->input->post('monitor_' . $n), 'send_mail' => $this->input->post('send_mail_' . $n), 'send_sms' => $this->input->post('send_sms_' . $n), 'alarm_session_total' => $this->input->post('alarm_session_total_' . $n), 'alarm_session_actives' => $this->input->post('alarm_session_actives_' . $n), 'alarm_session_waits' => $this->input->post('alarm_session_waits_' . $n), 'alarm_tablespace' => $this->input->post('alarm_tablespace_' . $n));
                 $this->servers->insert($data);
             }
         }
         redirect(site_url('servers_oracle/index'));
     }
     $this->layout->view("servers_oracle/batch_add", $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:28,代码来源:servers_oracle.php

示例10: redirect

 /**
  * 彻底删除
  */
 function forever_delete($id)
 {
     parent::check_privilege('application/trash');
     if ($id) {
         //检查该数据是否是回收站数据
         $record = $this->app->get_record_by_id($id);
         $is_delete = $record['is_delete'];
         if ($is_delete == 1) {
             $this->app->delete($id);
         }
         redirect(site_url('application/trash'));
     }
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:16,代码来源:application.php

示例11: redirect

 /**
  * 彻底删除
  */
 function forever_delete($id)
 {
     parent::check_privilege();
     if ($id) {
         //检查该数据是否是回收站数据
         $record = $this->machine_room->get_record_by_id($id);
         if ($record) {
             $this->machine_room->delete($id);
         }
         redirect(site_url('machine_room/index'));
     }
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:15,代码来源:machine_room.php

示例12: chart

 public function chart()
 {
     parent::check_privilege();
     $host = $this->uri->segment(3);
     $host = !empty($host) ? $host : "";
     $begin_time = $this->uri->segment(4);
     $begin_time = !empty($begin_time) ? $begin_time : "30";
     $time_span = $this->uri->segment(5);
     $time_span = !empty($time_span) ? $time_span : "min";
     //连接数图表
     $chart_reslut = array();
     for ($i = $begin_time; $i >= 0; $i--) {
         $timestamp = time() - 60 * $i;
         $time = date('YmdHi', $timestamp);
         $has_record = $this->os->check_has_record($host, $time);
         if ($has_record) {
             $chart_reslut[$i]['time'] = date('Y-m-d H:i', $timestamp);
             $dbdata = $this->os->get_os_chart_record($host, $time);
             $chart_reslut[$i]['process'] = $dbdata['process'];
             $chart_reslut[$i]['load_1'] = $dbdata['load_1'];
             $chart_reslut[$i]['load_5'] = $dbdata['load_5'];
             $chart_reslut[$i]['load_15'] = $dbdata['load_15'];
             $chart_reslut[$i]['cpu_user_time'] = $dbdata['cpu_user_time'];
             $chart_reslut[$i]['cpu_system_time'] = $dbdata['cpu_system_time'];
             $chart_reslut[$i]['cpu_idle_time'] = $dbdata['cpu_idle_time'];
             $chart_reslut[$i]['mem_usage_rate'] = $dbdata['mem_usage_rate'];
             $chart_reslut[$i]['disk_io_reads_total'] = $dbdata['disk_io_reads_total'];
             $chart_reslut[$i]['disk_io_writes_total'] = $dbdata['disk_io_writes_total'];
             $chart_reslut[$i]['net_in_bytes_total'] = $dbdata['net_in_bytes_total'];
             $chart_reslut[$i]['net_out_bytes_total'] = $dbdata['net_out_bytes_total'];
         }
     }
     $data['chart_reslut'] = $chart_reslut;
     $chart_option = array();
     if ($time_span == 'min') {
         $chart_option['formatString'] = '%H:%M';
     } else {
         if ($time_span == 'hour') {
             $chart_option['formatString'] = '%H:%M';
         } else {
             if ($time_span == 'day') {
                 $chart_option['formatString'] = '%m/%d %H:%M';
             }
         }
     }
     $data['chart_option'] = $chart_option;
     $data['begin_time'] = $begin_time;
     $data['cur_host'] = $host;
     $data['last_record'] = $this->os->get_last_record($host);
     $data['diskinfo'] = $this->os->get_disk_record($host);
     $this->layout->view('os/chart', $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:52,代码来源:os.php

示例13: update_user_role

 /**
  * 更新角色授权
  */
 public function update_user_role()
 {
     parent::check_privilege();
     $user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : '';
     $role_ids = !empty($_POST['role_id']) ? $_POST['role_id'] : '';
     /*
      * 提交后处理
      */
     $data['error_code'] = '';
     if (isset($_POST['submit']) && $_POST['submit'] == 'auth_user_role') {
         $result = $this->auth->update_user_role($user_id, $role_ids);
         if ($result === true) {
             redirect(site_url('/auth/index/user_id/' . $user_id . '/0'));
         } else {
             redirect(site_url('/auth/index/user_id/' . $user_id . '/1'));
         }
     }
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:21,代码来源:auth.php

示例14: array

 /**
  * 批量添加
  */
 function batch_add()
 {
     parent::check_privilege();
     /*
      * 提交批量添加后处理
      */
     $data['error_code'] = 0;
     if (isset($_POST['submit']) && $_POST['submit'] == 'batch_add') {
         for ($n = 1; $n <= 10; $n++) {
             $host = $this->input->post('host_' . $n);
             $port = $this->input->post('port_' . $n);
             $username = $this->input->post('username_' . $n);
             $password = $this->input->post('password_' . $n);
             $tags = $this->input->post('tags_' . $n);
             if (!empty($host) && !empty($port) && !empty($username) && !empty($password) && !empty($tags)) {
                 $data['error_code'] = 0;
                 $data = array('host' => $host, 'port' => $port, 'username' => $username, 'password' => $password, 'tags' => $tags, 'monitor' => $this->input->post('monitor_' . $n), 'send_mail' => $this->input->post('send_mail_' . $n), 'send_sms' => $this->input->post('send_sms_' . $n), 'alarm_threads_connected' => $this->input->post('alarm_threads_connected_' . $n), 'alarm_threads_running' => $this->input->post('alarm_threads_running_' . $n), 'alarm_threads_waits' => $this->input->post('alarm_threads_waits_' . $n), 'alarm_repl_status' => $this->input->post('alarm_repl_status_' . $n), 'alarm_repl_delay' => $this->input->post('alarm_repl_delay_' . $n));
                 $this->servers->insert($data);
             }
         }
         redirect(site_url('servers_mysql/index'));
     }
     $this->layout->view("servers_mysql/batch_add", $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:27,代码来源:servers_mysql.php

示例15: array

 /**
  * 批量添加
  */
 function batch_add()
 {
     parent::check_privilege();
     /*
      * 提交批量添加后处理
      */
     $data['error_code'] = 0;
     if (isset($_POST['submit']) && $_POST['submit'] == 'batch_add') {
         for ($n = 1; $n <= 10; $n++) {
             $host = $this->input->post('host_' . $n);
             $community = $this->input->post('community_' . $n);
             $tags = $this->input->post('tags_' . $n);
             if (!empty($host) && !empty($community) && !empty($tags)) {
                 $data['error_code'] = 0;
                 $data = array('host' => $this->input->post('host'), 'community' => $this->input->post('community'), 'tags' => $this->input->post('tags'), 'monitor' => $this->input->post('monitor'), 'send_mail' => $this->input->post('send_mail'), 'send_sms' => $this->input->post('send_sms'), 'send_mail_to_list' => $this->input->post('send_mail_to_list'), 'send_sms_to_list' => $this->input->post('send_sms_to_list'), 'alarm_os_process' => $this->input->post('alarm_os_process'), 'alarm_os_load' => $this->input->post('alarm_os_load'), 'alarm_os_cpu' => $this->input->post('alarm_os_cpu'), 'alarm_os_network' => $this->input->post('alarm_os_network'), 'alarm_os_disk' => $this->input->post('alarm_os_disk'), 'alarm_os_memory' => $this->input->post('alarm_os_memory'));
                 $this->servers->insert($data);
             }
         }
         redirect(site_url('servers_os/index'));
     }
     $this->layout->view("servers_os/batch_add", $data);
 }
开发者ID:hisery,项目名称:Lepus-1,代码行数:25,代码来源:servers_os.php


注:本文中的Front_Controller::check_privilege方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。