DX Auth

March 6, 2017 | Author: George Gradinaru | Category: N/A
Share Embed Donate


Short Description

Download DX Auth...

Description

Welcome to DX Auth DX Auth is an authentication library for Code Igniter. It's goal to enable you to easily include secure and easy to use authentication library to your project, while giving you the flexibility to choose from simple authentication system to full fledged authentication system. DX Auth is also build with internationalization in mind, so every string is available in language file. (Except the bundled examples, because that is your code not the library). It's based on CL Auth 0.2.5 beta developed by Jason Ashdown.

What is the feature of DX Auth? •

Basic auth (Login, logout, register, change password).



Remember me.



Login using username or email address or both (depend on config settings).



Forgot password.



Ban user.



Last login IP address and time (optional).



Email activation (optional).



User Profile (optional).



Role based (admin, user, moderator, etc). Inheritance also supported (optional).



Restrict page based on URI and role (optional).



Custom permission for each role (optional).



Login attempt (optional). You can use this to display catpcha after specified try to login to prevent bot.



Event feature (For example: You can put your own code like PM welcome message after user activated, etc).



Captcha (optional, native and reCAPTCHA is available).



Simple admin panel (So you can customize it, include it into your own admin panel, or delete if you don't need it).



Most of the feature is optional, means you can turn it off in config file, delete it, or just don't use it.

What is changed since CL Auth 0.2.5 If you are ever using CL Auth before, you might want to know what's changed since CL Auth 0.2.5 •

Bug fixes.



Add and change function.



Changed code structure.

1



Group changed to role.



Compatible with CI bundled session without hacking it.



Added language file for internationalization.



All function named lower_case instead of camelCase.



Source code writing following CI User guide.



Commented source code so you can follow along.



Code Igniter style user guide with detailed explanation.



And other that i don't remember :).

Looks good, so where to get started? Read Getting started, or simple example. DX Auth is tested in CI 1.7.0, but should be working for above version.

Table of Contents Basic Info

General Topics

Examples



License Agreement



Getting Started



Simple example



Change Log



Functions



Advanced example



Upgrading from previous version



Events



Recaptcha example

Credits



Config



Models



Permission example

• •

Tables anatomy



Troubleshooting

Installation •

Downloading DX Auth



Installation Instructions



Database Schema

Change Log Version 1.0.6 Release Date: January 3, 2008 •

Added salt option in config.



Added case sensitive captcha option in config.



Changed encode function, removed encryption key dependency.



Fixed bugs in DX Auth.



Added allow parameter in check_uri_permissions().



Changed model/dx_auth/permissions.php

2

Version 1.0.5 Release Date: December 20, 2008 •

Moved system/plugins to application/plugins.



Fixed bug in in model/dx_auth/user_temp.php.



Fixed bug in in model/dx_auth/permissions.php.

Version 1.0.4 Release Date: December 15, 2008 •

Added $check_parent parameter in is_role() function.



Changed $use_role_name to TRUE by default, in is_role() function.



Added 'DX_' prefix in session userdata used by DX_Auth library.



Changed 31. 32.

49

33. 34. 35.Register

36. 37. 38.

39.



40.



41. 42.



43. 44.



45.

46.



47.



48.



49.



50. 51.



52.

53.



54.



55.



56.



57. 58.



59.

60.



61.



62.



63.



64. 65.



66.

67. 68.

50

69.



70.



71.



79. 80.



81.

82.



83.



84.



85.

86. 87.



88. 89.



93. 94. 95. 96. 97.



98.

99. 100.



101.

102.



103.



104.



51

105.



You can find this example in controllers/auth.php and views/auth/register_recaptcha_form.php that included in DX Auth library download. Top of Page

Permission example This is an example how to set permission using model. Simple set permission view plaincopy to clipboardprint?

1. // Load model 2. $this->load->model('dx_auth/permissions', 'permissions'); 3.

4. // Set permission 'edit' permission to TRUE for role_id = 1. 5. $this->permissions->set_permission_value(1, 'edit', TRUE); Set permission value at once. view plaincopy to clipboardprint?

1. // Load model 2. $this->load->model('dx_auth/permissions', 'permissions'); 3.

4. // Get role_id = 1 permission data first. 5. // So the previously set permission array key won't be overwritten with new array with key $key only,

6. // when calling set_permission_data later. 7. $permission_data = $this->permissions->get_permission_data(1); 8.

9. // Set value in permission data array 10. $permission_data['edit'] = TRUE; 11. $permission_data['delete'] = FALSE; 12.

13. // Set permission data for role_id = 1 14. $this->permissions->set_permission_data(1, $permission_data); This is an example how to get the permission using DX Auth, after user already logged in. view plaincopy to clipboardprint?

52

1. if ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth>get_permission_value('edit'))

2. {

3.

echo 'Editing is allowed in your role';

4. }

5. else 6. {

7.

echo 'Editing is not allowed in your role';

8. } You can see more of the example, in controllers/backend.php in uri_permissions and custom_permissions function.

53

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF