PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:restricted access issue... (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:restricted access issue...
#671
desq (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
restricted access issue... 4 Months, 2 Weeks ago Karma: 0  
Hi,

I've installed directphp and tested that it will display the correct date using the test php script, which works fine.

I want to run a script which accesses a mysql database but receive an error message as follows

"The following command is not allowed: mysql_connect"

I tried to look at the list of blocked commands to see if the above was blocked and try to remove it from the list.

Although I am a superadministrator of my site, and can publish and unpublish directphp, I get an error message "restricted access" when I try and edit the parameters of directphp.

I tried to clear the problem by using global checkin, which removed the lock icon on the directphp entry in the "site mambots" list, and then tried to click on the link to directphp again, but still had no luck in getting access.

Do you know how I can gain access into the parameters?

BTW, I will not be allowing users to add content to the site, so I hope that security will not be an issue here with unblocking mysql_connect.

Thanks for your help....
 
  The administrator has disabled public write access.
#677
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:restricted access issue... 4 Months, 2 Weeks ago Karma: 8  
Hi,

The first one "The following command is not allowed: mysql_connect" is by DirectPHP.

By the second one "restricted access" is from your Joomla installation. I'm not sure exactly what's happening as you didn't give enough details.

However, since you're the superadministrator of your site and you said you will be the only one that will be using DirectPHP, here are two more ways you can change the parameters.

1) Edit mysql db directly. First look up the table jos_plugins (in Joomla 1.5) or jos_mambots (in Joomla 1.0). Then look for the entry DirectPHP in the table. In the last column "params", you should see "enable_command_block=1". Change this to "enable_command_block=0"

2) Edit the installation file DirectPHP.xml. Look for the line 'param name="enable_command_block" type="radio" default="1" label="Enable PHP Command Block"'. Change default="1" to default="0".

Then uninstall DirectPHP and reinstall DirectPHP using the modified DirectPHP.xml.

Using either method (1) or method (2), your DirectPHP should now be able to run all the PHP commands.

Let me know if it works.

Regards,
/kksou
 
  The administrator has disabled public write access.
#681
desq (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:restricted access issue... 4 Months, 2 Weeks ago Karma: 0  
Thanks for your quick response.

I edited the directphp.xml file, reinstalled and republished, but still got the same response that "The following command is not allowed: mysql_connect" and the date example still works fine. I cleared the cache on my browser just in case that might help but it didn't. I'll try editing the mysql database directly...

While checking a few things I looked further into the xml file but couldn't fine a reference to "mysql_connect" in the list of blocked commands. I've cut and pasted the list of commands below...

default="basename, chgrp, chmod, chown, clearstatcache, copy, delete, dirname, disk_free_space, disk_total_space, diskfreespace, fclose, feof, fflush, fgetc, fgetcsv, fgets, fgetss, file_exists, file_get_contents, file_put_contents, file, fileatime, filectime, filegroup, fileinode, filemtime, fileowner, fileperms, filesize, filetype, flock, fnmatch, fopen, fpassthru, fputcsv, fputs, fread, fscanf, fseek, fstat, ftell, ftruncate, fwrite, glob, lchgrp, lchown, link, linkinfo, lstat, move_uploaded_file, opendir, parse_ini_file, pathinfo, pclose, popen, readfile, readdir, readllink, realpath, rename, rewind, rmdir, set_file_buffer, stat, symlink, tempnam, tmpfile, touch, umask, unlink, fsockopen, system, exec, passthru, escapeshellcmd, pcntl_exec, proc_open, proc_close, mkdir, rmdir"
 
  The administrator has disabled public write access.
#682
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:restricted access issue... 4 Months, 2 Weeks ago Karma: 8  
Open up the file DirectPHP.php and search for mysql_connect. You'll find it in there.

There are two more things you can try:
1) Edit mysql db directly. This should work.

2) Or change the code directly in DirectPHP.php. First look for the line "$enable_command_block = $botParams->def( 'enable_command_block', 1 );". Comment this line and replace it with "$enable_command_block = 0;"
You can edit the file directly in the mambots folder. Or you can edit the file in the installation folder, in which case you must uninstall and reinstall again.

Regards,
/kksou
 
 
Last Edit: 2008/08/19 16:44 By kksou.
  The administrator has disabled public write access.
#684
desq (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:restricted access issue... 4 Months, 2 Weeks ago Karma: 0  
I've changed the code in the directphp.php and that worked so good news.

Thanks for your help!
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved