'){ $txt = substr($txt, 0, -2); } return eval($txt); } function ins_error($txt){ echo $txt; die(); } //See if the files exist if(!file_exists($globals['path'].'/enduser/index.php')){ #~~~~~~~~~~~~~~~~~~~~~~~ # We need to LOAD stuff #~~~~~~~~~~~~~~~~~~~~~~~ // Get the Zip Class @ins_eval(gzuncompress(ins_get_web_file($env['webserver'].'/unzip.php'))); if(!class_exists('PclZip')){ ins_error('Could not load the Unzip Class!'); } // Get the latest file revision $_data = ins_get_web_file('http://www.softaculous.com/updates.php?version=latest&panel=cpanel'); $info = @unserialize($_data); // Download the Latest Softaculous Version if(!$latest = ins_get_web_file($info['link'])){ ins_error('Could not download the Softaculous Package!'); } if(!ins_writefile($globals['path'].'/softaculous.zip', $latest, 1)){ ins_error('Could not save the Softaculous Package!'); } $zip = new PclZip($globals['path'].'/softaculous.zip'); $unzipped = $zip->extract(PCLZIP_OPT_EXTRACT_AS_STRING); //Are there any files if($unzipped == 0){ ins_error('Could not UNZIP the Softaculous Package!'); } //Check each file was extracted properly foreach($unzipped as $k => $v){ //No folders needed if($v['folder'] == true){ continue; } if(!ins_writefile($globals['path'].'/'.$v['stored_filename'], $v['content'], 1)){ ins_error('Could not save file - '.$v['stored_filename'].' while UNZIPPING the Softaculous Package!'); } } unset($unzipped); } //Detecting suPHP settings. According to that setting the permission for directory and files. if(@shell_exec(' /usr/local/cpanel/bin/rebuild_phpconf --current | grep -i "PHP5 SAPI: suphp"')){ $globals['chmod_files'] = '0644'; $globals['chmod_dir'] = '0755'; } $envtype = @implode('', file('/var/cpanel/envtype')); if(trim($envtype) !== 'standard'){ $globals['is_vps'] = 1; } if(!empty($argv[1])){ echo "Fetching a License \n"; // Whats my IP ??? $thisip = ins_get_web_file('http://www.softaculous.com/ip.php'); // Call the NOC API file to issue a license ins_get_web_file('http://www.softaculous.com/noc?nocname='.rawurlencode($argv[1]).'&nocpass='.rawurlencode($argv[2]).'&ca=buy&purchase=1&ips='.rawurlencode($thisip).'&toadd=1M&servertype='.(empty($globals['is_vps']) ? 1 : 2).'&authemail='.rawurlencode($argv[3]).'&autorenew=1'); } #################################### ## BEGIN THE INSTALLATION PROCESS ## #################################### //Some globals vars include_once($globals['path'].'/enduser/globals.php'); //The necessary functions to run this SOFTACULOUS Software include_once($globals['mainfiles'].'/functions.php'); //Load the SOFTPANEL Class if(!class_exists('softpanel')){ include_once($globals['enduser'].'/softpanel.php'); } $softpanel = new softpanel(); //GET the Categories, Scripts and iScripts catsnscripts(); //Load the Functions Language File - This will be from the default Lang Folder load_lang('index'); load_lang('admin/index'); load_lang('admin/cron'); load_lang('admin/softwares'); /////////////////////////////// // INSTALLATION PROCESS STEPS : // 1) CONFIGURE universal.php // 2) FETCH A LICENSE // 3) UPDATE categories.php // 4) UPDATE scripts.php // 5) UPDATE iscripts.php // 6) SET A CRON JOB // 7) SOFTACULOUS.CPANELPLUGIN // 8) CREATE LINKS to enduser // 9) Update Addon for RVSkin @since 3.7 // 10) REWRITE this file /////////////////////////////// // 1) CONFIGURE universal.php saveglobals($globals); // 2) FETCH A LICENSE loadlicense(true);//UPDATE as well // 3) UPDATE categories.php updatecats(); // 4) UPDATE scripts.php // 5) UPDATE iscripts.php updatescripts(); // 6) SET A CRON JOB add_cron($globals['cron_time']); // 7) SOFTACULOUS.CPANELPLUGIN @shell_exec('yum -y install file'); @shell_exec('/usr/local/cpanel/bin/register_cpanelplugin '.$globals['path'].'/softaculous.cpanelplugin'); // 8) CREATE LINKS to enduser $cpthemes = filelist('/usr/local/cpanel/base/frontend/', 0, 1); foreach($cpthemes as $k=>$v){ @shell_exec('ln -s '.$globals['enduser'].' '.$k.'/softaculous'); } // X / X2 themes if(!is_dir('/usr/local/cpanel/base/frontend/x/cells')){ @mkdir('/usr/local/cpanel/base/frontend/x/cells'); } if(!is_dir('/usr/local/cpanel/base/frontend/x2/cells')){ @mkdir('/usr/local/cpanel/base/frontend/x2/cells'); } $cell = '

Softaculous'; writefile('/usr/local/cpanel/base/frontend/x/cells/softaculous.html', $cell, 1); writefile('/usr/local/cpanel/base/frontend/x2/cells/softaculous.html', $cell, 1); // 9) Update Addons for RVSkin @Since 3.7 if(file_exists('/root/rvadmin/autoupdatewhmaddon.pl')){ @shell_exec('/usr/bin/perl /root/rvadmin/autoupdatewhmaddon.pl'); } // 10) REWRITE this file! $data = '#!/usr/local/bin/perl #WHMADDON:softaculous:Softaculous - Instant Installs my $URL; if ( \'root\' eq $ENV{\'REMOTE_USER\'} ){ $URL = "../cgi/softaculous/index.php"; }else{ $URL = "../cgi/softaculous/index.cgi"; } print "Location: $URL\n\n"; '; ins_writefile('/usr/local/cpanel/whostmgr/docroot/cgi/addon_softaculous.cgi', $data, 1); @shell_exec('chmod 0755 /usr/local/cpanel/whostmgr/docroot/cgi/addon_softaculous.cgi'); schmod('/usr/local/cpanel/whostmgr/docroot/cgi/addon_softaculous.cgi', 0755); @mkdir($globals['softscripts']); @shell_exec('chmod -R 0755 '.$globals['path']); @shell_exec('chmod -R 0755 '.$globals['softscripts']); // Run the Apps Category maker in cPanel change_app_name($globals['show_top_scripts']); soft_memory_limit(256); // Delete the installer file @unlink('/usr/local/cpanel/whostmgr/docroot/cgi/addon_softaculous.php'); if(!( isset($_SERVER['HTTP_USER_AGENT']) || isset($_SERVER['HTTP_COOKIE']) )){ // 10) RUN THE CRON //@shell_exec('/usr/bin/php '.$globals['path'].'/cron.php'); foreach($iscripts as $ik => $iv){ $report = updatesoftwares($ik, 0); echo $iv['name'].' - '.implode("\n", $report[$ik]['log'])."\n\r\n\r"; } echo '===================================================== Congratulations, Softaculous was installed successfully Softaculous has been installed at: Path : '.$globals['path'].' Scripts Path : '.$globals['softscripts'].' We request you to please register for updates and notifications at : http://www.softaculous.com/board/index.php?act=register It also inspires us when you register. Registration is free and just a one minute job. If you need any support you can always count on us. Just drop in at our Support Board: http://www.softaculous.com/board Alternatively, you can contact us via Email at support@softaculous.com Thank you for using Softaculous'; // Die as we are in CLI MODE die(); } ##################################### ## FINISHED INSTALLING SOFTACULOUS ## ##################################### echo ' Softaculous

 

Congratulations, Softaculous was installed successfully

Softaculous has been installed at:
Path : '.$globals['path'].'
Scripts Path : '.$globals['softscripts'].'

The Administration Panel links where you can edit these settings are as follows:


'.$l['tab_home'].'

'.$l['tab_settings'].'

'.$l['tab_updates'].'

'.$l['tab_softwares'].'

'.$l['tab_categories'].'

'.$l['tab_email'].'

'.$l['updating_files'].'


'; //The necessary JavaScripts echo ' We request you to please register at Softaculous for updates and notifications. It also inspires us when you register. Registration is free and just a one minute job. If you need any support you can always count on us. Just drop in at our Support Board
Alternatively, you can contact us via Email at support@softaculous.com.

To enter the Softaculous Admin Panel just click on the Softaculous - Instant Installs link in the Plugins Section of WHM.

Thank you for using Softaculous

'; ?>