1
sumairi
Re: One last chance before moving to PHPNuke
  • 2004/7/19 19:38

  • sumairi

  • Just popping in

  • Posts: 1

  • Since: 2003/7/1 4


I faced some problems with XOOPS i had to edit the code itself. I understand the difficulty you're having, because one bad thing about xoops, is that it's messy in many ways, and does lots of things that should have been done in different ways. sometimes they cache in mysql, sometimes they need 'chmod 777' to cache!! lots of redirections. Layout in many ways is themeable, and in many other ways is hardcoded, sometimes layout is not themeable, while style is themeable.

For developers, it's a bit messy too, you don't know why you have includes, kernel and classes!? you have to go to too many places to figure out how user information is saved after you hit the save button.

Same thing for you, the page you're accessing goes through somewhat unneccessary "in my opinion" procedure. The "/admin.php" page first checks if the "/cache/adminmenu.php" had already been generated in the "/cache" folder. If the file doesn't exist AND you've not asked it already to generate it, it creates a form with a dialog:
if (!file_exists(XOOPS_CACHE_PATH.'/adminmenu.php') && $op != 'generate') {
    
xoops_header();
    
xoops_confirm(array('op' => 'generate'), 'admin.php'_AD_PRESSGEN);
    
xoops_footer();
    exit();
}


You hit Ok, and then it goes back to the same page again:
switch ($op) {
case 
"list":
.
.
.
    break;
case 
'generate':
    
xoops_module_write_admin_menu(xoops_module_get_admin_menu());
    
redirect_header('admin.php'1_AD_LOGINADMIN);
    break;
default:
    break;
}

It will envoke the "xoops_module_write_admin_menu", which is in the "/includes/cp_functions.php":
function xoops_module_write_admin_menu($content)
{
    if (!
xoopsfwrite()) {
        return 
false;
    }
    
$filename XOOPS_CACHE_PATH.'/adminmenu.php';
    if ( !
$file fopen($filename"w") ) {
        echo 
'failed open file';
        return 
false;
    }
    if ( 
fwrite($file$content) == -) {
        echo 
'failed write file';
        return 
false;
    }
    
fclose($file);
    return 
true;
}

You can see that this function tries to save the "$content", created by "xoops_module_get_admin_menu" function, inside this file. if it fails, it prints an error and the quickly redirects you to the "admin.php", the same file again, which discovers that you don't have the "adminmenu.php" and starts from zero ...etc.

If you want, you can print the $content to your web browser using the print function, and then copy it and paste it to the /cache/mainmenu.php", manually creating the file, so the dialog wont bother you again.

To do this, modify the cp_functions.php file by editing the last few lines:
function xoops_module_write_admin_menu($content)
{
    
// begin-- 'chmod 777 /cache' not working
    // next 2 lines will print the mainmenu.php file to
    // the web browser instead of trying to create it.
    
print $content;
    return 
false;
    
///end-- 'chmod 777 /cache' not working

    
if (!xoopsfwrite()) {
        return 
false;
    }
    
$filename XOOPS_CACHE_PATH.'/adminmenu.php';
    if ( !
$file fopen($filename"w") ) {
        echo 
'failed open file';
        return 
false;
    }
    if ( 
fwrite($file$content) == -) {
        echo 
'failed write file';
        return 
false;
    }
    
fclose($file);
    return 
true;
}


Well, i know ou went to too many places in your permissions to solve your problem, but one thing you might want to check is "permission inheritance" in windows 2k. check that the parent directory security is the default, or full control everyone, probably your cache folder is inheriting more strict rules.

Thanks




TopTop



Login

Who's Online

204 user(s) are online (134 user(s) are browsing Support Forums)


Members: 0


Guests: 204


more...

Donat-O-Meter

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

Latest GitHub Commits