!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/exif/   drwxr-xr-x
Free 318.35 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:     AdminExif.inc (12.05 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/exif/classes/ExifHelper.class');

/**
 * Settings for Exif
 * @package Exif
 * @subpackage UserInterface
 * @author Bharat Mediratta <bharat@menalto.com>
 * @author Georg Rehfeld <rehfeld@georg-rehfeld.de>
 * @author Jozsef R.Nagy <jozsef.rnagy@site.hu>
 * @version $Revision: 15513 $
 */
class AdminExifController extends GalleryController {

    
/**
     * @see GalleryController::handleRequest
     */
    
function handleRequest($form) {
    
$ret GalleryCoreApi::assertUserIsSiteAdministrator();
    if (
$ret) {
        return array(
$retnull);
    }

    
$error $status = array();
    if (isset(
$form['action']['availableToSummary'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_SUMMARY);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['available'])) {
        
$count 0;
        foreach (
$form['available'] as $property) {
            if (!
in_array($property$properties)) {
            
$properties[] = $property;
            
$count++;
            }
        }

        
$ret ExifHelper::setProperties(EXIF_SUMMARY$properties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['added']['summary'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][available][missing]';
        }

    } else if (isset(
$form['action']['availableToDetailed'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_DETAILED);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['available'])) {
        
$count 0;
        foreach (
$form['available'] as $property) {
            if (!
in_array($property$properties)) {
            
$properties[] = $property;
            
$count++;
            }
        }

        
$ret ExifHelper::setProperties(EXIF_DETAILED$properties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['added']['detailed'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][available][missing]';
        }
    } else if (isset(
$form['action']['removeFromSummary'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_SUMMARY);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['summary'])) {
        
$count 0;
        
$newProperties = array();
        for (
$i 0$i sizeof($properties); $i++) {
            if (!
in_array($properties[$i], $form['summary'])) {
            
$newProperties[] = $properties[$i];
            } else {
            
$count++;
            }
        }

        
$ret ExifHelper::setProperties(EXIF_SUMMARY$newProperties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['removed']['summary'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][summary][missing]';
        }

    } else if (isset(
$form['action']['resetSummary'])) {
        
$ret ExifHelper::setDefaultProperties(EXIF_SUMMARY);
        if (
$ret) {
        return array(
$retnull);
        }
        
$status['restored']['summary'] = 1;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
    } else if (isset(
$form['action']['removeFromDetailed'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_DETAILED);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['detailed'])) {
        
$count 0;
        
$newProperties = array();
        for (
$i 0$i sizeof($properties); $i++) {
            if (!
in_array($properties[$i], $form['detailed'])) {
            
$newProperties[] = $properties[$i];
            } else {
            
$count++;
            }
        }

        
$ret ExifHelper::setProperties(EXIF_DETAILED$newProperties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['removed']['detailed'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][detailed][missing]';
        }
    } else if (isset(
$form['action']['resetDetailed'])) {
        
$ret ExifHelper::setDefaultProperties(EXIF_DETAILED);
        if (
$ret) {
        return array(
$retnull);
        }
        
$status['restored']['detailed'] = 1;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
    } else if (isset(
$form['action']['moveUpSummary'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_SUMMARY);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['summary'])) {

        
/* Iterate through each property that we want to shift */
        
$count 0;
        foreach (
$form['summary'] as $propertyToShift) {
            
/* Find its spot in the array and swap it with the one ahead of it */
            
for ($i 0$i sizeof($properties); $i++) {
            if (
$properties[$i] == $propertyToShift) {
                if (
$i 0) {
                
$save $properties[$i 1];
                
$properties[$i 1] = $properties[$i];
                
$properties[$i] = $save;
                
$count++;
                }
            }
            }
        }

        
$ret ExifHelper::setProperties(EXIF_SUMMARY$properties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['movedUp']['summary'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][summary][missing]';
        }
    } else if (isset(
$form['action']['moveDownSummary'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_SUMMARY);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['summary'])) {

        
/* Iterate through each property that we want to shift */
        
$count 0;
        foreach (
$form['summary'] as $propertyToShift) {
            
/* Find its spot in the array and swap it with the one ahead of it */
            
for ($i sizeof($properties) - 1$i >= 0$i--) {
            if (
$properties[$i] == $propertyToShift) {
                if (
$i sizeof($properties) - 1) {
                
$save $properties[$i 1];
                
$properties[$i 1] = $properties[$i];
                
$properties[$i] = $save;
                
$count++;
                }
            }
            }
        }

        
$ret ExifHelper::setProperties(EXIF_SUMMARY$properties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['movedDown']['summary'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][summary][missing]';
        }
    } else if (isset(
$form['action']['moveUpDetailed'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_DETAILED);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['detailed'])) {

        
/* Iterate through each property that we want to shift */
        
$count 0;
        foreach (
$form['detailed'] as $propertyToShift) {
            
/* Find its spot in the array and swap it with the one ahead of it */
            
for ($i 0$i sizeof($properties); $i++) {
            if (
$properties[$i] == $propertyToShift) {
                if (
$i 0) {
                
$save $properties[$i 1];
                
$properties[$i 1] = $properties[$i];
                
$properties[$i] = $save;
                
$count++;
                }
            }
            }
        }

        
$ret ExifHelper::setProperties(EXIF_DETAILED$properties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['movedUp']['detailed'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][detailed][missing]';
        }
    } else if (isset(
$form['action']['moveDownDetailed'])) {
        list (
$ret$properties) = ExifHelper::getProperties(EXIF_DETAILED);
        if (
$ret) {
        return array(
$retnull);
        }

        if (isset(
$form['detailed'])) {

        
/* Iterate through each property that we want to shift */
        
$count 0;
        foreach (
$form['detailed'] as $propertyToShift) {
            
/* Find its spot in the array and swap it with the one ahead of it */
            
for ($i sizeof($properties) - 1$i >= 0$i--) {
            if (
$properties[$i] == $propertyToShift) {
                if (
$i sizeof($properties) - 1) {
                
$save $properties[$i 1];
                
$properties[$i 1] = $properties[$i];
                
$properties[$i] = $save;
                
$count++;
                }
            }
            }
        }

        
$ret ExifHelper::setProperties(EXIF_DETAILED$properties);
        if (
$ret) {
            return array(
$retnull);
        }

        
$status['movedDown']['detailed'] = $count;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
        } else {
        
$error[] = 'form[error][detailed][missing]';
        }
    } else if (isset(
$form['action']['save'])) {
        
$addOption = (isset($form['item']['summary']) ? EXIF_ITEM_SUMMARY 0)
        | (isset(
$form['item']['description']) ? EXIF_ITEM_DESCRIPTION 0)
        | (isset(
$form['item']['keywords']) ? IPTC_ITEM_KEYWORDS 0)
        | (isset(
$form['item']['objectName']) ? IPTC_ITEM_TITLE 0)
        | (isset(
$form['item']['exifrotate']) ? EXIF_ITEM_ROTATE 0)
        | (isset(
$form['item']['exifrotatepreserve']) ? EXIF_ITEM_ROTATE_PRESERVE 0);

        
$ret GalleryCoreApi::setPluginParameter('module''exif''addOption'$addOption);
        if (
$ret) {
        return array(
$retnull);
        }
        
$status['saved'] = 1;
        
$redirect['view'] = 'core.SiteAdmin';
        
$redirect['subView'] = 'exif.AdminExif';
    }

    if (!empty(
$redirect)) {
        
$results['redirect'] = $redirect;
    } else {
        
$results['delegate']['view'] = 'core.SiteAdmin';
        
$results['delegate']['subView'] = 'exif.AdminExif';
    }
    
$results['status'] = $status;
    
$results['error'] = $error;

    return array(
null$results);
    }
}

/**
 * Settings for Exif
 */
class AdminExifView extends GalleryView {

    
/**
     * @see GalleryView::loadTemplate
     */
    
function loadTemplate(&$template, &$form) {
    
$ret GalleryCoreApi::assertUserIsSiteAdministrator();
    if (
$ret) {
        return array(
$retnull);
    }

    
$mode GalleryUtilities::getRequestVariables('mode');

    list (
$ret$module) = GalleryCoreApi::loadPlugin('module''exif');
    if (
$ret) {
        return array(
$retnull);
    }

    if (
$form['formName'] != 'AdminExif') {
        
/* Load up our form data */
        
$form['formName'] = 'AdminExif';

        list (
$ret$addOption) = $module->getParameter('addOption');
        if (
$ret) {
        return array(
$retnull);
        }
        
$form['item'] = array('summary' => $addOption EXIF_ITEM_SUMMARY,
                  
'description' => $addOption EXIF_ITEM_DESCRIPTION,
                  
'keywords' => $addOption IPTC_ITEM_KEYWORDS,
                  
'objectName' => $addOption IPTC_ITEM_TITLE,
                  
'exifrotate' => $addOption EXIF_ITEM_ROTATE,
                  
'exifrotatepreserve' => $addOption EXIF_ITEM_ROTATE_PRESERVE);
    }

    
$exifKeys ExifHelper::getExifKeys();
    
$visibleKeys = array();

    
/* Prepare the summary list */
    
$summaryList = array();
    list (
$ret$tmp) = ExifHelper::getProperties(EXIF_SUMMARY);
    if (
$ret) {
        return array(
$retnull);
    }
    foreach (
$tmp as $property) {
        
$summaryList[$property] = $module->translate($exifKeys[$property][0]);
    }

    
/* Prepare the detailed list */
    
$detailedList = array();
    list (
$ret$tmp) = ExifHelper::getProperties(EXIF_DETAILED);
    if (
$ret) {
        return array(
$retnull);
    }
    foreach (
$tmp as $property) {
        
$detailedList[$property] = $module->translate($exifKeys[$property][0]);
    }

    
/* Anything not summary and detailed is available */
    
$availableList = array();
    foreach (
$exifKeys as $key => $data) {
        if (isset(
$summaryList[$key]) && isset($detailedList[$key])) {
        continue;
        }

        
$availableList[$key] = $module->translate($data[0]);
    }

    
asort($availableList);

    
$AdminExif = array();
    
$AdminExif['availableList'] = $availableList;
    
$AdminExif['summaryList'] = $summaryList;
    
$AdminExif['detailedList'] = $detailedList;

    
$template->setVariable('AdminExif'$AdminExif);
    
$template->setVariable('controller''exif.AdminExif');
    return array(
null, array('body' => 'modules/exif/templates/AdminExif.tpl'));
    }
}
?>

:: 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.0067 ]--