You are not logged in.
Pages: 1
Hello all,
I am trying to get imagemanger set up on my system where i have dynamic image libraries depending on the user. i have it set up like how the wiki says, i have the config.js file changed to config.php, and variables passed in for the directories, like this:
.....
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
<?php
$IMConfig = array();
$IMConfig['images_dir'] = $absPath.'/img/';
$IMConfig['images_url'] = $relPath.'/img/';
$IMConfig = serialize($IMConfig);
if(!isset($_SESSION['Xinha:ImageManager']))
{
$_SESSION['Xinha:ImageManager'] = uniqid('secret_');
}
?>
xinha_config.ImageManager.backend_config
= '<?php echo jsaddslashes($IMConfig)?>';
xinha_config.ImageManager.backend_config_hash
= '<?php echo sha1($IMConfig . $_SESSION['Xinha:ImageManager'])?>';
....
It seems to be fine, but when i test it and open up imagemanager, i get the backend security error. the directories are generated right when i view source, so that is not a problem. is there any other config i have to do in the plugins config file or elsewhere? thanks for the help.
Offline
don't u actually have to use the other php code as well
<?php
function jsaddslashes($s)
{
$o="";
$l=strlen($s);
for($i=0;$i<$l;$i++)
{
$c=$s[$i];
switch($c)
{
case '<': $o.='\\x3C'; break;
case '>': $o.='\\x3E'; break;
case '\'': $o.='\\\''; break;
case '\\': $o.='\\\\'; break;
case '"': $o.='\\"'; break;
case "\n": $o.='\\n'; break;
case "\r": $o.='\\r'; break;
default:
$o.=$c;
}
}
return $o;
}
?>
I placed this code right before
xinha_config.ImageManager.backend_config
= '<?php echo jsaddslashes($IMConfig)?>';
becasue it is called by it
and yeah I'm having the same backend security error
gogo the documentation of imagemanager doesn't say anything about session_start() call,
what ianw is doing is exactly what the documentation has. :S are we missing something.
plus the path to ur images folder. can u give me an example. this images folder is the one inside the Xinha directory. can i use my uploads folder that is outside xinha directory.
here is my directory structure
www
--blog
----uploads
----plugins
------serendipity_event_xinha
--------xinha-nightly
-----------plugins
etc.
my url is pointed to the blog folder. so if i do http://myschizobuddy.com i see content of blog folder.
So what should the paths be.
Last edited by MySchizoBuddy (2005-08-20 00:58:40)
Offline
Yes you should also use jsspecialchars (or your own equivalent). session_start() is required in order before you can use $_SESSION in PHP (and have it actually work). You can use a folder anywhere you want, provided your server doesn't have safe_mode or base_dir restrictions enabled.
James Sleeman
Offline
ok this is what i have
<?php
session_start();
$IMConfig = array();
$IMConfig['images_dir'] = $absPath.'/uploads/';;
$IMConfig['images_url'] = $relPath.'/uploads/';
$IMConfig = serialize($IMConfig);
if(!isset($_SESSION['Xinha:ImageManager']))
{
$_SESSION['Xinha:ImageManager'] = uniqid('secret_');
}
?>
<?php
function jsaddslashes($s)
{
$o="";
$l=strlen($s);
for($i=0;$i<$l;$i++)
{
$c=$s[$i];
switch($c)
{
case '<': $o.='\\x3C'; break;
case '>': $o.='\\x3E'; break;
case '\'': $o.='\\\''; break;
case '\\': $o.='\\\\'; break;
case '"': $o.='\\"'; break;
case "\n": $o.='\\n'; break;
case "\r": $o.='\\r'; break;
default:
$o.=$c;
}
}
return $o;
}
?>
xinha_config.ImageManager.backend_config = '<?php echo jsaddslashes($IMConfig)?>';
xinha_config.ImageManager.backend_config_hash = '<?php echo sha1($IMConfig . $_SESSION['Xinha:ImageManager'])?>';
I'm still getting backend security error.
my html output is
xinha_config.ImageManager.backend_config = 'a:2:{s:10:\"images_dir\";s:9:\"/uploads/\";s:10:\"images_url\";s:9:\"/uploads/\";}';
xinha_config.ImageManager.backend_config_hash = 'a23ccbfedef329abb76b60f460e1b20e8de5e714';
can anyone post there directory structure and the code. I'm still confused at the paths.
Last edited by MySchizoBuddy (2005-08-20 06:12:41)
Offline
Offline
I have the session_start() earlier on in the script, and the jssaddslashes function. is there anything that should be modified in the config.inc.php file in the imagemanager plugin folder?
Offline
Pages: 1