Welcome Guest, Not a member yet? Register   Sign In
run script that is behind a protected directory
#4

[eluser]Pascal Kriete[/eluser]
I can't think of anything very nice, but I can think of a hack.

Duplicate the system/codeigniter/codeigniter.php and call it anything you want (codeigniter2 for all I care). Put it in the same folder.

In that file, right after:
Code:
$CFG =& load_class('Config');
$URI =& load_class('URI');
$RTR =& load_class('Router');
$OUT =& load_class('Output');

Force the one allowed path by doing:
Code:
$RTR->set_directory('directory_of_the_controller');  //make it blank if you're not using folders
$RTR->set_class('class_name');   // What your first uri segment would normally be
$RTR->set_method('method_name');  // What your second segment would be

Then, on the public side you create another index.php file identical to the regular one. Change the paths to the system and application folders to point to your protected directory.

At the bottom of the file change the require_once to point at your new codeigniter2.php file. Now your ajax call can call that new index.php .

It's a hack, but it should work. Remember that anything your js has access to, anyone will have access to.


Messages In This Thread
run script that is behind a protected directory - by El Forum - 05-17-2008, 09:08 AM
run script that is behind a protected directory - by El Forum - 05-17-2008, 09:24 AM
run script that is behind a protected directory - by El Forum - 05-17-2008, 09:27 AM
run script that is behind a protected directory - by El Forum - 05-17-2008, 09:47 AM
run script that is behind a protected directory - by El Forum - 05-18-2008, 03:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB