Hello.
first of all - thanks for this auth library.
Main reason I have chosen it - features I need.
Easy-to-read/edit code.
All seems fine, but it seems it doesn’t have config option, to disable password encryption?
Thank you so much!
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
December 01, 2008 6:14am
Subscribe [160]#151 / Dec 13, 2008 12:41am
Hello.
first of all - thanks for this auth library.
Main reason I have chosen it - features I need.
Easy-to-read/edit code.
All seems fine, but it seems it doesn’t have config option, to disable password encryption?
Thank you so much!
#152 / Dec 13, 2008 4:23am
^
No, i don’t plan to add config to disable password encryption.
But if you still want it, you can open DX_Auth.php
Search function _encode($password)
Delete the code in that function, and replace it with ‘return $password;’
Should be no problem.
#153 / Dec 13, 2008 6:19am
Hello,
There is any advantage that the user session data is set under the root of the session and not under a certain key?
Thanks,
Paul
#154 / Dec 13, 2008 2:09pm
Can you see any SMTP things in DX Auth library? I can’t, really. Configure your server and codeigniter first, please.
If you are using PHP under Windows, mail() function will work over SMTP by default.
[mail function] ; For Win32 only. SMTP = localhost smtp_port = 25So think twice, post once, please.
Thanks for the tip RH. I’ve never run into this problem before on windows localhost. I’ll look into it further.
#155 / Dec 13, 2008 10:12pm
Hello,
There is any advantage that the user session data is set under the root of the session and not under a certain key?
Thanks,
Paul
Actually, in my opinion there is no advantage, it was only for easy coding.
I know it may overwritten if someone using the same key, maybe i’m gonna add prefix DX_ in user session data used by DX_Auth.
#156 / Dec 14, 2008 6:03pm
Darn, it looks like that the pass several weeks of reviving the Redux Auth system are toast - you already have a system that does what I built - and more!
I wish that you would have mentioned something about this back in October! Oh well, at least this system exists now!
Question: Why do you store the email templates in language files? Why don’t you place them in views/auth/email/ so that we can change them depending on the template and we don’t have to mess with HTML in our config variables. Also, even though you are using HTML links in the language files - you don’t have a doc type defined or anything. Isn’t that bad practice?
#157 / Dec 14, 2008 7:44pm
Thanks for this great library!
It really speeds up development. I’m coding a site with 3000+ users with different roles and it works like a charm! 😊
I don’t know if it is a bug but I found that the is_role() does not search the parent roles of a user.
My roles are setup like this:
User
Band
Band1
Band2
Band3
etc…
When I run is_role(‘band’, TRUE) it returns false. Am I doing it wrong?
I did a quick fix for it:
//
// Added these methods to DX_Auth.php
//
function get_role_names()
{
return $this->arraytolower($this->ci->session->userdata('parent_roles_name'));
}
function arraytolower($array,$round = 0){
foreach($array as $key => $value){
if(is_array($value)) $array[strtolower($key)] = $this->arraytolower($value,$round+1);
else $array[strtolower($key)] = strtolower($value);
}
return $array;
}//
// ... and this snippet right before the return-statement in the is_role() method.
//
foreach ($roles as $val)
{
if (in_array(strtolower($val), $this->get_role_names() ))
{
$result = TRUE;
break;
}
}Is there another way to do it?
#158 / Dec 15, 2008 12:13am
Question: Why do you store the email templates in language files? Why don’t you place them in views/auth/email/ so that we can change them depending on the template and we don’t have to mess with HTML in our config variables. Also, even though you are using HTML links in the language files - you don’t have a doc type defined or anything. Isn’t that bad practice?
It was to support internationalization.
It’s ok, because CI using mailtype text as default for sending email, if you want to use html, then you may want to change it.
#159 / Dec 15, 2008 12:15am
Thanks for this great library!
It really speeds up development. I’m coding a site with 3000+ users with different roles and it works like a charm! 😊
I don’t know if it is a bug but I found that the is_role() does not search the parent roles of a user.
My roles are setup like this:
User
Band
Band1
Band2
Band3
etc…When I run is_role(‘band’, TRUE) it returns false. Am I doing it wrong?
I did a quick fix for it:
// // Added these methods to DX_Auth.php // function get_role_names() { return $this->arraytolower($this->ci->session->userdata('parent_roles_name')); } function arraytolower($array,$round = 0){ foreach($array as $key => $value){ if(is_array($value)) $array[strtolower($key)] = $this->arraytolower($value,$round+1); else $array[strtolower($key)] = strtolower($value); } return $array; }// // ... and this snippet right before the return-statement in the is_role() method. // foreach ($roles as $val) { if (in_array(strtolower($val), $this->get_role_names() )) { $result = TRUE; break; } }Is there another way to do it?
Thank you 😊
It was my mistake. Sorry, i forgot to update is_role function when i add inheritance feature.
I will update it in next release.
#160 / Dec 15, 2008 1:52am
Few small things
- In your backend views, you are using <? rather than <?php. It doesn’t work by default unless you have short tags open
- Even though nothing is returned, but if someone knows that I am using DXAuth library, they can use those check functions via URLs. Not sure if that would make any security threat since it doesn’t do anything but still making those functions private (I think by adding _ in front of them?) maybe more secure
A feature request
I am asking this to see if this is being worked on as I don’t want to re-invent it if it is.
I was wondering if you plan to add more functionality. Few things that’d really hit the spot are:
- Profile change page for BOTH auth and backend (backend for ALL users as that is admin spot)
- Edit logged in user information in BOTH auth and backend (backend for ALL users as that is admin spot (I think)
- Changing user roles
If there are no plans in future then I can go ahead and do it for my site. If there are then I can wait and use your code.
My preference if to use your code as that way I can easily update it for newer versions.
Sorry for being a demanding (and lazy) user. I liked this library and started using it this week (along with CI). Thanks
#161 / Dec 15, 2008 2:22am
Few small things
- In your backend views, you are using <? rather than <?php. It doesn’t work by default unless you have short tags open
Thanks.
- Even though nothing is returned, but if someone knows that I am using DXAuth library, they can use those check functions via URLs. Not sure if that would make any security threat since it doesn’t do anything but still making those functions private (I think by adding _ in front of them?) maybe more secure
Do you mean the callback function in Auth.php?
Well, you can use _remap function to disable that.
A feature request
I am asking this to see if this is being worked on as I don’t want to re-invent it if it is.
I was wondering if you plan to add more functionality. Few things that’d really hit the spot are:
- Profile change page for BOTH auth and backend (backend for ALL users as that is admin spot)
- Edit logged in user information in BOTH auth and backend (backend for ALL users as that is admin spot (I think)
- Changing user roles
If there are no plans in future then I can go ahead and do it for my site. If there are then I can wait and use your code.My preference if to use your code as that way I can easily update it for newer versions.
Sorry for being a demanding (and lazy) user. I liked this library and started using it this week (along with CI). Thanks
Sorry, i don’t plan to add more feature in backend at current time, since it was just an example, but maybe someday in the future.
But actually, i believe current functions in the DX Auth Model can fulfill your request.
And if you don’t mind, you can contribute by posting more advanced backend 😊
#162 / Dec 15, 2008 2:55am
Added small update to 1.0.4, to add check parent in is_role function, and few small changes.
#163 / Dec 15, 2008 6:57am
A small remark for this wonderful library:
Using DX Auth in a project of mine. After uploading the project to my webserver I kept on getting an error message saying dx_auth couldn’t be loaded. Eventually I found out that the capitalized name of the file ‘DX_Auth.php’ was causing the problem.
I suppose some webservers are case-sensitive while others are not. A small suggestion from me would be to rename the files to Dx_auth.php/Dx_auth_event.php to prevent this error from occuring when run on case-sensitive webservers.
#164 / Dec 15, 2008 8:54am
Sorry, i don’t plan to add more feature in backend at current time, since it was just an example, but maybe someday in the future.
But actually, i believe current functions in the DX Auth Model can fulfill your request.
And if you don’t mind, you can contribute by posting more advanced backend 😊
Thanks. I’ll see what I come up with and will share it here when done
#165 / Dec 15, 2008 4:55pm
Great Lib. One thing though… After a successful login as a normal user, if I go to the backend’s url, it throws an error. Users shouldn’t know the url to your backend anyway, but just an fyi…
A PHP Error was encountered
Severity: Warning
Message: in_array() [function.in-array]: Wrong datatype for second argument
Filename: libraries/DX_Auth.php
Line Number: 172