|
为什么我根本找不到“$ForceEnter”这个关键字啊?
<?php error_reporting(0); if($_GET[groupid]){ //this for DISCUZ $groupid_dz=$_GET[groupid]; } if($_POST[groupid]){ //this for DISCUZ $groupid_dz=$_POST[groupid]; } require('../require/global.php'); if( file_exists('./group/forbid.php') ){ require_once('./group/forbid.php'); } $mmcbbsdb=$mmcbbsgroupname='';
$SCRIPT_FILENAME = str_replace('\\\\', '/', ($HTTP_SERVER_VARS['PATH_TRANSLATED'] ? $HTTP_SERVER_VARS['PATH_TRANSLATED'] : $HTTP_SERVER_VARS['SCRIPT_FILENAME']));
if($loginname&&$loginpwd){ $mmcbbsname=$loginname; $mmcbbspwd=md5($loginpwd); $mmcbbspwd=mymd5($mmcbbspwd); }else{ $mmcbbsname=$_COOKIE['mmcbbsname']; $mmcbbspwd=$_COOKIE['mmcbbspwd']; }
//$mmcbbsdb=$db->get_one("select {$P_M[m][groupid]} AS groupid,{$P_M[m][uid]} AS uid,{$P_M[m][memberid]} AS memberid,{$P_M[m][username]} AS username from {$P_M[m][table]} where {$P_M[m][username]}='$mmcbbsname' AND {$P_M[m][password]}='$mmcbbspwd' "); $mmcbbsdb=$db->get_one("select {$P_M[m][groupid]} AS groupid,{$P_M[m][uid]} AS uid,{$P_M[m][memberid]} AS memberid,{$P_M[m][username]} AS username,{$P_M[m][password]} AS password from {$P_M[m][table]} where {$P_M[m][username]}='$mmcbbsname' "); if(mymd5($mmcbbsdb[password])!=$mmcbbspwd||!$mmcbbspwd){ $mmcbbsdb=''; }
if( ereg("phpwind",$P_M[bbstype])&&$mmcbbsdb['groupid']<0 && is_passport ){ $mmcbbsdb['groupid']=$mmcbbsdb['memberid']; }
if( $mmcbbsdb['groupid'] && file_exists("./group/$mmcbbsdb[groupid].php") ){ $mmcbbsgroupname=$mmcbbsdb['groupid']; $lfjid=$mmcbbsdb[username]; $lfjuid=$mmcbbsdb[uid]; $lfjdb=$mmcbbsdb; $_mmcbbspwd=mymd5($mmcbbsdb[password]); if(!$_COOKIE[passport]){ setcookie('passport',"$lfjuid\t$lfjid\t$_mmcbbspwd",$timestamp+3600,'/'); } }
if( file_exists("../php168/admin_1.php")&&$mmcbbsdb['username'] ){ include_once("../php168/admin_1.php"); if($admin_name==$mmcbbsdb['username']&&$admin_name){ $mmcbbsgroupname="admin_1"; if( $mmcbbsdb[groupid]!=3 ){//自动创建管理员 $db->query("update {$P_M[m][table]} set {$P_M[m][groupid]}=3 where {$P_M[m][username]}='$mmcbbsname' "); } } }
//$mmcbbsgroupname="admin_1"; /*如果忘记密码进不了后台,请把这一行开头的两个斜杆删除*/
if(!$mmcbbsgroupname){ logoin(); } /** *安全验证 **/ $adminlfj=$_COOKIE['adminlfj']; if($oldpwd){ $adminlfj=md5($oldpwd); } if( file_exists("md5_pwd_".$mmcbbsname.".php") ){ include ("md5_pwd_".$mmcbbsname.".php") ; if($adminlfj!=$my_md5&&$my_md5){ $md5msg=2; logoin(); } }
if( $mmcbbsgroupname&&file_exists('./group/'.$mmcbbsgroupname.'.php') ){ include_once( './group/'.$mmcbbsgroupname.'.php'); }else{ showerr("你虽然已登录后台成功,但是没分配任何后台权限,请管理员为你这个用户组分配一个后台权限吧"); }
/** *后台跳转函数 **/ function reto($msg,$url='',$reto='1'){ global $FROMURL; if(!$url)$url=$FROMURL; $reto && $reto="<META HTTP-EQUIV=REFRESH CONTENT='$reto;URL=$url'>"; return "<table width='158' cellspacing='1' cellpadding='3' bgcolor='#0650D2'><tr bgcolor='#f9f9f9'阿洁love宝宝> <td> <div align='center'><font size='+6'><b><font size='5'><a href='$url'>$msg</a></font></b></font></div> </td> </tr></table>$reto"; }
/** *会员用户组选择列表 **/ function select_mgroup($names='grouptitle',$ck='',$url=''){ global $db,$P_M; if($url) $reto=" onchange=\"window.location=('{$url}&{$names}='+this.options[this.selectedIndex].value+'')\""; $show="<select name='$names' $reto><option value='' selected>现有用户组</option>"; $query=$db->query("select * from {$P_M[g][table]} where {$P_M[g][gptype]}!='0' AND {$P_M[g][gptype]}!='member' AND {$P_M[g][gptype]}!='' "); while($array=$db->fetch_array($query)){ $list=$array[$names]; $ck==$list?$ckk='selected':$ckk=''; $show.=" <option value='$list' $ckk>{$array[$P_M[g][grouptitle]]}</option>"; } $query=$db->query("select * from {$P_M[g][table]} where {$P_M[g][gptype]}='0' OR {$P_M[g][gptype]}='member' OR {$P_M[g][gptype]}='' order by {$P_M[g][grouppost]}"); $show.=" <option value=''>--+以上是系统组,以下是会员组+--</option>"; while($array=$db->fetch_array($query)){ $list=$array[$names]; if( ereg("phpwind",$P_M[bbstype])&&$list<0 ){ $list=$array[memberid]; } $ck==$list?$ckk='selected':$ckk=''; $show.=" <option value='$list' $ckk>{$array[$P_M[g][grouptitle]]}</option>"; } return $show." </select>"; }
/** *风格选择列表 **/ function select_style($name='stylefile',$ck='',$url='',$select=''){ if($url) $reto=" onchange=\"window.location=('{$url}&{$name}='+this.options[this.selectedIndex].value+'')\""; $show="<select name='$name' $reto><option value=''>选择风格</option>"; $filedir=opendir("../php168/style/"); while($file=readdir($filedir)){ if($file!="."&&$file!=".."){ include "../php168/style/$file"; $ck==$stylefile?$ckk='selected':$ckk=''; if($select){ if($style_web!=$select){ continue; } } $show.="<option value='$stylefile' $ckk style='color=blue'>$stylename</option>"; } } return $show." </select>"; }
/** *友情链接选择列表 **/ function select_link($cname='name',$ck='',$url=''){ global $db; if($url) $reto=" onchange=\"window.location=('{$url}&{$cname}='+this.options[this.selectedIndex].value+'')\""; $show="<select name='$cname' $reto><option value='' selected>现有链接</option>"; $query=$db->query("select * from lfj_link"); while(@extract($db->fetch_array($query))){ $list=$$cname; $ck==$list?$ckk='selected':$ckk=''; $show.=" <option value='$list' $ckk>$name</option>"; } return $show." </select>"; }
/** *后台操作菜单 **/ function leftlink2($filedb,$sort){ global $mmcbbsgroupname,$jj; include ('./group/'.$mmcbbsgroupname.'.php');
$j=1; $m=5; foreach($filedb AS $word=>$array){ $j++; $m++; $show.="<tr bgcolor='#0650D2'>"; if($m%4>1){ $style=" bgcolor='#D4ECF5' onMouseOver=this.style.backgroundColor='#C1E3F0' onMouseOut=this.style.backgroundColor='#D4ECF5'"; if($m==6){ $m=7; } }else{ $style="bgcolor='#D4ECF5' onMouseOver=this.style.backgroundColor='#C1E3F0' onMouseOut=this.style.backgroundColor='#D4ECF5'"; } if($$array['power']){ $show.="<td width='50%' style='padding-left:10px' $style><div align='left'><A HREF=$array[link] target=main>$word</A></div></td>"; $power++; }else{ $show.="<td width='50%' $style></td>"; } $show.="</tr>"; } if($j%2==0){ $show.="<td width='50%' bgcolor='#D4ECF5' onMouseOver=this.style.backgroundColor='#C1E3F0' onMouseOut=this.style.backgroundColor='#D4ECF5'><div align='center'> </div></td></tr>"; } $show="<table width='158' cellspacing='0' cellpadding='2' style='padding-left:2px;padding-right:2px' bgcolor='#0650D2'><tr bgcolor='#0650D2' valign='middle'> <td colspan=1 height='24' background='./images/table.gif' bgcolor='#0650D2'><font color='#0F42A6'><b><a href='javascript:' onclick=showson(s$jj)><font color=#0F42A6>$sort</font></a></b></font></td></tr><tr><td><table width='100%' cellspacing='1' cellpadding='3' style='display:none' id=s$jj>$show</table></td></tr></table><table width='100%' cellspacing='0' cellpadding='0'><tr><td height=1 bgcolor='#0650D2'></tr></table>"; if($power){ return $show; } } function showmenu($menudb){ global $jj; foreach($menudb AS $key1=>$value2){ $jj++; $show.=leftlink2($value2,$key1); } return $show; }
/** *后台用户组选择菜单 **/ function groupselect($name,$ck=''){ $dir=opendir("./group"); $show="<select name='$name'> <option value=''>请选择用户组</option>"; while($file=readdir($dir)){ if($file!="."&&$file!=".."){ $detail=explode(".",$file); $groupname=$detail[0]; if($ck==$groupname){ $show.="<option value='$groupname' selected>$groupname</option>"; }else{ $show.="<option value='$groupname' >$groupname</option>"; } } } $show.=" </select>"; return $show; }
/** *纠正栏目错误 **/ function sort_error_in($db,$table,$id){ $query=$db->query("select * from $table where fid='$id'"); while( @extract($db->fetch_array($query)) ){ $show.="{$id}[MMCBBS]"; $show.=sort_error_in($db,$table,$id); } return $show; }
function sort_error($table,$name='errid'){ global $db; $show="<select name='$name'><option value=''>出错的栏目</option>"; $array=explode( "[MMCBBS]",sort_error_in($db,$table,0) ); $query=$db->query("select * from $table"); while( @extract($db->fetch_array($query)) ){ if(!in_array($id,$array)){ $show.="<option value='$id' $ckk>$name</option>"; } } $show.=" </select>"; return $show; }
/** *更新栏目级别 **/ function mod_sort_class($db,$table,$class,$id){ $db->query("update $table set class='$class'+1 where fid='$id' "); $query=$db->query("select * from $table where fid='$id'"); while( @extract($db->fetch_array($query)) ){ mod_sort_class($db,$table,$class,$id); } }
/** *更新栏目有几个子栏目 **/ function mod_sort_sons($db,$table,$id){ $query=$db->query("select * from $table where fid='$id'"); $sons=$db->num_rows($query); $db->query("update $table set sons='$sons' where id='$id' "); while( @extract($db->fetch_array($query)) ){ mod_sort_sons($db,$table,$id); } }
/** *读取模板内容 **/ function readhtml($dir=''){ global $lfj,$job,$filedb,$hack,$web,$include; if(!$dir){ $dir="template/$lfj/{$job}.htm"; } if($hack){ $job || $job='mod'; $dir="../hack/$hack/admin/template/{$job}.htm"; }elseif($web){ $job || $job='mod'; $dir="../$web/admin/template/$include/{$job}.htm"; $show.=read_file("../$web/admin/template/menu.htm"); } $show.=read_file("$dir"); $show=str_replace('\"','"',$show); $show=str_replace('"','\"',$show); return $show; }
/** *数组写入缓存 **/ function write_for($post_array,$path,$db=''){ global $P_lfj,$filedb; foreach($post_array as $key=>$value){ $ckdb[$key]=1; if(is_array($value)){ $values3=''; foreach($value as $key2 => $values2){ if($values2){ $values3.="$key2,"; } } $value=$values3; } $getarray[$key]=$value; if($db){ $key="{$db}['{$key}']"; } $write.=" \$$key='$value';"; } //1 if( file_exists($path) ){ include ($path); if(is_array($$db)){ foreach($$db AS $key3=>$value3){ $$db[$key3]=addslashes($value3); //$key3=='guide_word'&&die("{$$db[$key3]}"); } } } foreach($P_lfj AS $key=>$value){ if(!$ckdb[$key]){ $values=$$key; $db && $values="{${$db}[$key]}"; $values=addslashes($values); //$values=str_replace('"',"",$values);$values=str_replace("'","",$values); $getarray[$key]=$values; if($db){ $key="{$db}['{$key}']"; } $write.=" \$$key='$values';"; } } //1 $write='<? '.$write.' ?>'; $writefile="<? "; if(!$db){ foreach($P_lfj as $key=>$value){ $writefile.="\$$key='$getarray[$key]'; "; } }elseif(is_array($P_lfj)){ foreach($P_lfj as $key=>$value){ $writefile.="\${$db}['{$key}']='$getarray[$key]'; "; } }
$writefile.='?>'; if($db=='webdb') $writefile=$write; write_file($path,$writefile); }
/** *服务器信息 **/ function webmsg($msg=''){ global $db,$siteurl,$onlineip,$SCRIPT_FILENAME,$WEBURL; @extract($db->get_one("SELECT VERSION() AS dbversion")); isset($_COOKIE) ? $ifcookie="SUCCESS" : $ifcookie="FAIL"; //Cookie 测试 $sysversion=PHP_VERSION; //PHP版本 $sysos=$_SERVER['SERVER_SOFTWARE']; //服务器端信息 $dbversion; //MYSQL 版本 $max_upload= ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'Disabled'; //最大上传限制 $max_ex_time=ini_get('max_execution_time').' seconds'; //最大执行时间 $sys_mail= ini_get('sendmail_path') ? 'Unix Sendmail ( Path: '.ini_get('sendmail_path').')' :( ini_get('SMTP') ? 'SMTP ( Server: '.ini_get('SMTP').')': 'Disabled' ); //邮件支持模式 $systemtime=date("Y-m-j g:i A"); //服务器所在时间 $siteurl=$WEBURL; //当前所在页面 $onlineip=$onlineip; //当前IP $SCRIPT_FILENAME=$SCRIPT_FILENAME; //硬盘路径 $show="$msg"; $show.=read_file("template/copyright.htm"); $show=str_replace('"','',$show); eval("\$show=\"$show\";"); return $show; }
function logoin(){ global $loginname,$loginpwd,$md5msg,$timestamp,$onlineip,$filedb,$iframe,$webdb; if($loginname&&$loginpwd){ $show="密码错误"; $file="$loginname|$loginpwd|$timestamp|$onlineip|0\n"; if(@filesize("./bak/login_record.php")<10||!file_exists("./bak/login_record.php")){ $file="<? exit;\n".$file; } write_file("./bak/login_record.php",$file,'a'); } else{ $show="网站管理登录"; } $md5msg && $show="验证码错误,如果你忘记了验证码,可在后台把 admin/md5_pwd_{$loginname}.php 删除即可"; include './template/login.htm'; exit; }
function check_table_field($table,$array){ global $db; foreach($array AS $key=>$value){ if( !table_field($table,$key) ){ $SQL.="ALTER TABLE `$table` ADD `$key` VARCHAR( 254 ) NOT NULL ;"; } } if($SQL){ $db->query($SQL); } } ?>
|