macrossz 发表于 2008-7-24 11:21:41

dezend出来的admincp.php的代码,谁能用来做SS6UC的发布脚本


<?php
/*********************/
/*                   */
/*DeZend For PHP5*/
/*BY WwW.DeZend.CC */
/*   With Bendy */
/*                   */
/*********************/
include_once( "./include/main.inc.php" );
@define( "IN_SUPESITE_ADMINCP", TRUE );
define( "IMG_DIR", S_URL."/admin/images" );
define( "CPURL", S_URL."/admincp.php" );
$action = empty( $_GET['action'] ) ? "" : $_GET['action'];
getcookie( 1 );
if ( empty( $_SGLOBAL['supe_uid'] ) || empty( $_SGLOBAL['member']['password'] ) )
{
setcookie( "_refer", rawurlencode( S_URL_ALL."/admincp.php?".$_SERVER['QUERY_STRING'] ) );
messagebox( "error", "admincp_login", geturl( "action/login" ) );
}
if ( empty( $_SGLOBAL['group'] ) )
{
messagebox( "error", "admincp_no_popedom" );
}
$checkperm = $userflag = 0;
if ( $_SGLOBAL['group']['groupid'] == "1" )
{
$checkperm = 1;
$userflag = 9;
}
else
{
$mid = intval( postget( "mid" ) );
if ( empty( $mid ) && !empty( $_COOKIE['supe_admin_jumpurl'] ) )
{
$sarr = explode( "&", $_COOKIE['supe_admin_jumpurl'] );
if ( !empty( $sarr ) && is_array( $sarr ) )
{
   foreach ( $sarr as $value )
   {
    $carr = explode( "=", $value );
    if ( $carr == "mid" )
    {
   $mid = intval( $carr );
   break;
    }
    else if ( $carr == "action" )
    {
   $action = trim( $carr );
    }
   }
}
}
if ( ( $action == "modelmanages" || $action == "modelcategories" || $action == "modelfolders" ) && !empty( $mid ) && 0 < $mid )
{
$query = $_SGLOBAL['db']->query( "SELECT p.* FROM ".tname( "modelperm" )." p WHERE p.uid='".$_SGLOBAL['supe_uid']."' AND p.mid='".$mid."'" );
$item = $_SGLOBAL['db']->fetch_array( $query );
if ( empty( $item ) )
{
   messagebox( "error", "admincp_no_popedom" );
}
$checkperm = 2;
$userflag = $item['flag'];
}
if ( !empty( $_SGLOBAL['group']['allownews'] ) || !empty( $_SGLOBAL['group']['allowcheckitem'] ) )
{
$checkperm = 2;
}
}
if ( empty( $checkperm ) )
{
messagebox( "error", "admincp_no_popedom" );
}
$supe_adminpass = md5( $_SGLOBAL['authkey'].$_SGLOBAL['member']['password'] );
$cookie_adminpass = empty( $_COOKIE[$cookiepre."supe_adminpass"] ) ? "" : $_COOKIE[$cookiepre."supe_adminpass"];
if ( $cookie_adminpass != $supe_adminpass )
{
if ( submitcheck( "dologin", 1 ) )
{
if ( !empty( $_COOKIE['supe_admin_jumpurl'] ) )
{
   $tourl = "admincp.php?".$_COOKIE['supe_admin_jumpurl'];
}
else
{
   $tourl = "admincp.php";
}
$password = md5( $_POST['admin_password'] );
if ( !empty( $_SCONFIG['ucmode'] ) )
{
   include_once( S_ROOT."./uc_client/client.php" );
   $ucresult = uc_user_login( $_SGLOBAL['member']['username'], $_POST['admin_password'], $loginfield == "uid" );
   list( $members['uid'], $members['username'], $members['username'], $members['username'] ) = members   if ( 0 < $members['uid'] )
   {
    $query = $_SGLOBAL['db']->query( "SELECT * FROM ".tname( "members" )." WHERE uid='".$members['uid']."'" );
    $member = $_SGLOBAL['db']->fetch_array( $query );
    $password = $member['password'];
   }
   else
   {
    messagebox( "error", "background_logging_in_failure", $tourl );
   }
}
if ( $password == $_SGLOBAL['member']['password'] )
{
   ssetcookie( "supe_adminpass", $supe_adminpass );
   setcookie( "supe_admin_jumpurl", "" );
   messagebox( "ok", "background_logging_in_success", $tourl );
}
else
{
   messagebox( "error", "background_logging_in_failure", $tourl );
}
}
setcookie( "supe_admin_jumpurl", $_SERVER['QUERY_STRING'] );
include_once( S_ROOT."./admin/tpl/admincp_login.php" );
exit( );
}
if ( $checkperm == 2 )
{
$checkperm = 0;
if ( $action == "spacenews" )
{
if ( !empty( $_SGLOBAL['group']['allownews'] ) )
{
   $checkperm = 2;
}
}
else if ( $action == "check" )
{
if ( !empty( $_SGLOBAL['group']['allowcheckitem'] ) )
{
   $checkperm = 2;
}
}
else if ( !empty( $userflag ) )
{
$checkperm = 2;
}
}
if ( empty( $checkperm ) )
{
messagebox( "error", "admincp_no_popedom" );
}
include_once( S_ROOT."./language/admincp.lang.php" );
@$fp = @fopen( S_ROOT."./log/admincplog.php", "a" );
@flock( $fp, 2 );
@fwrite( $fp, "<?exit?>{$_SGLOBAL['timestamp']}\t{$_SGLOBAL['supe_username']}\t{$_SGLOBAL['onlineip']}\t".$_SERVER['QUERY_STRING']."\n" );
@fclose( $fp );
$_SGLOBAL['allblocktype'] = array( "category", "spacenews", "poll", "spaceblog", "spaceimage", "spacefile", "spacegoods", "spacelink", "spacevideo", "group", "model", "tag", "spacetag", "spacecomment", "userspace", "announcement", "friendlink", "bbsthread", "bbsannouncement", "bbsforum", "bbslink", "bbsmember", "bbsattachment", "bbspost" );
include_once( S_ROOT."./include/common.inc.php" );
include_once( S_ROOT."./function/html.func.php" );
include_once( S_ROOT."./function/admin.func.php" );
include_once( S_ROOT."./function/cache.func.php" );
if ( !empty( $action ) )
{
$theurl = CPURL."?action=".$action;
switch ( $action )
{
case "settings" :
case "tags" :
case "blocks" :
case "categories" :
case "friendgroups" :
case "spacenews" :
case "styles" :
case "attachmenttypes" :
case "robots" :
case "robotmessages" :
case "polls" :
case "usergroups" :
case "prefields" :
case "crons" :
case "html" :
case "rightclick" :
case "spaces" :
case "templates" :
case "ad" :
case "effects" :
case "check" :
case "reports" :
case "announcements" :
case "tpl" :
case "css" :
case "usercss" :
case "styletpl" :
case "bbsforums" :
case "channel" :
case "userprofile" :
case "sitemap" :
case "groups" :
case "items" :
case "comments" :
case "guestbooks" :
case "attachments" :
case "domain" :
case "friendlinks" :
case "database" :
case "words" :
case "sharefields" :
case "customfields" :
case "cache" :
case "archiver" :
case "models" :
case "modelmanages" :
case "modelcategories" :
case "modelfolders" :
case "modelperm" :
case "topics" :
include_once( S_ROOT."./admin/tpl/admincp_header.php" );
include_once( "./admin/admin_".$action.".php" );
include_once( S_ROOT."./admin/tpl/admincp_footer.php" );
break;
case "toolbar" :
$dbversion = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT VERSION()" ), 0 );
$items = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "spaceitems" ) ), 0 );
$spaces = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "userspaces" ) ), 0 );
include_once( S_ROOT."./admin/admin_admincp_toolbar.php" );
break;
case "sidemenu" :
include_once( S_ROOT."./admin/admin_admincp_sidemenu.php" );
break;
case "topictpl" :
include_once( "./admin/admin_".$action.".php" );
break;
default :
$dbver = $_SCONFIG['dbver'];
if ( empty( $_GET['showinfo'] ) )
{
   $reportnum = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "reports" )." WHERE status='0'" ), 0 );
   if ( 0 < $reportnum )
   {
    $inforstr = "<tr><td>".$alang['site_statistics'].": <a href=\"".S_URL."/admincp.php?action=home&showinfo=1\">[".$alang['view_statistics']."]</a></td><td><a href=\"".S_URL."/admincp.php?action=reports\">".$alang['have_report']."</a>(".$reportnum.")</td></tr>";
   }
   else
   {
    $inforstr = "<tr><td>".$alang['site_statistics'].": <a href=\"".S_URL."/admincp.php?action=home&showinfo=1\">[".$alang['view_statistics']."]</a></td><td><a href=\"".S_URL."/admincp.php?action=reports\">".$alang['have_report']."</a></td></tr>";
   }
}
else
{
   $attachs = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT SUM(size) FROM ".tname( "attachments" ) ), 0 );
   $attachs = is_numeric( $attachs ) ? formatsize( $attachs ) : "-";
   $items = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "spaceitems" ) ), 0 );
   $spaces = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "userspaces" ) ), 0 );
   $groups = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "groups" ) ), 0 );
   $month = $_SGLOBAL['timestamp'] - 3600 * 24 * 30;
   $day = $_SGLOBAL['timestamp'] - 3600 * 24;
   $spaces_month = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "userspaces" )." WHERE dateline>{$month}" ), 0 );
   $spaces_day = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "userspaces" )." WHERE dateline>{$day}" ), 0 );
   $items_month = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "spaceitems" )." WHERE dateline>{$month}" ), 0 );
   $items_day = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT COUNT(*) FROM ".tname( "spaceitems" )." WHERE dateline>{$day}" ), 0 );
   $data_length = 0;
   $query = $_SGLOBAL['db']->query( "SHOW TABLE STATUS FROM `".$dbname."` LIKE '{$tablepre}%'" );
   while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
   {
    $data_length = $data_length + $value['Data_length'] + $value['Index_length'];
   }
   $data_length = formatsize( $data_length );
   $inforstr = "\t\t\t\t<tr>\r\n\t\t\t\t<td>{$alang['few_stations_open_space']}: {$spaces}</td>\r\n\t\t\t\t<td>{$alang['few_stations_open_group']}: {$groups}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>{$alang['information_released_within_a_few_points']}: {$items}</td>\r\n\t\t\t\t<td></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"2\"><hr size=\"1\" style=\"color:#FFFFFF\"></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>{$alang['several_additional_space_within_30_days']}: {$spaces_month}</td>\r\n\t\t\t\t<td>{$alang['within_24_hours_the_number_of_new_space']}: {$spaces_day}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>{$alang['add_info_within_30_days_of_a_few']}: {$items_month}</td>\r\n\t\t\t\t<td>{$alang['several_add_info_within_24_hours']}: {$items_day}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>{$alang['mysql_has_used_space']}: {$data_length}</td>\r\n\t\t\t\t<td>{$alang['upload_annex_size']}: {$attachs}</td>\r\n\t\t\t\t</tr>";
}
include_once( S_ROOT."./admin/tpl/admincp_header.php" );
include_once( S_ROOT."./admin/tpl/admincp_home.php" );
include_once( S_ROOT."./admin/tpl/admincp_footer.php" );
break;
}
}
else
{
include_once( S_ROOT."./admin/tpl/admincp_index.php" );
}
?>

macrossz 发表于 2008-7-24 19:24:47

看来只好靠自己了
页: [1]
查看完整版本: dezend出来的admincp.php的代码,谁能用来做SS6UC的发布脚本