1
Axxxxxl
restricted access Problem
  • 2009/11/14 1:19

  • Axxxxxl

  • Just popping in

  • Posts: 12

  • Since: 2009/4/1 2


Hi,

im from Germany and have the following problem. I update one of my XOOPS site from 2.3 to 2.4.0 and today to 2.4.1 and the system itself works fine. I use now the news modul 1.64 and can change all available editors. My favorit FCKeditor (NOT CKEditor) works also but even if i click the button for insert a image and then "search on server (in german: "Durchsuchen") i get the error "restricted access". The same FCK on a "old" 2.3 site works fine.

I found in many files of 2.4.x e.g. /class/xoopseditor/xoopseditor.php the new line:
defined('XOOPS_ROOT_PATH') or die('Restricted access');


I think here is the main problem?! But i am right, that the XOOPS_ROOT_PATH is defined in my mainfile.php? I never change this file and it works great with 2.3 but now i get the "restricted access" error. Also all CHMOD Settings for Cache and the other tempfiles are correct, im sure!

Can you help me with this problem? I need the upload of images in FCKeditor! THANKS!

2
ghia
Re: restricted access Problem
  • 2009/11/14 2:42

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


What URL is displayed in the browser when that message is showed?

3
Axxxxxl
Re: restricted access Problem
  • 2009/11/14 9:51

  • Axxxxxl

  • Just popping in

  • Posts: 12

  • Since: 2009/4/1 2


In the Popup of the FCKEditor when i want to upload a picture there is the following URL:

http://www.myurl/class/xoopseditor/fckeditor/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=http%3A%2F%2Fwww.myurl%2Fclass%2Fxoopseditor%2Ffckeditor%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php


I got the same error if i use the Testpage of FCKEditor in
../class/xoopseditor/fckeditor/fckeditor/editor/filemanager/connectors/test.html


everytime "restricted access"

So i ask myself, what means the new code
defined('XOOPS_ROOT_PATH') or die('Restricted access');

in many pages of XOOPS 2.4.1, because i think there is the main problem?!?!

4
ghia
Re: restricted access Problem
  • 2009/11/14 10:44

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It means that there is a PHP file called which is not (indirectly) including mainfile.php. This prevents unauthorised used of PHP scripts. Some were added in the new 2.4 to tigthen security.
It's clear that there is somewhere an unchained file.
What modifications did you do, to use the (default disabled) uploads of FCK?

5
Axxxxxl
Re: restricted access Problem
  • 2009/11/14 16:21

  • Axxxxxl

  • Just popping in

  • Posts: 12

  • Since: 2009/4/1 2


I modificate nothing. I use XOOPS from 2.0.18 to 2.3 together with the FCEditor, i think the version from myxoops.de or simple-xoops.de and the Upload was enabled all the time!
I know only, that when in XOOPS the option "gzip compression" is activated, the FCKEditor dont work, but i have the option disabled.

Also in the CKeditor all works fine, but if i try to upload, it came a message in the CK Popup Window that say (in german): "The Filemanager is disabled. Please contact the Administrator or change it in the configuration".

Mysterios! But the Debug Mode say nothing like "missin a include file" and so on. We must find a solution because i need my lovely FCKEditor. If i find it by myself, i will write your a message here.

6
Axxxxxl
Re: restricted access Problem
  • 2009/11/14 17:47

  • Axxxxxl

  • Just popping in

  • Posts: 12

  • Since: 2009/4/1 2


Me again,

for testing i do a fresh XOOPS 2.4.1. installation only with news 1.64 and FCKEditor from my other site, where it works.
But im sure now, that is a main problem since XOOPS 2.4 that the FCKEditor also on this fresh site say "Restricted Access" and in the CKEditor i can open the popup for insert images but i miss the "Search Server" Button to search my images.

Please give this information to the official XOOPS Team for Fixing!!!

7
ghia
Re: restricted access Problem
  • 2009/11/15 11:37

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
I modificate nothing. I use XOOPS from 2.0.18 to 2.3 together with the FCEditor, i think the version from myxoops.de or simple-xoops.de and the Upload was enabled all the time!
I think you heve the simple-xoops version, because file browser or upload is normally not enabled on XOOPS.
Try a compare with the files from FCKEditor from you and the ones from XOOPS 2.3.3.

Can you show the content of your /class/xoopseditor/fckeditor/formfckeditor.php ?

Quote:
in the CKEditor i can open the popup for insert images but i miss the "Search Server" Button to search my images.
For security reasons this is standard disabled.
See this and this.

