├── .gitattributes ├── .gitignore ├── 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 │ ├── index.php │ ├── manage │ │ ├── member.php │ │ ├── menu.php │ │ ├── node.php │ │ └── role.php │ └── product │ │ └── index.php ├── 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 │ └── rbac │ │ ├── config │ │ ├── memcached.php │ │ └── rbac.php │ │ ├── controllers │ │ ├── index.php │ │ └── manage │ │ │ ├── member.php │ │ │ ├── menu.php │ │ │ ├── node.php │ │ │ └── role.php │ │ ├── helpers │ │ └── rbac_helper.php │ │ ├── hooks │ │ ├── index.html │ │ └── rbac_hook.php │ │ ├── libraries │ │ └── memcached.php │ │ ├── models │ │ └── rbac_model.php │ │ └── views │ │ ├── foot.php │ │ ├── head.php │ │ ├── login.php │ │ ├── main.php │ │ ├── manage │ │ ├── member.php │ │ ├── member │ │ │ ├── add.php │ │ │ ├── delete.php │ │ │ └── edit.php │ │ ├── menu.php │ │ ├── menu │ │ │ ├── add.php │ │ │ ├── delete.php │ │ │ └── edit.php │ │ ├── node.php │ │ ├── node │ │ │ ├── add.php │ │ │ ├── delete.php │ │ │ └── edit.php │ │ ├── role.php │ │ └── role │ │ │ ├── action.php │ │ │ ├── add.php │ │ │ ├── delete.php │ │ │ └── edit.php │ │ ├── menu.php │ │ └── redirect.php └── views │ └── product │ └── index.php ├── index.php ├── mysql.sql ├── static ├── bootstrap │ ├── css │ │ ├── bootstrap-theme.min.css │ │ └── bootstrap.min.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── js │ │ ├── bootstrap.min.js │ │ └── respond.min.js ├── jquery.1102.min.js └── offcanvas.css └── 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 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SmartCI v1.6 2 | ======= 3 | 基于CI的RBAC访问控制 4 | 5 | 框架:CI 2.1.4 6 | 前端:bootstrap3.0 7 | 模型:RBAC0(甚至更简单) 8 | 9 |

在CI上增加的文件

10 |
11 |     application->controllers->manage[目录]
12 |     此目录为RBAC的后端管理(不实现方法,只是简单调用,只是简单调用third_party下文件)
13 | 
14 |
15 |     application->controllers->index.php
16 |     RBAC登录,用户主页(不实现方法,只是简单调用third_party下文件)
17 | 
18 |
19 |     application->third_party[目录]
20 |     这里面就是整体的RBAC实现了,如果有更新,基本上只更新此目录即可[除非有特殊声明更新其他文件]
21 | 
22 | 23 |

在CI上配置的设置

24 |
25 | Autoload:
26 |     packages    APPPATH.'third_party/rbac'
27 | 
28 |
29 | Hooks:
30 |     post_controller_constructor     RBAC验证
31 |     display_override                重写显示(注意:默认重写view,如果不想重写则在方法中调用$this->view_override = FALSE;)
32 |     pre_system                      开启原生SESSION
33 | 
34 | 35 |

RBAC支持的配置

36 |
37 | /* Location: ./application/third_party/rbac/config/rbac.php */
38 | $config['rbac_auth_on']	             = TRUE;			      	//是否开启认证
39 | $config['rbac_auth_type']	         = '2';			     		//认证方式1,登录认证;2,实时认证
40 | $config['rbac_auth_key']	         = 'MyAuth';		 		//SESSION标记
41 | $config['rbac_auth_gateway']         = 'Index/login';    		//默认认证网关
42 | $config['rbac_default_index']        = 'product/index/index';   //成功登录默认跳转模块
43 | $config['rbac_manage_menu_hidden']   = array('后台管理');		//后台管理导航中不显示的菜单
44 | $config['rbac_manage_node_hidden']   = array('manage');			//后台管理节点中不显示的菜单
45 | $config['rbac_notauth_dirc']         = array('');	     	    //默认无需认证目录array("public","manage")
46 | 
47 | 48 |

更新日志

49 | * 2014-07-15更新:v160,CI_RBAC正式改名SmartCI。 50 | * 2014-04-24更新:v160,不好意思返璞归真了,在1.5.0版本基础上做的优化,感觉还是不要动CI的核心,关于RBAC的配置文件放入third_party中,不在使用CI提供的autoload,自己实现。 51 | * 2014-04-21更新:v155,重写了CI的引导文件和Router,对于manage目录做了特殊处理,目的是把rbac全部的放入third_party中,跟整体系统没有关联,这个还在继续中,有更多的好的方法还在实践。原则是尽量少改动CI的核心文件。如果以后有更好思路会把CI引导各文件和Router还原,如果有人有思路,忘提供。 52 | * 2014-04-17更新:大更新,整体目录结构变化,目的是为了让RBAC的管理与控制与CI中的各目录隔离,现在基于CI的特性做了部分处理,还有些暂未能隔离,再想办法。V1.5
53 | * 2014-04-14更新:修复节点授权BUG,引入Memcache
54 | * 2014-03-10更新:修复登录BUG
55 | * 2014-03-10更新:错误页与登录页更新 AND Titlebar上的错误字
56 | * 2014-03-06更新:修复一个重大BUG,用户ID跟角色ID搞错了,导致无法通过验证,修复URL大小写问题 57 | * 2014-03-03发布:V1.0版本发布 58 | -------------------------------------------------------------------------------- /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/autoload.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 | 'Rbac', 15 | 'function' => 'aoto_verify', 16 | 'filename' => 'rbac_hook.php', 17 | 'filepath' => 'third_party/rbac/hooks', 18 | 'params' => '', 19 | ); 20 | 21 | $hook['display_override'] = array( 22 | 'class' => 'Rbac', 23 | 'function' => 'view_override', 24 | 'filename' => 'rbac_hook.php', 25 | 'filepath' => 'third_party/rbac/hooks', 26 | 'params' => '', 27 | ); 28 | 29 | //默认开启SESSION 30 | $hook['pre_system'] = array( 31 | 'class' => '', 32 | 'function' => 'session_start', 33 | 'filename' => '', 34 | 'filepath' => '', 35 | 'params' => '', 36 | ); 37 | /* End of file hooks.php */ 38 | /* Location: ./application/config/hooks.php */ -------------------------------------------------------------------------------- /application/config/index.html: -------------------------------------------------------------------------------- 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/index.php: -------------------------------------------------------------------------------- 1 | view_override = FALSE; 13 | $header = array( 14 | 'header_title'=>'测试系统页面' 15 | ); 16 | $this->load->view("product/index",$header); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /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/third_party/rbac/config/memcached.php: -------------------------------------------------------------------------------- 1 | array('192.168.4.37:11211'), 13 | 'debug' => false 14 | ); 15 | 16 | /* End of file memcached.php */ 17 | /* Location: ./application/third_party/rbac/config/memcached.php */ -------------------------------------------------------------------------------- /application/third_party/rbac/config/rbac.php: -------------------------------------------------------------------------------- 1 | config->item('rbac_auth_gateway'),"请先登录!"); 21 | }else{ 22 | success_redirct($this->config->item('rbac_default_index'),"您已成功登录,正在跳转请稍候!","1"); 23 | } 24 | 25 | } 26 | /** 27 | * 用户登录 28 | */ 29 | public function login(){ 30 | 31 | $this->load->model("rbac_model"); 32 | $username = $this->input->post('username'); 33 | $password = $this->input->post('password'); 34 | if($username&&$password){ 35 | $STATUS = $this->rbac_model->check_user($username,md5($password)); 36 | if($STATUS===TRUE){ 37 | success_redirct($this->config->item('rbac_default_index'),"登录成功!"); 38 | }else{ 39 | error_redirct($this->config->item('rbac_auth_gateway'),$STATUS); 40 | die(); 41 | } 42 | }else{ 43 | $this->load->view("login"); 44 | } 45 | 46 | } 47 | /* 48 | * 用户退出 49 | */ 50 | public function logout(){ 51 | session_destroy(); 52 | success_redirct($this->config->item('rbac_auth_gateway'),"登出成功!",2); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /application/third_party/rbac/controllers/manage/node.php: -------------------------------------------------------------------------------- 1 | load->database(); 13 | } 14 | /** 15 | * 节点首页 16 | */ 17 | public function index() 18 | { 19 | $rbac_where = ""; 20 | $node_hidden_array = $this->config->item('rbac_manage_node_hidden'); 21 | if(!empty($node_hidden_array)){ 22 | $rbac_where = "WHERE "; 23 | foreach($node_hidden_array as $node_hidden){ 24 | $rbac_where.= "dirc != '$node_hidden' AND "; 25 | } 26 | $rbac_where = substr($rbac_where,0,-4); 27 | } 28 | $query = $this->db->query("SELECT * FROM rbac_node {$rbac_where} ORDER BY dirc,cont,func"); 29 | $data = $query->result(); 30 | foreach($data as $vo){ 31 | $node_list[$vo->dirc][$vo->cont][$vo->func] = $vo; 32 | } 33 | $this->load->view('manage/node',array('node'=>$node_list)); 34 | } 35 | /** 36 | * 新增节点 37 | * @param string $dirc 38 | * @param string $cont 39 | * @param string $func 40 | */ 41 | public function add($dirc=NULL,$cont=NULL,$func=NULL){ 42 | if($this->input->post()){ 43 | $dirc = $this->input->post("dirc")?$this->input->post("dirc"):$dirc; 44 | $cont = $this->input->post("cont")?$this->input->post("cont"):$cont; 45 | $func = $this->input->post("func"); 46 | $memo = $this->input->post("memo"); 47 | $status = $this->input->post("status")==1?1:0; 48 | if($dirc&&$cont&&$func&&$memo){ 49 | $query = $this->db->query("SELECT id FROM rbac_node WHERE dirc = '".$dirc."' AND cont = '".$cont."' AND func = '".$func."'"); 50 | $data = $query->row_array(); 51 | if(!$data){ 52 | $sql = "INSERT INTO rbac_node (`dirc`,`cont`,`func`,`status`,`memo`) values('{$dirc}','{$cont}','{$func}','{$status}','{$memo}')"; 53 | //echo $sql;die(); 54 | $this->db->query($sql); 55 | success_redirct('manage/node/index','节点添加成功!'); 56 | }else{ 57 | error_redirct('',"该节点已存在!"); 58 | } 59 | }else{ 60 | error_redirct('',"信息填写不全!"); 61 | } 62 | } 63 | $this->load->view('manage/node/add',array('dirc'=>$dirc,'cont'=>$cont,'func'=>$func)); 64 | } 65 | /** 66 | * 删除节点 67 | * @param string $dirc 68 | * @param string $cont 69 | * @param string $func 70 | */ 71 | public function delete($dirc=NULL,$cont=NULL,$func=NULL){ 72 | if($dirc==NULL){error_redirct("manage/node/index","操作失败");} 73 | if($this->input->post()){ 74 | $verfiy = $this->input->post("verfiy"); 75 | if($verfiy){ 76 | $where_dirc = "dirc = '{$dirc}'"; 77 | $where_cont = $cont==NULL?"":" AND cont = '{$cont}'"; 78 | $where_func = $func==NULL?"":" AND func = '{$func}'"; 79 | $query = $this->db->query("SELECT GROUP_CONCAT(id) as node_id FROM rbac_node WHERE {$where_dirc} {$where_cont} {$where_func}"); 80 | $node_list = $query->row_array(); 81 | $sql = "UPDATE rbac_menu SET node_id = NULL WHERE node_id in (".$node_list['node_id'].")"; 82 | $this->db->query($sql); 83 | $sql = "DELETE FROM rbac_node WHERE {$where_dirc} {$where_cont} {$where_func} "; 84 | $this->db->query($sql); 85 | success_redirct("manage/node/index","删除成功"); 86 | }else{ 87 | error_redirct("manage/node/index","操作失败"); 88 | } 89 | 90 | } 91 | $this->load->view('manage/node/delete',array('dirc'=>$dirc,'cont'=>$cont,'func'=>$func)); 92 | } 93 | /** 94 | * 修改节点 95 | * @param unknown $id 96 | */ 97 | public function edit($id){ 98 | $query = $this->db->query("SELECT * FROM rbac_node WHERE id = ".$id); 99 | $data = $query->row_array(); 100 | if($data){ 101 | if($this->input->post()){ 102 | $memo = $this->input->post("memo"); 103 | $status = $this->input->post("status")==1?1:0; 104 | if($memo){ 105 | $sql = "UPDATE rbac_node set `memo`='{$memo}',`status` = '{$status}' WHERE id = {$id}"; 106 | $this->db->query($sql); 107 | success_redirct("manage/node/index","节点修改成功"); 108 | }else{ 109 | error_redirct('',"信息填写不全!"); 110 | } 111 | } 112 | $this->load->view("manage/node/edit",array('data'=>$data)); 113 | }else{ 114 | error_redirct("manage/node/index","未找到此节点"); 115 | } 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /application/third_party/rbac/helpers/rbac_helper.php: -------------------------------------------------------------------------------- 1 | config->load('memcached',TRUE); 20 | if($ci_obj->config->item('flag','memcached')===FALSE) return FALSE; 21 | $ci_obj->load->library('memcached'); 22 | static $static_memc; 23 | if($static_memc)return $static_memc; 24 | $memc = new memcached($ci_obj->config->item('config','memcached')); 25 | $static_memc = $memc; 26 | return $static_memc; 27 | } 28 | } 29 | 30 | //获取&设置RBAC数据[基于SESSION|MEMCACHED] 31 | if(!function_exists('rbac_conf')){ 32 | function rbac_conf($arr_key,$value=NULL){ 33 | $ci_obj = &get_instance(); 34 | //获取 35 | if(mem_inst()){ 36 | if(!$config = mem_inst()->get(mem_id())){ 37 | $config = $_SESSION[$ci_obj->config->item('rbac_auth_key')]; 38 | } 39 | }else{ 40 | $config = @$_SESSION[$ci_obj->config->item('rbac_auth_key')]; 41 | } 42 | $conf[-1] = &$config; 43 | foreach($arr_key as $k=>$ar){ 44 | $conf[$k] = &$conf[$k-1][$ar]; 45 | } 46 | if($value !==NULL){ 47 | $conf[count($arr_key)-1] = $value; 48 | } 49 | //设置 50 | if(mem_inst()){ 51 | if(!mem_inst()->set(mem_id(),$config)){ 52 | $_SESSION[$ci_obj->config->item('rbac_auth_key')] = $config; 53 | } 54 | }else{ 55 | $_SESSION[$ci_obj->config->item('rbac_auth_key')] = $config; 56 | } 57 | return isset($conf[count($arr_key)-1])?$conf[count($arr_key)-1]:FALSE; 58 | } 59 | } 60 | //用户退出 61 | if(!function_exists('rbac_logout')){ 62 | function rbac_logout($arr_key,$value=NULL){ 63 | if(mem_inst()){ 64 | mem_inst()->delete(mem_id()); 65 | } 66 | session_destroy(); 67 | } 68 | } 69 | 70 | //错误跳转 71 | if(!function_exists("error_redirct")){ 72 | function error_redirct($url="",$contents="操作失败",$time = 3){ 73 | 74 | $ci_obj = &get_instance(); 75 | if($url!=""){ 76 | $url = base_url("index.php/".$url); 77 | }else{ 78 | $url = isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:site_url(); 79 | } 80 | $data['url'] = $url; 81 | $data['time'] = $time; 82 | $data['type'] = "error"; 83 | $data['contents'] = $contents; 84 | $ci_obj->load->view("redirect",$data); 85 | $ci_obj->output->_display($ci_obj->output->get_output()); 86 | die(); 87 | } 88 | } 89 | 90 | //正确跳转 91 | if(!function_exists("success_redirct")){ 92 | function success_redirct($url,$contents="操作成功",$time = 3){ 93 | $ci_obj = &get_instance(); 94 | if($url!=""){ 95 | $url = base_url("index.php/".$url); 96 | }else{ 97 | $url = isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:site_url(); 98 | } 99 | $data['url'] = $url; 100 | $data['time'] = $time; 101 | $data['type'] = "success"; 102 | $data['contents'] = $contents; 103 | $ci_obj->load->view("redirect",$data); 104 | $ci_obj->output->_display($ci_obj->output->get_output()); 105 | die(); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /application/third_party/rbac/hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /application/third_party/rbac/models/rbac_model.php: -------------------------------------------------------------------------------- 1 | load->database(); 13 | } 14 | 15 | /* 16 | * 获取权限列表 17 | */ 18 | public function get_acl($role_id){ 19 | $query = $this->db->query("SELECT id,dirc,cont,func FROM `rbac_node` WHERE id in (SELECT node_id FROM `rbac_auth` WHERE role_id = ".$role_id.")"); 20 | $role_data = $query->result(); 21 | foreach($role_data as $vo){ 22 | $Tmp_role[$vo->dirc][$vo->cont][$vo->func] = TRUE; 23 | } 24 | rbac_conf(array('ACL'),$Tmp_role); 25 | } 26 | 27 | /* 28 | * 用户登录检测 29 | */ 30 | public function check_user($username,$password){ 31 | $query = $this->db->query("SELECT id,password,nickname,email,role_id,status FROM `rbac_user` WHERE username = '".$username."' LIMIT 1"); 32 | $data = $query->row_array(); 33 | if($data){ 34 | if($data['status']==1){ 35 | if($data['password']==$password){ 36 | rbac_conf(array('INFO','id'),$data['id']); 37 | rbac_conf(array('INFO','role_id'),$data['role_id']); 38 | rbac_conf(array('INFO','email'),$data['email']); 39 | rbac_conf(array('INFO','nickname'),$data['nickname']); 40 | $this->get_acl($data['role_id']); 41 | return TRUE; 42 | } 43 | else{ 44 | return "用户密码错误!"; 45 | } 46 | }else{ 47 | return "该用户已禁用!"; 48 | } 49 | }else{ 50 | return "该用户不存!"; 51 | } 52 | } 53 | 54 | /* 55 | * 用户登录检测 By id 56 | */ 57 | public function check_user_by_id($id){ 58 | $query = $this->db->query("SELECT id,password,nickname,email,role_id,status FROM `rbac_user` WHERE id = '".$id."' LIMIT 1"); 59 | $data = $query->row_array(); 60 | if($data){ 61 | if($data['status']==1){ 62 | rbac_conf(array('INFO','id'),$data['id']); 63 | rbac_conf(array('INFO','role_id'),$data['role_id']); 64 | rbac_conf(array('INFO','email'),$data['email']); 65 | rbac_conf(array('INFO','nickname'),$data['nickname']); 66 | $this->get_acl($data['role_id']); 67 | return TRUE; 68 | }else{ 69 | return "该用户已禁用!"; 70 | } 71 | }else{ 72 | return "该用户不存!"; 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/foot.php: -------------------------------------------------------------------------------- 1 |
2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/head.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <?php echo isset($header_title)?$header_title:isset($this->get_menu['list'][$this->uuri])?$this->get_menu['list'][$this->uuri]:""; ?> 10 | 11 | 12 | 13 | 14 | 15 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/login.php: -------------------------------------------------------------------------------- 1 | load->view("head");?> 2 | 9 | 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 |
测试用帐号(用户:admin 密码:admin)
39 |
40 |
41 |
42 | 43 | load->view("foot");?> -------------------------------------------------------------------------------- /application/third_party/rbac/views/main.php: -------------------------------------------------------------------------------- 1 | load->view("head");?> 2 | 3 |
4 |
5 | 8 |
9 | output->get_output();?> 10 |
11 |
12 |
13 | 14 | load->view("foot");?> -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/member.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 33 | ',$mb->id,$mb->username,$mb->nickname,$mb->email,($mb->rolename?$mb->rolename:"暂无角色"),($mb->status==1?"正常":"停用"),site_url("manage/member/edit/".$mb->id),site_url("manage/member/delete/".$mb->id)); 34 | } 35 | ?> 36 | 37 |
ID用户名昵称Email角色状态操作
%s%s%s%s%s%s 28 |
29 | 编辑 30 | 删除 31 |
32 |
38 |
39 | 40 | 新增用户'; ?> 41 | pagination->create_links(); ?> 42 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/member/add.php: -------------------------------------------------------------------------------- 1 |

新增用户

2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 33 |
34 |
35 | 38 |
39 | 40 | 取消修改 41 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/member/delete.php: -------------------------------------------------------------------------------- 1 | 5 |

您确定要删除此用户()?

6 | 7 |
8 | 9 | 10 | 取消修改 11 |
12 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/member/edit.php: -------------------------------------------------------------------------------- 1 |

用户编辑

2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 |
36 | 39 |
40 | 41 | 42 | 取消修改 43 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/menu.php: -------------------------------------------------------------------------------- 1 | 5 | " ; 8 | $havechild = " " ; 9 | echo ''; 10 | echo ' 11 | 12 | 13 | 14 | 15 | 21 | '; 22 | if(isset($mn["child"])){ 23 | foreach($mn["child"] as $cmn){ 24 | echo ' 25 | 26 | 27 | 28 | 29 | 35 | '; 36 | 37 | if(isset($cmn["child"])){ 38 | foreach($cmn["child"] as $gcmn){ 39 | echo ' 40 | 43 | 44 | 45 | 46 | 51 | '; 52 | } 53 | } 54 | } 55 | } 56 | echo '
'.($mn["self"]->node_id?$havechild:$nochild).$mn["self"]->title.''.($mn["self"]->memo?$mn["self"]->memo.$mn["self"]->dcf:"未挂接").''.$mn["self"]->sort.''.($mn["self"]->status==1?"显示":"隐藏").' 20 |
        '.($cmn["self"]->node_id?$havechild:$nochild).$cmn["self"]->title.''.($cmn["self"]->memo?$cmn["self"]->memo.$cmn["self"]->dcf:"未挂接").''.$cmn["self"]->sort.''.($cmn["self"]->status==1?"显示":"隐藏").' 34 |
         41 |          42 | '.($gcmn["self"]->node_id?$havechild:"").$gcmn["self"]->title.''.($gcmn["self"]->memo?$gcmn["self"]->memo.$gcmn["self"]->dcf:"未挂接").''.$gcmn["self"]->sort.''.($gcmn["self"]->status==1?"显示":"隐藏").' 50 |
'; 57 | } 58 | ?> 59 |
60 | id."/1/NULL").'">新增一级菜单'; ?> 61 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/menu/add.php: -------------------------------------------------------------------------------- 1 |

新增子菜单

2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 18 |
19 |
20 | 21 | 22 |
23 |
24 | 27 |
28 |
29 | 32 |
    33 |
  • 一级菜单建议不挂接节点,只当标题使用!
  • 34 |
  • 二级当标题时其下需有三级节点,否则将不显示!
  • 35 |
  • 三级菜单请挂接节点,否则将不会显示!
  • 36 |
37 |
38 | 39 | 40 | 41 | 取消修改 42 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/menu/delete.php: -------------------------------------------------------------------------------- 1 | 5 |

您确定要删除下列菜单?

6 | 7 | " ; 10 | $havechild = " " ; 11 | echo ''; 12 | echo ' 13 | 14 | 15 | 16 | 17 | '; 18 | if(isset($mn["child"])){ 19 | foreach($mn["child"] as $cmn){ 20 | echo ' 21 | 22 | 23 | 24 | 25 | '; 26 | 27 | if(isset($cmn["child"])){ 28 | foreach($cmn["child"] as $gcmn){ 29 | echo ' 30 | 33 | 34 | 35 | 36 | '; 37 | } 38 | } 39 | } 40 | } 41 | echo '
'.($mn["self"]->node_id?$havechild:$nochild).$mn["self"]->title.''.($mn["self"]->memo?$mn["self"]->memo:"未挂接").''.$mn["self"]->sort.''.($mn["self"]->status==1?"显示":"隐藏").'
        '.($cmn["self"]->node_id?$havechild:$nochild).$cmn["self"]->title.''.($cmn["self"]->memo?$cmn["self"]->memo:"未挂接").''.$cmn["self"]->sort.''.($cmn["self"]->status==1?"显示":"隐藏").'
         31 |          32 | '.($gcmn["self"]->node_id?$havechild:"").$gcmn["self"]->title.''.($gcmn["self"]->memo?$gcmn["self"]->memo.$gcmn["self"]->dcf:"未挂接").''.$gcmn["self"]->sort.''.($gcmn["self"]->status==1?"显示":"隐藏").'
'; 42 | } 43 | ?> 44 |
45 | 46 | 47 | 取消修改 48 |
49 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/menu/edit.php: -------------------------------------------------------------------------------- 1 |

修改子菜单

2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | 28 |
29 |
30 | 33 |
    34 |
  • 一级菜单建议不挂接节点,只当标题使用!
  • 35 |
  • 二级当标题时其下需有三级节点,否则将不显示!
  • 36 |
  • 三级菜单请挂接节点,否则将不会显示!
  • 37 |
38 |
39 | 40 | 41 | 42 | 43 | 取消修改 44 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/node.php: -------------------------------------------------------------------------------- 1 | 5 | $mn){ 8 | echo ''; 9 | echo ' 10 | 11 | 12 | 13 | 18 | '; 19 | foreach($mn as $mn_key=>$cmn){ 20 | echo ' 21 | 22 | 23 | 24 | 29 | '; 30 | foreach($cmn as $cmn_key=>$gcmn){ 31 | echo ' 32 | 33 | 34 | 35 | 40 | '; 41 | } 42 | } 43 | echo '
'.$key.'
14 | 新增控制器 15 | 删除目录 16 |
17 |
         '.$mn_key.'
25 | 新增方法 26 | 删除控制器 27 |
28 |
                 '.$cmn_key.''.$gcmn->memo.''.($gcmn->status==1?"启用":"停用").'
36 | id).'">修改 37 | 删除方法 38 |
39 |
'; 44 | } 45 | ?> 46 |
47 | 新增目录'; ?> 48 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/node/add.php: -------------------------------------------------------------------------------- 1 |

新增节点

2 |
3 |
4 | 5 | > 6 |
7 |
8 | 9 | > 10 |
11 |
12 | 13 | > 14 |
15 |
16 | 17 | 18 |
19 |
20 | 23 |
24 | 25 | 取消操作 26 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/node/delete.php: -------------------------------------------------------------------------------- 1 | 5 |

您确定要删除?

6 |

请慎重操作!

7 | 友情提示: 8 | 13 |
14 |
15 | 16 | 17 | 取消操作 18 |
19 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/node/edit.php: -------------------------------------------------------------------------------- 1 |

节点修改

2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | 18 |
19 |
20 | 23 |
24 | 25 | 取消操作 26 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/role.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 28 | ',$mb->id,$mb->rolename,($mb->status==1?"正常":"停用"),site_url("manage/role/edit/".$mb->id),site_url("manage/role/action/".$mb->id),site_url("manage/role/delete/".$mb->id)); 29 | } 30 | ?> 31 | 32 |
ID角色名称状态操作
%s%s%s 22 |
23 | 编辑角色 24 | 赋权节点 25 | 删除删除 26 |
27 |
33 |
34 | 35 | 新增角色'; ?> 36 | pagination->create_links(); ?> 37 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/role/action.php: -------------------------------------------------------------------------------- 1 | 5 | $mn){ 7 | echo ''; 8 | printf(' 9 | 10 | 11 | 12 | ',$key); 13 | foreach($mn as $mn_key=>$cmn){ 14 | printf(' 15 | 16 | 17 | 18 | ',$mn_key); 19 | foreach($cmn as $cmn_key=>$gcmn){ 20 | printf(' 21 | 22 | 23 | 27 | ',$gcmn->memo,(@$rnl[$key][$mn_key][$cmn_key]?"danger":"success"),site_url("manage/role/action/".$role_id."/".$gcmn->id),(@$rnl[$key][$mn_key][$cmn_key]?"取消授权":"节点授权")); 28 | } 29 | } 30 | echo '
%s
         %s
                 '.$cmn_key.'%s
24 | %s 25 |
26 |
'; 31 | } 32 | ?> 33 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/role/add.php: -------------------------------------------------------------------------------- 1 |

新增角色

2 |
3 |
4 | 5 | 6 |
7 |
8 | 11 |
12 | 13 | 取消修改 14 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/role/delete.php: -------------------------------------------------------------------------------- 1 | 5 |

您确定要删除此角色()?

6 |

删除角色将同时删除角色的所有授权,请慎重操作!

7 | 8 |
9 | 10 | 11 | 取消修改 12 |
13 | -------------------------------------------------------------------------------- /application/third_party/rbac/views/manage/role/edit.php: -------------------------------------------------------------------------------- 1 |

角色编辑

2 |
3 |
4 | 5 | 6 |
7 |
8 | 11 |
12 | 13 | 14 | 取消修改 15 |
-------------------------------------------------------------------------------- /application/third_party/rbac/views/menu.php: -------------------------------------------------------------------------------- 1 | '; 5 | if($mn["self"]["uri"]=="/"){ 6 | $flist = " ".$mn["self"]["title"].""; 7 | }else{ 8 | $flist = anchor($mn["self"]["uri"],$mn["self"]["title"], array('class' => 'list-group-item')); 9 | } 10 | echo $flist; 11 | if(isset($mn["child"])){ 12 | foreach($mn["child"] as $cmn){ 13 | 14 | if(@$cmn["shown"]){ 15 | if($cmn["self"]["uri"]=="/"){ 16 | $slist = "     ".$cmn["self"]["title"].""; 17 | }else{ 18 | $slist = anchor($cmn["self"]["uri"],'    '.$cmn["self"]["title"], array('class' => 'list-group-item')); 19 | } 20 | echo $slist; 21 | if(isset($cmn["child"])){ 22 | foreach($cmn["child"] as $gcmn){ 23 | if(@$gcmn["shown"]){ 24 | $tlist = anchor($gcmn["self"]["uri"],"        ".$gcmn["self"]["title"], array('class' => 'list-group-item')); 25 | } 26 | echo $tlist; 27 | } 28 | } 29 | } 30 | 31 | } 32 | } 33 | echo '
'; 34 | } 35 | } 36 | 37 | ?> -------------------------------------------------------------------------------- /application/third_party/rbac/views/redirect.php: -------------------------------------------------------------------------------- 1 | load->view('head');?> 2 | 3 |
4 |
5 | 6 |
7 |
"> 8 |
9 |
10 | 11 |

12 |

秒钟后自动跳转!【立即跳转

13 |
14 | 15 |
16 |
17 |
18 |
19 |
20 | 32 | load->view("foot");?> -------------------------------------------------------------------------------- /application/views/product/index.php: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |
5 |

Hello, world!

6 |

This is an example to show the potential of an offcanvas layout pattern in Bootstrap. Try some responsive-range viewport sizes to see it in action.

7 |
8 |
9 |
10 |

Heading

11 |

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

12 |

View details »

13 |
14 |
15 |

Heading

16 |

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

17 |

View details »

18 |
19 |
20 |

Heading

21 |

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

22 |

View details »

23 |
24 |
-------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toryzen/SmartCI/2ee027f51f5134ffa51d471fe20b3e5013066529/static/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toryzen/SmartCI/2ee027f51f5134ffa51d471fe20b3e5013066529/static/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toryzen/SmartCI/2ee027f51f5134ffa51d471fe20b3e5013066529/static/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/bootstrap/js/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill 2 | * Copyright 2014 Scott Jehl 3 | * Licensed under MIT 4 | * http://j.mp/respondjs */ 5 | 6 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;bmarker[$name] = microtime(); 54 | } 55 | 56 | // -------------------------------------------------------------------- 57 | 58 | /** 59 | * Calculates the time difference between two marked points. 60 | * 61 | * If the first parameter is empty this function instead returns the 62 | * {elapsed_time} pseudo-variable. This permits the full system 63 | * execution time to be shown in a template. The output class will 64 | * swap the real value for this variable. 65 | * 66 | * @access public 67 | * @param string a particular marked point 68 | * @param string a particular marked point 69 | * @param integer the number of decimal places 70 | * @return mixed 71 | */ 72 | function elapsed_time($point1 = '', $point2 = '', $decimals = 4) 73 | { 74 | if ($point1 == '') 75 | { 76 | return '{elapsed_time}'; 77 | } 78 | 79 | if ( ! isset($this->marker[$point1])) 80 | { 81 | return ''; 82 | } 83 | 84 | if ( ! isset($this->marker[$point2])) 85 | { 86 | $this->marker[$point2] = microtime(); 87 | } 88 | 89 | list($sm, $ss) = explode(' ', $this->marker[$point1]); 90 | list($em, $es) = explode(' ', $this->marker[$point2]); 91 | 92 | return number_format(($em + $es) - ($sm + $ss), $decimals); 93 | } 94 | 95 | // -------------------------------------------------------------------- 96 | 97 | /** 98 | * Memory Usage 99 | * 100 | * This function returns the {memory_usage} pseudo-variable. 101 | * This permits it to be put it anywhere in a template 102 | * without the memory being calculated until the end. 103 | * The output class will swap the real value for this variable. 104 | * 105 | * @access public 106 | * @return string 107 | */ 108 | function memory_usage() 109 | { 110 | return '{memory_usage}'; 111 | } 112 | 113 | } 114 | 115 | // END CI_Benchmark class 116 | 117 | /* End of file Benchmark.php */ 118 | /* Location: ./system/core/Benchmark.php */ -------------------------------------------------------------------------------- /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/Lang.php: -------------------------------------------------------------------------------- 1 | is_loaded, TRUE)) 77 | { 78 | return; 79 | } 80 | 81 | $config =& get_config(); 82 | 83 | if ($idiom == '') 84 | { 85 | $deft_lang = ( ! isset($config['language'])) ? 'english' : $config['language']; 86 | $idiom = ($deft_lang == '') ? 'english' : $deft_lang; 87 | } 88 | 89 | // Determine where the language file is and load it 90 | if ($alt_path != '' && file_exists($alt_path.'language/'.$idiom.'/'.$langfile)) 91 | { 92 | include($alt_path.'language/'.$idiom.'/'.$langfile); 93 | } 94 | else 95 | { 96 | $found = FALSE; 97 | 98 | foreach (get_instance()->load->get_package_paths(TRUE) as $package_path) 99 | { 100 | if (file_exists($package_path.'language/'.$idiom.'/'.$langfile)) 101 | { 102 | include($package_path.'language/'.$idiom.'/'.$langfile); 103 | $found = TRUE; 104 | break; 105 | } 106 | } 107 | 108 | if ($found !== TRUE) 109 | { 110 | show_error('Unable to load the requested language file: language/'.$idiom.'/'.$langfile); 111 | } 112 | } 113 | 114 | 115 | if ( ! isset($lang)) 116 | { 117 | log_message('error', 'Language file contains no data: language/'.$idiom.'/'.$langfile); 118 | return; 119 | } 120 | 121 | if ($return == TRUE) 122 | { 123 | return $lang; 124 | } 125 | 126 | $this->is_loaded[] = $langfile; 127 | $this->language = array_merge($this->language, $lang); 128 | unset($lang); 129 | 130 | log_message('debug', 'Language file loaded: language/'.$idiom.'/'.$langfile); 131 | return TRUE; 132 | } 133 | 134 | // -------------------------------------------------------------------- 135 | 136 | /** 137 | * Fetch a single line of text from the language array 138 | * 139 | * @access public 140 | * @param string $line the language line 141 | * @return string 142 | */ 143 | function line($line = '') 144 | { 145 | $value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line]; 146 | 147 | // Because killer robots like unicorns! 148 | if ($value === FALSE) 149 | { 150 | log_message('error', 'Could not find the language line "'.$line.'"'); 151 | } 152 | 153 | return $value; 154 | } 155 | 156 | } 157 | // END Language Class 158 | 159 | /* End of file Lang.php */ 160 | /* Location: ./system/core/Lang.php */ 161 | -------------------------------------------------------------------------------- /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/Utf8.php: -------------------------------------------------------------------------------- 1 | item('charset') == 'UTF-8' // Application charset must be UTF-8 48 | ) 49 | { 50 | log_message('debug', "UTF-8 Support Enabled"); 51 | 52 | define('UTF8_ENABLED', TRUE); 53 | 54 | // set internal encoding for multibyte string functions if necessary 55 | // and set a flag so we don't have to repeatedly use extension_loaded() 56 | // or function_exists() 57 | if (extension_loaded('mbstring')) 58 | { 59 | define('MB_ENABLED', TRUE); 60 | mb_internal_encoding('UTF-8'); 61 | } 62 | else 63 | { 64 | define('MB_ENABLED', FALSE); 65 | } 66 | } 67 | else 68 | { 69 | log_message('debug', "UTF-8 Support Disabled"); 70 | define('UTF8_ENABLED', FALSE); 71 | } 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Clean UTF-8 strings 78 | * 79 | * Ensures strings are UTF-8 80 | * 81 | * @access public 82 | * @param string 83 | * @return string 84 | */ 85 | function clean_string($str) 86 | { 87 | if ($this->_is_ascii($str) === FALSE) 88 | { 89 | $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str); 90 | } 91 | 92 | return $str; 93 | } 94 | 95 | // -------------------------------------------------------------------- 96 | 97 | /** 98 | * Remove ASCII control characters 99 | * 100 | * Removes all ASCII control characters except horizontal tabs, 101 | * line feeds, and carriage returns, as all others can cause 102 | * problems in XML 103 | * 104 | * @access public 105 | * @param string 106 | * @return string 107 | */ 108 | function safe_ascii_for_xml($str) 109 | { 110 | return remove_invisible_characters($str, FALSE); 111 | } 112 | 113 | // -------------------------------------------------------------------- 114 | 115 | /** 116 | * Convert to UTF-8 117 | * 118 | * Attempts to convert a string to UTF-8 119 | * 120 | * @access public 121 | * @param string 122 | * @param string - input encoding 123 | * @return string 124 | */ 125 | function convert_to_utf8($str, $encoding) 126 | { 127 | if (function_exists('iconv')) 128 | { 129 | $str = @iconv($encoding, 'UTF-8', $str); 130 | } 131 | elseif (function_exists('mb_convert_encoding')) 132 | { 133 | $str = @mb_convert_encoding($str, 'UTF-8', $encoding); 134 | } 135 | else 136 | { 137 | return FALSE; 138 | } 139 | 140 | return $str; 141 | } 142 | 143 | // -------------------------------------------------------------------- 144 | 145 | /** 146 | * Is ASCII? 147 | * 148 | * Tests if a string is standard 7-bit ASCII or not 149 | * 150 | * @access public 151 | * @param string 152 | * @return bool 153 | */ 154 | function _is_ascii($str) 155 | { 156 | return (preg_match('/[^\x00-\x7F]/S', $str) == 0); 157 | } 158 | 159 | // -------------------------------------------------------------------- 160 | 161 | } 162 | // End Utf8 Class 163 | 164 | /* End of file Utf8.php */ 165 | /* Location: ./system/core/Utf8.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_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @mssql_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | while ($field = mssql_fetch_field($this->result_id)) 67 | { 68 | $field_names[] = $field->name; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | while ($field = mssql_fetch_field($this->result_id)) 88 | { 89 | $F = new stdClass(); 90 | $F->name = $field->name; 91 | $F->type = $field->type; 92 | $F->max_length = $field->max_length; 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | if (is_resource($this->result_id)) 112 | { 113 | mssql_free_result($this->result_id); 114 | $this->result_id = FALSE; 115 | } 116 | } 117 | 118 | // -------------------------------------------------------------------- 119 | 120 | /** 121 | * Data Seek 122 | * 123 | * Moves the internal pointer to the desired offset. We call 124 | * this internally before fetching results to make sure the 125 | * result set starts at zero 126 | * 127 | * @access private 128 | * @return array 129 | */ 130 | function _data_seek($n = 0) 131 | { 132 | return mssql_data_seek($this->result_id, $n); 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Result - associative array 139 | * 140 | * Returns the result set as an array 141 | * 142 | * @access private 143 | * @return array 144 | */ 145 | function _fetch_assoc() 146 | { 147 | return mssql_fetch_assoc($this->result_id); 148 | } 149 | 150 | // -------------------------------------------------------------------- 151 | 152 | /** 153 | * Result - object 154 | * 155 | * Returns the result set as an object 156 | * 157 | * @access private 158 | * @return object 159 | */ 160 | function _fetch_object() 161 | { 162 | return mssql_fetch_object($this->result_id); 163 | } 164 | 165 | } 166 | 167 | 168 | /* End of file mssql_result.php */ 169 | /* Location: ./system/database/drivers/mssql/mssql_result.php */ -------------------------------------------------------------------------------- /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/mysql/mysql_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @mysql_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | while ($field = mysql_fetch_field($this->result_id)) 67 | { 68 | $field_names[] = $field->name; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | while ($field = mysql_fetch_object($this->result_id)) 88 | { 89 | preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches); 90 | 91 | $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL; 92 | $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL; 93 | 94 | $F = new stdClass(); 95 | $F->name = $field->Field; 96 | $F->type = $type; 97 | $F->default = $field->Default; 98 | $F->max_length = $length; 99 | $F->primary_key = ( $field->Key == 'PRI' ? 1 : 0 ); 100 | 101 | $retval[] = $F; 102 | } 103 | 104 | return $retval; 105 | } 106 | 107 | // -------------------------------------------------------------------- 108 | 109 | /** 110 | * Free the result 111 | * 112 | * @return null 113 | */ 114 | function free_result() 115 | { 116 | if (is_resource($this->result_id)) 117 | { 118 | mysql_free_result($this->result_id); 119 | $this->result_id = FALSE; 120 | } 121 | } 122 | 123 | // -------------------------------------------------------------------- 124 | 125 | /** 126 | * Data Seek 127 | * 128 | * Moves the internal pointer to the desired offset. We call 129 | * this internally before fetching results to make sure the 130 | * result set starts at zero 131 | * 132 | * @access private 133 | * @return array 134 | */ 135 | function _data_seek($n = 0) 136 | { 137 | return mysql_data_seek($this->result_id, $n); 138 | } 139 | 140 | // -------------------------------------------------------------------- 141 | 142 | /** 143 | * Result - associative array 144 | * 145 | * Returns the result set as an array 146 | * 147 | * @access private 148 | * @return array 149 | */ 150 | function _fetch_assoc() 151 | { 152 | return mysql_fetch_assoc($this->result_id); 153 | } 154 | 155 | // -------------------------------------------------------------------- 156 | 157 | /** 158 | * Result - object 159 | * 160 | * Returns the result set as an object 161 | * 162 | * @access private 163 | * @return object 164 | */ 165 | function _fetch_object() 166 | { 167 | return mysql_fetch_object($this->result_id); 168 | } 169 | 170 | } 171 | 172 | 173 | /* End of file mysql_result.php */ 174 | /* Location: ./system/database/drivers/mysql/mysql_result.php */ -------------------------------------------------------------------------------- /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_result.php: -------------------------------------------------------------------------------- 1 | num_rows)) 39 | { 40 | return $this->num_rows; 41 | } 42 | elseif (($this->num_rows = $this->result_id->rowCount()) > 0) 43 | { 44 | return $this->num_rows; 45 | } 46 | 47 | $this->num_rows = count($this->result_id->fetchAll()); 48 | $this->result_id->execute(); 49 | return $this->num_rows; 50 | } 51 | 52 | // -------------------------------------------------------------------- 53 | 54 | /** 55 | * Number of fields in the result set 56 | * 57 | * @access public 58 | * @return integer 59 | */ 60 | function num_fields() 61 | { 62 | return $this->result_id->columnCount(); 63 | } 64 | 65 | // -------------------------------------------------------------------- 66 | 67 | /** 68 | * Fetch Field Names 69 | * 70 | * Generates an array of column names 71 | * 72 | * @access public 73 | * @return array 74 | */ 75 | function list_fields() 76 | { 77 | if ($this->db->db_debug) 78 | { 79 | return $this->db->display_error('db_unsuported_feature'); 80 | } 81 | return FALSE; 82 | } 83 | 84 | // -------------------------------------------------------------------- 85 | 86 | /** 87 | * Field data 88 | * 89 | * Generates an array of objects containing field meta-data 90 | * 91 | * @access public 92 | * @return array 93 | */ 94 | function field_data() 95 | { 96 | $data = array(); 97 | 98 | try 99 | { 100 | for($i = 0; $i < $this->num_fields(); $i++) 101 | { 102 | $data[] = $this->result_id->getColumnMeta($i); 103 | } 104 | 105 | return $data; 106 | } 107 | catch (Exception $e) 108 | { 109 | if ($this->db->db_debug) 110 | { 111 | return $this->db->display_error('db_unsuported_feature'); 112 | } 113 | return FALSE; 114 | } 115 | } 116 | 117 | // -------------------------------------------------------------------- 118 | 119 | /** 120 | * Free the result 121 | * 122 | * @return null 123 | */ 124 | function free_result() 125 | { 126 | if (is_object($this->result_id)) 127 | { 128 | $this->result_id = FALSE; 129 | } 130 | } 131 | 132 | // -------------------------------------------------------------------- 133 | 134 | /** 135 | * Data Seek 136 | * 137 | * Moves the internal pointer to the desired offset. We call 138 | * this internally before fetching results to make sure the 139 | * result set starts at zero 140 | * 141 | * @access private 142 | * @return array 143 | */ 144 | function _data_seek($n = 0) 145 | { 146 | return FALSE; 147 | } 148 | 149 | // -------------------------------------------------------------------- 150 | 151 | /** 152 | * Result - associative array 153 | * 154 | * Returns the result set as an array 155 | * 156 | * @access private 157 | * @return array 158 | */ 159 | function _fetch_assoc() 160 | { 161 | return $this->result_id->fetch(PDO::FETCH_ASSOC); 162 | } 163 | 164 | // -------------------------------------------------------------------- 165 | 166 | /** 167 | * Result - object 168 | * 169 | * Returns the result set as an object 170 | * 171 | * @access private 172 | * @return object 173 | */ 174 | function _fetch_object() 175 | { 176 | return $this->result_id->fetchObject(); 177 | } 178 | 179 | } 180 | 181 | 182 | /* End of file pdo_result.php */ 183 | /* Location: ./system/database/drivers/pdo/pdo_result.php */ -------------------------------------------------------------------------------- /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_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @pg_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | for ($i = 0; $i < $this->num_fields(); $i++) 67 | { 68 | $field_names[] = pg_field_name($this->result_id, $i); 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | for ($i = 0; $i < $this->num_fields(); $i++) 88 | { 89 | $F = new stdClass(); 90 | $F->name = pg_field_name($this->result_id, $i); 91 | $F->type = pg_field_type($this->result_id, $i); 92 | $F->max_length = pg_field_size($this->result_id, $i); 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | if (is_resource($this->result_id)) 112 | { 113 | pg_free_result($this->result_id); 114 | $this->result_id = FALSE; 115 | } 116 | } 117 | 118 | // -------------------------------------------------------------------- 119 | 120 | /** 121 | * Data Seek 122 | * 123 | * Moves the internal pointer to the desired offset. We call 124 | * this internally before fetching results to make sure the 125 | * result set starts at zero 126 | * 127 | * @access private 128 | * @return array 129 | */ 130 | function _data_seek($n = 0) 131 | { 132 | return pg_result_seek($this->result_id, $n); 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Result - associative array 139 | * 140 | * Returns the result set as an array 141 | * 142 | * @access private 143 | * @return array 144 | */ 145 | function _fetch_assoc() 146 | { 147 | return pg_fetch_assoc($this->result_id); 148 | } 149 | 150 | // -------------------------------------------------------------------- 151 | 152 | /** 153 | * Result - object 154 | * 155 | * Returns the result set as an object 156 | * 157 | * @access private 158 | * @return object 159 | */ 160 | function _fetch_object() 161 | { 162 | return pg_fetch_object($this->result_id); 163 | } 164 | 165 | } 166 | 167 | 168 | /* End of file postgre_result.php */ 169 | /* Location: ./system/database/drivers/postgre/postgre_result.php */ -------------------------------------------------------------------------------- /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_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @sqlite_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | for ($i = 0; $i < $this->num_fields(); $i++) 67 | { 68 | $field_names[] = sqlite_field_name($this->result_id, $i); 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | for ($i = 0; $i < $this->num_fields(); $i++) 88 | { 89 | $F = new stdClass(); 90 | $F->name = sqlite_field_name($this->result_id, $i); 91 | $F->type = 'varchar'; 92 | $F->max_length = 0; 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | // Not implemented in SQLite 112 | } 113 | 114 | // -------------------------------------------------------------------- 115 | 116 | /** 117 | * Data Seek 118 | * 119 | * Moves the internal pointer to the desired offset. We call 120 | * this internally before fetching results to make sure the 121 | * result set starts at zero 122 | * 123 | * @access private 124 | * @return array 125 | */ 126 | function _data_seek($n = 0) 127 | { 128 | return sqlite_seek($this->result_id, $n); 129 | } 130 | 131 | // -------------------------------------------------------------------- 132 | 133 | /** 134 | * Result - associative array 135 | * 136 | * Returns the result set as an array 137 | * 138 | * @access private 139 | * @return array 140 | */ 141 | function _fetch_assoc() 142 | { 143 | return sqlite_fetch_array($this->result_id); 144 | } 145 | 146 | // -------------------------------------------------------------------- 147 | 148 | /** 149 | * Result - object 150 | * 151 | * Returns the result set as an object 152 | * 153 | * @access private 154 | * @return object 155 | */ 156 | function _fetch_object() 157 | { 158 | if (function_exists('sqlite_fetch_object')) 159 | { 160 | return sqlite_fetch_object($this->result_id); 161 | } 162 | else 163 | { 164 | $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC); 165 | if (is_array($arr)) 166 | { 167 | $obj = (object) $arr; 168 | return $obj; 169 | } else { 170 | return NULL; 171 | } 172 | } 173 | } 174 | 175 | } 176 | 177 | 178 | /* End of file sqlite_result.php */ 179 | /* Location: ./system/database/drivers/sqlite/sqlite_result.php */ -------------------------------------------------------------------------------- /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_result.php: -------------------------------------------------------------------------------- 1 | result_id); 38 | } 39 | 40 | // -------------------------------------------------------------------- 41 | 42 | /** 43 | * Number of fields in the result set 44 | * 45 | * @access public 46 | * @return integer 47 | */ 48 | function num_fields() 49 | { 50 | return @sqlsrv_num_fields($this->result_id); 51 | } 52 | 53 | // -------------------------------------------------------------------- 54 | 55 | /** 56 | * Fetch Field Names 57 | * 58 | * Generates an array of column names 59 | * 60 | * @access public 61 | * @return array 62 | */ 63 | function list_fields() 64 | { 65 | $field_names = array(); 66 | foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) 67 | { 68 | $field_names[] = $field['Name']; 69 | } 70 | 71 | return $field_names; 72 | } 73 | 74 | // -------------------------------------------------------------------- 75 | 76 | /** 77 | * Field data 78 | * 79 | * Generates an array of objects containing field meta-data 80 | * 81 | * @access public 82 | * @return array 83 | */ 84 | function field_data() 85 | { 86 | $retval = array(); 87 | foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) 88 | { 89 | $F = new stdClass(); 90 | $F->name = $field['Name']; 91 | $F->type = $field['Type']; 92 | $F->max_length = $field['Size']; 93 | $F->primary_key = 0; 94 | $F->default = ''; 95 | 96 | $retval[] = $F; 97 | } 98 | 99 | return $retval; 100 | } 101 | 102 | // -------------------------------------------------------------------- 103 | 104 | /** 105 | * Free the result 106 | * 107 | * @return null 108 | */ 109 | function free_result() 110 | { 111 | if (is_resource($this->result_id)) 112 | { 113 | sqlsrv_free_stmt($this->result_id); 114 | $this->result_id = FALSE; 115 | } 116 | } 117 | 118 | // -------------------------------------------------------------------- 119 | 120 | /** 121 | * Data Seek 122 | * 123 | * Moves the internal pointer to the desired offset. We call 124 | * this internally before fetching results to make sure the 125 | * result set starts at zero 126 | * 127 | * @access private 128 | * @return array 129 | */ 130 | function _data_seek($n = 0) 131 | { 132 | // Not implemented 133 | } 134 | 135 | // -------------------------------------------------------------------- 136 | 137 | /** 138 | * Result - associative array 139 | * 140 | * Returns the result set as an array 141 | * 142 | * @access private 143 | * @return array 144 | */ 145 | function _fetch_assoc() 146 | { 147 | return sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC); 148 | } 149 | 150 | // -------------------------------------------------------------------- 151 | 152 | /** 153 | * Result - object 154 | * 155 | * Returns the result set as an object 156 | * 157 | * @access private 158 | * @return object 159 | */ 160 | function _fetch_object() 161 | { 162 | return sqlsrv_fetch_object($this->result_id); 163 | } 164 | 165 | } 166 | 167 | 168 | /* End of file mssql_result.php */ 169 | /* Location: ./system/database/drivers/mssql/mssql_result.php */ -------------------------------------------------------------------------------- /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/toryzen/SmartCI/2ee027f51f5134ffa51d471fe20b3e5013066529/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_apc.php: -------------------------------------------------------------------------------- 1 | $time + $ttl, 121 | 'mtime' => $time, 122 | 'data' => $data 123 | ); 124 | } 125 | 126 | // ------------------------------------------------------------------------ 127 | 128 | /** 129 | * is_supported() 130 | * 131 | * Check to see if APC is available on this system, bail if it isn't. 132 | */ 133 | public function is_supported() 134 | { 135 | if ( ! extension_loaded('apc') OR ini_get('apc.enabled') != "1") 136 | { 137 | log_message('error', 'The APC PHP extension must be loaded to use APC Cache.'); 138 | return FALSE; 139 | } 140 | 141 | return TRUE; 142 | } 143 | 144 | // ------------------------------------------------------------------------ 145 | 146 | 147 | } 148 | // End Class 149 | 150 | /* End of file Cache_apc.php */ 151 | /* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ 152 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------