1
Hi...
I'm working now on my first XOOPS module, and got huge problem with making administration for it.
When i trying to change datas stored in table created by my module, DB debug reports:
Quote:
SELECT * FROM xoops_config WHERE (conf_modid = 0 AND conf_catid = 1) ORDER BY conf_order ASC
SELECT sess_data FROM xoops_session WHERE sess_id = 'e3d0ff76764663e1b06b0d3187fad791'
SELECT * FROM xoops_users WHERE uid=1
SELECT * FROM xoops_modules WHERE dirname = 'ipboard'
SELECT * FROM xoops_modules WHERE dirname = 'pogoda'
SELECT * FROM xoops_group_permission WHERE (gperm_name = 'module_admin' AND gperm_modid = 1 AND (gperm_groupid = 1 OR gperm_groupid = 2))
UPDATE xoops_pogoda SET type=0 WHERE type=1
Error number: 0
Error message: Action not allowed
UPDATE xoops_pogoda SET type = 1 WHERE id = 3
Error number: 0
Error message: Action not allowed
select * from xoops_pogoda ORDER BY name ASC
Total: 9 queries
This admin.php file looks like this:
Quote:
<?php
include "../../../mainfile.php";
include XOOPS_ROOT_PATH."/include/cp_functions.php";
include_once XOOPS_ROOT_PATH."/class/xoopsmodule.php";
if (is_object($xoopsUser)) {
$xoopsModule =& XoopsModule::getByDirname("pogoda");
if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
$admintest=1;
} else {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
/**
* Główna funkcja
*/
function admin_main() {
global $xoopsConfig, $xoopsModule, $xoopsDB, $module_name, $xoopsUser;
$xoopsDB->query( "UPDATE xoops_pogoda SET type=0 WHERE type=1" );
$xoopsDB->query( "UPDATE xoops_pogoda SET type = 1 WHERE id = 3 " );
OpenTable();
echo '<center><h4><b>Pogoda</b></h4><HR><BR></center>';
$result = $xoopsDB->query( "select * from ".$xoopsDB->prefix("pogoda")." ORDER BY name ASC" );
while( list( $id, $type, $name, $url ) = $xoopsDB->fetchRow( $result ) ) {
[rest of code]
CloseTable();
}
switch ( $_GET['op'] )
{
default:
xoops_cp_header();
admin_main( );
xoops_cp_footer();
}
?>
And xoops_version.php looks like this:
Quote:
<?php
$modversion['name'] = "Pogoda";
$modversion['version'] = "0.1";
$modversion['description'] = "Pogoda";
$modversion['credits'] = "Diabl0/MAO<br />diabl0@mao.pl";
$modversion['author'] = "Diabl0/MAO <diabl0@mao.pl>";
$modversion['license'] = "GNU/GPL";
$modversion['official'] = 0;
$modversion['image'] = "images/pogoda.jpg";
$modversion['dirname'] = "pogoda";
// Menu
$modversion['hasMain'] = 1;
// Templates
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = "admin/admin.php";
$modversion['adminmenu'] = "admin/menu.php";
// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
// All tables should not have any prefix!
$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
$modversion['tables'][0] = "pogoda";
?>
Why this error happens, and how to fix this?