Welcome Guest, Not a member yet? Register   Sign In
CI Folders
#9

[eluser]David Cassidy[/eluser]
[quote author="JanDoToDo" date="1262410406"]Ok.. Thanks for the info. Yeah.. as i said the first one works Smile but not the 2nd folder Sad maybe this is a setting somewhere?? dunno... basically what im trying to do is password protect the files inside the folder through htaccess and creating a subfolder seemed easiest! If you know another way it would also be appreciated! Smile[/quote]

Instead of cluttering up your filesystem with redundant directories, why not take advantage of one of the features of the mod_auth module and use your .htaccess file to protect just the file you want to restrict access to?

Code:
<Files foo.php>
    AuthType Basic
    AuthName "Protected Access"
    AuthUserFile /usr/local/apache/passwd
    Require valid-user
</Files>

Change the filename above and add this snippet to the .htaccess file within the controller directory where it resides. Less clutter means less frustration.

If you are need of password protecting several files, have enough confidence in regular expressions and are feeling particularly brave, you can use the FilesMatch option instead. Otherwise, there is no shortage of authentication and authorization libraries for CodeIgniter - most of which are fairly simple to implement. It's simply up to you to decide whether you need a more elaborate authorization method or not.

Good luck!

[quote author="Demedes" date="1262444314"]I think, this is not right.[/quote]

MVC really only dictates how different components of the application interact with one another. The structure of your directories is really of no consequence.


Messages In This Thread
CI Folders - by El Forum - 01-01-2010, 03:34 PM
CI Folders - by El Forum - 01-01-2010, 03:48 PM
CI Folders - by El Forum - 01-01-2010, 05:28 PM
CI Folders - by El Forum - 01-01-2010, 05:30 PM
CI Folders - by El Forum - 01-01-2010, 05:33 PM
CI Folders - by El Forum - 01-01-2010, 07:49 PM
CI Folders - by El Forum - 01-01-2010, 08:55 PM
CI Folders - by El Forum - 01-02-2010, 02:58 AM
CI Folders - by El Forum - 01-02-2010, 04:04 AM
CI Folders - by El Forum - 01-02-2010, 05:47 AM
CI Folders - by El Forum - 01-02-2010, 05:54 AM
CI Folders - by El Forum - 01-02-2010, 06:34 AM
CI Folders - by El Forum - 01-02-2010, 07:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB