⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 administrators.php

📁 集成了投票调查、流量统计、文件上传、留言版、论坛、软件下载、文章赏析、通讯录、网上购物 等板块 管理账户为peilei 密码为800901
💻 PHP
字号:
<?php
/*
 网络商店 - 吉鑫网络
 http://www.chinaifc.com

Copyright (c) 2001,2003 网络商店

    汗化版权所有吉鑫网络
*/

    include_once( DIR_WS_FUNCTIONS . 'database.php');
    include_once( DIR_WS_FUNCTIONS . 'languages.php');
		
    if ((!$language) || ($HTTP_GET_VARS['language'])) 
    {
        if ( !$language ) 
        {
          tep_session_register('language');
          tep_session_register('languages_id');
        }
    
        $language = tep_get_languages_directory($HTTP_GET_VARS['language']);
        if (!$language) $language = tep_get_languages_directory(DEFAULT_LANGUAGE);
    }
    
    // include the language translations
    include_once(DIR_WS_LANGUAGES . $language . '.php');
    
    $aADMBoxes = array ( 
				 'administrators.php'   => BOX_HEADING_ADMINISTRATORS, 
                         'catalog.php'          => BOX_HEADING_CATALOG, 
                         'configuration.php'    => BOX_HEADING_CONFIGURATION,
                         'customers.php'        => BOX_HEADING_CUSTOMERS, 
                         'localization.php'     => BOX_HEADING_LOCALIZATION,
				 'taxes.php'            => BOX_HEADING_LOCATION_AND_TAXES, 
                         'modules.php'          => BOX_HEADING_MODULES, 
                         'reports.php'          => BOX_HEADING_REPORTS,
                         'tools.php'            => BOX_HEADING_TOOLS,
                         );
                      
    // associate all the admin pages with the box class that includes it                      
    $aADMPages = array( 'configuration.php'            => 'configuration.php',
                        'modules.php'                  => 'modules.php',
				'categories.php'			 => 'catalog.php',
                        'products_attributes.php'      => 'catalog.php',
                        'manufacturers.php'            => 'catalog.php',
                        'reviews.php'                  => 'catalog.php',
                        'specials.php'                 => 'catalog.php', 
                        'products_expected.php'        => 'catalog.php',
                        'customers.php'                => 'customers.php',
                        'orders.php'                   => 'customers.php',
                        'countries.php'                => 'taxes.php',
                        'zones.php'                    => 'taxes.php',
                        'geo_zones.php'                => 'taxes.php',
                        'tax_classes.php'              => 'taxes.php',
                        'tax_rates.php'                => 'taxes.php',
                        'banner_manager.php'           => 'banners.php',
                        'currencies.php'               => 'localization.php',
                        'languages.php'                => 'localization.php',
                        'orders_status.php'            => 'localization.php',
                        'stats_products_viewed.php'    => 'reports.php',
                        'stats_products_purchased.php' => 'reports.php',
                        'stats_customers.php'          => 'reports.php',
                        'file_manager.php'             => 'tools.php',
                        'backup.php'                   => 'tools.php',
				'banner_manager.php'		 => 'tools.php',
				'define_languages.php'		 => 'tools.php',
                        'whos_online.php'              => 'tools.php',
                        'cache.php'                    => 'tools.php',
                        'mail.php'                     => 'tools.php',
				'newsletters.php'			 => 'tools.php',
				'server_info.php'			 => 'tools.php',
                        'administrators.php'           => 'administrators.php',
				'update_admin.php'		 => 'administrators.php',
				'index.php'				 => 'support',
				'logoff.php'			 => 'support',
				'login.php'				 => 'support',												
                     );                    
    
    // check to see if php implemented session management functions - if not, include php3/php4 compatible session class
    if (!function_exists('session_start')) 
    {
        include_once(DIR_WS_CLASSES . 'sessions.php');
    }

    function RequireLoginValidForPage($aRetPage)
    {
    global $PHP_SELF, $in_login, $login_id, $aADMPages;
     
	  $aThisPage = basename($PHP_SELF);
        $aRetPage  = str_replace( $aThisPage, 'index.php', $aRetPage );
				    
        if (empty($in_login ))
        {
            if (!tep_session_is_registered('login_id')) 
            {
            header('Location: login.php?in_login=yes&retpage=' . urlencode($aRetPage) . "\n");

            } else {
              $aSQL = "select allowed_pages from administrators where (admin_id = '$login_id')";
              $aRes = tep_db_query($aSQL);
                if ($aVal = tep_db_fetch_array($aRes))
                {
                  $aPages = $aVal['allowed_pages'];
                  if (trim($aPages != '*'))
                  {
                    $aAllowedPages   = explode('|', $aPages);
                    $aCurrentPageBox = $aADMPages[$aThisPage];
                      if ($aCurrentPageBox != '*')
                        {
                          if (!in_array( $aCurrentPageBox, $aAllowedPages))
                          {
				 echo '<center><p><font size="+2">You are not authorized to view this page, please go back.';
				 exit();
                          }
                       }
                   }
               } 
           }
       }
   }
    
    function CanShowBox($aBoxName)
    {
        global $login_id;
        $aSQL = "select allowed_pages from administrators where (admin_id = '$login_id')";
        $aRes = tep_db_query($aSQL);
        if ( $aVal = tep_db_fetch_array( $aRes ) )
        {
            $aPages = $aVal['allowed_pages'];
            if (trim( $aPages != '*' ))
            {
                $aAllowedPages   = explode('|', $aPages);
                $aCurrentPageBox = $aBoxName;
                if (in_array($aCurrentPageBox, $aAllowedPages))
                {
                    return true;
                }
            } else {
                return true;
            }
        }
        return false;
    }
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -