phpweb后台管理账号权限都是存放在了 pwn_base_adminauth表里面。
此表记录着所有的phpweb权限。 然后可以通过下面的语句进行添加query( “INSERT INTO pwn_base_adminauth VALUES (’0′,’shop’, ’341′,’商城产品发布权限’,”,’1′,’31′, ”)”);
$msql->query( “INSERT INTO pwn_base_adminauth VALUES (’0′,’shop’, ’341′,’商城产品查看权限’, ”,’2′,’31′, ”)”); ?>
增加你想要的权限,然后对其进行管理的时候 在页面中 进行 needauth( 319 );
代码如下
function needauth( $au ) { global $msql; global $strAdminNoright;
if ( !isset( $_COOKIE['SYSUSER'] ) || $_COOKIE['SYSUSER'] == “” ) { echo “
”; exit( ); }
$msql->query( “select * from pwn_base_admin where user=’”.$_COOKIE['SYSUSER'].”‘” );
if ( $msql->next_record( ) ) { $psd = $msql->f( “password” );
$needmd5 = md5( $_COOKIE['SYSUSER'].”l0aZXUYJ876Mn5rQoL55B”.$psd.$_COOKIE['SYSTM'] );
if ( $needmd5 != $_COOKIE['SYSZC'] ) { } if ( $au != “0″ ) { $msql->query( “select * from pwn_base_adminrights where user=’”.$_COOKIE['SYSUSER'].”‘ and auth=’{$au}’” );
if ( $msql->next_record( ) ) { } else { } } } else { } }
大体意思是 根据权限id 从数据库读取此session里面的人员是不是又有此权限发布商品?php>