PHPWEB破解安装新模块的经验与方法分享

  因为最近在用PHPWEB做一个站,但是原有的模版站里没有下载模块,在后台安装模块需要验证用户。不甘心,所以研究了一下PHPWEB的模块安装部分,发现验证部分是调用baseadmin下面的post.php进行,所以想在这个文件动手脚。研究了一下,成功安装了下载模块。将经验与大家分享,希望大家用得上。

  首先解密post.php文件并进行修改,下面是我修改好的post.php:

<?php
define( ROOTPATH,../../ );
include( ROOTPATH.includes/admin.inc.php );
include( language/.$sLan..php );
include( ROOTPATH.includes/data.inc.php );
$act = $_POST['act'];
switch ( $act )
{
case getbordertemplist :
needauth( 5 );
$pluslable = $_POST['pluslable'];
if ( $pluslable == modGroupLable )
{
$sql = where bordertype='lable' ;
}
else
{
$sql = where bordertype='border' ;
}
$str = ;
$msql->query( select * from {P}_base_border .$sql. order by tempid );
while ( $msql->next_record( ) )
{
$tempid = $msql->f( tempid );
$btempname = $msql->f( tempname );
$str .= <div id='bt_.$tempid.' class='bordtemplist'>.$tempid. .$btempname.</div>;
}
echo $str;
exit( );
break;
case previewborder :
needauth( 5 );
$borderid = $_POST['borderid'];
$coltitle = $_POST['coltitle'];
$borderwidth = $_POST['borderwidth'];
$bordercolor = $_POST['bordercolor'];
$borderstyle = $_POST['borderstyle'];
$backgroundcolor = $_POST['backgroundcolor'];
$showbar = $_POST['showbar'];
$barbg = $_POST['barbg'];
$barcolor = $_POST['barcolor'];
if ( $borderid == 1000 )
{
$path = ROOTPATH.base/border/.$borderid./tpl.htm;
$imgpath = ROOTPATH.base/border/.$borderid./images/;
}
else if ( substr( $borderid,1,1 ) == 0 )
{
$path = ROOTPATH.base/border/.substr( $borderid,1 )./.substr( $borderid,1 )..htm;
$imgpath = ROOTPATH.base/border/.substr( $borderid,1 )./images/;
}
else
{
$path = ROOTPATH.base/border/.substr( $borderid,1 )./tpl.htm;
$imgpath = ROOTPATH.base/border/.substr( $borderid,1 )./images/;
}
if ( file_exists( $path ) )
{
$fd = fopen( $path,r );
$str = fread( $fd,300000 );
fclose( $fd );
$str = str_replace( {#RP#},ROOTPATH,$str );
$str = str_replace( images/,$imgpath,$str );
$str = str_replace( {#coltitle#},$coltitle,$str );
$str = str_replace( {#morelink#},#,$str );
$str = str_replace( {#showmore#},block,$str );
$str = str_replace( {#borderwidth#},$borderwidth,$str );
$str = str_replace( {#bordercolor#},$bordercolor,$str );
$str = str_replace( {#borderstyle#},$borderstyle,$str );
$str = str_replace( {#backgroundcolor#},$backgroundcolor,$str );
$str = str_replace( {#showbar#},$showbar,$str );
$str = str_replace( {#barbg#},$barbg,$str );
$str = str_replace( {#barcolor#},$barcolor,$str );
$arr = explode( <!-start->,$str );
$TempArr['start'] = $arr[1];
$arr = explode( <!-end->,$str );
$TempArr['end'] = $arr[1];
$str = $TempArr['start'].<img src='images/plusborder.gif' border='0' width='100%' />.$TempArr['end'];
}
else
{
$str = $strBorderNotExist;
}
echo $str;
exit( );
break;
case getplustemplist :
needauth( 5 );
$pluslable = $_POST['pluslable'];
$set_tempname = $_POST['set_tempname'];
$tempname = $_POST['tempname'];
$str = ;
if ( $tempname == $set_tempname )
{
$str .= <div id='pt_0' class='plustemplist' style='border-color:#d8f0fa;background:#f4fafd' title='.$set_tempname.'>.$strTempDef. (.$set_tempname.)</div>;
}
else
{
$str .= <div id='pt_0' class='plustemplist' title='.$set_tempname.'>.$strTempDef. (.$set_tempname.)</div>;
}
$fsql->query( select * from {P}_base_plustemp where pluslable='{$pluslable}' order by id );
while ( $fsql->next_record( ) )
{
$tempid = $fsql->f( id );
$cname = $fsql->f( cname );
$ctempname = $fsql->f( tempname );
if ( $tempname == $ctempname )
{
$str .= <div id='pt_.$tempid.' class='plustemplist' style='border-color:#d8f0fa;background:#f4fafd' title='.$ctempname.'>.$cname. (.$ctempname.)</div>;
}
else
{
$str .= <div id='pt_.$tempid.' class='plustemplist' title='.$ctempname.'>.$cname. (.$ctempname.)</div>;
}
}
echo $str;
exit( );
break;// Downloads By http://www.veryhuo.com
case getpicsource :
needauth( 5 );
$sourcename = $_POST['sourcename'];
$sourcefolder = $_POST['sourcefolder'];
$sourcefold = ROOTPATH.effect/source/.$sourcefolder;
$handle = opendir( $sourcefold );
$i = 0;
while ( $image_file = readdir( $handle ) )
{
$nowfile = $sourcefold./.$image_file;
if ( $image_file != . && $image_file != .. && $image_file != _notes && !strstr( $image_file,/ ) )
{
$sourcesizearr = getimagesize( $nowfile );
if ( $sourcesizearr[1] <= $sourcesizearr[0] )
{
if ( 80 < $sourcesizearr[0] )
{
$sourcewidth = 80;
}
else
{
$sourcewidth = $sourcesizearr[0];
}
$str .= <div class='sourcediv' title='.$image_file.'><div class='sourcepic'><img src='.$nowfile.' border='0' width='.$sourcewidth.'></div><div class='sourcememo'>.$sourcesizearr[0].x.$sourcesizearr[1].</div></div>;
}
else
{
if ( 80 < $sourcesizearr[1] )
{
$sourceheight = 80;
}
else
{
$sourceheight = $sourcesizearr[0];
}
$str .= <div class='sourcediv' title='.$image_file.'><div class='sourcepic'><img src='.$nowfile.' border='0' height='.$sourceheight.'></div><div class='sourcememo'>.$sourcesizearr[0].x.$sourcesizearr[1].</div></div>;
}
}
$i++;
}
closedir( $handle );
echo $str;
exit( );
break;
case tempdel :
needauth( 6 );
$tempid = $_POST['tempid'];
$msql->query( delete from {P}_base_plustemp where id='{$tempid}' );
echo OK;
exit( );
break;
case tempadd :
needauth( 6 );
$pluslable = $_POST['pluslable'];
$cname = $_POST['cname'];
$tempname = $_POST['tempname'];
$msql->query( insert into {P}_base_plustemp set pluslable='{$pluslable}',cname='{$cname}',tempname='{$tempname}' );
$tempid = $msql->instid( );
$str = <tr id='tr_.$tempid.'> <td height='22'>.$pluslable.</td><td>.$cname.</td><td>.$tempname.</td><td width='60'><img id='del_.$tempid.' src='images/delete.png' width='24' height='24' class='tempdel' /></td></tr>;
echo $str;
exit( );
break;
case plusinput :
tryfunc( );
needauth( 6 );
$file = $_FILES['datafile'];
$arr = explode( .,$file['name'] );
if ( $arr[1] != dat )
{
echo 1001;
exit( );
}
$f = $file['tmp_name'];
$fd = fopen( $f,r );
$str = fread( $fd,1000000 );
fclose( $fd );
$str = str_replace( ,,$str );
$arr = explode( ,,$str );
$i = 0;
for ( ; $i < sizeof( $arr ); $i++ )
{
if ( $arr[$i] != )
{
$arrs = explode( =,trim( $arr[$i] ) );
$data[$arrs[0]] = $arrs[1];
}
}
$nums = sizeof( $data );
if ( $nums < 68 || 100 < $nums )
{
echo 1002;
exit( );
}
if ( $data['pluslable'] == || $data['coltype'] == || $data['plusname'] == )
{
echo 1002;
exit( );
}
$msql->query( select id from {P}_base_plusdefault where pluslable='.$data['pluslable'].' );
if ( $msql->next_record( ) )
{
echo 1003;
exit( );
}
$scl = ;
do
{
$val = each &$data[1];
$key = each &$data[0];
if ( each( &$data ) )
{
$scl .= `.$key.`='.$val.',;
}
} while ( 1 );
$scl = substr( $scl,0 - 1 );
$msql->query( insert into {P}_base_plusdefault set {$scl} );
echo OK;
exit( );
break;
case borderadd :
tryfunc( );
needauth( 6 );
$tempid = $_POST['tempid'];
$bordertype = $_POST['bordertype'];
$tempname = $_POST['tempname'];
$msql->query( select id from {P}_base_border where tempid='{$tempid}' );
if ( $msql->next_record( ) )
{
echo 1001;
exit( );
}
$msql->query( insert into {P}_base_border set tempid='{$tempid}',bordertype='{$bordertype}',tempname='{$tempname}' );
echo OK;
exit( );
break;
case borderdel :
needauth( 6 );
$tempid = $_POST['tempid'];
$msql->query( delete from {P}_base_border where tempid='{$tempid}' );
echo OK;
exit( );
break;
case chkPwCode :
include( ROOTPATH.base/nusoap/nusoap.php );
$server = http://update.phpweb.net/remote/webservice/soapserver.php;
$customer = new soapclientx( $server );
$r_params = array( siteurl => $SiteUrl,domain => $_SERVER['HTTP_HOST'],user => $GLOBALS['CONF']['phpwebUser'],version => PHPWEB_VERSION );
$lic = $customer->call( chkPwCode,$r_params );
if ( $err = $customer->geterror( ) )
{
exit( );
}
if ( $lic[0] == 1 )
{
$msql->query( update {P}_base_config set value='{$lic['1']}' where variable='safecode' );
}
break;
case uninstall :
needauth( 9 );
$coltype = $_POST['coltype'];
if ( strlen( $coltype ) < 1 )
{
echo 0000;
exit( );
}
$msql->query( select moveable from {P}_base_coltype where coltype='{$coltype}' );
if ( $msql->next_record( ) )
{
$moveable = $msql->f( moveable );
}
else
{
echo 1000;
exit( );
}
if ( $moveable != 1 )
{
echo 1001;
exit( );
}
$sql_file = ROOTPATH.$coltype./install/uninstall.sql;
if ( file_exists( $sql_file ) )
{
$fd = fopen( $sql_file,r );
$sql = fread( $fd,filesize( $sql_file ) );
fclose( $fd );
}
else
{
echo 1002;
exit( );
}
if ( strstr( $sql,dev_ ) || !strstr( $sql,{P}_ ) || !strstr( $sql,; ) )
{
echo 1003;
exit( );
}
$sql = remove_remarks( trim( $sql ) );
$pieces = split_sql_file( $sql,; );
$pieces_count = count( $pieces );
$i = 0;
for ( ; $i < $pieces_count; $i++ )
{
$a_sql_query = trim( $pieces[$i] );
if ( 10 < strlen( $a_sql_query ) && substr( $a_sql_query,1 ) != # )
{
$msql->query( $a_sql_query );
}
}
$bak = time( );
if ( $coltype != member && $coltype != comment )
{
@rename( @ROOTPATH.@$coltype,@ROOTPATH.@$coltype._backup_.@$bak );
}
echo OK;
exit( );
break;
case getcollist :
needauth( 9 );
include( ROOTPATH.base/nusoap/nusoap.php );
$server = http://update.phpweb.net/remote/webservice/soapserver.php;
$customer = new soapclientx( $server );
$r_params = array( siteurl => $SiteUrl,domain => $_SERVER['HTTP_HOST'] );
$lic = $customer->call( getColList,$r_params );
if ( $err = $customer->geterror( ) )
{
$errinfo = $customer->response;
echo ERROR:.$err.<br>.$errinfo.</div>;
exit( );
}
if ( !$lic || $lic == )
{
echo 1000;
exit( );
}
$fsql->query( select coltype from {P}_base_coltype );
while ( $fsql->next_record( ) )
{
$colarr[] = $fsql->f( coltype );
}
$nums = sizeof( $lic );
$str = ;
$i = 0;
for ( ; $i < $nums; $i++ )
{
$colname = $lic[$i]['colname'];
$coltype = $lic[$i]['coltype'];
if ( in_array( $coltype,$colarr ) == false )
{
$str .= <option value='.$coltype.'>.$colname.</option>;
}
}
if ( 0 < $nums && $str == )
{
echo 1002;
exit( );
}
echo $str;
exit( );
break;
case colinstall :
needauth( 9 );
$coltype = $_POST['coltype'];
$user = $_POST['user'];
$passwd = $_POST['passwd'];
if ( strlen( $coltype ) < 1 )
{
echo 1000;
exit( );
}
include( ROOTPATH.base/nusoap/nusoap.php );
$server = http://update.phpweb.net/remote/webservice/soapserver.php;
$customer = new soapclientx( $server );
$r_params = array( siteurl => $SiteUrl,coltype => $coltype,user => $user,passwd => $passwd );
$lic = $customer->call( colInstCheck,$r_params );
if ( $err = $customer->geterror( ) )
{
$errinfo = $customer->response;
echo ERROR:.$err.<br>.$errinfo.</div>;

}
if ( !$lic || $lic == )
{
echo 1005;

}
if ( $lic == nouser )
{

}
if ( $lic == norights )
{
echo 1007;

}
$msql->query( select id from {P}_base_coltype where coltype='{$coltype}' );
if ( $msql->next_record( ) )
{
echo 1001;

}
$modversionfile = ROOTPATH.$coltype./version.txt;
if ( file_exists( $modversionfile ) )
{
$fn = fopen( $modversionfile,r );
$modversion = fread( $fn,filesize( $modversionfile ) );
fclose( $fn );
if ( PHPWEB_RELEASE < $modversion )
{
echo 1009;

}
}
$sql_file = ROOTPATH.$coltype./install/install.sql;
if ( file_exists( $sql_file ) )
{
$fd = fopen( $sql_file,filesize( $sql_file ) );
fclose( $fd );
}
else
{
echo 1002;

}
if ( strstr( $sql,; ) )
{
echo 1003;

}
$sql = remove_remarks( trim( $sql ) );
$pieces = split_sql_file( $sql,1 ) != # )
{
$msql->query( $a_sql_query );
}
}
echo OK;
exit( );
break;
case coluninstallcheck :
$user = $_POST['user'];
$passwd = $_POST['passwd'];
include( ROOTPATH.base/nusoap/nusoap.php );
$server = http://update.phpweb.net/remote/webservice/soapserver.php;
$customer = new soapclientx( $server );
$r_params = array( siteurl => $SiteUrl,passwd => $passwd );
$lic = $customer->call( colUnInstCheck,$r_params );
if ( $err = $customer->geterror( ) )
{
$errinfo = $customer->response;
echo ERROR:.$err.<br>.$errinfo.</div>;
exit( );
}
if ( !$lic || $lic == )
{
echo 1005;
exit( );
}
if ( $lic == nouser )
{
echo 1006;
exit( );
}
if ( $lic == canuninstall )
{
echo OK;
exit( );
}
else
{
echo ERROR;
exit( );
}
break;
case pchkModule :
include( ROOTPATH.base/nusoap/nusoap.php );
$server = http://update.phpweb.net/remote/webservice/soapserver.php;
$customer = new soapclientx( $server );
$r_params = array( siteurl => $SiteUrl,domain => $_SERVER['HTTP_HOST'] );
$lic = $customer->call( pchkModule,$r_params );
if ( $err = $customer->geterror( ) )
{
exit( );
}
if ( $lic == 1 )
{
@unlink( ../catch/temp );
}
else
{
$fp = @fopen( ../catch/temp,r );
$xnums = @fread( @$fp,10 );
@fclose( @$fp );
$str = $xnums + 1;
@mkdir( ../catch,511 );
$fd = @fopen( ../catch/temp,w );
@fwrite( @$fd,@$str );
@fclose( @$fd );
@chmod( ../catch/temp,438 );

 

  然后去有这个模块的站点拷贝这个模块的文件夹,我的是下载模块,就是那个down的,最后去后台安装这个模块,随便输个用户名和密码,稍后就会提示安装模块成功,在后台也可以看到这个模块。

  但是你点击进入的话会提示你没有权限操作、

  这是因为在原有模版站里没有对这个模块的授权,使用phpMyAdmin进入网站数据库,在_base_adminrights里面添加这个模块的相应权限,下载模块是160到165,如下图,这样,整个模块就安装完成了!

  接下来我会整理一些模块和相关的权限信息,希望能给大家以帮助!

  本文来源:http://blog.yourtion.com/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


文章浏览阅读483次。dedecms织梦频道模板中调用栏目分类并排序:{dede:channelartlist}栏目排序:{dede:global runphp='yes' name=itemindex}@me;{/dede:global}<a href=”{dede:field name='typeurl' /}”>点击进入{dede:field name='typename' /}列表>></a>{/dede:channelartlist}织梦channel标签.._织梦 调取排序
文章浏览阅读284次。我们在用织梦建站的过程中,难免会遇到各种问题,有时候由于主机或者服务器无法支持某些函数或者不够稳定等,需要更换空间或服务器。这个时候我们如何完整地把织梦网站数据转移到新的空间或者服务器上,这是织梦站长必须掌握的技能之一。当然,网站搬家来说,方法是很多的,但是万变不离其宗,说到底就是程序文件和数据文件的备份转移。织梦DedeCMS网站转移主机或者服务器时最常见的转移方式,来说明一下网站搬家的过程。首先是织梦DedeCMS网站程序的数据库备份,方法是进入织梦Dedecms的后台,系统–> 数据库备_dede后台转主机需要修改哪些哪些东西
文章浏览阅读152次。seo专题是seo优化必不可少的一环,对于网站优化的意义重大,因为一些用内容页做不上去的关键词都可以尝试用专题形式来做。相对于一般性的网页来说,专题页面具有内容丰富性、多样性、用户体验好的特征,百度官方也在最近说了专题优化的好处。但是,专题对seo是好的,但是对于做专题的人来说却并不好做,因为他非常的繁琐和耗费功夫。从原理来说,一般性的网页(栏目、内容页)都是通过统一的模板进行映射的网页,这些网页的构成都非常的简单,虽然有些可以利用内容模型和自定义列表进行参数提取,这样让内容非常的丰富,但是这个丰富_织梦专题
文章浏览阅读142次。在Dedecms中,在列表页调用文章摘要的方法主要有:1:[field:info /]2:[field:description /]3:[field:info function="cn_substr(@me,字符数)"/]4:[field:description function="cn_substr(@me,字符数)"/]第1、2种方法是直接调用文章摘要,在调用的字数问题上,当使用[field:info /]时,可以在{dede:arclist infolen=' ' }{/dede:arcli_dede 内容摘要 字数
文章浏览阅读234次。织梦DedeCMS文章内容发布时可以选择“头条”、“推荐”、“特荐”等文档属性,我们可以利用这些条件加一个判断的标签,然后给文章列表加一个推荐的印戳图标,这样大大提高了页面的友好程度。文字推荐方法:[field:flag runphp='yes'] if(stristr(@me,"c")) @me = "[推荐]";else @me = '';[/field:flag][field:flag runphp='yes'] if(stristr(@me,"a")) @me = "[特荐]";else _dede 列表页 调用推荐文章
文章浏览阅读701次。虽然织梦DedeCMS因为安全问题被人所诟病,但瑕不掩瑜,无论从用户群数量还是时间等各方面,织梦DedeCMS都是国内排名前几的CMS建站程序。如果你想学习CMS的二次开发,织梦DedeCMS是必须需要研究的。对织梦DedeCMS的二次开发来说,了解织梦的目录构成、文件、函数则是必备的功课。今天整理一篇关于Dedecms目录介绍的文章,对织梦DedeCMS的目录结构、核心文件、模板文件等做一个简单的介绍。为使版面美观,就借用下php程序的注释,//符合后面为该文件的作用。由于版本的原因,有一_织梦默认模板目录
文章浏览阅读375次。dede是目前cms中使用最广泛的,也是中小网站中seo优化最好的(默认模板而言),所以很多的企业都会选择采用dede作为做站的首选,因此学seo了解些织梦seo优化的技巧和方面是有必要的。焦大曾经做过多年的织梦seo优化,以个人经验所知,觉得以下几个方面的seo最为重要:第一,url设置与栏目分开。我们看到目前90%以上的dede建站者的文章url都是类似域名/栏目名/文章ID,或者域名/a/日期/栏目/文章ID,其中第一种在企业站最常见,第二种在新闻资讯网站中常见。个人觉得这么设置会出._dede seo
文章浏览阅读189次。dedecms的arclist循环中,判断如果是第一个li,则添加固定的css,否则不加写法如下: 1 2 3 4 {dede:arclist row=4 flag='p'} <li [field:global name=autoindex runphp="yes"](@me==1)? @me="class=on":@me="";[/field:global]>[field:global.autoindex/]<.._dedecms arclist
文章浏览阅读227次。字段要想在任何位置任何模版中调用,需要特殊设置。自定义字段自定义的织梦如何添加自定义字段的频道模型,这里以图片集频道举例注意:创建字段可以在列表的底层模板中获得”这个必须勾选在字段中添加(价格属性)在基本设置里》列表附加调用)二,调用自定义调用{dede:list pagesize='5' addfields='jiage' channelid='2'}<P>标题:[field:title/]</P><P>价格:[field:jiage/]&_织梦列表调用自定义字段
本教程操作系统:Windows10系统、DedeCMS 5.7.109版本、Dell G3电脑。 织梦CMS是一个使用PHP语言开发的网站建设管理系统,因此在安装过程中需要安装数据库以存储网站内容和数据。
在Dedecms织梦列表页中是肯定要使用pagelist标签的,但是有的时候也会因为一些css格式的问题会出现排列顺序的问题,所以也要知道怎么样修改pagelist标签?
今天分享织梦网站怎么搬家,个人感觉织梦的搬家比其他的程序的都简单。1、网站备份登录织梦后台,【系统】-【数据库备份/还原】-【提交】,织梦程序开始自动备份数据库,等待即可。
织梦(dede)程序不安全是公认的,同样是建站,使用织梦程序被黑的风险更大,所以,一些安全设置是非常有必要的。织梦网站安全设置的4个主要操作
使用xemu、爱站工具包、尖叫青蛙等制作网站地图,每次生成sitemap还需要再上传到服务器,还是比较麻烦的,不过有些网站程序可以通过插件完成网站地图的自动更新,比如wordpress。但是织梦一直都不行,今天就用插件+代
分享织梦自动生成网站sitemap,但是需要安装插件,今天分享,织梦如何不使用插件,制作网站xml地图。
织梦自定义表单没有全选/取消全选功能,有时候想要全选全,需要一个一个选择比较麻烦,如果网站有大量的恶意留言,想要删除更麻烦。虽然可以使用sql命令删除恶意留言,但不是很灵活,今天就给织梦自定义表单添加全选
前几天百度公开课说了,api推送的优先级比较高,所以在没有快速收录的情况下,api提交必须要有,那么织梦要如何实现api主动推送呢?
dede定时主动推送,虽然也很方便,但只能固定时间推送,实时性不高,今天小编分享如何发布文章后实时api推送至百度?
dede当前位置标签代码方法一:{dede:fieldname='position'/}dede当前位置标签代码方法二:{dede:fieldname='position'runphp='yes'}$a=mb_strlen(@me);//计算字符串的长度@me=cn_substr(@me,$a-2,-1);//截取字符{/dede:field}(这是去掉“去掉>”得得方法)dede当前位置
织梦DEDECMS文章、栏目页获取当前页面顶级栏目名称的方法在用织梦做一些项目时,时常会碰到需要在当前页面调用顶级栏目名称的时候,织梦默认{dede:fieldname='typename'/}可以获取当前栏目页上一级栏目的名称,而不是当前栏目顶级栏目名称。下面拓展出一个方法来实现这个效果: 方