package cPanel::Gallery::Coppermine;

# cpanel - cPanel/Gallery/Coppermine.pm           Copyright(c) 2014 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use strict;
use warnings;

our $VERSION = 0.60;
my $pkg = __PACKAGE__;

our $meta_info = {
    setphpsuexecvar        => 1,
    adminuser_pass         => 1,
    admin_user_pass_length => 5,
    admin_email            => 1,
    installdir             => 'gallery',
    description            => 'Coppermine is a multi-purpose fully-featured and integrated web picture gallery script written in PHP using GD or ImageMagick lib with a MySQL backend.',
    version                => '1.5.46',
    security               => 'Requires 777 directory permissions and world readable config files. Subject to all common PHP security problems.',
    security_rank          => 1,
    website                => 'http://coppermine-gallery.net/',
    documentation_url      => 'http://documentation.coppermine-gallery.net/en/',
    support_url            => 'http://coppermine-gallery.net/forum/',

    config_files => ['include/config.inc.php'],
    chmod        => {
        '0777' => [qw(include albums albums/userpics albums/edit)],
    },

    # with generic directories such as 'images', i feel the need to list all files
    '1.3.3' => {
        public_html_install_files => [
            qw(addfav.php addpic.php admin.php albmgr.php albums/edit/index.html albums/index.html albums/userpics/index.html anycontent.php banning.php bridge/invisionboard.inc.php bridge/phpbb.inc.php bridge/punbb.inc.php bridge/smf.inc.php bridge/vbulletin.inc.php bridge/vbulletin23.inc.php bridge/vbulletin3.0_readme.txt bridge/vbulletin30.inc.php bridge/vbulletin3gamma.inc.php bridge/woltlab21.inc.php bridge/yabbse.inc.php calendar.php catmgr.php CHANGELOG config.php COPYING db_ecard.php db_input.php delete.php displayecard.php displayimage.php docs/COPYING docs/credits.html docs/faq.htm docs/index.htm docs/pics/admin_menu.gif docs/pics/admin_mode_bar.GIF docs/pics/albmgr.gif docs/pics/album_menu.GIF docs/pics/category_cp.GIF docs/pics/config_language.gif docs/pics/cpg10.gif docs/pics/cpg110.gif docs/pics/cpg111.gif docs/pics/cpg120.gif docs/pics/cpg121.gif docs/pics/cpg13x.gif docs/pics/cpg1x.gif docs/pics/cpg_all.gif docs/pics/cpg_exclam.gif docs/pics/cpg_no.gif docs/pics/cpg_ok.gif docs/pics/cust_thmb.gif docs/pics/cust_thmb_3.gif docs/pics/cust_thmb_final.gif docs/pics/delete.gif docs/pics/down.gif docs/pics/edit.gif docs/pics/edit_album.GIF docs/pics/edit_picture.GIF docs/pics/edit_video.gif docs/pics/groupsscrsht2.jpg docs/pics/group_cp.GIF docs/pics/link.gif docs/pics/searchnew_1.gif docs/pics/searchnew_2.gif docs/pics/spacer.gif docs/pics/up.gif docs/pics/user_folder_link.gif docs/pics/util_re-size.gif docs/README.html docs/tester-README.txt docs/theme.htm docs/translation.htm ecard.php editOnePic.php editpics.php faq.php forgot_passwd.php getlang.php groupmgr.php image_processor.php images/arrow_upleft.gif images/ascending.gif images/coppermine_logo.png images/delete.gif images/descending.gif images/down.gif images/ecard.gif images/edit.gif images/flags/ae.gif images/flags/am.gif images/flags/ar.gif images/flags/at.gif images/flags/au.gif images/flags/az.gif images/flags/ba.gif images/flags/baq.gif images/flags/bd.gif images/flags/be.gif images/flags/bg.gif images/flags/bh.gif images/flags/blank.gif images/flags/bm.gif images/flags/br.gif images/flags/by.gif images/flags/ca.gif images/flags/ch.gif images/flags/cl.gif images/flags/cn-xj.gif images/flags/cn.gif images/flags/cr.gif images/flags/ct.gif images/flags/cy.gif images/flags/cz.gif images/flags/de.gif images/flags/dk.gif images/flags/ee.gif images/flags/eg.gif images/flags/es.gif images/flags/fi.gif images/flags/fj.gif images/flags/fr.gif images/flags/gb-cm.gif images/flags/gb.gif images/flags/gr.gif images/flags/hk.gif images/flags/hr.gif images/flags/hu.gif images/flags/id.gif images/flags/ie.gif images/flags/il.gif images/flags/in.gif images/flags/ir.gif images/flags/is.gif images/flags/it.gif images/flags/jp.gif images/flags/kr.gif images/flags/ku.gif images/flags/kw.gif images/flags/lb.gif images/flags/lt.gif images/flags/lu.gif images/flags/lv.gif images/flags/md.gif images/flags/mn.gif images/flags/mx.gif images/flags/my.gif images/flags/nc.gif images/flags/nl.gif images/flags/no.gif images/flags/nz.gif images/flags/pe.gif images/flags/ph.gif images/flags/pk.gif images/flags/pl.gif images/flags/pr.gif images/flags/pt.gif images/flags/py.gif images/flags/qa.gif images/flags/reset.gif images/flags/ro.gif images/flags/ru.gif images/flags/sa.gif images/flags/se.gif images/flags/sg.gif images/flags/si.gif images/flags/sk.gif images/flags/sl.gif images/flags/sr.gif images/flags/sv.gif images/flags/th.gif images/flags/tr.gif images/flags/tt.gif images/flags/tw.gif images/flags/ua.gif images/flags/us.gif images/flags/ve.gif images/flags/vn.gif images/flags/white.gif images/flags/ye.gif images/flags/yu.gif images/flags/za.gif images/folder.gif images/gif48x48.gif images/green.gif images/info.gif images/logo.gif images/move_down.gif images/move_up.gif images/next.gif images/nopic.jpg images/prev.gif images/private.jpg images/rating0.gif images/rating1.gif images/rating2.gif images/rating3.gif images/rating4.gif images/rating5.gif images/read_error48x48.gif images/red.gif images/slideshow.gif images/smiles/icon_arrow.gif images/smiles/icon_biggrin.gif images/smiles/icon_confused.gif images/smiles/icon_cool.gif images/smiles/icon_cry.gif images/smiles/icon_eek.gif images/smiles/icon_evil.gif images/smiles/icon_exclaim.gif images/smiles/icon_frown.gif images/smiles/icon_idea.gif images/smiles/icon_lol.gif images/smiles/icon_mad.gif images/smiles/icon_mrgreen.gif images/smiles/icon_neutral.gif images/smiles/icon_question.gif images/smiles/icon_razz.gif images/smiles/icon_redface.gif images/smiles/icon_rolleyes.gif images/smiles/icon_sad.gif images/smiles/icon_smile.gif images/smiles/icon_surprised.gif images/smiles/icon_twisted.gif images/smiles/icon_wink.gif images/spacer.gif images/stamp.gif images/thumb_audio.jpg images/thumb_avi.jpg images/thumb_doc.jpg images/thumb_document.jpg images/thumb_gz.jpg images/thumb_htm.jpg images/thumb_html.jpg images/thumb_mid.jpg images/thumb_midi.jpg images/thumb_mov.jpg images/thumb_movie.jpg images/thumb_mp3.jpg images/thumb_mpeg.jpg images/thumb_mpg.jpg images/thumb_ogg.jpg images/thumb_pdf.jpg images/thumb_qtv.jpg images/thumb_ra.jpg images/thumb_ram.jpg images/thumb_rar.jpg images/thumb_rm.jpg images/thumb_rmj.jpg images/thumb_swf.jpg images/thumb_txt.jpg images/thumb_wav.jpg images/thumb_wma.jpg images/thumb_wmv.jpg images/thumb_xls.jpg images/thumb_zip.jpg images/unk48x48.gif images/up.gif images/up_dup.gif images/up_na.gif images/up_ok.gif images/up_pb.gif include/archive.php include/config.inc.php.sample include/crop.inc.php include/exifReader.inc.php include/exif_php.inc.php include/functions.inc.php include/imageObjectGD.class.php include/imageObjectIM.class.php include/index.html include/init.inc.php include/iptc.inc.php include/mailer.inc.php include/media.functions.inc.php include/picmgmt.inc.php include/search.inc.php include/select_lang.inc.php include/slideshow.inc.php include/smilies.inc.php include/sql_parse.php include/config.inc.php include/install.lock index.php installer.css install.php lang/arabic-utf-8.php lang/arabic.php lang/basque-utf-8.php lang/basque.php lang/brazilian_portuguese-utf-8.php lang/brazilian_portuguese.php lang/bulgarian-utf-8.php lang/bulgarian.php lang/catalan-utf-8.php lang/catalan.php lang/chinese_big5-utf-8.php lang/chinese_big5.php lang/chinese_gb-utf-8.php lang/chinese_gb.php lang/croatian-utf-8.php lang/croatian.php lang/czech-utf-8.php lang/czech.php lang/danish-utf-8.php lang/danish.php lang/dutch-utf-8.php lang/dutch.php lang/english-utf-8.php lang/english.php lang/estonian-utf-8.php lang/estonian.php lang/finnish-utf-8.php lang/finnish.php lang/french-utf-8.php lang/french.php lang/german-utf-8.php lang/german.php lang/german_sie-utf-8.php lang/german_sie.php lang/greek-utf-8.php lang/greek.php lang/hebrew-utf-8.php lang/hebrew.php lang/hungarian-utf-8.php lang/hungarian.php lang/indonesian-utf-8.php lang/indonesian.php lang/italian-utf-8.php lang/italian.php lang/italian2-utf-8.php lang/italian2.php lang/japanese-utf-8.php lang/japanese.php lang/kurdish-utf-8.php lang/kurdish.php lang/latvian-utf-8.php lang/latvian.php lang/malay-utf-8.php lang/malay.php lang/norwegian-utf-8.php lang/norwegian.php lang/persian-utf-8.php lang/polish-utf-8.php lang/polish.php lang/romanian-utf-8.php lang/romanian.php lang/romanian_no_diacritics-utf-8.php lang/romanian_no_diacritics.php lang/russian-utf-8.php lang/russian.php lang/slovak-utf-8.php lang/slovak.php lang/slovenian-utf-8.php lang/slovenian.php lang/spanish-utf-8.php lang/spanish.php lang/swedish-utf-8.php lang/swedish.php lang/thai-utf-8.php lang/thai.php lang/turkish-utf-8.php lang/turkish.php lang/uighur-utf-8.php lang/uighur.php lang/vietnamese-utf-8.php lang/vietnamese.php lang/welsh-utf-8.php lang/welsh.php login.php logout.php modifyalb.php phpinfo.php picEditor.php profile.php ratepic.php readme register.php reviewcom.php scripts.js searchnew.php search.php showthumb.php sql/basic.sql sql/schema.sql sql/update.sql themes/classic/images/button_bg.gif themes/classic/images/site_logo.png themes/classic/images/tile.gif themes/classic/style.css themes/classic/template.html themes/classic/theme.php themes/eyeball/images/bg.gif themes/eyeball/images/button_bg.gif themes/eyeball/images/hline_bg.gif themes/eyeball/images/hline_blue_ball.gif themes/eyeball/images/hline_left.gif themes/eyeball/images/hline_right.gif themes/eyeball/images/home.gif themes/eyeball/images/imv_ecards.gif themes/eyeball/images/imv_next.gif themes/eyeball/images/imv_picinfo.gif themes/eyeball/images/imv_prev.gif themes/eyeball/images/imv_slideshow.gif themes/eyeball/images/imv_up.gif themes/eyeball/images/rating0.gif themes/eyeball/images/rating1.gif themes/eyeball/images/rating2.gif themes/eyeball/images/rating3.gif themes/eyeball/images/rating4.gif themes/eyeball/images/rating5.gif themes/eyeball/images/spacer.gif themes/eyeball/images/tableh1a_bg_left.gif themes/eyeball/images/tableh1a_bg_middle.gif themes/eyeball/images/tableh1a_bg_right.gif themes/eyeball/images/tile.gif themes/eyeball/images/top_background_r1_c1.gif themes/eyeball/images/top_background_r1_c2.gif themes/eyeball/images/top_background_r1_c4.gif themes/eyeball/images/top_background_r1_c5.gif themes/eyeball/images/top_background_r1_c7.gif themes/eyeball/images/top_background_r2_c2.gif themes/eyeball/images/top_background_r2_c6.gif themes/eyeball/images/top_menu_button.gif themes/eyeball/images/top_menu_left.gif themes/eyeball/images/top_menu_right.gif themes/eyeball/images/top_menu_spacer.gif themes/eyeball/style.css themes/eyeball/template.html themes/eyeball/theme.php themes/fruity/images/blind.gif themes/fruity/images/button_bg.gif themes/fruity/images/delete.gif themes/fruity/images/ecard.gif themes/fruity/images/edit.gif themes/fruity/images/grey_horizontal.gif themes/fruity/images/grey_vertical.gif themes/fruity/images/info.gif themes/fruity/images/lb_bottom.gif themes/fruity/images/lb_left.gif themes/fruity/images/lb_right.gif themes/fruity/images/left_bottom.gif themes/fruity/images/left_bottom_left.gif themes/fruity/images/left_top.gif themes/fruity/images/main_under_left.gif themes/fruity/images/main_under_middle.gif themes/fruity/images/main_under_right.gif themes/fruity/images/middle_top2.gif themes/fruity/images/next.gif themes/fruity/images/prev.gif themes/fruity/images/rating0.gif themes/fruity/images/rating1.gif themes/fruity/images/rating2.gif themes/fruity/images/rating3.gif themes/fruity/images/rating4.gif themes/fruity/images/rating5.gif themes/fruity/images/site_logo.jpg themes/fruity/images/site_logo.png themes/fruity/images/slideshow.gif themes/fruity/images/thumbnail.gif themes/fruity/images/tile.gif themes/fruity/images/yellow_corner.gif themes/fruity/style.css themes/fruity/template.html themes/fruity/theme.php themes/hardwired/images/back.gif themes/hardwired/images/box_left_icon.gif themes/hardwired/images/buttoncenter.gif themes/hardwired/images/buttoncenter1.gif themes/hardwired/images/buttonleft.gif themes/hardwired/images/buttonleft1.gif themes/hardwired/images/buttonleftad.gif themes/hardwired/images/buttonleftmemb.gif themes/hardwired/images/buttonleftmy.gif themes/hardwired/images/buttonleftout.gif themes/hardwired/images/buttonleftup.gif themes/hardwired/images/buttonright.gif themes/hardwired/images/buttonright1.gif themes/hardwired/images/delete.gif themes/hardwired/images/ecard.gif themes/hardwired/images/edit.gif themes/hardwired/images/hardwired_bak.gif themes/hardwired/images/hw_01.gif themes/hardwired/images/hw_02.gif themes/hardwired/images/hw_03.gif themes/hardwired/images/info.gif themes/hardwired/images/nextimg.gif themes/hardwired/images/previmg.gif themes/hardwired/images/rating0.gif themes/hardwired/images/rating1.gif themes/hardwired/images/rating2.gif themes/hardwired/images/rating3.gif themes/hardwired/images/rating4.gif themes/hardwired/images/rating5.gif themes/hardwired/images/slideshow.gif themes/hardwired/images/tile.gif themes/hardwired/style.css themes/hardwired/template.html themes/hardwired/theme.php themes/igames/images/aladdin.gif themes/igames/images/box_left_icon.gif themes/igames/images/button_bg.gif themes/igames/images/left_menu_button.gif themes/igames/images/left_menu_button_over.gif themes/igames/images/menu_button.gif themes/igames/images/menu_button_over.gif themes/igames/images/menu_spacer.gif themes/igames/images/rating0.gif themes/igames/images/rating1.gif themes/igames/images/rating2.gif themes/igames/images/rating3.gif themes/igames/images/rating4.gif themes/igames/images/rating5.gif themes/igames/images/right_menu_button.gif themes/igames/images/right_menu_button_over.gif themes/igames/images/tableh1a_bg_left.gif themes/igames/images/tableh1a_bg_middle.gif themes/igames/images/tableh1a_bg_right.gif themes/igames/images/tableh1_bg.gif themes/igames/images/tableh2_bg.gif themes/igames/images/tile.gif themes/igames/images/top_panel_r1_c1.jpg themes/igames/images/top_panel_r1_c4.jpg themes/igames/images/top_panel_r1_c5.jpg themes/igames/images/top_panel_r2_c1.jpg themes/igames/images/top_panel_r2_c2.jpg themes/igames/images/top_panel_r2_c3.jpg themes/igames/images/white_to_black.jpg themes/igames/style.css themes/igames/template.html themes/igames/theme.php themes/mac_ox_x/images/button_bg.gif themes/mac_ox_x/images/home.gif themes/mac_ox_x/images/maintable_bg.gif themes/mac_ox_x/images/main_table_r1_c1.gif themes/mac_ox_x/images/main_table_r1_c1b.gif themes/mac_ox_x/images/main_table_r1_c3.gif themes/mac_ox_x/images/main_table_r1_c3b.gif themes/mac_ox_x/images/main_table_r2_c1.gif themes/mac_ox_x/images/main_table_r2_c2.gif themes/mac_ox_x/images/main_table_r2_c2b.gif themes/mac_ox_x/images/main_table_r2_c3.gif themes/mac_ox_x/images/menu_button_bg_left.gif themes/mac_ox_x/images/menu_button_bg_middle.gif themes/mac_ox_x/images/menu_button_bg_right.gif themes/mac_ox_x/images/menu_spacer.gif themes/mac_ox_x/images/rating0.gif themes/mac_ox_x/images/rating1.gif themes/mac_ox_x/images/rating2.gif themes/mac_ox_x/images/rating3.gif themes/mac_ox_x/images/rating4.gif themes/mac_ox_x/images/rating5.gif themes/mac_ox_x/images/tableh1a_bg_left.gif themes/mac_ox_x/images/tableh1a_bg_middle.gif themes/mac_ox_x/images/tableh1a_bg_right.gif themes/mac_ox_x/images/tableh1_bg.gif themes/mac_ox_x/images/tableh2_bg.gif themes/mac_ox_x/images/tile.gif themes/mac_ox_x/images/top_panel_r1_c1.gif themes/mac_ox_x/images/top_panel_r1_c1b.gif themes/mac_ox_x/images/top_panel_r1_c2.jpg themes/mac_ox_x/images/top_panel_r2_c1.gif themes/mac_ox_x/images/top_panel_r2_c1b.gif themes/mac_ox_x/style.css themes/mac_ox_x/template.html themes/mac_ox_x/theme.php themes/project_vii/images/box_left_icon.gif themes/project_vii/images/button_bg.gif themes/project_vii/images/left_menu_button.gif themes/project_vii/images/left_menu_button_over.gif themes/project_vii/images/menu_button.gif themes/project_vii/images/menu_button_over.gif themes/project_vii/images/menu_spacer.gif themes/project_vii/images/right_menu_button.gif themes/project_vii/images/right_menu_button_over.gif themes/project_vii/images/tile.gif themes/project_vii/images/top_panel_r1_c1.jpg themes/project_vii/images/top_panel_r1_c4.jpg themes/project_vii/images/top_panel_r1_c5.jpg themes/project_vii/images/top_panel_r2_c1.jpg themes/project_vii/images/top_panel_r2_c2.jpg themes/project_vii/images/top_panel_r2_c3.jpg themes/project_vii/style.css themes/project_vii/template.html themes/project_vii/theme.php themes/rainy_day/images/button1_r1_c1.gif themes/rainy_day/images/button1_r1_c2.gif themes/rainy_day/images/button1_r1_c3.gif themes/rainy_day/images/button_bg.gif themes/rainy_day/images/rating0.gif themes/rainy_day/images/rating1.gif themes/rainy_day/images/rating2.gif themes/rainy_day/images/rating3.gif themes/rainy_day/images/rating4.gif themes/rainy_day/images/rating5.gif themes/rainy_day/images/template_r1_c1.gif themes/rainy_day/images/template_r1_c5.gif themes/rainy_day/images/template_r1_c6.gif themes/rainy_day/images/template_r2_c1.gif themes/rainy_day/images/template_r2_c10.gif themes/rainy_day/images/template_r2_c2.gif themes/rainy_day/images/template_r3_c1.gif themes/rainy_day/images/template_r3_c7.gif themes/rainy_day/images/template_r3_c9.gif themes/rainy_day/images/template_r4_c1.gif themes/rainy_day/images/template_r4_c3.gif themes/rainy_day/images/template_r4_c9.gif themes/rainy_day/images/template_r5_c1.gif themes/rainy_day/images/template_r5_c3.gif themes/rainy_day/images/template_r5_c4.gif themes/rainy_day/images/template_r5_c8.gif themes/rainy_day/images/template_r5_c9.gif themes/rainy_day/images/template_r6_c1.gif themes/rainy_day/images/template_r6_c3.gif themes/rainy_day/images/template_r6_c9.gif themes/rainy_day/images/template_r7_c1.gif themes/rainy_day/images/template_r7_c3.gif themes/rainy_day/images/template_r7_c5.gif themes/rainy_day/images/template_r7_c6.gif themes/rainy_day/images/template_r7_c9.gif themes/rainy_day/images/tile.gif themes/rainy_day/style.css themes/rainy_day/template.html themes/rainy_day/theme.php themes/styleguide/domLib.js themes/styleguide/domTT.js themes/styleguide/images/albmgr_php.gif themes/styleguide/images/banning_php.gif themes/styleguide/images/catmgr_php.gif themes/styleguide/images/config_php.gif themes/styleguide/images/db_ecard_php.gif themes/styleguide/images/delete_php.gif themes/styleguide/images/displayimage_php.gif themes/styleguide/images/ecard_php.gif themes/styleguide/images/editpics_php.gif themes/styleguide/images/forgot_passwd_php.gif themes/styleguide/images/groupmgr_php.gif themes/styleguide/images/index_php.gif themes/styleguide/images/login_php.gif themes/styleguide/images/logout_php.gif themes/styleguide/images/modifyalb_php.gif themes/styleguide/images/profile_php.gif themes/styleguide/images/reviewcom_php.gif themes/styleguide/images/searchnew_php.gif themes/styleguide/images/search_php.gif themes/styleguide/images/spacer.gif themes/styleguide/images/thumbnails_php.gif themes/styleguide/images/tile.gif themes/styleguide/images/upload_php.gif themes/styleguide/images/usermgr_php.gif themes/styleguide/images/util_php.gif themes/styleguide/readme.htm themes/styleguide/template.html themes/styleguide/theme.php themes/water_drop/images/bg.gif themes/water_drop/images/box_left_icon.gif themes/water_drop/images/button_bg.gif themes/water_drop/images/orange_carret.gif themes/water_drop/images/tile.gif themes/water_drop/style.css themes/water_drop/template.html themes/water_drop/theme.php thumbnails.php update.php upgrade-1.0-to-1.2.php upload.php usermgr.php util.php versioncheck.php xp_publish.php zipdownload.php)
        ],

        public_html_install_dirs => [
            qw(albums albums/edit albums/userpics bridge docs docs/pics images images/flags images/smiles include lang sql themes themes/classic themes/classic/images themes/eyeball themes/eyeball/images themes/fruity themes/fruity/images themes/hardwired themes/hardwired/images themes/igames themes/igames/images themes/mac_ox_x themes/mac_ox_x/images themes/project_vii themes/project_vii/images themes/rainy_day themes/rainy_day/images themes/styleguide themes/styleguide/images themes/water_drop themes/water_drop/images)
        ],
        public_html_install_unknown => [qw(include albums)],
        public_html_install_note    => 'When uninstalling Coppermine, all files in the directories "include" and "albums" will be removed with Coppermine.',
    },

    # '1.4.8' => to many "common" files to support manually, once it auto creates this data it ~/public_html installs will be possibel again

    mysql               => ['cpm'],
    table_prefix        => 'cp',
    install_fields_hook => sub {
        my ( $input_hr, $error_ref, $cpo ) = @_;
        $cpo->{'input_1gallery_name'} =~ s{'}{\\'}g;
        $cpo->{'input_2gallery_description'} =~ s{'}{\\'}g;
    },
    install_fields => {
        '1gallery_name' => {
            label => 'Gallery name',
            value => 'My Photo Gallery',
            attr  => '',
            type  => 'text',
        },
        '2gallery_description' => {
            label => 'Gallery description',
            value => 'My Gallery Description',
            attr  => 'size="40"',
            type  => 'text',
        }
      }

};

if ( defined &Cpanel::cPAddons::proc_keys_named_after_version ) {
    Cpanel::cPAddons::proc_keys_named_after_version( $meta_info, __PACKAGE__ );
}

#### action functions ##
sub install {
    my $aoc        = shift;
    my @checkpaths = qw( /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin /usr/bin/X11 /usr/X11R6/bin /usr/local/bin /usr/X11R6/bin /usr/local/cpanel/3rdparty/bin);
    foreach my $path (@checkpaths) {
        if ( -x "$path/convert" ) {
            $aoc->{'cm_imagemagickpath'} = "$path/";
        }
    }
    if ( !$aoc->{'cm_imagemagickpath'} ) {
        print "Installation Failed.<br>\nThe ImageMagick program 'convert' was not found.  ImageMagick needs to be installed before installing Coppermine.<br>\nPlease contact support for further assistance.<br>\n";
        return;
    }
    $aoc->stdinstall(@_);
    $aoc->_do_phpsuexec_perms();
}

sub upgrade { shift->stdupgrade(@_); }

sub uninstall { shift->stduninstall(@_); }

#### non action functions ##
sub installform   { print shift->{'installform'}; }
sub upgradeform   { print shift->{'upgradeform'}; }
sub uninstallform { print shift->{'uninstallform'}; }

1;
