diff --git a/README.md b/README.md index 89291e8..eb4e52f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ ##Requirements * PHP 5.1.6+, 5.3+ recommended * CodeIgniter 2.0+ +* CodeIgniter Sparks * MySQL * ~~php-gmp~~ @@ -23,11 +24,12 @@ * Groups and Roles: Create groups, and assign users to your groups. Your roles are set on a group, not a user, so changing roles, whether the scale is large or small, is fast and painless. * Text-based roles: Simply list your roles in the configuration file, then check against them in your code. BitAuth handles everything in between. -##Download -[https://github.com/danmontgomery/codeigniter-bitauth/tarball/v0.2.1](https://github.com/danmontgomery/codeigniter-bitauth/tarball/v0.2.1) - ##Installation -Copy the included files to their appropriate locations in the application/ folder. Import bitauth.sql into your database. **If you would like to change the names of the tables BitAuth uses, you can change them in this .sql file, and must also change them in config/bitauth.php**. + php tools/spark install bitauth +Import bitauth.sql into your database. **If you would like to change the names of the tables BitAuth uses, you can change them in this .sql file, and must also change them in config/bitauth.php**. + +##Usage + $this->load->spark('bitauth/X.X.X'); ##Updating If updating from v0.1.x, there is a convert() function in the Example controller. This will modify the structure of your groups table, as well as convert any roles you have stored to the new format. This function uses base_convert(), which means results may vary depending on the machine you're running this on. After upgrading, be sure to check the roles in your groups for accuracy. @@ -39,4 +41,4 @@ The default login is **admin**/**admin**. I **highly** recommend you not use the default cookie session... [Try my driver replacement](http://getsparks.org/packages/session-driver/show) for CI's session library (end of shameless self promotion). -Currently, only MySQL is supported. This may change in the future. Or not. We'll see. \ No newline at end of file +Currently, only MySQL is supported. This may change in the future. Or not. We'll see. diff --git a/config/autoload.php b/config/autoload.php new file mode 100644 index 0000000..268289a --- /dev/null +++ b/config/autoload.php @@ -0,0 +1,3 @@ + - - - - - BitAuth: Activation Failed - - - '; - echo 'BitAuth Example: Activation Failed!'; - echo ''.anchor('example', 'Continue').''; - echo ''; - ?> - - \ No newline at end of file + + + + + BitAuth: Activation Failed + + + '; + echo ''; + echo ''; + echo '
BitAuth Example: Activation Failed!
'.anchor('example', 'Continue').'
'; + ?> + + diff --git a/application/views/example/activation_successful.php b/views/example/activation_successful.php similarity index 95% rename from application/views/example/activation_successful.php rename to views/example/activation_successful.php index 799cdaf..c34f211 100644 --- a/application/views/example/activation_successful.php +++ b/views/example/activation_successful.php @@ -1,22 +1,21 @@ - - - - - - BitAuth: Activation Successful - - - '; - echo ''; - echo ''; - echo '
BitAuth Example: Activation Successful
'.anchor('example', 'Continue').'
'; - ?> - - \ No newline at end of file + + + + + BitAuth: Activation Successful + + + '; + echo ''; + echo ''; + echo '
BitAuth Example: Activation Successful
'.anchor('example', 'Continue').'
'; + ?> + + diff --git a/application/views/example/add_group.php b/views/example/add_group.php similarity index 95% rename from application/views/example/add_group.php rename to views/example/add_group.php index f016d36..68c5f97 100644 --- a/application/views/example/add_group.php +++ b/views/example/add_group.php @@ -1,4 +1,3 @@ - diff --git a/application/views/example/add_user.php b/views/example/add_user.php similarity index 95% rename from application/views/example/add_user.php rename to views/example/add_user.php index 41ab339..a291832 100644 --- a/application/views/example/add_user.php +++ b/views/example/add_user.php @@ -1,4 +1,3 @@ - diff --git a/application/views/example/edit_group.php b/views/example/edit_group.php similarity index 97% rename from application/views/example/edit_group.php rename to views/example/edit_group.php index deadff0..c5e31eb 100644 --- a/application/views/example/edit_group.php +++ b/views/example/edit_group.php @@ -1,52 +1,51 @@ - - - - - - BitAuth: Edit Group - - - '; - echo ''; - - if( ! empty($group)) - { - echo ''; - echo ''; - echo ''; - echo ''; - - if(validation_errors()) - { - echo ''; - } - - echo ''; - } else { - echo ''; - } - - echo '
BitAuth Example: Edit Group
Group Name'.form_input('name', set_value('name', $group->name)).'
Description'.form_textarea('description', set_value('description', $group->description)).'
Roles'.form_multiselect('roles[]', $roles, set_value('roles[]', $group_roles)).'
Members'.form_multiselect('members[]', $users, set_value('members[]', $group->members)).'
'.validation_errors().'
'.anchor('example/groups', 'Cancel').' '.form_submit('submit','Update').'

Group Not Found

'.anchor('example/groups', 'Go Back').'

'; - echo form_close(); - - echo '
'; - echo anchor('example/logout', 'Logout', 'style="float: right;"'); - echo '
'; - - ?> - - + + + + + BitAuth: Edit Group + + + '; + echo 'BitAuth Example: Edit Group'; + + if( ! empty($group)) + { + echo 'Group Name'.form_input('name', set_value('name', $group->name)).''; + echo 'Description'.form_textarea('description', set_value('description', $group->description)).''; + echo 'Roles'.form_multiselect('roles[]', $roles, set_value('roles[]', $group_roles)).''; + echo 'Members'.form_multiselect('members[]', $users, set_value('members[]', $group->members)).''; + + if(validation_errors()) + { + echo ''.validation_errors().''; + } + + echo ''.anchor('example/groups', 'Cancel').' '.form_submit('submit','Update').''; + } else { + echo '

Group Not Found

'.anchor('example/groups', 'Go Back').'

'; + } + + echo ''; + echo form_close(); + + echo '
'; + echo anchor('example/logout', 'Logout', 'style="float: right;"'); + echo '
'; + + ?> + + diff --git a/application/views/example/edit_user.php b/views/example/edit_user.php similarity index 96% rename from application/views/example/edit_user.php rename to views/example/edit_user.php index 07673a9..f157228 100644 --- a/application/views/example/edit_user.php +++ b/views/example/edit_user.php @@ -1,4 +1,3 @@ - diff --git a/application/views/example/groups.php b/views/example/groups.php similarity index 94% rename from application/views/example/groups.php rename to views/example/groups.php index 8e420c9..3e556c9 100644 --- a/application/views/example/groups.php +++ b/views/example/groups.php @@ -1,4 +1,3 @@ - diff --git a/application/views/example/login.php b/views/example/login.php similarity index 94% rename from application/views/example/login.php rename to views/example/login.php index 672aab8..ed215e1 100644 --- a/application/views/example/login.php +++ b/views/example/login.php @@ -1,4 +1,3 @@ - diff --git a/application/views/example/no_access.php b/views/example/no_access.php similarity index 95% rename from application/views/example/no_access.php rename to views/example/no_access.php index 0a5a0e5..7fc5d60 100644 --- a/application/views/example/no_access.php +++ b/views/example/no_access.php @@ -1,22 +1,21 @@ - - - - - - BitAuth: Access Denied - - - '; - echo 'BitAuth Example: Access Denied'; - echo 'Nope.
'.anchor('example', 'Continue').''; - echo ''; - ?> - - \ No newline at end of file + + + + + BitAuth: Access Denied + + + '; + echo ''; + echo ''; + echo '
BitAuth Example: Access Denied
Nope.
'.anchor('example', 'Continue').'
'; + ?> + + diff --git a/application/views/example/users.php b/views/example/users.php similarity index 94% rename from application/views/example/users.php rename to views/example/users.php index 6a7cb54..893c9e3 100644 --- a/application/views/example/users.php +++ b/views/example/users.php @@ -1,4 +1,3 @@ -