8
Axxxxxl
Re: restricted access Problem
  • 2009/11/15 18:45

  • Axxxxxl

  • Just popping in

  • Posts: 12

  • Since: 2009/4/1 2


If i try /class/xoopseditor/fckeditor/formfckeditor.php manually i get:
Fatal errorCall to undefined function xoops_load() in /var/www/vhosts/web7/html/test/class/xoopseditor/fckeditor/formfckeditor.php on line 24
The content of this file is:
/*  You may not change or alter any portion of this comment or credits  of supporting developers from this source code or any supporting source code   which is considered copyrighted (c) material of the original comment or credit authors.    This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */  /**  *  FCKeditor adapter for XOOPS  *  * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/  * @license         http://www.fsf.org/copyleft/gpl.html GNU public license  * @package         class  * @subpackage      editor  * @since           2.3.0  * @author          Taiwen Jiang   * @version         $Id: formfckeditor.php 2154 2008-09-22 02:38:32Z phppp $  */  xoops_load('XoopsEditor');  class XoopsFormFckeditor extends XoopsEditor {     var $language;     var $upload true;     var $width "100%";     var $height "500px";     var $toolbarset "Xoops";      /**      * Constructor      *      * @param    array   $configs  Editor Options      */     function __construct($configs)     {         $this->rootPath "/class/xoopseditor/fckeditor";         parent::__construct($configs);         $this->width = isset($this->configs["width"]) ? $this->configs["width"] : $this->width;         $this->height = isset($this->configs["height"]) ? $this->configs["height"] : $this->height;         $this->upload = isset($this->configs["upload"]) ? $this->configs["upload"] : $this->upload;         $this->toolbarset = isset($this->configs["toolbarset"]) ? $this->configs["toolbarset"] : $this->toolbarset;     }          function XoopsFormFckeditor($configs)     {         $this->__construct($configs);     }      /**      * get language      *      * @return    string      */     function getLanguage()     {         if ($this->language) {             return $this->language;         }         if (defined("_XOOPS_EDITOR_FCKEDITOR_LANGUAGE")) {             $this->language strtolower(constant("_XOOPS_EDITOR_FCKEDITOR_LANGUAGE"));         } else {             $this->language str_replace('_''-'strtolower(_LANGCODE));         }                  return $this->language;     }      /**      * prepare HTML for output      *      * @param   bool    decode content?      * @return  sting HTML      */     function render($decode true)     {         $ret '';         $oFCKeditor = new FCKeditor($this->getName());         $oFCKeditor->BasePath    XOOPS_URL $this->rootPath"/fckeditor/";         $oFCKeditor->ToolbarSet    $this->toolbarset;         $oFCKeditor->Width        $this->width;         $oFCKeditor->Height        $this->height;         if ($decode) {             $ts =& MyTextSanitizer::getInstance();             $oFCKeditor->Value $ts->undoHtmlSpecialChars$this->getValue() );         } else {             $oFCKeditor->Value $this->getValue();         }          if (is_readable(XOOPS_ROOT_PATH $this->rootPath'/fckeditor/editor/lang/' $this->getLanguage() . '.js')) {             $oFCKeditor->Config['DefaultLanguage'] = $this->getLanguage();         }          if (defined("_XOOPS_EDITOR_FCKEDITOR_FONTLIST")) {             $oFCKeditor->Config['FontNames'] = _XOOPS_EDITOR_FCKEDITOR_FONTLIST;         }                  $dirname is_object($GLOBALS["xoopsModule"]) ? $GLOBALS["xoopsModule"]->getVar("dirname""n") : "system";          if (!file_exists($config_file XOOPS_ROOT_PATH "/cache/fckconfig.{$dirname}.js")) {             if ( $fp fopen$config_file "wt" ) ) {                 $fp_content "";                 if ($xoopsconfig implode(""file(XOOPS_ROOT_PATH $this->rootPath'/fckconfig-xoops.js'))) {                     $fp_content .= "/* FCKconfig custom configuration */n";                     $fp_content .= $xoopsconfig "nn";                 }                 $fp_content .= "/* FCKconfig module configuration */n";                 if (is_readable($config_mod XOOPS_ROOT_PATH "/modules/{$dirname}/fckeditor.config.js")) {                     $fp_content .= "/* Loaded from module local config file */n" implode(""file($config_mod)) . "nn";                 }                 if (is_readable(XOOPS_ROOT_PATH "/modules/{$dirname}/fckeditor.connector.php")) {                     $fp_content .= "var browser_path = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=" XOOPS_URL "/modules/" $GLOBALS["xoopsModule"]->getVar("dirname""n") . "/fckeditor.connector.php';n";                     $fp_content .= "FCKConfig.LinkBrowserURL = browser_path ;n";                     $fp_content .= "FCKConfig.ImageBrowserURL = browser_path + '&Type=Image';n";                     $fp_content .= "FCKConfig.FlashBrowserURL = browser_path + '&Type=Flash';nn";                 }                 if (is_readable(XOOPS_ROOT_PATH "/modules/{$dirname}/fckeditor.upload.php")) {                     $fp_content .= "var uploader_path = '" XOOPS_URL "/modules/{$dirname}/fckeditor.upload.php';n";                     $fp_content .= "FCKConfig.LinkUploadURL = uploader_path;n";                     $fp_content .= "FCKConfig.ImageUploadURL = uploader_path + '?Type=Image';n";                     $fp_content .= "FCKConfig.FlashUploadURL = uploader_path + '?Type=Flash';nn";                 }                 if (empty($this->upload)) {                     $fp_content .= "FCKConfig.LinkUpload = false;n";                     $fp_content .= "FCKConfig.ImageUpload = false;n";                     $fp_content .= "FCKConfig.FlashUpload = false;nn";                 }                                  fwrite$fp$fp_content );                 fclose$fp );             } else {                 trigger_error"Cannot create fckeditor config file"E_USER_ERROR );             }         }                  if (is_readable($config_file)) {             $oFCKeditor->Config['CustomConfigurationsPath'] = XOOPS_URL "/cache/fckconfig.{$dirname}.js";         } else {             $oFCKeditor->Config['CustomConfigurationsPath'] = XOOPS_URL $this->rootPath'/fckconfig-xoops.js';         }                  foreach ($this->configs as $key => $val) {             if (isset($this->{$key})) continue;             $oFCKeditor->Config[$key] = $val;         }                  $ret $oFCKeditor->CreateHtml();         return $ret;     }      /**      * Check if compatible      *      * @return      */     function isActive()     {         if ( ! @include_once XOOPS_ROOT_PATH $this->rootPath"/fckeditor/fckeditor.php" ) {             $this->isEnabled false;         } else {             $this->isEnabled FCKeditor::IsCompatible();         }         return $this->isEnabled;     } } ?>
I test on my clean test site with XOOPS 2.4.1: - the FCK Editor from my 2.3.3 install that works -> dont work here - the FCK Editor from the XOOPS 2.3.3 install dir -> dont work - the FCK Editor from Simple XOOPS (2.40) -> dont work "restricted access" I also use the change settings from your links in your last post, but the CKEditor doesnt show me the "search..." Button, see here: Resized Image an i miss the "upload" tab in this window above. I will cry if i cant use one of this editors. So the Text Features works fine but without image upload i isnt a good working. I dont want upload all the files manually. And im still sure, that the main problem that FCKEditor doesnt work is this new "Restricted Access" Feature in XOOPS 2.4.x!!! If anybody can do a clean test install of XOOPS 2.4 WITH FCKeditor OR CKEditor FULL working (with Fileuploads!!) please send me the config files of this working installation! Ask for my Mail with PN!

9
ghia
Re: restricted access Problem
  • 2009/11/16 1:54

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
If i try /class/xoopseditor/fckeditor/formfckeditor.php manually i get:
When I asked for 'Can you show the content of your /class/xoopseditor/fckeditor/formfckeditor.php ?', it is what you see when you edit the file, not what you get when you run it.

For the CKeditor, did you try the patch of my last link?

For the original 2.3.3 FCKeditor, you need a
include '../../../../../../../../mainfile.php';
in the /connector/php/config.php file and to activate it with a proper user permissions check.

10
Axxxxxl
Re: restricted access Problem
  • 2009/11/16 11:54

  • Axxxxxl

  • Just popping in

  • Posts: 12

  • Since: 2009/4/1 2


STRIKE!

If you tell me your last post a little bit earlieer, we dont had write so much lines

But, IT WORKS! I add just this simple line
include '../../../../../../../../mainfile.php';

in the config.php of FCKEditor and even if i loged in, it works fine like in the "goog old days"

And for security i testing also without login -> the connector is diasable and nobody can upload me bad stuff.

So many thanks for your help and we´ll see us here, sure!!!

Greetings from the cold Germany!!!!!!!!!!!!!!!

PS1: the old FCK with XOOPS 2.3.3 works without that line, but i add it for more security!

PS2: If you find a working CKEditor where the upload is enabled and work, please send me the configuration!

Login

Who's Online

272 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 272


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits