!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/home/jerryg/public_html/gallery2/modules/core/   drwxr-xr-x
Free 318.34 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     AdminPlugins.inc (7.18 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 * Gallery - a web based photo album viewer and editor
 * Copyright (C) 2000-2007 Bharat Mediratta
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */

GalleryCoreApi::requireOnce('modules/core/classes/GalleryRepository.class');

/**
 * This view will show administration options for available plugins
 * @package GalleryCore
 * @subpackage UserInterface
 * @author Bharat Mediratta <bharat@menalto.com>
 * @version $Revision: 15840 $
 */
class AdminPluginsView extends GalleryView {

    
/**
     * @see GalleryView::loadTemplate
     */
    
function loadTemplate(&$template, &$form) {
    global 
$gallery;

    
$ret GalleryCoreApi::assertUserIsSiteAdministrator();
    if (
$ret) {
        return array(
$retnull);
    }

    list (
$ret$core) = GalleryCoreApi::loadPlugin('module''core');
    if (
$ret) {
        return array(
$retnull);
    }
    
$themeGroup = array('group' => 'theme''groupLabel' => $core->translate('Themes'));

    if (
$form['formName'] != 'AdminPlugins') {
        
/* We have no form variables */
        
$form['formName'] = 'AdminPlugins';
    }

    foreach (array(
'module''theme') as $type) {
        
/* Load the module list */
        
list ($ret$pluginStatus[$type]) = GalleryCoreApi::fetchPluginStatus($typetrue);
        if (
$ret) {
        return array(
$retnull);
        }

        
/*
         * It's possible that we have some out-of-date plugins which haven't been deactivated
         * yet, since the deactivation only occurs when we try to load the module.  Load all
         * the active plugins now to force the version check, then reload the plugin status
         * when we're done to pick up any changes we trigger.
         */
        
foreach ($pluginStatus[$type] as $pluginId => $status) {
        if (!empty(
$status['active'])) {
            list (
$ret$module) = GalleryCoreApi::loadPlugin($type$pluginId);
            if (
$ret && !($ret->getErrorCode() & ERROR_PLUGIN_VERSION_MISMATCH)) {
            return array(
$retnull);
            }
        }
        }

        
/* Reload the plugin list, which may now be updated because of obsolete modules. */
        
list ($ret$pluginStatus[$type]) = GalleryCoreApi::fetchPluginStatus($typetrue);
        if (
$ret) {
        return array(
$retnull);
        }

        
$platform =& $gallery->getPlatform();
        
$g2Dir dirname(dirname(dirname(__FILE__))) . '/';
        
GalleryCoreApi::requireOnce('modules/core/PluginCallback.inc');
        foreach (
$pluginStatus[$type] as $pluginId => $status) {
        list (
$ret$plugin) = GalleryCoreApi::loadPlugin($type$pluginIdtrue);
        if (
$ret) {
            return array(
$retnull);
        }

        
$entry = array();
        
$entry['type'] = $type;
        
$entry['name'] = $plugin->translate($plugin->getName());
        
$entry['id'] = $plugin->getId();
        
$entry['description'] = $plugin->translate($plugin->getDescription());
        
$entry['version'] = $plugin->getVersion();
        
$entry['installedVersion'] = isset($status['version']) ? $status['version'] : null;
        
$entry['deletable'] =
            (
$platform->is_writeable("$g2Dir{$type}s/$pluginId") &&
             
$platform->is_writeable("$g2Dir{$type}s/$pluginId/$type.inc")) ? 0;

        list (
$ret$entry['state']) =
            
PluginCallbackView::getPluginState($type$plugin$status);
        if (
$ret) {
            return array(
$retnull);
        }

        
$screenshot "{$type}s/$pluginId/images/screenshot.png";
        if (
$platform->file_exists($g2Dir $screenshot)) {
            
$entry['screenshot'] = $screenshot;
        }

        if (
$entry['state'] == 'incompatible') {
            
$entry['api']['required']['plugin'] =
            
join('.'$type == 'theme' ?
                 
$plugin->getRequiredThemeApi() : $plugin->getRequiredModuleApi());
            
$entry['api']['provided']['plugin'] = join('.'GalleryModule::getApiVersion());
            
$entry['api']['required']['core'] = join('.'$plugin->getRequiredCoreApi());
            
$entry['api']['provided']['core'] = join('.'GalleryCoreApi::getApiVersion());
        }

        if (
$type == 'theme') {
            
$plugins[] = array_merge($entry$themeGroup);
        } else {
            
$plugins[] = array_merge($entry$plugin->getGroup());
        }
        }
    }
    
usort($plugins, array($this'pluginSort'));

    
$AdminPlugins = array();
    
$AdminPlugins['plugins'] = $plugins;
    list (
$ret$AdminPlugins['defaultTheme']) = GalleryCoreApi::getPluginParameter(
        
'module''core''default.theme');
    if (
$ret) {
        return array(
$retnull);
    }

    list (
$ret$repositories$repositoryInitErrorCount) =
        
GalleryRepository::getRepositories();
    if (
$ret) {
        return array(
$retnull);
    }

    
$AdminPlugins['showGetMorePluginsTip'] = 1;
    foreach (
$repositories as $source => $repository) {
        if (
$repository->localIndexExists()) {
        
$AdminPlugins['showGetMorePluginsTip'] = 0;
        break;
        }
    }

    
/* Only the codebase install can delete plugins, not multisites */
    
$AdminPlugins['canDeletePlugins'] =
        
GALLERY_CONFIG_DIR == dirname(dirname(dirname(__FILE__)));

    
$template->setVariable('AdminPlugins'$AdminPlugins);
    
$template->setVariable('controller''core.AdminPlugins');
    
$template->javascript('lib/yui/yahoo-min.js');
    
$template->javascript('lib/yui/dom-min.js');
    
$template->javascript('lib/yui/event-min.js');
    
$template->javascript('lib/yui/connection-min.js');
    
$template->javascript('lib/yui/animation-min.js');
    
$template->javascript('lib/yui/container-min.js');
    
$template->javascript('modules/core/templates/AdminPlugins.js');

    return array(
null, array('body' => 'modules/core/templates/AdminPlugins.tpl'));
    }

    function 
pluginSort($a$b) {
    static 
$groupOrder$stateOrder;
    if (!isset(
$stateOrder)) {
        
/*
         * unupgraded first, unconfigured second, incompatible third, inactive forth,
         * active fifth, uninstalled last
         */
        
$stateOrder = array('unupgraded' => 1'unconfigured' => 2'incompatible' => 3,
                
'inactive' => 4'active' => 5'uninstalled' => 6);
    }
    if (!isset(
$groupOrder)) {
        
/* gallery first, toolkits second, other last */
        
$groupOrder = array('gallery' => 1'toolkits' => 2'' => 3'other' => 4);
    }
    
$ag $a['group'];
    
$bg $b['group'];
    if (
$ag != $bg) {
        
$ao = isset($groupOrder[$ag]) ? $groupOrder[$ag] : $groupOrder[''];
        
$bo = isset($groupOrder[$bg]) ? $groupOrder[$bg] : $groupOrder[''];
        if (
$ao != $bo) {
        return (
$ao $bo) ? : -1;
        }
        
$ag = isset($a['groupLabel']) ? $a['groupLabel'] : $ag;
        
$bg = isset($b['groupLabel']) ? $b['groupLabel'] : $bg;
        return (
$ag $bg) ? : -1;
    } else {
        
$as $a['state'];
        
$bs $b['state'];
        
$aso $stateOrder[$as];
        
$bso $stateOrder[$bs];
        if(
$aso == $bso) {
            
$an strtolower($a['name']);
            
$bn strtolower($b['name']);
            if (
$an == $bn) {
                return 
0;
        } else {
            return (
$an $bn) ? : -1;
        }
        } else {
        return (
$aso $bso) ? : -1;
        }
    }
    }
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0325 ]--