├── CREDITS ├── README.md ├── application ├── .htaccess ├── cache │ ├── .htaccess │ └── index.html ├── config │ ├── autoload.php │ ├── config.php │ ├── constants.php │ ├── database.php │ ├── doctypes.php │ ├── foreign_chars.php │ ├── hooks.php │ ├── index.html │ ├── migration.php │ ├── mimes.php │ ├── profiler.php │ ├── routes.php │ ├── smileys.php │ └── user_agents.php ├── controllers │ ├── auth.php │ ├── bridge.php │ ├── files.php │ ├── index.html │ ├── interfaces.php │ ├── ip │ │ ├── address.php │ │ ├── arp.php │ │ ├── dhcp_client.php │ │ ├── dhcp_server.php │ │ ├── dns.php │ │ ├── firewall.php │ │ ├── pool.php │ │ ├── routes.php │ │ └── services.php │ ├── ppp.php │ └── system │ │ ├── clock.php │ │ ├── history.php │ │ ├── identity.php │ │ └── license.php ├── core │ ├── MY_Controller.php │ ├── MY_Loader.php │ └── index.html ├── errors │ ├── error_404.php │ ├── error_db.php │ ├── error_general.php │ ├── error_php.php │ └── index.html ├── helpers │ └── index.html ├── hooks │ └── index.html ├── index.html ├── language │ └── english │ │ └── index.html ├── libraries │ └── index.html ├── logs │ └── index.html ├── models │ └── index.html ├── third_party │ └── index.html └── views │ ├── alert.php │ ├── auth │ ├── index.php │ └── layout.php │ ├── files │ ├── index.php │ └── subnav.php │ ├── index.html │ ├── interfaces │ ├── bonding.php │ ├── bridge │ │ ├── index.php │ │ ├── nat.php │ │ └── subnav.php │ ├── button.php │ ├── eoip.php │ ├── ethernet.php │ ├── index.php │ ├── ipip.php │ ├── subnav.php │ ├── vlan.php │ └── vrrp.php │ ├── ip │ ├── address │ │ ├── index.php │ │ └── subnav.php │ ├── arp │ │ ├── index.php │ │ └── subnav.php │ ├── dhcp_client │ │ ├── index.php │ │ └── subnav.php │ ├── dhcp_server │ │ ├── index.php │ │ └── subnav.php │ ├── dns │ │ ├── cache.php │ │ ├── static.php │ │ └── subnav.php │ ├── firewall │ │ ├── button.php │ │ ├── connection.php │ │ ├── filter.php │ │ ├── mangle.php │ │ ├── nat.php │ │ ├── service.php │ │ └── subnav.php │ ├── pool │ │ ├── index.php │ │ ├── subnav.php │ │ └── used_address.php │ ├── routes │ │ ├── index.php │ │ └── subnav.php │ └── services │ │ ├── index.php │ │ └── subnav.php │ ├── layout.php │ ├── ppp │ ├── active.php │ ├── button.php │ ├── profiles.php │ ├── secrets.php │ └── subnav.php │ ├── sidebar.php │ └── system │ ├── clock │ ├── index.php │ └── subnav.php │ ├── history │ ├── index.php │ └── subnav.php │ ├── identity │ ├── index.php │ └── subnav.php │ └── license │ ├── index.php │ └── subnav.php ├── index.php ├── license.txt ├── media └── bootstrap │ ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ └── docs.css │ ├── img │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png │ └── js │ ├── bootstrap-dropdown.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ └── jquery.js ├── sparks └── mikrotik_api │ └── 0.7.0 │ ├── README.md │ ├── config │ ├── autoload.php │ └── mikrotik.php │ ├── libraries │ ├── mikrotik │ │ ├── core │ │ │ ├── mapi_core.php │ │ │ └── mapi_query.php │ │ ├── file │ │ │ └── mapi_file.php │ │ ├── interface │ │ │ ├── mapi_interface_bonding.php │ │ │ ├── mapi_interface_bridge.php │ │ │ ├── mapi_interface_eoip.php │ │ │ ├── mapi_interface_ethernet.php │ │ │ ├── mapi_interface_ipip.php │ │ │ ├── mapi_interface_l2tp_client.php │ │ │ ├── mapi_interface_l2tp_server.php │ │ │ ├── mapi_interface_ppp_client.php │ │ │ ├── mapi_interface_ppp_server.php │ │ │ ├── mapi_interface_pppoe_client.php │ │ │ ├── mapi_interface_pppoe_server.php │ │ │ ├── mapi_interface_pptp_client.php │ │ │ ├── mapi_interface_pptp_server.php │ │ │ ├── mapi_interface_vlan.php │ │ │ ├── mapi_interface_vrrp.php │ │ │ └── mapi_interfaces.php │ │ ├── ip │ │ │ ├── mapi_ip.php │ │ │ ├── mapi_ip_accounting.php │ │ │ ├── mapi_ip_address.php │ │ │ ├── mapi_ip_arp.php │ │ │ ├── mapi_ip_dhcp_client.php │ │ │ ├── mapi_ip_dhcp_relay.php │ │ │ ├── mapi_ip_dhcp_server.php │ │ │ ├── mapi_ip_dns.php │ │ │ ├── mapi_ip_firewall.php │ │ │ ├── mapi_ip_hotspot.php │ │ │ ├── mapi_ip_pool.php │ │ │ ├── mapi_ip_proxy.php │ │ │ ├── mapi_ip_route.php │ │ │ └── mapi_ip_service.php │ │ ├── ppp │ │ │ ├── mapi_ppp.php │ │ │ ├── mapi_ppp_aaa.php │ │ │ ├── mapi_ppp_active.php │ │ │ ├── mapi_ppp_profile.php │ │ │ └── mapi_ppp_secret.php │ │ └── system │ │ │ ├── mapi_system.php │ │ │ └── mapi_system_scheduler.php │ └── mikrotik_api.php │ └── spark.info └── system ├── .htaccess ├── core ├── Benchmark.php ├── CodeIgniter.php ├── Common.php ├── Config.php ├── Controller.php ├── Exceptions.php ├── Hooks.php ├── Input.php ├── Lang.php ├── Loader.php ├── Model.php ├── Output.php ├── Router.php ├── Security.php ├── URI.php ├── Utf8.php └── index.html ├── database ├── DB.php ├── DB_active_rec.php ├── DB_cache.php ├── DB_driver.php ├── DB_forge.php ├── DB_result.php ├── DB_utility.php ├── drivers │ ├── cubrid │ │ ├── cubrid_driver.php │ │ ├── cubrid_forge.php │ │ ├── cubrid_result.php │ │ ├── cubrid_utility.php │ │ └── index.html │ ├── index.html │ ├── mssql │ │ ├── index.html │ │ ├── mssql_driver.php │ │ ├── mssql_forge.php │ │ ├── mssql_result.php │ │ └── mssql_utility.php │ ├── mysql │ │ ├── index.html │ │ ├── mysql_driver.php │ │ ├── mysql_forge.php │ │ ├── mysql_result.php │ │ └── mysql_utility.php │ ├── mysqli │ │ ├── index.html │ │ ├── mysqli_driver.php │ │ ├── mysqli_forge.php │ │ ├── mysqli_result.php │ │ └── mysqli_utility.php │ ├── oci8 │ │ ├── index.html │ │ ├── oci8_driver.php │ │ ├── oci8_forge.php │ │ ├── oci8_result.php │ │ └── oci8_utility.php │ ├── odbc │ │ ├── index.html │ │ ├── odbc_driver.php │ │ ├── odbc_forge.php │ │ ├── odbc_result.php │ │ └── odbc_utility.php │ ├── pdo │ │ ├── index.html │ │ ├── pdo_driver.php │ │ ├── pdo_forge.php │ │ ├── pdo_result.php │ │ └── pdo_utility.php │ ├── postgre │ │ ├── index.html │ │ ├── postgre_driver.php │ │ ├── postgre_forge.php │ │ ├── postgre_result.php │ │ └── postgre_utility.php │ ├── sqlite │ │ ├── index.html │ │ ├── sqlite_driver.php │ │ ├── sqlite_forge.php │ │ ├── sqlite_result.php │ │ └── sqlite_utility.php │ └── sqlsrv │ │ ├── index.html │ │ ├── sqlsrv_driver.php │ │ ├── sqlsrv_forge.php │ │ ├── sqlsrv_result.php │ │ └── sqlsrv_utility.php └── index.html ├── fonts ├── index.html └── texb.ttf ├── helpers ├── array_helper.php ├── captcha_helper.php ├── cookie_helper.php ├── date_helper.php ├── directory_helper.php ├── download_helper.php ├── email_helper.php ├── file_helper.php ├── form_helper.php ├── html_helper.php ├── index.html ├── inflector_helper.php ├── language_helper.php ├── number_helper.php ├── path_helper.php ├── security_helper.php ├── smiley_helper.php ├── string_helper.php ├── text_helper.php ├── typography_helper.php ├── url_helper.php └── xml_helper.php ├── index.html ├── language ├── english │ ├── calendar_lang.php │ ├── date_lang.php │ ├── db_lang.php │ ├── email_lang.php │ ├── form_validation_lang.php │ ├── ftp_lang.php │ ├── imglib_lang.php │ ├── index.html │ ├── migration_lang.php │ ├── number_lang.php │ ├── profiler_lang.php │ ├── unit_test_lang.php │ └── upload_lang.php └── index.html └── libraries ├── Cache ├── Cache.php └── drivers │ ├── Cache_apc.php │ ├── Cache_dummy.php │ ├── Cache_file.php │ └── Cache_memcached.php ├── Calendar.php ├── Cart.php ├── Driver.php ├── Email.php ├── Encrypt.php ├── Form_validation.php ├── Ftp.php ├── Image_lib.php ├── Javascript.php ├── Log.php ├── Migration.php ├── Pagination.php ├── Parser.php ├── Profiler.php ├── Session.php ├── Sha1.php ├── Table.php ├── Trackback.php ├── Typography.php ├── Unit_test.php ├── Upload.php ├── User_agent.php ├── Xmlrpc.php ├── Xmlrpcs.php ├── Zip.php ├── index.html └── javascript └── Jquery.php /CREDITS: -------------------------------------------------------------------------------- 1 | 2 | CodeIgniter 2.1.0 3 | CodeIgniter Mikrotik API 0.7.0 4 | Bootstrap 2.0.3 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phpMikBox - Mikrotik Web-based Management 2 | 3 | This apps is intended to be Mikrotik webbox alternative, but with winbox features. 4 | Build with CodeIgniter, Mikrotik API, and Bootstrap. 5 | 6 | ## USAGE 7 | 1. Make sure that your Mikrotik API service already enabled. (by default it's listen on port 8728) 8 | 2. Change mikrotik configuration located on sparks/mikrotik_api/0.7.0/config/mikrotik.php 9 | 10 | **FAIR WARNING: Still under slow pace development, you are welcome to contribute.** -------------------------------------------------------------------------------- /application/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /application/cache/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /application/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/config/constants.php: -------------------------------------------------------------------------------- 1 | '', 5 | 'xhtml1-strict' => '', 6 | 'xhtml1-trans' => '', 7 | 'xhtml1-frame' => '', 8 | 'html5' => '', 9 | 'html4-strict' => '', 10 | 'html4-trans' => '', 11 | 'html4-frame' => '' 12 | ); 13 | 14 | /* End of file doctypes.php */ 15 | /* Location: ./application/config/doctypes.php */ -------------------------------------------------------------------------------- /application/config/foreign_chars.php: -------------------------------------------------------------------------------- 1 | 'ae', 12 | '/ö|œ/' => 'oe', 13 | '/ü/' => 'ue', 14 | '/Ä/' => 'Ae', 15 | '/Ü/' => 'Ue', 16 | '/Ö/' => 'Oe', 17 | '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ/' => 'A', 18 | '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª/' => 'a', 19 | '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', 20 | '/ç|ć|ĉ|ċ|č/' => 'c', 21 | '/Ð|Ď|Đ/' => 'D', 22 | '/ð|ď|đ/' => 'd', 23 | '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě/' => 'E', 24 | '/è|é|ê|ë|ē|ĕ|ė|ę|ě/' => 'e', 25 | '/Ĝ|Ğ|Ġ|Ģ/' => 'G', 26 | '/ĝ|ğ|ġ|ģ/' => 'g', 27 | '/Ĥ|Ħ/' => 'H', 28 | '/ĥ|ħ/' => 'h', 29 | '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ/' => 'I', 30 | '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı/' => 'i', 31 | '/Ĵ/' => 'J', 32 | '/ĵ/' => 'j', 33 | '/Ķ/' => 'K', 34 | '/ķ/' => 'k', 35 | '/Ĺ|Ļ|Ľ|Ŀ|Ł/' => 'L', 36 | '/ĺ|ļ|ľ|ŀ|ł/' => 'l', 37 | '/Ñ|Ń|Ņ|Ň/' => 'N', 38 | '/ñ|ń|ņ|ň|ʼn/' => 'n', 39 | '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ/' => 'O', 40 | '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º/' => 'o', 41 | '/Ŕ|Ŗ|Ř/' => 'R', 42 | '/ŕ|ŗ|ř/' => 'r', 43 | '/Ś|Ŝ|Ş|Š/' => 'S', 44 | '/ś|ŝ|ş|š|ſ/' => 's', 45 | '/Ţ|Ť|Ŧ/' => 'T', 46 | '/ţ|ť|ŧ/' => 't', 47 | '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ/' => 'U', 48 | '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ/' => 'u', 49 | '/Ý|Ÿ|Ŷ/' => 'Y', 50 | '/ý|ÿ|ŷ/' => 'y', 51 | '/Ŵ/' => 'W', 52 | '/ŵ/' => 'w', 53 | '/Ź|Ż|Ž/' => 'Z', 54 | '/ź|ż|ž/' => 'z', 55 | '/Æ|Ǽ/' => 'AE', 56 | '/ß/'=> 'ss', 57 | '/IJ/' => 'IJ', 58 | '/ij/' => 'ij', 59 | '/Œ/' => 'OE', 60 | '/ƒ/' => 'f' 61 | ); 62 | 63 | /* End of file foreign_chars.php */ 64 | /* Location: ./application/config/foreign_chars.php */ -------------------------------------------------------------------------------- /application/config/hooks.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/config/migration.php: -------------------------------------------------------------------------------- 1 | migration->latest() this is the version that schema will 21 | | be upgraded / downgraded to. 22 | | 23 | */ 24 | $config['migration_version'] = 0; 25 | 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Migrations Path 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Path to your migrations folder. 33 | | Typically, it will be within your application path. 34 | | Also, writing permission is required within the migrations path. 35 | | 36 | */ 37 | $config['migration_path'] = APPPATH . 'migrations/'; 38 | 39 | 40 | /* End of file migration.php */ 41 | /* Location: ./application/config/migration.php */ -------------------------------------------------------------------------------- /application/config/profiler.php: -------------------------------------------------------------------------------- 1 | array('grin.gif', '19', '19', 'grin'), 20 | ':lol:' => array('lol.gif', '19', '19', 'LOL'), 21 | ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), 22 | ':)' => array('smile.gif', '19', '19', 'smile'), 23 | ';-)' => array('wink.gif', '19', '19', 'wink'), 24 | ';)' => array('wink.gif', '19', '19', 'wink'), 25 | ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), 26 | ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), 27 | ':-S' => array('confused.gif', '19', '19', 'confused'), 28 | ':wow:' => array('surprise.gif', '19', '19', 'surprised'), 29 | ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), 30 | ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), 31 | '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), 32 | ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), 33 | ':P' => array('raspberry.gif', '19', '19', 'raspberry'), 34 | ':blank:' => array('blank.gif', '19', '19', 'blank stare'), 35 | ':long:' => array('longface.gif', '19', '19', 'long face'), 36 | ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), 37 | ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), 38 | ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), 39 | '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), 40 | ':down:' => array('downer.gif', '19', '19', 'downer'), 41 | ':red:' => array('embarrassed.gif', '19', '19', 'red face'), 42 | ':sick:' => array('sick.gif', '19', '19', 'sick'), 43 | ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), 44 | ':-/' => array('hmm.gif', '19', '19', 'hmmm'), 45 | '>:(' => array('mad.gif', '19', '19', 'mad'), 46 | ':mad:' => array('mad.gif', '19', '19', 'mad'), 47 | '>:-(' => array('angry.gif', '19', '19', 'angry'), 48 | ':angry:' => array('angry.gif', '19', '19', 'angry'), 49 | ':zip:' => array('zip.gif', '19', '19', 'zipper'), 50 | ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), 51 | ':ahhh:' => array('shock.gif', '19', '19', 'shock'), 52 | ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), 53 | ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), 54 | ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), 55 | ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), 56 | ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), 57 | ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), 58 | ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), 59 | ':snake:' => array('snake.gif', '19', '19', 'snake'), 60 | ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), 61 | ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item 62 | 63 | ); 64 | 65 | /* End of file smileys.php */ 66 | /* Location: ./application/config/smileys.php */ -------------------------------------------------------------------------------- /application/controllers/auth.php: -------------------------------------------------------------------------------- 1 | load->library('session'); 9 | } 10 | 11 | public function index() 12 | { 13 | if($this->session->userdata('loggedin')) redirect('/'); 14 | 15 | $data['main'] = 'auth/index'; 16 | $this->load->view('auth/layout', $data); 17 | } 18 | 19 | public function login() 20 | { 21 | $config['mikrotik']['host'] = $this->input->post('address'); 22 | $config['mikrotik']['port'] = '8728'; 23 | $config['mikrotik']['username'] = $this->input->post('username'); 24 | $config['mikrotik']['password'] = $this->input->post('password'); 25 | $config['mikrotik']['debug'] = FALSE; 26 | $config['mikrotik']['attempts'] = 3; 27 | $config['mikrotik']['delay'] = 2; 28 | $config['mikrotik']['timeout'] = 2; 29 | $this->session->set_userdata($config); 30 | $this->session->set_userdata('loggedin', TRUE); 31 | redirect('/'); 32 | } 33 | 34 | public function logout() 35 | { 36 | $this->session->unset_userdata('mikrotik'); 37 | $this->session->unset_userdata('loggedin'); 38 | redirect('auth'); 39 | } 40 | 41 | } 42 | 43 | /* End of file auth.php */ 44 | /* Location: ./application/controllers/auth.php */ -------------------------------------------------------------------------------- /application/controllers/bridge.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->interfaces()->bridge()->get_all_bridge(); 13 | $data['main'] = 'interfaces/bridge/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | public function ports() 18 | { 19 | $data['interfaces'] = $this->mikrotik_api->interfaces()->bridge()->get_all_ports(); 20 | $data['main'] = 'interfaces/bridge/ports'; 21 | $this->load->view('layout', $data); 22 | } 23 | 24 | public function filters() 25 | { 26 | $data['interfaces'] = $this->mikrotik_api->interfaces()->bridge()->get_all_filters(); 27 | $data['main'] = 'interfaces/bridge/filters'; 28 | $this->load->view('layout', $data); 29 | } 30 | 31 | public function nat() 32 | { 33 | $data['interfaces'] = $this->mikrotik_api->interfaces()->bridge()->get_all_bridge_nat(); 34 | $data['main'] = 'interfaces/bridge/nat'; 35 | $this->load->view('layout', $data); 36 | } 37 | 38 | public function hosts() 39 | { 40 | $data['interfaces'] = $this->mikrotik_api->interfaces()->bridge()->get_all_hosts(); 41 | $data['main'] = 'interfaces/bridge/hosts'; 42 | $this->load->view('layout', $data); 43 | } 44 | 45 | } 46 | 47 | /* End of file bridge.php */ 48 | /* Location: ./application/controllers/bridge.php */ -------------------------------------------------------------------------------- /application/controllers/files.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->file()->get_all_file(); 13 | $data['main'] = 'files/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file files.php */ 20 | /* Location: ./application/controllers/files.php */ -------------------------------------------------------------------------------- /application/controllers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/controllers/interfaces.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->interfaces()->ethernet()->get_all_interface(); 13 | $data['main'] = 'interfaces/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | public function ethernet() 18 | { 19 | $data['interfaces'] = $this->mikrotik_api->interfaces()->ethernet()->get_all_interface(); 20 | $data['main'] = 'interfaces/ethernet'; 21 | $this->load->view('layout', $data); 22 | } 23 | 24 | public function eoip() 25 | { 26 | $data['interfaces'] = $this->mikrotik_api->interfaces()->eoip()->get_all_eoip(); 27 | $data['main'] = 'interfaces/eoip'; 28 | $this->load->view('layout', $data); 29 | } 30 | 31 | public function ipip() 32 | { 33 | $data['interfaces'] = $this->mikrotik_api->interfaces()->ipip()->get_all_ipip(); 34 | $data['main'] = 'interfaces/ipip'; 35 | $this->load->view('layout', $data); 36 | } 37 | 38 | public function vlan() 39 | { 40 | $data['interfaces'] = $this->mikrotik_api->interfaces()->vlan()->get_all_vlan(); 41 | $data['main'] = 'interfaces/vlan'; 42 | $this->load->view('layout', $data); 43 | } 44 | 45 | public function vrrp() 46 | { 47 | $data['interfaces'] = $this->mikrotik_api->interfaces()->vrrp()->get_all_vrrp(); 48 | $data['main'] = 'interfaces/vrrp'; 49 | $this->load->view('layout', $data); 50 | } 51 | 52 | public function bonding() 53 | { 54 | $data['interfaces'] = $this->mikrotik_api->interfaces()->bonding()->get_all_bonding(); 55 | $data['main'] = 'interfaces/bonding'; 56 | $this->load->view('layout', $data); 57 | } 58 | } 59 | 60 | /* End of file interfaces.php */ 61 | /* Location: ./application/controllers/interfaces.php */ -------------------------------------------------------------------------------- /application/controllers/ip/address.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->address()->get_all_address(); 13 | $data['main'] = 'ip/address/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file address.php */ 20 | /* Location: ./application/controllers/address.php */ -------------------------------------------------------------------------------- /application/controllers/ip/arp.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->arp()->get_all_arp(); 13 | $data['main'] = 'ip/arp/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file arp.php */ 20 | /* Location: ./application/controllers/arp.php */ -------------------------------------------------------------------------------- /application/controllers/ip/dhcp_client.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->dhcp_client()->get_all_dhcp_client(); 13 | $data['main'] = 'ip/dhcp_client/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file dhcp_client.php */ 20 | /* Location: ./application/controllers/dhcp_client.php */ -------------------------------------------------------------------------------- /application/controllers/ip/dhcp_server.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->dhcp_server()->get_all_dhcp_server(); 13 | $data['main'] = 'ip/dhcp_server/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file dhcp_server.php */ 20 | /* Location: ./application/controllers/dhcp_server.php */ -------------------------------------------------------------------------------- /application/controllers/ip/dns.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->dns()->get_all_static_dns(); 18 | $data['main'] = 'ip/dns/static'; 19 | $this->load->view('layout', $data); 20 | } 21 | 22 | public function cache() 23 | { 24 | $data['dns'] = $this->mikrotik_api->ip()->dns()->get_all_dns_cache_all(); 25 | $data['main'] = 'ip/dns/cache'; 26 | $this->load->view('layout', $data); 27 | } 28 | 29 | } 30 | 31 | /* End of file dns.php */ 32 | /* Location: ./application/controllers/dns.php */ -------------------------------------------------------------------------------- /application/controllers/ip/firewall.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->firewall()->get_all_firewall_filter(); 18 | $data['main'] = 'ip/firewall/filter'; 19 | $this->load->view('layout', $data); 20 | } 21 | 22 | public function nat() 23 | { 24 | $data['firewall'] = $this->mikrotik_api->ip()->firewall()->get_all_firewall_nat(); 25 | $data['main'] = 'ip/firewall/nat'; 26 | $this->load->view('layout', $data); 27 | } 28 | 29 | public function mangle() 30 | { 31 | $data['firewall'] = $this->mikrotik_api->ip()->firewall()->get_all_firewall_mangle(); 32 | $data['main'] = 'ip/firewall/mangle'; 33 | $this->load->view('layout', $data); 34 | } 35 | 36 | public function service() 37 | { 38 | $data['firewall'] = $this->mikrotik_api->ip()->firewall()->get_all_firewall_service_port(); 39 | $data['main'] = 'ip/firewall/service'; 40 | $this->load->view('layout', $data); 41 | } 42 | 43 | public function connection() 44 | { 45 | $data['firewall'] = $this->mikrotik_api->ip()->firewall()->get_all_firewall_connection(); 46 | $data['main'] = 'ip/firewall/connection'; 47 | $this->load->view('layout', $data); 48 | } 49 | 50 | public function address() 51 | { 52 | $data['firewall'] = $this->mikrotik_api->ip()->firewall()->get_all_firewall_address_lists(); 53 | $data['main'] = 'ip/firewall/address'; 54 | $this->load->view('layout', $data); 55 | } 56 | } 57 | 58 | /* End of file firewall.php */ 59 | /* Location: ./application/controllers/ip/firewall.php */ -------------------------------------------------------------------------------- /application/controllers/ip/pool.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->pool()->get_all_pool(); 13 | $data['main'] = 'ip/pool/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | public function used_addresses() 18 | { 19 | redirect('ip/pool'); 20 | } 21 | 22 | } 23 | 24 | /* End of file pool.php */ 25 | /* Location: ./application/controllers/pool.php */ -------------------------------------------------------------------------------- /application/controllers/ip/routes.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->route()->get_all_route(); 13 | $data['main'] = 'ip/routes/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | public function nexthops() 18 | { 19 | redirect('ip/routes'); 20 | } 21 | 22 | public function rules() 23 | { 24 | redirect('ip/routes'); 25 | } 26 | 27 | public function vrf() 28 | { 29 | redirect('ip/routes'); 30 | } 31 | 32 | } 33 | 34 | /* End of file routes.php */ 35 | /* Location: ./application/controllers/routes.php */ -------------------------------------------------------------------------------- /application/controllers/ip/services.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ip()->service()->get_all_service(); 13 | $data['main'] = 'ip/services/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file services.php */ 20 | /* Location: ./application/controllers/services.php */ -------------------------------------------------------------------------------- /application/controllers/ppp.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->ppp()->ppp_secret()->get_all_ppp_secret(); 28 | $data['main'] = 'ppp/secrets'; 29 | $this->load->view('layout', $data); 30 | } 31 | 32 | public function profiles() 33 | { 34 | $data['ppp'] = $this->mikrotik_api->ppp()->ppp_profile()->get_all_ppp_profile(); 35 | $data['main'] = 'ppp/profiles'; 36 | $this->load->view('layout', $data); 37 | } 38 | 39 | public function active() 40 | { 41 | $data['ppp'] = $this->mikrotik_api->ppp()->ppp_active()->get_all_ppp_active(); 42 | $data['main'] = 'ppp/active'; 43 | $this->load->view('layout', $data); 44 | } 45 | } 46 | 47 | /* End of file ppp.php */ 48 | /* Location: ./application/controllers/ppp.php */ -------------------------------------------------------------------------------- /application/controllers/system/clock.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->system()->get_all_clock(); 13 | $data['main'] = 'system/clock/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | public function manual_timezone() 18 | { 19 | redirect('system/clock'); 20 | } 21 | 22 | } 23 | 24 | /* End of file clock.php */ 25 | /* Location: ./application/controllers/clock.php */ -------------------------------------------------------------------------------- /application/controllers/system/history.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->system()->get_all_history(); 13 | $data['main'] = 'system/history/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file history.php */ 20 | /* Location: ./application/controllers/history.php */ -------------------------------------------------------------------------------- /application/controllers/system/identity.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->system()->get_all_identity(); 13 | $data['main'] = 'system/identity/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file identity.php */ 20 | /* Location: ./application/controllers/identity.php */ -------------------------------------------------------------------------------- /application/controllers/system/license.php: -------------------------------------------------------------------------------- 1 | mikrotik_api->system()->get_all_license(); 13 | $data['main'] = 'system/license/index'; 14 | $this->load->view('layout', $data); 15 | } 16 | 17 | } 18 | 19 | /* End of file license.php */ 20 | /* Location: ./application/controllers/license.php */ -------------------------------------------------------------------------------- /application/core/MY_Controller.php: -------------------------------------------------------------------------------- 1 | load->library('session'); 9 | 10 | // session check 11 | if($this->session->userdata('loggedin')==NULL) redirect('auth'); 12 | 13 | $config['mikrotik'] = $this->session->userdata('mikrotik'); 14 | $this->load->spark('mikrotik_api/0.7.0'); 15 | $this->mikrotik_api->initialize($config); 16 | } 17 | } 18 | 19 | /* End of file MY_Controller.php */ 20 | /* Location: ./application/core/MY_Controller.php */ -------------------------------------------------------------------------------- /application/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/errors/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Page Not Found 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_db.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Database Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_general.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 55 | 56 | 57 |
58 |

59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /application/errors/error_php.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |

A PHP Error was encountered

4 | 5 |

Severity:

6 |

Message:

7 |

Filename:

8 |

Line Number:

9 | 10 |
-------------------------------------------------------------------------------- /application/errors/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/helpers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/language/english/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/models/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/third_party/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/views/alert.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | Well done! You successfully read this important alert message. 5 |
6 | -------------------------------------------------------------------------------- /application/views/auth/index.php: -------------------------------------------------------------------------------- 1 |
2 |

Welcome to phpmikbox, the web-based mikrotik management

3 | Still under slow-pace development, you are welcome to contribute. Fork it on Github. 4 |
5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 |
-------------------------------------------------------------------------------- /application/views/auth/layout.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | phpmikbox / Login 5 | 6 | 7 | 8 | 9 | 10 | 11 | 21 | 22 |
23 | 24 | 25 | load->view('alert');?> 26 | 27 | 28 | 29 | load->view($main);?> 30 | 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /application/views/files/index.php: -------------------------------------------------------------------------------- 1 | load->view('files/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($files); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
#File NameTypeSizeCreation Time
-------------------------------------------------------------------------------- /application/views/files/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/views/interfaces/bonding.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/bridge/index.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/bridge/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/bridge/nat.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/bridge/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($firewall); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#ActionChainSrc. AddressDst. AddressProtocolSrc. PortDst. PortIn. InterfaceOut. InterfaceBytesPackets
-------------------------------------------------------------------------------- /application/views/interfaces/bridge/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/interfaces/button.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |
19 | 22 |
23 |
-------------------------------------------------------------------------------- /application/views/interfaces/eoip.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/ethernet.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/index.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/ipip.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/interfaces/vlan.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/interfaces/vrrp.php: -------------------------------------------------------------------------------- 1 | load->view('interfaces/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($interfaces); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#NameTypeL2 MTUTxRxTx Packet (p/s)Rx Packet (p/s)Tx DropsRx DropsTx ErrorsRx Errors
-------------------------------------------------------------------------------- /application/views/ip/address/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/address/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($arp); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
#AddressNetworkBroadcastInterface
-------------------------------------------------------------------------------- /application/views/ip/address/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/arp/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/arp/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($arp); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
#IP AddressMAC AddressInterface
-------------------------------------------------------------------------------- /application/views/ip/arp/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/dhcp_client/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/dhcp_client/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($dhcp); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
#InterfaceUse Peer DNSAdd Default RouteIP AddressExpires AfterStatus
-------------------------------------------------------------------------------- /application/views/ip/dhcp_client/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/dhcp_server/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/dhcp_server/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($dhcp); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
#NameInterfaceRelayLease TimeAddress PoolAdd ARP For Leases
-------------------------------------------------------------------------------- /application/views/ip/dhcp_server/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/dns/cache.php: -------------------------------------------------------------------------------- 1 | load->view('ip/dns/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($dns); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
#NameTypeDataTTL
-------------------------------------------------------------------------------- /application/views/ip/dns/static.php: -------------------------------------------------------------------------------- 1 | load->view('ip/dns/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($dns); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
#NameAddressTTL (s)
-------------------------------------------------------------------------------- /application/views/ip/dns/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/firewall/button.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |
19 | 22 |
23 |
-------------------------------------------------------------------------------- /application/views/ip/firewall/connection.php: -------------------------------------------------------------------------------- 1 | load->view('ip/firewall/subnav'); 3 | $this->load->view('ip/firewall/button'); 4 | ?> 5 | 6 | "; 8 | print_r($firewall); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 |
#Src. AddressDst. AddressProtocolConnection TypeConnection MarkP2PTimeoutTCP State
-------------------------------------------------------------------------------- /application/views/ip/firewall/filter.php: -------------------------------------------------------------------------------- 1 | load->view('ip/firewall/subnav'); 3 | $this->load->view('ip/firewall/button'); 4 | ?> 5 | 6 | "; 8 | print_r($firewall); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#ActionChainSrc. AddressDst. AddressProtocolSrc. PortDst. PortIn. InterfaceOut. InterfaceBytesPackets
-------------------------------------------------------------------------------- /application/views/ip/firewall/mangle.php: -------------------------------------------------------------------------------- 1 | load->view('ip/firewall/subnav'); 3 | $this->load->view('ip/firewall/button'); 4 | ?> 5 | 6 | "; 8 | print_r($firewall); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#ActionChainSrc. AddressDst. AddressProtocolSrc. PortDst. PortIn. InterfaceOut. InterfaceBytesPackets
-------------------------------------------------------------------------------- /application/views/ip/firewall/nat.php: -------------------------------------------------------------------------------- 1 | load->view('ip/firewall/subnav'); 3 | $this->load->view('ip/firewall/button'); 4 | ?> 5 | 6 | "; 8 | print_r($firewall); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
#ActionChainSrc. AddressDst. AddressProtocolSrc. PortDst. PortIn. InterfaceOut. InterfaceBytesPackets
-------------------------------------------------------------------------------- /application/views/ip/firewall/service.php: -------------------------------------------------------------------------------- 1 | load->view('ip/firewall/subnav'); 3 | $this->load->view('ip/firewall/button'); 4 | ?> 5 | 6 | "; 8 | print_r($firewall); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
#NamePorts
-------------------------------------------------------------------------------- /application/views/ip/firewall/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/pool/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/pool/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($pool); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
#NameAddressesNext Pool
-------------------------------------------------------------------------------- /application/views/ip/pool/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/pool/used_address.php: -------------------------------------------------------------------------------- 1 | load->view('ip/pool/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($dns); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
#NameAddressTTL (s)
-------------------------------------------------------------------------------- /application/views/ip/routes/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/routes/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($routes); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
#Dst. AddressGatewayDistanceRouting MarkPref. Source
-------------------------------------------------------------------------------- /application/views/ip/routes/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/ip/services/index.php: -------------------------------------------------------------------------------- 1 | load->view('ip/services/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($services); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
#NamePortAvailable FromCertificate
-------------------------------------------------------------------------------- /application/views/ip/services/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/layout.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | phpmikbox 5 | 6 | 7 | 8 | 9 | 10 | 11 | 21 | 22 |
23 |
24 | 25 | load->view('sidebar');?> 26 | 27 | 28 | 29 |
30 | 31 | 32 | load->view('alert');?> 33 | 34 | 35 | 36 | load->view($main);?> 37 | 38 | 39 |
40 | 41 |
42 |
43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /application/views/ppp/active.php: -------------------------------------------------------------------------------- 1 | load->view('ppp/subnav'); 3 | $this->load->view('ppp/button'); 4 | ?> 5 | 6 | "; 8 | print_r($ppp); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
#NameServiceCaller IDEncodingAddressUptime
-------------------------------------------------------------------------------- /application/views/ppp/button.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 |
19 | 22 |
23 |
-------------------------------------------------------------------------------- /application/views/ppp/profiles.php: -------------------------------------------------------------------------------- 1 | load->view('ppp/subnav'); 3 | $this->load->view('ppp/button'); 4 | ?> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
#NameLocal AddressRemote AddressBridgeRate Limit (rx/tx)Only One
-------------------------------------------------------------------------------- /application/views/ppp/secrets.php: -------------------------------------------------------------------------------- 1 | load->view('ppp/subnav'); 3 | $this->load->view('ppp/button'); 4 | ?> 5 | 6 | "; 8 | print_r($ppp); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
#NamePasswordServiceCaller IDProfileLocal AddressRemote Address
-------------------------------------------------------------------------------- /application/views/ppp/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/system/clock/index.php: -------------------------------------------------------------------------------- 1 | load->view('system/clock/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($clock); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
#TimeDateTime Zone NameGMT Offset
-------------------------------------------------------------------------------- /application/views/system/clock/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/system/history/index.php: -------------------------------------------------------------------------------- 1 | load->view('system/history/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($history); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
#ActionByPolicy
-------------------------------------------------------------------------------- /application/views/system/history/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/system/identity/index.php: -------------------------------------------------------------------------------- 1 | load->view('system/identity/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($identity); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
#Name
-------------------------------------------------------------------------------- /application/views/system/identity/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/views/system/license/index.php: -------------------------------------------------------------------------------- 1 | load->view('system/license/subnav'); 3 | $this->load->view('interfaces/button'); 4 | ?> 5 | 6 | "; 8 | print_r($license); 9 | echo "";*/ 10 | ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
#Software IDUpgradable ToLevelFeaturesExpires In
-------------------------------------------------------------------------------- /application/views/system/license/subnav.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008 - 2011, EllisLab, Inc. 2 | All rights reserved. 3 | 4 | This license is a legal agreement between you and EllisLab Inc. for the use 5 | of CodeIgniter Software (the "Software"). By obtaining the Software you 6 | agree to comply with the terms and conditions of this license. 7 | 8 | PERMITTED USE 9 | You are permitted to use, copy, modify, and distribute the Software and its 10 | documentation, with or without modification, for any purpose, provided that 11 | the following conditions are met: 12 | 13 | 1. A copy of this license agreement must be included with the distribution. 14 | 15 | 2. Redistributions of source code must retain the above copyright notice in 16 | all source code files. 17 | 18 | 3. Redistributions in binary form must reproduce the above copyright notice 19 | in the documentation and/or other materials provided with the distribution. 20 | 21 | 4. Any files that have been modified must carry notices stating the nature 22 | of the change and the names of those who changed them. 23 | 24 | 5. Products derived from the Software must include an acknowledgment that 25 | they are derived from CodeIgniter in their documentation and/or other 26 | materials provided with the distribution. 27 | 28 | 6. Products derived from the Software may not be called "CodeIgniter", 29 | nor may "CodeIgniter" appear in their name, without prior written 30 | permission from EllisLab, Inc. 31 | 32 | INDEMNITY 33 | You agree to indemnify and hold harmless the authors of the Software and 34 | any contributors for any direct, indirect, incidental, or consequential 35 | third-party claims, actions or suits, as well as any related expenses, 36 | liabilities, damages, settlements or fees arising from your use or misuse 37 | of the Software, or a violation of any terms of this license. 38 | 39 | DISCLAIMER OF WARRANTY 40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR 41 | IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE, 42 | NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 43 | 44 | LIMITATIONS OF LIABILITY 45 | YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE. 46 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE 47 | FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION 48 | WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE 49 | APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING 50 | BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF 51 | DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. 52 | -------------------------------------------------------------------------------- /media/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/back2arie/phpmikbox/1ffb9d6e000a353ef49cce700fdf77c9bc9fd336/media/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /media/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/back2arie/phpmikbox/1ffb9d6e000a353ef49cce700fdf77c9bc9fd336/media/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /media/bootstrap/js/bootstrap-dropdown.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-dropdown.js v2.0.3 3 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* DROPDOWN CLASS DEFINITION 27 | * ========================= */ 28 | 29 | var toggle = '[data-toggle="dropdown"]' 30 | , Dropdown = function (element) { 31 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 32 | $('html').on('click.dropdown.data-api', function () { 33 | $el.parent().removeClass('open') 34 | }) 35 | } 36 | 37 | Dropdown.prototype = { 38 | 39 | constructor: Dropdown 40 | 41 | , toggle: function (e) { 42 | var $this = $(this) 43 | , $parent 44 | , selector 45 | , isActive 46 | 47 | if ($this.is('.disabled, :disabled')) return 48 | 49 | selector = $this.attr('data-target') 50 | 51 | if (!selector) { 52 | selector = $this.attr('href') 53 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 54 | } 55 | 56 | $parent = $(selector) 57 | $parent.length || ($parent = $this.parent()) 58 | 59 | isActive = $parent.hasClass('open') 60 | 61 | clearMenus() 62 | 63 | if (!isActive) $parent.toggleClass('open') 64 | 65 | return false 66 | } 67 | 68 | } 69 | 70 | function clearMenus() { 71 | $(toggle).parent().removeClass('open') 72 | } 73 | 74 | 75 | /* DROPDOWN PLUGIN DEFINITION 76 | * ========================== */ 77 | 78 | $.fn.dropdown = function (option) { 79 | return this.each(function () { 80 | var $this = $(this) 81 | , data = $this.data('dropdown') 82 | if (!data) $this.data('dropdown', (data = new Dropdown(this))) 83 | if (typeof option == 'string') data[option].call($this) 84 | }) 85 | } 86 | 87 | $.fn.dropdown.Constructor = Dropdown 88 | 89 | 90 | /* APPLY TO STANDARD DROPDOWN ELEMENTS 91 | * =================================== */ 92 | 93 | $(function () { 94 | $('html').on('click.dropdown.data-api', clearMenus) 95 | $('body') 96 | .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) 97 | .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) 98 | }) 99 | 100 | }(window.jQuery); -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/README.md: -------------------------------------------------------------------------------- 1 | #Mikrotik RouterOS API 2 | This spark library for working with Mikrotik RouterOS API. The Library is developing 3 | from Denis Basta (denis.basta@gmail.com) routeros_api class and we change it to our 4 | core class with name Mapi_Core. 5 | 6 | We have been tested with RouterOS version 3 and above 7 | 8 | ##Documentation 9 | We still build documentation for this spark library, 10 | so to get documentation about this library please go to http://doc.vthink.web.id 11 | and to get spark libary update information please go to our site at : http://vthink.web.id/index.php/content/categories/21 12 | 13 | 14 | And to know more about Mikrotik RouterOS API Manual 15 | you can go to site : http://wiki.mikrotik.com/wiki/Manual:API 16 | 17 | 18 | ##Requirement 19 | This spark library need minimum requirement for doing well on run. 20 | * CodeIgniter : version 2.0.3 21 | * PHP : version 5.2.x and above 22 | * Mikrotik RouterOS : version 3.xx and above 23 | 24 | ##Instalation 25 | For Install this spark, open your terminal and write down this command 26 | 27 | php tools/spark install mikrotik_api -v0.7.0 28 | 29 | ##Configuration 30 | You need to define your connection and authentication information in config file.
31 | The config file is located in sparks/mikrotik_api/0.7.0/config/mikrotik.php 32 | 33 | $config['mikrotik']['host'] = '192.168.88.1'; 34 | $config['mikrotik']['port'] = '8728'; 35 | $config['mikrotik']['username'] = 'admin'; 36 | $config['mikrotik']['password'] = ''; 37 | $config['mikrotik']['debug'] = FALSE; 38 | $config['mikrotik']['attempts'] = 5; 39 | $config['mikrotik']['delay'] = 2; 40 | $config['mikrotik']['timeout'] = 2; 41 | 42 | Descriptions: 43 | 44 | $config['mikrotik']['host'] = '192.168.88.1'; --> ip address or domain of your Mikrotik RouterOS 45 | $config['mikrotik']['port'] = '8728'; --> port of your Mikrotik RouterOS API service 46 | $config['mikrotik']['username'] = 'admin'; --> username of your Mikrotik RouterOS 47 | $config['mikrotik']['password'] = ''; --> password of your Mikrotik RouterOS 48 | $config['mikrotik']['debug'] = FALSE; --> if TRUE, the library will write the output of your command 49 | $config['mikrotik']['attempts'] = 5; --> how many times the library will attempt a connection before declare Connection Error 50 | $config['mikrotik']['delay'] = 2; --> how long delay between attempt a new connection 51 | $config['mikrotik']['timeout'] = 2; --> how long the library will declare a timeout when there is no response from Mikrotik RouterOS 52 | 53 | 54 | ##Run 55 | Okey, if you have finished yet to configure, lets try this code 56 | 57 | class Test extends CI_Controller { 58 | function __construct() { 59 | parent::__construct(); 60 | $this->load->spark('mikrotik_api/0.7.0'); 61 | } 62 | 63 | public function index(){ 64 | $test = $this->mikrotik_api->ip()->address()->get_all_address(); 65 | print_r($test); 66 | } 67 | 68 | } 69 | 70 | 71 | ##Bugs 72 | Please send us email when you got bugs or some idea for this spark library 73 | * nunenuh@gmail.com 74 | * krisna.pranata@gmail.com 75 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/config/autoload.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Krisna Pranata krisna.pranata@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | * @version 0.5.0 12 | */ 13 | class Mapi_Query extends Mapi_Core { 14 | /** 15 | * @access private 16 | * @var type array 17 | */ 18 | private $param; 19 | 20 | /** 21 | * Instantiation 22 | * @param type $param array 23 | */ 24 | function __construct($param=array()) { 25 | $this->param = $param; 26 | parent::__construct($param); //Mikrotik_Api_Core 27 | } 28 | 29 | /** 30 | * @access protected 31 | * @param type $param string/array 32 | * @return boolean 33 | */ 34 | function query($param){ 35 | $out=''; 36 | if ($this->connect()){ 37 | $out= $this->__build($param); 38 | $this->disconnect(); 39 | } else { 40 | $out = FALSE; 41 | } 42 | return $out; 43 | } 44 | 45 | /** 46 | * @access protected 47 | * @param type $param array 48 | * @return type array 49 | */ 50 | private function __build($param){ 51 | $tmp=''; 52 | if (!is_array($param)){ 53 | $tmp=explode('/', $param); 54 | } else { 55 | $tmp=explode('/', $param['command']); 56 | } 57 | 58 | $tmp_count=count($tmp); 59 | $last_command=$tmp[$tmp_count-1]; 60 | 61 | //write check 62 | if (is_array($param)){ 63 | $count = count($param); 64 | $i=0; 65 | foreach ($param as $key => $value){ 66 | $status=FALSE; 67 | if ($i==$count-1){ 68 | $status=TRUE; 69 | } 70 | if ($key=='command'){ 71 | $this->write($value,false); 72 | } else { 73 | if ($key=='id'){ 74 | if ($last_command=="print"){ 75 | $this->write('?.'.$key.'='.$value, $status); 76 | } else { 77 | $this->write('=.'.$key.'='.$value, $status); 78 | } 79 | } else { 80 | $this->write('='.$key.'='.$value,$status); 81 | } 82 | } 83 | $i++; 84 | } 85 | } else { 86 | $this->write($param); 87 | } 88 | 89 | $r_status=''; 90 | if ($last_command=="print"||$last_command=="getall"){ 91 | $r_status=TRUE; 92 | } else { 93 | $r_status=FALSE; 94 | } 95 | 96 | return $this->read($r_status); 97 | } 98 | 99 | } -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/file/mapi_file.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | 13 | class Mapi_File extends Mapi_Query { 14 | /** 15 | * @access private 16 | * @var type array 17 | */ 18 | private $param; 19 | 20 | function __construct($param ) { 21 | $this->param = $param; 22 | parent::__construct($param); 23 | } 24 | 25 | /** 26 | * This method is used to display all file in mikrotik RouterOs 27 | * @return type array 28 | */ 29 | public function get_all_file(){ 30 | return $this->query('/file/getall'); 31 | } 32 | 33 | /** 34 | * This method is used to display one file 35 | * in detail based on the id 36 | * @param type $id string 37 | * @return type array 38 | */ 39 | public function detail_file($id){ 40 | $input = array( 41 | 'command' => '/file/print', 42 | 'id' => $id 43 | ); 44 | return $this->query($input); 45 | } 46 | 47 | /** 48 | * This method is used to delete file by id 49 | * @param type $id string 50 | * @return type array 51 | */ 52 | public function delete_file($id){ 53 | $input = array( 54 | 'command' => '/file/remove', 55 | 'id' => $id 56 | ); 57 | return $this->query($input); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/interface/mapi_interface_ethernet.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | class Mapi_Interface_Ethernet extends Mapi_Query { 13 | /** 14 | * 15 | * @var type array 16 | */ 17 | private $param; 18 | 19 | function __construct($param) { 20 | $this->param = $param; 21 | parent::__construct($param); 22 | } 23 | 24 | /** 25 | * This method is used to display all interface 26 | * @return type array 27 | */ 28 | public function get_all_interface(){ 29 | return $this->query('/interface/getall'); 30 | } 31 | 32 | /** 33 | * This method is used to display one interface 34 | * in detail based on the id 35 | * @param type $param array 36 | * @param type $id string 37 | * @return type array 38 | */ 39 | 40 | public function set_interface($param, $id){ 41 | $input = array( 42 | 'command' => '/interface/set', 43 | 'id' => $id 44 | ); 45 | $out = array_merge($input, $param); 46 | return $this->query($out); 47 | } 48 | 49 | /** 50 | * This method is used to enable interface by id 51 | * @param type $id string 52 | * @return type array 53 | */ 54 | public function enable_interface($id){ 55 | $input = array( 56 | 'command' => '/interface/enable', 57 | 'id' => $id 58 | ); 59 | return $this->query($input); 60 | } 61 | 62 | /** 63 | * This method is used to disable interface by id 64 | * @param type $id string 65 | * @return type array 66 | */ 67 | public function disable_interface($id){ 68 | $input = array( 69 | 'command' => '/interface/disable', 70 | 'id' => $id 71 | ); 72 | return $this->query($input); 73 | } 74 | /** 75 | * This method is used to display one interafce 76 | * in detail based on the id 77 | * @param type $id string 78 | * @return type array 79 | * 80 | */ 81 | public function detail_interface($id){ 82 | $input = array( 83 | 'command' => '/interface/print', 84 | 'id' => $id 85 | ); 86 | return $this->query($input); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ip/mapi_ip_accounting.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | class Mapi_Ip_Accounting extends Mapi_Query{ 13 | /** 14 | * 15 | * @var type array 16 | */ 17 | private $param; 18 | 19 | function __construct($param) { 20 | $this->param = $param; 21 | parent::__construct($param); 22 | } 23 | 24 | /** 25 | * This method is used to set or edit ip accountng 26 | * @param type $account_local_traffic string 27 | * @param type $enabled string 28 | * @param type $threshold string 29 | * @return type array 30 | */ 31 | public function set_accounting($account_local_traffic, $enabled, $threshold){ 32 | $input = array( 33 | 'command' => '/ip/accounting/set', 34 | 'account-local-traffic' => $account_local_traffic, 35 | 'enabled' => $enabled, 36 | 'threshold' => $threshold 37 | ); 38 | return $this->query($input); 39 | } 40 | 41 | /** 42 | * This method is used to display all accounting 43 | * @return type array 44 | * 45 | */ 46 | public function get_all_accounting(){ 47 | return $this->query('/ip/accounting/getall'); 48 | } 49 | 50 | /** 51 | * This method is used to display all snapshot 52 | * @return type array 53 | * 54 | */ 55 | public function get_all_snapshot(){ 56 | return $this->query('/ip/accounting/snapshot/getall'); 57 | } 58 | 59 | /** 60 | * This method is used to display all uncounted 61 | * @return type array 62 | * 63 | */ 64 | public function get_all_uncounted(){ 65 | return $this->query('/ip/accounting/uncounted/getall'); 66 | } 67 | 68 | /** 69 | * This method is used to display all web-acces 70 | * @return type array 71 | * 72 | */ 73 | public function get_all_web_access(){ 74 | return $this->query('/ip/accounting/web-access/getall'); 75 | } 76 | /** 77 | * This method is used to ip accounting set web-acces 78 | * @param type $accessible_via_web string default : yes or no 79 | * @return type array 80 | * 81 | */ 82 | public function set_web_access($accessible_via_web){ 83 | $input = array( 84 | 'command' => '/ip/accounting/web-access/set', 85 | 'accessible-via-web' => $accessible_via_web, 86 | 'address' => '0.0.0.0/0' 87 | ); 88 | return $this->query($input); 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ip/mapi_ip_pool.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | class Mapi_Ip_Pool extends Mapi_Query { 13 | /** 14 | * 15 | * @var type array 16 | */ 17 | private $param; 18 | 19 | function __construct($param) { 20 | $this->param = $param; 21 | parent::__construct($param); 22 | } 23 | 24 | /** 25 | * This method is used to add pool 26 | * @param type $param array 27 | * @return type array 28 | * 29 | */ 30 | public function add_pool($param){ 31 | $input = array( 32 | 'command' => '/ip/pool/add' 33 | ); 34 | $out = array_merge($input, $param); 35 | return $this->query($out); 36 | } 37 | 38 | /** 39 | * This method is used to display 40 | * all pool 41 | * @return type array 42 | * 43 | */ 44 | public function get_all_pool(){ 45 | return $this->query('/ip/pool/getall'); 46 | } 47 | 48 | /** 49 | * This method is used to remove the pool by id 50 | * @param type $id string 51 | * @return type array 52 | * 53 | */ 54 | public function delete_pool($id){ 55 | $input = array( 56 | 'command' => '/ip/pool/remove', 57 | 'id' => $id 58 | ); 59 | return $this->query($input); 60 | } 61 | 62 | /** 63 | * This method is used to change pool based on the id 64 | * @param type $param array 65 | * @param type $id string 66 | * @return type array 67 | * 68 | */ 69 | public function set_pool($param, $id){ 70 | $input = array( 71 | 'command' => '/ip/pool/set', 72 | 'id' => $id 73 | ); 74 | $out = array_merge($input, $param); 75 | return $this->query($out); 76 | } 77 | /** 78 | * This method is used to display one pool 79 | * in detail based on the id 80 | * @param type $id string 81 | * @return type array 82 | * 83 | */ 84 | public function detail_pool($id){ 85 | $input = array( 86 | 'command' => '/ip/pool/print', 87 | 'id' => $id 88 | ); 89 | return $this->query($input); 90 | } 91 | } 92 | 93 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ip/mapi_ip_proxy.php: -------------------------------------------------------------------------------- 1 | param ; $param; 17 | parent::__construct($param); 18 | } 19 | 20 | /** 21 | * This method used for get all Ip Proxi 22 | * @return type array 23 | */ 24 | public function get_all_proxy(){ 25 | return $this->query('/ip/proxy/getall'); 26 | } 27 | 28 | /** 29 | * 30 | * This method used for set Ip proxy 31 | * @param type $param array 32 | * @return type array 33 | */ 34 | public function set_proxy($param){ 35 | $input = array( 36 | 'command' => '/ip/proxy/set' 37 | ); 38 | $out = array_merge($input, $param); 39 | return $this->query($out); 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ip/mapi_ip_route.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 7 | * @copyright Copyright (c) 2011, Virtual Think Team. 8 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 9 | * @category Libraries 10 | */ 11 | class Mapi_Ip_Route extends Mapi_Query { 12 | /** 13 | * 14 | * @var type array 15 | */ 16 | private $param; 17 | 18 | function __construct($param ) { 19 | $this->param = $param; 20 | parent::__construct($param); 21 | } 22 | 23 | /** 24 | * This method is used to display all ip route 25 | * @return type array 26 | */ 27 | public function get_all_route(){ 28 | return $this->query('/ip/route/getall'); 29 | } 30 | 31 | /** 32 | * This method is used to add ip route gateway 33 | * @param type $param array 34 | * @return type array 35 | */ 36 | public function add_route_gateway($param){ 37 | $input = array( 38 | 'command' => '/ip/route/add' 39 | ); 40 | $out = array_merge($input, $param); 41 | return $this->query($out); 42 | } 43 | 44 | /** 45 | * Can change or disable only static routes 46 | * @param type $id is not array 47 | * 48 | */ 49 | public function disable_route($id){ 50 | $input = array( 51 | 'command' => '/ip/route/disable', 52 | 'id' => $id 53 | ); 54 | return $this->query($input); 55 | } 56 | 57 | /** 58 | * Can change or enable only static routes 59 | * @param type $id string 60 | * @return type array 61 | * 62 | */ 63 | public function enable_route($id){ 64 | $input = array( 65 | 'command' => '/ip/route/enable', 66 | 'id' => $id 67 | ); 68 | return $this->query($input); 69 | } 70 | 71 | /** 72 | * Can change or remove only static routes 73 | * @param type $id string 74 | * @return type array 75 | * 76 | */ 77 | public function delete_route($id){ 78 | $input = array( 79 | 'command' => '/ip/route/remove', 80 | 'id' => $id 81 | ); 82 | return $this->query($input); 83 | } 84 | 85 | /** 86 | * Can change only static routes 87 | * @param type $param array 88 | * @param type $id string 89 | * @return type array 90 | * 91 | */ 92 | public function set_route($param, $id){ 93 | $input = array( 94 | 'command' => '/ip/route/set', 95 | 'id' => $id 96 | ); 97 | $out=array_merge($input, $param); 98 | return $this->query($out); 99 | } 100 | 101 | /** 102 | * This method is used to display one ip route 103 | * in detail based on the id 104 | * @param type $id string 105 | * @return type array 106 | * 107 | */ 108 | public function detail_route($id){ 109 | $input = array( 110 | 'command' => '/ip/route/print', 111 | 'id' => $id 112 | ); 113 | return $this->query($input); 114 | } 115 | } 116 | 117 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ip/mapi_ip_service.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | class Mapi_Ip_Service extends Mapi_Query { 13 | private $param; 14 | function __construct($param ) { 15 | $this->param = $param; 16 | parent::__construct($param); 17 | } 18 | 19 | /** 20 | * This methode is used to display all ip service 21 | * @return type array 22 | */ 23 | public function get_all_service(){ 24 | return $this->query('/ip/service/getall'); 25 | } 26 | 27 | /** 28 | * This methode is used to enable ip service by id 29 | * @param type $id string 30 | * @return type array 31 | */ 32 | public function enable_service($id){ 33 | $input = array( 34 | 'command' => '/ip/service/enable', 35 | 'id' => $id 36 | ); 37 | return $this->query($input); 38 | } 39 | 40 | /** 41 | * This methode is used to disable ip service by id 42 | * @param type $id string 43 | * @return type array 44 | */ 45 | public function disable_service($id){ 46 | $input = array( 47 | 'command' => '/ip/service/disable', 48 | 'id' => $id 49 | ); 50 | return $this->query($input); 51 | } 52 | 53 | /** 54 | * This method is used to display one ip service 55 | * in detail based on the id 56 | * @param type $id string 57 | * @return type array 58 | */ 59 | public function detail_service($id){ 60 | $input = array( 61 | 'command' => '/ip/service/print', 62 | 'id' => $id 63 | ); 64 | return $this->query($input); 65 | } 66 | 67 | public function set_service($param, $id){ 68 | $input = array( 69 | 'command' => '/ip/service/set', 70 | 'id' => $id 71 | ); 72 | $out = array_merge($input, $param); 73 | return $this->query($out); 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ppp/mapi_ppp.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | class Mapi_Ppp { 13 | private $param; 14 | function __construct($param = array()) { 15 | $this->param = $param; 16 | } 17 | 18 | /** 19 | * This method for call class Mapi_Ppp_Profile 20 | * @return Object of Mapi_Ppp_Profile class 21 | */ 22 | public function ppp_profile(){ 23 | return new Mapi_Ppp_Profile($this->param); 24 | } 25 | 26 | /** 27 | * This method for call class Mapi_Ppp_Secret 28 | * @return Object of Mapi_Ppp_Secret 29 | */ 30 | public function ppp_secret(){ 31 | return new Mapi_Ppp_Secret($this->param); 32 | } 33 | 34 | 35 | /** 36 | * This method for call class Mapi_Ppp_Aaa 37 | * @access public 38 | * @return object of Mapi_Ppp_Aaa class 39 | */ 40 | public function ppp_aaa(){ 41 | return new Mapi_Ppp_Aaa($this->param); 42 | } 43 | 44 | /** 45 | * This method for call class Mapi_Ppp_Active 46 | * @return Object of Mapi_Ppp_Active class 47 | */ 48 | public function ppp_active(){ 49 | return new Mapi_Ppp_Active($this->param); 50 | } 51 | } -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ppp/mapi_ppp_aaa.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 7 | * @copyright Copyright (c) 2011, Virtual Think Team. 8 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 9 | * @category Libraries 10 | */ 11 | class Mapi_Ppp_Aaa extends Mapi_Query { 12 | /** 13 | * 14 | * @var type array 15 | */ 16 | private $param; 17 | 18 | function __construct($param){ 19 | $this->param = $param; 20 | parent::__construct($param); 21 | } 22 | 23 | /** 24 | * This method is used to display all ppp aaa 25 | * @return type array 26 | */ 27 | public function get_all_aaa(){ 28 | return $this->query('/ppp/aaa/getall'); 29 | } 30 | 31 | /** 32 | * This method is used to set ppp aaa 33 | * @param type $use_radius string 34 | * @param type $accounting string 35 | * @param type $interim_update string 36 | * @return type array 37 | */ 38 | public function set_ppp_aaa($use_radius, $accounting, $interim_update){ 39 | $input = array( 40 | 'command' => '/ppp/aaa/set', 41 | 'use-radius' => $use_radius, 42 | 'accounting' => $accounting, 43 | 'interim-update' => $interim_update 44 | ); 45 | return $this->query($input); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ppp/mapi_ppp_active.php: -------------------------------------------------------------------------------- 1 | 7 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 8 | * @copyright Copyright (c) 2011, Virtual Think Team. 9 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 10 | * @category Libraries 11 | */ 12 | class Mapi_Ppp_Active extends Mapi_Query { 13 | private $param; 14 | function __construct($param){ 15 | $this->param = $param; 16 | parent::__construct($param); 17 | } 18 | 19 | /** 20 | * This method is used to display all ppp active 21 | * @return type array 22 | */ 23 | public function get_all_ppp_active(){ 24 | return $this->query('/ppp/active/getall'); 25 | } 26 | 27 | /** 28 | * This method is used to delete ppp active 29 | * @param type $id string 30 | * @return type array 31 | */ 32 | public function delete_ppp_active($id){ 33 | $input = array( 34 | 'caommand' => '/ppp/active/remove', 35 | 'id' => $id 36 | ); 37 | return $this->query($input); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/libraries/mikrotik/ppp/mapi_ppp_profile.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Lalu Erfandi Maula Yusnu nunenuh@gmail.com 7 | * @copyright Copyright (c) 2011, Virtual Think Team. 8 | * @license http://opensource.org/licenses/gpl-license.php GNU Public License 9 | * @category Libraries 10 | */ 11 | class Mapi_Ppp_Profile extends Mapi_Query { 12 | /** 13 | * 14 | * @var type array 15 | */ 16 | private $param; 17 | 18 | function __construct($param) { 19 | $this->param = $param; 20 | parent::__construct($param); 21 | } 22 | 23 | /** 24 | * This method is used to add ppp profile 25 | * @param type $param array 26 | * @return type array 27 | * 28 | */ 29 | public function add_ppp_profile($param){ 30 | $input = array( 31 | 'command' => '/ppp/profile/add', 32 | ); 33 | $out = array_merge($input, $param); 34 | return $this->query($out); 35 | } 36 | 37 | /** 38 | * This method is used to display all ppp profile 39 | * @return type array 40 | * 41 | */ 42 | public function get_all_ppp_profile(){ 43 | return $this->query('/ppp/profile/getall'); 44 | } 45 | 46 | /** 47 | * This method is used to remove ppp profile by id 48 | * @param type $id string 49 | * @return type array 50 | * 51 | */ 52 | public function delete_ppp_profile($id){ 53 | $input = array( 54 | 'command' => '/ppp/profile/remove', 55 | 'id' => $id 56 | ); 57 | return $this->query($input); 58 | } 59 | 60 | /** 61 | * This method is used to set or edit ppp profile by id 62 | * @param type $param array 63 | * @param type $id string 64 | * @return type array 65 | * 66 | */ 67 | public function set_ppp_profile($param, $id){ 68 | $input = array( 69 | 'command' => '/ppp/profile/set', 70 | 'id' => $id 71 | ); 72 | $out = array_merge($input, $param); 73 | return $this->query($out); 74 | } 75 | 76 | /** 77 | * This method is used to display one ppp profile 78 | * in detail based on the id 79 | * @param type $id string 80 | * @return type array 81 | * 82 | */ 83 | public function detail_ppp_profile($id){ 84 | $input = array( 85 | 'command' => '/ppp/profile/print', 86 | 'id' => $id 87 | ); 88 | return $this->query($input); 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /sparks/mikrotik_api/0.7.0/spark.info: -------------------------------------------------------------------------------- 1 | name: mikrotik_api 2 | version: 0.7.0 3 | compatibility: 2.0.3 4 | -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | Deny from all -------------------------------------------------------------------------------- /system/core/Controller.php: -------------------------------------------------------------------------------- 1 | $class) 45 | { 46 | $this->$var =& load_class($class); 47 | } 48 | 49 | $this->load =& load_class('Loader', 'core'); 50 | 51 | $this->load->initialize(); 52 | 53 | log_message('debug', "Controller Class Initialized"); 54 | } 55 | 56 | public static function &get_instance() 57 | { 58 | return self::$instance; 59 | } 60 | } 61 | // END Controller class 62 | 63 | /* End of file Controller.php */ 64 | /* Location: ./system/core/Controller.php */ -------------------------------------------------------------------------------- /system/core/Model.php: -------------------------------------------------------------------------------- 1 | $key; 52 | } 53 | } 54 | // END Model Class 55 | 56 | /* End of file Model.php */ 57 | /* Location: ./system/core/Model.php */ -------------------------------------------------------------------------------- /system/core/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/cubrid/cubrid_utility.php: -------------------------------------------------------------------------------- 1 | conn_id) 41 | { 42 | return "SELECT '" . $this->database . "'"; 43 | } 44 | else 45 | { 46 | return FALSE; 47 | } 48 | } 49 | 50 | // -------------------------------------------------------------------- 51 | 52 | /** 53 | * Optimize table query 54 | * 55 | * Generates a platform-specific query so that a table can be optimized 56 | * 57 | * @access private 58 | * @param string the table name 59 | * @return object 60 | * @link http://www.cubrid.org/manual/840/en/Optimize%20Database 61 | */ 62 | function _optimize_table($table) 63 | { 64 | // No SQL based support in CUBRID as of version 8.4.0. Database or 65 | // table optimization can be performed using CUBRID Manager 66 | // database administration tool. See the link above for more info. 67 | return FALSE; 68 | } 69 | 70 | // -------------------------------------------------------------------- 71 | 72 | /** 73 | * Repair table query 74 | * 75 | * Generates a platform-specific query so that a table can be repaired 76 | * 77 | * @access private 78 | * @param string the table name 79 | * @return object 80 | * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency 81 | */ 82 | function _repair_table($table) 83 | { 84 | // Not supported in CUBRID as of version 8.4.0. Database or 85 | // table consistency can be checked using CUBRID Manager 86 | // database administration tool. See the link above for more info. 87 | return FALSE; 88 | } 89 | 90 | // -------------------------------------------------------------------- 91 | /** 92 | * CUBRID Export 93 | * 94 | * @access private 95 | * @param array Preferences 96 | * @return mixed 97 | */ 98 | function _backup($params = array()) 99 | { 100 | // No SQL based support in CUBRID as of version 8.4.0. Database or 101 | // table backup can be performed using CUBRID Manager 102 | // database administration tool. 103 | return $this->db->display_error('db_unsuported_feature'); 104 | } 105 | } 106 | 107 | /* End of file cubrid_utility.php */ 108 | /* Location: ./system/database/drivers/cubrid/cubrid_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/cubrid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mssql/mssql_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | 85 | } 86 | 87 | /* End of file mssql_utility.php */ 88 | /* Location: ./system/database/drivers/mssql/mssql_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mysqli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/mysqli/mysqli_utility.php: -------------------------------------------------------------------------------- 1 | db->_escape_identifiers($table); 52 | } 53 | 54 | // -------------------------------------------------------------------- 55 | 56 | /** 57 | * Repair table query 58 | * 59 | * Generates a platform-specific query so that a table can be repaired 60 | * 61 | * @access private 62 | * @param string the table name 63 | * @return object 64 | */ 65 | function _repair_table($table) 66 | { 67 | return "REPAIR TABLE ".$this->db->_escape_identifiers($table); 68 | } 69 | 70 | // -------------------------------------------------------------------- 71 | 72 | /** 73 | * MySQLi Export 74 | * 75 | * @access private 76 | * @param array Preferences 77 | * @return mixed 78 | */ 79 | function _backup($params = array()) 80 | { 81 | // Currently unsupported 82 | return $this->db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | /* End of file mysqli_utility.php */ 87 | /* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/oci8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/oci8/oci8_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | /* End of file oci8_utility.php */ 87 | /* Location: ./system/database/drivers/oci8/oci8_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/odbc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/odbc/odbc_utility.php: -------------------------------------------------------------------------------- 1 | db->db_debug) 37 | { 38 | return $this->db->display_error('db_unsuported_feature'); 39 | } 40 | return FALSE; 41 | } 42 | 43 | // -------------------------------------------------------------------- 44 | 45 | /** 46 | * Optimize table query 47 | * 48 | * Generates a platform-specific query so that a table can be optimized 49 | * 50 | * @access private 51 | * @param string the table name 52 | * @return object 53 | */ 54 | function _optimize_table($table) 55 | { 56 | // Not a supported ODBC feature 57 | if ($this->db->db_debug) 58 | { 59 | return $this->db->display_error('db_unsuported_feature'); 60 | } 61 | return FALSE; 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * Repair table query 68 | * 69 | * Generates a platform-specific query so that a table can be repaired 70 | * 71 | * @access private 72 | * @param string the table name 73 | * @return object 74 | */ 75 | function _repair_table($table) 76 | { 77 | // Not a supported ODBC feature 78 | if ($this->db->db_debug) 79 | { 80 | return $this->db->display_error('db_unsuported_feature'); 81 | } 82 | return FALSE; 83 | } 84 | 85 | // -------------------------------------------------------------------- 86 | 87 | /** 88 | * ODBC Export 89 | * 90 | * @access private 91 | * @param array Preferences 92 | * @return mixed 93 | */ 94 | function _backup($params = array()) 95 | { 96 | // Currently unsupported 97 | return $this->db->display_error('db_unsuported_feature'); 98 | } 99 | 100 | } 101 | 102 | /* End of file odbc_utility.php */ 103 | /* Location: ./system/database/drivers/odbc/odbc_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/pdo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/pdo/pdo_utility.php: -------------------------------------------------------------------------------- 1 | db->db_debug) 37 | { 38 | return $this->db->display_error('db_unsuported_feature'); 39 | } 40 | return FALSE; 41 | } 42 | 43 | // -------------------------------------------------------------------- 44 | 45 | /** 46 | * Optimize table query 47 | * 48 | * Generates a platform-specific query so that a table can be optimized 49 | * 50 | * @access private 51 | * @param string the table name 52 | * @return object 53 | */ 54 | function _optimize_table($table) 55 | { 56 | // Not a supported PDO feature 57 | if ($this->db->db_debug) 58 | { 59 | return $this->db->display_error('db_unsuported_feature'); 60 | } 61 | return FALSE; 62 | } 63 | 64 | // -------------------------------------------------------------------- 65 | 66 | /** 67 | * Repair table query 68 | * 69 | * Generates a platform-specific query so that a table can be repaired 70 | * 71 | * @access private 72 | * @param string the table name 73 | * @return object 74 | */ 75 | function _repair_table($table) 76 | { 77 | // Not a supported PDO feature 78 | if ($this->db->db_debug) 79 | { 80 | return $this->db->display_error('db_unsuported_feature'); 81 | } 82 | return FALSE; 83 | } 84 | 85 | // -------------------------------------------------------------------- 86 | 87 | /** 88 | * PDO Export 89 | * 90 | * @access private 91 | * @param array Preferences 92 | * @return mixed 93 | */ 94 | function _backup($params = array()) 95 | { 96 | // Currently unsupported 97 | return $this->db->display_error('db_unsuported_feature'); 98 | } 99 | 100 | } 101 | 102 | /* End of file pdo_utility.php */ 103 | /* Location: ./system/database/drivers/pdo/pdo_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/postgre/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/postgre/postgre_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | } 85 | 86 | 87 | /* End of file postgre_utility.php */ 88 | /* Location: ./system/database/drivers/postgre/postgre_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/sqlite/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/sqlite/sqlite_utility.php: -------------------------------------------------------------------------------- 1 | db_debug) 41 | { 42 | return $this->db->display_error('db_unsuported_feature'); 43 | } 44 | return array(); 45 | } 46 | 47 | // -------------------------------------------------------------------- 48 | 49 | /** 50 | * Optimize table query 51 | * 52 | * Is optimization even supported in SQLite? 53 | * 54 | * @access private 55 | * @param string the table name 56 | * @return object 57 | */ 58 | function _optimize_table($table) 59 | { 60 | return FALSE; 61 | } 62 | 63 | // -------------------------------------------------------------------- 64 | 65 | /** 66 | * Repair table query 67 | * 68 | * Are table repairs even supported in SQLite? 69 | * 70 | * @access private 71 | * @param string the table name 72 | * @return object 73 | */ 74 | function _repair_table($table) 75 | { 76 | return FALSE; 77 | } 78 | 79 | // -------------------------------------------------------------------- 80 | 81 | /** 82 | * SQLite Export 83 | * 84 | * @access private 85 | * @param array Preferences 86 | * @return mixed 87 | */ 88 | function _backup($params = array()) 89 | { 90 | // Currently unsupported 91 | return $this->db->display_error('db_unsuported_feature'); 92 | } 93 | } 94 | 95 | /* End of file sqlite_utility.php */ 96 | /* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/database/drivers/sqlsrv/sqlsrv_utility.php: -------------------------------------------------------------------------------- 1 | db->display_error('db_unsuported_feature'); 83 | } 84 | 85 | } 86 | 87 | /* End of file mssql_utility.php */ 88 | /* Location: ./system/database/drivers/mssql/mssql_utility.php */ -------------------------------------------------------------------------------- /system/database/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/fonts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/fonts/texb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/back2arie/phpmikbox/1ffb9d6e000a353ef49cce700fdf77c9bc9fd336/system/fonts/texb.ttf -------------------------------------------------------------------------------- /system/helpers/array_helper.php: -------------------------------------------------------------------------------- 1 | input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure); 52 | } 53 | } 54 | 55 | // -------------------------------------------------------------------- 56 | 57 | /** 58 | * Fetch an item from the COOKIE array 59 | * 60 | * @access public 61 | * @param string 62 | * @param bool 63 | * @return mixed 64 | */ 65 | if ( ! function_exists('get_cookie')) 66 | { 67 | function get_cookie($index = '', $xss_clean = FALSE) 68 | { 69 | $CI =& get_instance(); 70 | 71 | $prefix = ''; 72 | 73 | if ( ! isset($_COOKIE[$index]) && config_item('cookie_prefix') != '') 74 | { 75 | $prefix = config_item('cookie_prefix'); 76 | } 77 | 78 | return $CI->input->cookie($prefix.$index, $xss_clean); 79 | } 80 | } 81 | 82 | // -------------------------------------------------------------------- 83 | 84 | /** 85 | * Delete a COOKIE 86 | * 87 | * @param mixed 88 | * @param string the cookie domain. Usually: .yourdomain.com 89 | * @param string the cookie path 90 | * @param string the cookie prefix 91 | * @return void 92 | */ 93 | if ( ! function_exists('delete_cookie')) 94 | { 95 | function delete_cookie($name = '', $domain = '', $path = '/', $prefix = '') 96 | { 97 | set_cookie($name, '', '', $domain, $path, $prefix); 98 | } 99 | } 100 | 101 | 102 | /* End of file cookie_helper.php */ 103 | /* Location: ./system/helpers/cookie_helper.php */ -------------------------------------------------------------------------------- /system/helpers/directory_helper.php: -------------------------------------------------------------------------------- 1 | 0) && @is_dir($source_dir.$file)) 61 | { 62 | $filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden); 63 | } 64 | else 65 | { 66 | $filedata[] = $file; 67 | } 68 | } 69 | 70 | closedir($fp); 71 | return $filedata; 72 | } 73 | 74 | return FALSE; 75 | } 76 | } 77 | 78 | 79 | /* End of file directory_helper.php */ 80 | /* Location: ./system/helpers/directory_helper.php */ -------------------------------------------------------------------------------- /system/helpers/download_helper.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/helpers/language_helper.php: -------------------------------------------------------------------------------- 1 | lang->line($line); 46 | 47 | if ($id != '') 48 | { 49 | $line = '"; 50 | } 51 | 52 | return $line; 53 | } 54 | } 55 | 56 | // ------------------------------------------------------------------------ 57 | /* End of file language_helper.php */ 58 | /* Location: ./system/helpers/language_helper.php */ -------------------------------------------------------------------------------- /system/helpers/number_helper.php: -------------------------------------------------------------------------------- 1 | lang->load('number'); 43 | 44 | if ($num >= 1000000000000) 45 | { 46 | $num = round($num / 1099511627776, $precision); 47 | $unit = $CI->lang->line('terabyte_abbr'); 48 | } 49 | elseif ($num >= 1000000000) 50 | { 51 | $num = round($num / 1073741824, $precision); 52 | $unit = $CI->lang->line('gigabyte_abbr'); 53 | } 54 | elseif ($num >= 1000000) 55 | { 56 | $num = round($num / 1048576, $precision); 57 | $unit = $CI->lang->line('megabyte_abbr'); 58 | } 59 | elseif ($num >= 1000) 60 | { 61 | $num = round($num / 1024, $precision); 62 | $unit = $CI->lang->line('kilobyte_abbr'); 63 | } 64 | else 65 | { 66 | $unit = $CI->lang->line('bytes'); 67 | return number_format($num).' '.$unit; 68 | } 69 | 70 | return number_format($num, $precision).' '.$unit; 71 | } 72 | } 73 | 74 | 75 | /* End of file number_helper.php */ 76 | /* Location: ./system/helpers/number_helper.php */ -------------------------------------------------------------------------------- /system/helpers/path_helper.php: -------------------------------------------------------------------------------- 1 | security->xss_clean($str, $is_image); 44 | } 45 | } 46 | 47 | // ------------------------------------------------------------------------ 48 | 49 | /** 50 | * Sanitize Filename 51 | * 52 | * @access public 53 | * @param string 54 | * @return string 55 | */ 56 | if ( ! function_exists('sanitize_filename')) 57 | { 58 | function sanitize_filename($filename) 59 | { 60 | $CI =& get_instance(); 61 | return $CI->security->sanitize_filename($filename); 62 | } 63 | } 64 | 65 | // -------------------------------------------------------------------- 66 | 67 | /** 68 | * Hash encode a string 69 | * 70 | * @access public 71 | * @param string 72 | * @return string 73 | */ 74 | if ( ! function_exists('do_hash')) 75 | { 76 | function do_hash($str, $type = 'sha1') 77 | { 78 | if ($type == 'sha1') 79 | { 80 | return sha1($str); 81 | } 82 | else 83 | { 84 | return md5($str); 85 | } 86 | } 87 | } 88 | 89 | // ------------------------------------------------------------------------ 90 | 91 | /** 92 | * Strip Image Tags 93 | * 94 | * @access public 95 | * @param string 96 | * @return string 97 | */ 98 | if ( ! function_exists('strip_image_tags')) 99 | { 100 | function strip_image_tags($str) 101 | { 102 | $str = preg_replace("##", "\\1", $str); 103 | $str = preg_replace("##", "\\1", $str); 104 | 105 | return $str; 106 | } 107 | } 108 | 109 | // ------------------------------------------------------------------------ 110 | 111 | /** 112 | * Convert PHP tags to entities 113 | * 114 | * @access public 115 | * @param string 116 | * @return string 117 | */ 118 | if ( ! function_exists('encode_php_tags')) 119 | { 120 | function encode_php_tags($str) 121 | { 122 | return str_replace(array(''), array('<?php', '<?PHP', '<?', '?>'), $str); 123 | } 124 | } 125 | 126 | 127 | /* End of file security_helper.php */ 128 | /* Location: ./system/helpers/security_helper.php */ -------------------------------------------------------------------------------- /system/helpers/typography_helper.php: -------------------------------------------------------------------------------- 1 | load->library('typography'); 44 | 45 | return $CI->typography->nl2br_except_pre($str); 46 | } 47 | } 48 | 49 | // ------------------------------------------------------------------------ 50 | 51 | /** 52 | * Auto Typography Wrapper Function 53 | * 54 | * 55 | * @access public 56 | * @param string 57 | * @param bool whether to allow javascript event handlers 58 | * @param bool whether to reduce multiple instances of double newlines to two 59 | * @return string 60 | */ 61 | if ( ! function_exists('auto_typography')) 62 | { 63 | function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE) 64 | { 65 | $CI =& get_instance(); 66 | $CI->load->library('typography'); 67 | return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks); 68 | } 69 | } 70 | 71 | 72 | // -------------------------------------------------------------------- 73 | 74 | /** 75 | * HTML Entities Decode 76 | * 77 | * This function is a replacement for html_entity_decode() 78 | * 79 | * @access public 80 | * @param string 81 | * @return string 82 | */ 83 | if ( ! function_exists('entity_decode')) 84 | { 85 | function entity_decode($str, $charset='UTF-8') 86 | { 87 | global $SEC; 88 | return $SEC->entity_decode($str, $charset); 89 | } 90 | } 91 | 92 | /* End of file typography_helper.php */ 93 | /* Location: ./system/helpers/typography_helper.php */ -------------------------------------------------------------------------------- /system/helpers/xml_helper.php: -------------------------------------------------------------------------------- 1 | ","\"", "'", "-"), 53 | array("&", "<", ">", """, "'", "-"), 54 | $str); 55 | 56 | // Decode the temp markers back to entities 57 | $str = preg_replace("/$temp(\d+);/","&#\\1;",$str); 58 | 59 | if ($protect_all === TRUE) 60 | { 61 | $str = preg_replace("/$temp(\w+);/","&\\1;", $str); 62 | } 63 | 64 | return $str; 65 | } 66 | } 67 | 68 | // ------------------------------------------------------------------------ 69 | 70 | /* End of file xml_helper.php */ 71 | /* Location: ./system/helpers/xml_helper.php */ -------------------------------------------------------------------------------- /system/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/language/english/calendar_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/language/english/migration_lang.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /system/libraries/Cache/drivers/Cache_dummy.php: -------------------------------------------------------------------------------- 1 | '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); 34 | 35 | /** 36 | * Constructor 37 | */ 38 | public function __construct() 39 | { 40 | $config =& get_config(); 41 | 42 | $this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/'; 43 | 44 | if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path)) 45 | { 46 | $this->_enabled = FALSE; 47 | } 48 | 49 | if (is_numeric($config['log_threshold'])) 50 | { 51 | $this->_threshold = $config['log_threshold']; 52 | } 53 | 54 | if ($config['log_date_format'] != '') 55 | { 56 | $this->_date_fmt = $config['log_date_format']; 57 | } 58 | } 59 | 60 | // -------------------------------------------------------------------- 61 | 62 | /** 63 | * Write Log File 64 | * 65 | * Generally this function will be called using the global log_message() function 66 | * 67 | * @param string the error level 68 | * @param string the error message 69 | * @param bool whether the error is a native PHP error 70 | * @return bool 71 | */ 72 | public function write_log($level = 'error', $msg, $php_error = FALSE) 73 | { 74 | if ($this->_enabled === FALSE) 75 | { 76 | return FALSE; 77 | } 78 | 79 | $level = strtoupper($level); 80 | 81 | if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) 82 | { 83 | return FALSE; 84 | } 85 | 86 | $filepath = $this->_log_path.'log-'.date('Y-m-d').'.php'; 87 | $message = ''; 88 | 89 | if ( ! file_exists($filepath)) 90 | { 91 | $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; 92 | } 93 | 94 | if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) 95 | { 96 | return FALSE; 97 | } 98 | 99 | $message .= $level.' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n"; 100 | 101 | flock($fp, LOCK_EX); 102 | fwrite($fp, $message); 103 | flock($fp, LOCK_UN); 104 | fclose($fp); 105 | 106 | @chmod($filepath, FILE_WRITE_MODE); 107 | return TRUE; 108 | } 109 | 110 | } 111 | // END Log Class 112 | 113 | /* End of file Log.php */ 114 | /* Location: ./system/libraries/Log.php */ -------------------------------------------------------------------------------- /system/libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | --------------------------------------------------------------------------------