package cPanel::CMS::E107;

use strict;
use warnings;

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

our $meta_info = {
   adminuser_pass => 1,
   admin_user_pass_length => 6,
   admin_user_pass_length_max => 10,
   admin_email => 1,
   installdir => 'e107',
   description => 'e107 is a content management system written in php and using the popular open source mySQL database system for content storage.',
   version => '0.6171',
   'security' => 'Requires 777 directory permissions and world readable config files. Subject to all common PHP security problems.',
   security_rank => 1,
   website => 'http://e107.org/',
   config_files => ['e107_config.php'],
   chmod => {
      '0777' => [qw(e107_files/cache/ e107_files/backend/news.txt e107_files/backend/news.xml e107_files/public/ e107_files/public/avatars/ e107_plugins/custom/ e107_plugins/custompages/)],
      '0644' => [qw(e107_config.php)],
   },
   mysql => ['e107'],
   table_prefix => 'e107',
   '0.6171' => {
      public_html_install_files => [qw(article.php backend.php banner.php chat.php class2.php comment.php content.php download.php e107_6171_readme.txt e107_config.php e107.htaccess email.php error.php forum.php forum_post.php forum_viewforum.php forum_viewtopic.php fpw.php index.php links.php login.php membersonly.php news.php oldpolls.php online.php print.php rate.php request.php robots.txt search.php signup.php sitedown.php sitemap.php stats.php subcontent.php submitnews.php top.php upgrade.php upload.php user.php userposts.php usersettings.php)],
      public_html_install_dirs => [qw()],
      #e107 has a prefix on all of its directories, this makes uninstalling pretty simple
      public_html_install_unknown => [qw(e107_admin e107_docs e107_files e107_handlers e107_images e107_install e107_languages e107_plugins e107_themes)],
   },
};

#### action functions ##
sub install {
   my $aoc = shift;
   $aoc->{url_to_install_length} =length($aoc->{url_to_install});
   $aoc->{username_length}       =length($aoc->{username});
   $aoc->{email_length}          =length($aoc->{email});
   return $aoc->stdinstall(@_)
}
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;
