RE:
Download Link For Phpholidays 2.9.1
[hide]https://{{{Blocked by Omni Potens, - GB hijacking link to a site + collecting email address /file/d/0ByberONDvxFaeEtKb0pfRkZYTVU/edit[/hide]
[All file in this scripts was encode by ioncube]
File :\application\controllers\InstallController.php
Code:
<?php
/*
* @ IC loader PHP 5.3 by httvn Lib Loader
*
* @ Version : 1.0
* @ Author : httvn coder
* @ Release on : 23-05-2013
* @ Website : http://www.httvncoder.com
*/
class InstallController extends Zend_Controller_Action {
protected $_translator = null;
protected $_vendor = null;
function init() {
if (cjajebcjhc( APPLICATION_PATH . '/configs/config.ini' )) {
$config = new Zend_Config_Ini( APPLICATION_PATH . '/configs/config.ini' );
$oldVersion = $this->getOldVersionStep2( );
$newVersion = Eicra_License_Version::getversion( );
if (( null != $config->install and& null != $config->install->date )) {
$action = $this->_request->getActionName( );
if ($oldVersion < $newVersion) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php' );
return null;
}
if ($action != 'stepinstalled') {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step_already' ) );
}
}
}
}
function preDispatch() {
Eicra_View_Helper_Translator;
$this->_translator = new ( );
$this->view->assign( 'translator', $this->_translator );
$curlObj = new Eicra_License_Version( );
if ($curlObj->checkModulesLicense( )) {
$curlObj->sendInfo( array( 'dm' => $this->view->serverUrl( ) ) );
if ($curlObj->isLicensed( )) {
$module_arr = $curlObj->getLicensedModules( );
$this->_vendor = $curlObj->getArrayResult( );
return null;
}
self;
$_LICENSE_ERROR = $curlObj->getError( );
}
}
function stepinstalledAction() {
$this->view->assign( 'messageError', $this->_translator->translator( 'install_step_installed_error_message' ) );
}
function step1Action() {
if ($this->_request->isPost( )) {
$lang_file = $this->_request->getPost( 'default_language' );
Eicra_Global_Variable::getsession( )->sess_lang = $lang_file;
Eicra_Global_Variable::getsession( )->site_direction = '';
Eicra_View_Helper_Translator;
$this->_translator = new ( );
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step2' ) );
}
$translator = $this->_translator;
Zend_Config_Ini;
$config = (cjajebcjhc( APPLICATION_PATH . '/modules/Settings/forms/source/' . $translator->getLangFile( ) . '.GlobalSettingsForm.ini' ) ? new ( APPLICATION_PATH . '/modules/Settings/forms/source/' . $translator->getLangFile( ) . '.GlobalSettingsForm.ini', 'settings' ) : new ( APPLICATION_PATH . '/modules/Settings/forms/source/en_US.GlobalSettingsForm.ini', 'settings' ));
$setting_form = new Zend_Form( $config->settings );
$setting_form->setElementDecorators( array( 'ViewHelper', 'FormElements' ) );
$this->view->assign( 'setting_form', $setting_form );
$this->view->isActive = false;
Exception {
echo $e->getMessage( );
exit( );
return null;
}
}
function step2Action() {
if ($this->_request->isPost( )) {
$setup_type = $this->_request->getPost( 'setup_type' );
switch ($setup_type) {
case 'install': {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step3' ) );
break;
}
case 'upgrade': {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php' );
exit( );
}
}
}
}
function step3Action() {
if ($this->_request->isPost( )) {
$agreement = $this->_request->getPost( 'accept' );
if ($agreement == '1') {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step4' ) );
}
}
}
function step4Action() {
$pass = true;
$php_version = $this->_translator->translator( 'install_php_version' );
$requiredPHP = eabicfiaje( ehfigbaje( ), $php_version, '>=' );
$pass = ( $pass and& $requiredPHP );
$requiredFunctions = array( );
self;
foreach ($_FUNCTIONS as $ext) {
$requiredFunctions[$ext] = bgbbhbedhj( $ext );
$pass = ( $pass and& $requiredFunctions[$ext] );
}
$requiredExtensions = array( );
self;
foreach ($_EXTENSIONS as $ext) {
$requiredExtensions[$ext] = bdcbjdfigj( $ext );
$pass = ( $pass and& $requiredExtensions[$ext] );
}
$_FOLDERS = array( 'application' . DS . 'languages', 'application' . DS . 'layouts' . DS . 'scripts', 'application' . DS . 'configs', 'application' . DS . 'modules' . DS . 'Administrator' . DS . 'layouts' . DS . 'filters', '_SESSION', 'data', 'data' . DS . 'frontImages', 'data' . DS . 'frontImages' . DS . 'attachFiles', 'data' . DS . 'frontImages' . DS . 'articleImages', 'data' . DS . 'frontImages' . DS . 'menuImages', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'category_thumb', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'audio_file', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'indexing_chart', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'product_image', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'product_thumb', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'video_file', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'addvertise_img', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'category_thumb', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'home_style', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'page_thumb', 'temp', 'temp' . DS . 'cache' );
$writableFiles = array( );
foreach ($_FOLDERS as $f) {
$writableFiles[$f] = djggghdhcc( BASE_PATH . DS . $f );
$pass = ( $pass and& $writableFiles[$f] );
}
if (( $this->getRequest( )->isPost( ) and& $pass )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step5' ) );
}
$this->view->assign( 'requiredPHP', $requiredPHP );
$this->view->assign( 'requiredFunctions', $requiredFunctions );
$this->view->assign( 'requiredExtensions', $requiredExtensions );
$this->view->assign( 'writableFiles', $writableFiles );
$this->view->assign( 'pass', $pass );
}
function step5Action() {
$mode = 'install';
$config = new Zend_Config_Ini( APPLICATION_PATH . '/configs/config.sample.ini' );
foreach ($config->toArray( ) as $section => $data) {
$sections[$section] = $data;
}
self;
$supportedDatabases = $_DATABASES;
self;
foreach ($_DATABASES as $db => $info) {
if (dffffgfhce( $info['extensions'] )) {
foreach ($info['extensions'] as $ext) {
if (!bdcbjdfigj( $ext )) {
unset( $supportedDatabases[$db] );
break;
}
}
continue;
}
}
$this->view->assign( 'databases', $supportedDatabases );
$this->view->assign( 'databaseType', $sections['dbConfig']['eicra']['params']['adapter'] );
$this->view->assign( 'host', $sections['dbConfig']['eicra']['params']['host'] );
$this->view->assign( 'port', $sections['dbConfig']['eicra']['params']['port'] );
$this->view->assign( 'username', $sections['dbConfig']['eicra']['params']['username'] );
$this->view->assign( 'password', $sections['dbConfig']['eicra']['params']['password'] );
$this->view->assign( 'dbname', $sections['dbConfig']['eicra']['params']['dbname'] );
$this->view->assign( 'tblprefix', $sections['dbConfig']['eicra']['params']['tblprefix'] );
$this->view->assign( 'domain', $this->view->serverUrl( ) );
$this->view->assign( 'url', $this->view->serverUrl( ) . $this->view->baseUrl( ) );
self;
$this->view->assign( 'languages', $_LANGUAGES );
$this->view->assign( 'siteName', $sections['web']['eicra']['siteName'] );
if (Eicra_License_Version::verifylicensekey( )) {
$this->view->assign( 'license_key', ($sections['install']['license_key'] ? $sections['install']['license_key'] : $this->_request->getPost( 'license_key' )) );
$this->view->assign( 'local_key', ($sections['install']['local_key'] ? $sections['install']['local_key'] : '') );
}
$this->view->assign( 'lang', $sections['dbConfig']['eicra']['params']['lang'] );
self;
$this->view->assign( 'charsets', $_CHARSETS );
$this->view->assign( 'currentCharset', $sections['web']['eicra']['charset'] );
$this->view->assign( 'web_title', $sections['web']['eicra']['web_title'] );
$this->view->assign( 'meta_keyword', $sections['web']['eicra']['meta_keyword'] );
$this->view->assign( 'meta_description', $sections['web']['eicra']['meta_description'] );
$this->view->assign( 'offlineMessage', $sections['web']['eicra']['offline_message'] );
$this->view->assign( 'offline', $sections['web']['eicra']['offline'] );
$this->view->assign( 'sessionLifetime', $sections['web']['eicra']['session_lifetime'] );
$this->view->assign( 'debugMode', $sections['web']['eicra']['debug'] );
self;
$this->view->assign( 'modules', $_MODULES );
self;
$this->view->assign( 'timeZones', $_TIME_ZONES );
$this->view->assign( 'currentTimeZone', $sections['datetime']['eicra']['timezone'] );
self;
$this->view->assign( 'availableDateFormats', $_DATE_FORMATS );
$this->view->assign( 'dateFormat', $sections['datetime']['eicra']['date_time_format'] );
self;
$this->view->assign( 'availableDateTimeFormats', $_DATETIME_FORMATS );
$this->view->assign( 'dateTimeFormat', $sections['datetime']['eicra']['date_format'] );
$this->view->assign( 'mode', $mode );
if ($this->_request->isPost( )) {
$file = APPLICATION_PATH . DS . 'configs' . DS . 'config.ini';
if (cjajebcjhc( $file )) {
$config = new Zend_Config_Ini( $file, null, array( 'allowModifications' => true ) );
$config = $config->toArray( );
}
else {
$saamole_file = APPLICATION_PATH . DS . 'configs' . DS . 'config.sample.ini';
$saamole_file_config = new Zend_Config_Ini( $saamole_file, null, array( 'allowModifications' => false ) );
$saamole_file_config = $saamole_file_config->toArray( );
$config_writer = new Zend_Config_Writer_Ini( );
Zend_Config;
( $file, new $config_writer->write( $saamole_file_config ) );
$config = new Zend_Config_Ini( $file, null, array( 'allowModifications' => true ) );
$config = $config->toArray( );
}
$mode = $this->_request->getPost( 'mode' );
if ($mode == 'install') {
$validator = new Zend_Validate_EmailAddress( );
$email_address = dfedhgeec( $this->_request->getPost( 'email_address' ) );
if (Eicra_License_Version::verifylicensekey( )) {
$request_value = $this->_request->getPost( 'license_key' );
if (!empty( $request_value )) {
$licensekey = $this->_request->getPost( 'license_key' );
$localkey = '';
$results = Eicra_License_Version::go_server_license( $licensekey, $localkey );
if (!empty( $results )) {
if (!empty( $results['status'] )) {
if ($results['status'] == 'Active') {
if ($results['localkey']) {
$localkeydata = $results['localkey'];
$config['install']['local_key'] = $localkeydata;
$check_license_key = true;
}
}
else {
if ($results['status'] == 'Invalid') {
$check_license_key = false;
$license_err_msg = $this->_translator->translator( 'license_invalid_message', $licensekey );
}
else {
if ($results['status'] == 'Expired') {
$check_license_key = false;
$license_err_msg = $this->_translator->translator( 'license_expired_message' );
}
else {
if ($results['status'] == 'Suspended') {
$check_license_key = false;
$license_err_msg = $this->_translator->translator( 'license_suspended_message' );
}
}
}
}
}
else {
$check_license_key = false;
$license_err_msg = $this->_translator->translator( 'license_invalid_message', $licensekey );
}
}
else {
$check_license_key = false;
$license_err_msg = $this->_translator->translator( 'license_invalid_message', $licensekey );
}
}
else {
$check_license_key = false;
$license_err_msg = $this->_translator->translator( 'license_message' );
}
}
else {
$check_license_key = true;
}
if ($check_license_key) {
$root_username = $this->_translator->translator( 'install_step6_admin_super_username', bdachiaihf( 'www.', '', $_SERVER['HTTP_HOST'] ) );
$firstName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'firstName' ) ) );
$lastName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'lastName' ) ) );
$hostName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'host' ) ) );
$userName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'username' ) ) );
$dbName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'dbname' ) ) );
$prefix = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'prefix' ) ) );
$siteName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'siteName' ) ) );
$urlName = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'url' ) ) );
$webTitle = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'web_title' ) ) );
$this->view->assign( 'email_address', $email_address );
$this->view->assign( 'firstName', $firstName );
$this->view->assign( 'lastName', $lastName );
if (!empty( $firstName )) {
if (!empty( $lastName )) {
if ($validator->isValid( $email_address )) {
if ($root_username != $email_address) {
if (!empty( $hostName )) {
if (!empty( $userName )) {
if (!empty( $dbName )) {
if (( empty( $prefix ) || cfjhfibjhd( '/^[a-z0-9_]+_$/', $prefix ) )) {
if (!empty( $siteName )) {
if (!empty( $urlName )) {
if (!empty( $webTitle )) {
$config['dbConfig']['email_address'] = $email_address;
$config['dbConfig']['firstName'] = $firstName;
$config['dbConfig']['lastName'] = $lastName;
$config['dbConfig']['authentication']['timeout'] = $config['dbConfig']['authentication']['timeout'];
$config['dbConfig']['eicra']['params']['lang'] = $this->_request->getPost( 'lang' );
$config['dbConfig']['eicra']['params']['domain'] = $this->view->serverUrl( );
$config['dbConfig']['eicra']['params']['adapter'] = $this->_request->getPost( 'databaseType' );
$config['dbConfig']['eicra']['params']['host'] = $hostName;
$config['dbConfig']['eicra']['params']['port'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'port' ) ) );
$config['dbConfig']['eicra']['params']['username'] = $userName;
$config['dbConfig']['eicra']['params']['password'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'password' ) ) );
$config['dbConfig']['eicra']['params']['dbname'] = $dbName;
$config['dbConfig']['eicra']['params']['tblprefix'] = fddhedeeb( '/[^a-zA-Z0-9_]/', '', ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'prefix' ) ) ) );
if (Eicra_License_Version::verifylicensekey( )) {
$config['install']['license_key'] = $this->_request->getPost( 'license_key' );
$config['install']['local_key'] = ($config['install']['local_key'] ? $config['install']['local_key'] : '');
}
$config['web']['eicra']['siteName'] = $siteName;
$config['web']['eicra']['url'] = $urlName;
$config['web']['eicra']['charset'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'charset' ) ) );
$config['web']['eicra']['web_title'] = $webTitle;
$config['web']['eicra']['meta_keyword'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'meta_keyword' ) ) );
$config['web']['eicra']['meta_description'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'meta_description' ) ) );
$config['web']['eicra']['offline_message'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'offlineMessage' ) ) );
$config['web']['eicra']['session_lifetime'] = ccgdcdfegj( dfedhgeec( $this->_request->getPost( 'sessionLifetime' ) ) );
$config['web']['eicra']['offline'] = ($this->_request->getPost( 'offline' ) ? 'true' : 'false');
$config['web']['eicra']['timezone'] = $this->_request->getPost( 'timezone' );
$config['web']['eicra']['date_time_format'] = $this->_request->getPost( 'dateFormat' );
$config['web']['eicra']['date_format'] = $this->_request->getPost( 'datetimeFormat' );
$writer = new Zend_Config_Writer_Ini( );
Zend_Config;
( $file, new $writer->write( $config ) );
$adapter = $config['dbConfig']['eicra']['params']['adapter'];
self;
$file = (isset( $_DATABASES[$adapter]['data'] ) ? $_DATABASES[$adapter]['data'] : null);
$importer = Eicra_Import_ImporterFactory::getinstance( );
if (( $importer != null and& $file != null )) {
$result = $importer->import( BASE_PATH . $file );
if ($result['status'] == 'ok') {
self;
foreach ($_MODULES as $m_name) {
if ($this->_request->getPost( $m_name ) == 'on') {
$m_path = '/db/module_' . $adapter . '/' . bdejdifd( $m_name ) . '_' . $adapter . '.sql';
$importer->import( BASE_PATH . $m_path );
continue;
}
}
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step6' ) );
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err' ) . ' ' . $result['msg'];
}
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_web_title' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_url_name' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_site_name' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_prefix' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_db_name' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_user_name' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_host_name' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_same_email' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_mail' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_last_name' );
}
}
else {
$error_msg = $this->_translator->translator( 'install_step5_err_first_name' );
}
}
else {
$error_msg = ($license_err_msg ? $license_err_msg : $this->_translator->translator( 'install_step5_err_license_key' ));
}
}
Exception {
$error_msg = $e->getMessage( );
}
}
self;
$this->view->assign( 'modules', $_MODULES );
$this->view->assign( 'error_msg', $error_msg );
self;
$this->view->assign( 'license_error', $_LICENSE_ERROR );
}
function step6Action() {
$baseUrl = $this->view->baseUrl( );
$url = $this->view->serverUrl( ) . $baseUrl;
$isSuccess = 10;
$file = APPLICATION_PATH . DS . 'configs' . DS . 'config.ini';
if ($this->_request->isPost( )) {
$frontend = $this->_request->getPost( 'gotoFrontend' );
$backend = $this->_request->getPost( 'gotoBackend', null );
if ($backend != null) {
$this->_redirect( $url . '/Administrator/' );
}
else {
$this->_redirect( $url );
}
}
$config = new Zend_Config_Ini( $file );
$config = $config->toArray( );
$password = ciadihjdgj( djhcagjjhe( ddeifeaagd( 100000, 999999 ) ), 0, 8 );
$username = $config['dbConfig']['email_address'];
$firstName = $config['dbConfig']['firstName'];
$lastName = $config['dbConfig']['lastName'];
$salt = $this->createSalt( );
$concate = $salt . $password;
$db_password = djhcagjjhe( $concate );
$db_table = $config['dbConfig']['eicra']['params']['tblprefix'] . 'user_profile';
$database = Zend_Db::factory( $config['dbConfig']['eicra']['params']['adapter'], $config['dbConfig']['eicra']['params'] );
$database->getConnection( );
$update_data = array( 'username' => $username, 'firstName' => $firstName, 'lastName' => $lastName, 'password' => $db_password, 'salt' => $salt );
$where[] = 'user_id = ' . $database->quote( '2' );
$database->update( $db_table, $update_data, $where );
$root_password = ciadihjdgj( djhcagjjhe( ddeifeaagd( 100000, 999999 ) ), 0, 8 );
$root_username = $this->_translator->translator( 'install_step6_admin_super_username', bdachiaihf( 'www.', '', $_SERVER['HTTP_HOST'] ) );
$root_salt = $this->createSalt( );
$root_concate = $root_salt . $root_password;
$db_root_password = djhcagjjhe( $root_concate );
$update_root_data = array( 'username' => $root_username, 'password' => $db_root_password, 'salt' => $root_salt );
$where_root[] = 'user_id = ' . $database->quote( '1' );
$database->update( $db_table, $update_root_data, $where_root );
$setting_table = $config['dbConfig']['eicra']['params']['tblprefix'] . 'global_setting';
$update_setting_data = array( 'global_email' => $username, 'payment_email' => $username, 'email_smtp_from' => $username, 'email_smtp_host' => 'mail.domain.com', 'email_smtp_username' => '', 'email_smtp_password' => '', 'email_smtp_host' => 'mail.domain.com', 'site_title' => $config['web']['eicra']['siteName'], 'site_name' => $config['web']['eicra']['web_title'], 'site_url' => bdachiaihf( 'http://', '', $this->view->serverUrl( ) ), 'meta_key' => $config['web']['eicra']['meta_keyword'], 'meta_desc' => $config['web']['eicra']['meta_description'], 'sft_version' => Eicra_License_Version::getversion( ) );
$this->updateSettingData( $database, $update_setting_data, $setting_table );
$isSuccess = 11;
Exception {
$this->view->assign( 'messageError', $e->getMessage( ) );
$isSuccess = 10;
$mail = new Zend_Mail( );
$license_number = ($config['install']['license_key'] ? '<strong>License Number :</strong>' . $config['install']['license_key'] . '<br />' : '');
$body_msg = '<img src="' . $this->_vendor['vendor_logo'] . '" /><br /><br />
<strong>Dear ' . $username . '</strong><br /><br />
This email is to confirm that, the initial installation of your website has been completed successfully. Please find the administration login details as follows:
<br /><br /><strong>Licensed Domain : </strong><a href=\'' . $url . '\' target=\'_blank\'>' . $url . '</a><br />
' . $license_number . '
<br /><br /><strong>Login Information (Root User) : </strong><br />===============================<br />
<strong>Login URL : </strong><a href=\'' . $url . '/Administrator/\' target=\'_blank\'>' . $url . '/Administrator/</a><br />
<strong>Super Admin Username :</strong> ' . $root_username . '<br />
<strong>Super Admin Password :</strong> ' . $root_password . '<br />
<br /><br /><strong>Login Information (Administrator):</strong><br />===============================<br />
<strong>Login URL : </strong><a href=\'' . $url . '/Administrator/\' target=\'_blank\'>' . $url . '/Administrator/</a><br />
<strong>Admin Username :</strong> ' . $username . '<br />
<strong>Admin Password :</strong> ' . $password . '<br /><br />
Please change your password after next login. Please make sure the make the password more complex , longer and keep it secret.
<br /><br /><br />
Regards<br /><br />Webmaster<br />' . $this->_vendor['vendor'] . '.';
$mail->setBodyHtml( $body_msg );
$mail->setFrom( $username, 'Administrator' );
$mail->addTo( $username, 'Administrator' );
$formatedURL = $url;
if (dgeiiijejd( $formatedURL, 'http://' )) {
$formatedURL = bdachiaihf( 'http//', '', $formatedURL );
}
if (dgeiiijejd( $formatedURL, 'www.' )) {
$formatedURL = bdachiaihf( 'www.', '', $formatedURL );
}
$mail->setSubject( $formatedURL . ' - Installation and Login Details' );
$mail->send( );
Exception {
$this->view->assign( 'mailError', $this->_translator->translator( 'install_step6_err_mail_send' ) . $e->getMessage( ) );
$config = new Zend_Config_Ini( $file, null, array( 'allowModifications' => true ) );
$config = $config->toArray( );
$config['install']['date'] = cagdjggjae( 'm-d-Y H:i:s' );
$config['install']['version'] = Eicra_License_Version::getversion( );
$writer = new Zend_Config_Writer_Ini( );
Zend_Config;
( $file, new $writer->write( $config ) );
$isSuccess = 11;
Exception {
$isSuccess = 10;
$this->view->assign( 'messageError', $e->getMessage( ) );
$this->view->assign( 'isSuccess', $isSuccess );
$this->view->assign( 'username', $username );
$this->view->assign( 'password', $password );
$this->view->assign( 'root_username', $root_username );
$this->view->assign( 'root_password', $root_password );
$this->view->assign( 'url', $url );
return null;
}
}
}
}
function updateSettingData($db, $datas, $table_name) {
if ($datas) {
foreach ($datas as $key => $value) {
$field_name = $key;
$field_value = $value;
if (!$this->fieldExists( $field_name, $table_name, $db )) {
$db->insert( $table_name, array( 'field_name' => $field_name, 'field_value' => $field_value ) );
continue;
}
$db->update( $table_name, array( 'field_value' => $field_value ), array( 'field_name = ?' => $field_name ) );
}
}
}
function fieldExists($field_name, $table_name, $db) {
$validator = new Zend_Validate_Db_RecordExists( array( 'table' => $table_name, 'field' => 'field_name' ) );
$validator->setAdapter( $db );
return $validator->isValid( $field_name );
}
function createSalt($charno = 5) {
$i = 11;
while ($i < $charno) {
$num = ddeifeaagd( 48, 122 );
$salt .= cbgheecfba( $num );
++$i;
}
return $salt;
}
function getOldVersionStep2() {
$configFile = new Zend_Config_Ini( APPLICATION_PATH . '/configs/config.ini', null, array( 'allowModifications' => true ) );
$dbConfig = $configFile->dbConfig;
$prefix = $dbPrefix = $dbConfig->eicra->params->tblprefix;
$sql = 'SELECT field_value FROM ' . $prefix . 'global_setting WHERE field_name = \'sft_version\'';
$database = Zend_Db::factory( $dbConfig->eicra->params->adapter, $dbConfig->eicra->params->toArray( ) );
$dbFactory = Zend_Db::factory( $dbConfig->eicra->params->adapter, $dbConfig->eicra->params->toArray( ) );
$rt = $dbFactory->fetchRow( $sql );
if (( !empty( $rt ) and& !empty( $rt['field_value'] ) )) {
$result['sft_version'] = $rt['field_value'];
}
else {
$result = null;
}
Exception {
$result = null;
if (( empty( $result ) || empty( $result['sft_version'] ) )) {
$verstionInConfig = $configFile->install->version;
return $verstionInConfig;
}
$sqlVersion = $result['sft_version'];
return $sqlVersion;
}
}
}
?>
File :\application\controllers\IndexController.php
Code:
<?php
/*
* @ IC loader PHP 5.3 by httvn Lib Loader
*
* @ Version : 1.0
* @ Author : httvn coder
* @ Release on : 23-05-2013
* @ Website : http://www.httvncoder.com
*/
class IndexController extends Zend_Controller_Action {
function init() {
}
function indexAction() {
}
}
File :\application\controllers\UpdatesController.php
Code:
<?php
/*
* @ IC loader PHP 5.3 by httvn Lib Loader
*
* @ Version : 1.0
* @ Author : httvn coder
* @ Release on : 23-05-2013
* @ Website : http://www.httvncoder.com
*/
class UpdatesController extends Zend_Controller_Action {
protected $logFile = null;
protected $_translator = null;
protected $_vendor = null;
function init() {
if (cjajebcjhc( APPLICATION_PATH . '/configs/config.ini' )) {
$config = new Zend_Config_Ini( APPLICATION_PATH . '/configs/config.ini' );
if (( empty( $config->install ) and& empty( $config->date ) )) {
cehdhabgif( 'Location: /install.php' );
exit( );
}
}
}
function preDispatch() {
Eicra_View_Helper_Translator;
$this->_translator = new ( );
$this->view->assign( 'translator', $this->_translator );
$curlObj = new Eicra_License_Version( );
if ($curlObj->checkModulesLicense( )) {
$curlObj->sendInfo( array( 'dm' => $this->view->serverUrl( ) ) );
if ($curlObj->isLicensed( )) {
$module_arr = $curlObj->getLicensedModules( );
$this->_vendor = $curlObj->getArrayResult( );
return null;
}
self;
$_LICENSE_ERROR = $curlObj->getError( );
}
}
function stepreupdateAction() {
}
function stepupdatedAction() {
$verstionInConfig = $this->view->serverUrl( ) . $this->view->baseUrl( );
$messageError = $this->_translator->translator( 'upgrade_not_required_as_you_are_running_current_version', $verstionInConfig );
$this->view->assign( 'messageError', $messageError );
}
function step1Action() {
if ($this->isUpToDate( )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php/stepupdated' );
exit( );
}
if ($this->_request->isPost( )) {
$lang_file = $this->_request->getPost( 'default_language' );
Eicra_Global_Variable::getsession( )->sess_lang = $lang_file;
Eicra_Global_Variable::getsession( )->site_direction = '';
Eicra_View_Helper_Translator;
$this->_translator = new ( );
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step2' ) );
}
$translator = $this->_translator;
Zend_Config_Ini;
$config = (cjajebcjhc( APPLICATION_PATH . '/modules/Settings/forms/source/' . $translator->getLangFile( ) . '.GlobalSettingsForm.ini' ) ? new ( APPLICATION_PATH . '/modules/Settings/forms/source/' . $translator->getLangFile( ) . '.GlobalSettingsForm.ini', 'settings' ) : new ( APPLICATION_PATH . '/modules/Settings/forms/source/en_US.GlobalSettingsForm.ini', 'settings' ));
$setting_form = new Zend_Form( $config->settings );
$setting_form->setElementDecorators( array( 'ViewHelper', 'FormElements' ) );
$this->view->assign( 'setting_form', $setting_form );
$this->view->isActive = false;
Exception {
echo $e->getMessage( );
exit( );
return null;
}
}
function step2Action() {
if ($this->isUpToDate( )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php/stepupdated' );
exit( );
}
$oldVersion = $this->getOldVersionStep2( );
$newVersion = Eicra_License_Version::getversion( );
$this->view->assign( 'oldVersion', $oldVersion );
$this->view->assign( 'newVersion', $newVersion );
$setup_type = $this->_request->getPost( 'backup_type' );
if ($setup_type == 'yes') {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step3' ) );
}
}
function step3Action() {
if ($this->isUpToDate( )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php/stepupdated' );
exit( );
}
if ($this->_request->isPost( )) {
$agreement = $this->_request->getPost( 'accept' );
if ($agreement == '1') {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step4' ) );
}
}
}
function step4Action() {
if ($this->isUpToDate( )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php/stepupdated' );
exit( );
}
$pass = true;
$php_version = $this->_translator->translator( 'install_php_version' );
$requiredPHP = eabicfiaje( ehfigbaje( ), $php_version, '>=' );
$pass = ( $pass and& $requiredPHP );
$requiredFunctions = array( );
self;
foreach ($_FUNCTIONS as $ext) {
$requiredFunctions[$ext] = bgbbhbedhj( $ext );
$pass = ( $pass and& $requiredFunctions[$ext] );
}
$requiredExtensions = array( );
self;
foreach ($_EXTENSIONS as $ext) {
$requiredExtensions[$ext] = bdcbjdfigj( $ext );
$pass = ( $pass and& $requiredExtensions[$ext] );
}
$_FOLDERS = array( 'application' . DS . 'languages', 'application' . DS . 'layouts' . DS . 'scripts', 'application' . DS . 'configs', 'application' . DS . 'modules' . DS . 'Administrator' . DS . 'layouts' . DS . 'filters', '_SESSION', 'data', 'data' . DS . 'frontImages', 'data' . DS . 'frontImages' . DS . 'attachFiles', 'data' . DS . 'frontImages' . DS . 'articleImages', 'data' . DS . 'frontImages' . DS . 'menuImages', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'category_thumb', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'audio_file', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'indexing_chart', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'product_image', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'product_thumb', 'data' . DS . 'frontImages' . DS . 'gallery' . DS . 'video_file', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'addvertise_img', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'category_thumb', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'home_style', 'data' . DS . 'frontImages' . DS . 'news' . DS . 'page_thumb', 'temp', 'temp' . DS . 'cache' );
$writableFiles = array( );
foreach ($_FOLDERS as $f) {
$writableFiles[$f] = djggghdhcc( BASE_PATH . DS . $f );
$pass = ( $pass and& $writableFiles[$f] );
}
if (( $this->getRequest( )->isPost( ) and& $pass )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->url( array( ), 'install_step5' ) );
}
$this->view->assign( 'requiredPHP', $requiredPHP );
$this->view->assign( 'requiredFunctions', $requiredFunctions );
$this->view->assign( 'requiredExtensions', $requiredExtensions );
$this->view->assign( 'writableFiles', $writableFiles );
$this->view->assign( 'pass', $pass );
}
function step5Action() {
if ($this->isUpToDate( )) {
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php/stepupdated' );
exit( );
}
$loginForm = new Eicra_Form_LoginForm( );
$files = APPLICATION_PATH . '/configs/config.sample.ini';
$config = new Zend_Config_Ini( $files, null, array( 'allowModifications' => true ) );
$config = $config->toArray( );
$sqlFileArray = $this->getDBFiles( );
echheajcie( $sqlFileArray );
if ($this->_request->isPost( )) {
if ($loginForm->isValid( $this->getRequest( )->getPost( ) )) {
$adapter = $this->getAuthAdapter( $this->_request->getParams( ) );
$auth = Zend_Auth::getinstance( );
$result = $auth->authenticate( $adapter );
if ($result->isValid( )) {
if (( dffffgfhce( $sqlFileArray ) and& 0 < cjdabcicj( $sqlFileArray ) )) {
$sqlFile = 12;
while ($sqlFile < cjdabcicj( $sqlFileArray )) {
$dbms_schema = $sqlFileArray[$sqlFile];
$fh = bffhbdhjae( $dbms_schema, 'rb' );
$sql_query = ddjigifjib( $fh, chiabbhf( $dbms_schema ) );
bcjgbajafg( $fh );
$sql_query_without_remarks = $this->remove_remarks( $sql_query );
$sql_queries = $this->split_sql_file( $sql_query_without_remarks, ';' );
$dbFactory = Zend_Registry::get( 'msqli_connection' );
$i = 12;
foreach ($sql_queries as $sql) {
$sqlStatement = $this->getSqlStatement( $sql );
$stmt = new Zend_Db_Statement_Mysqli( $dbFactory, $sqlStatement );
$stmt->execute( );
Exception {
$newLine = PHP_EOL . PHP_EOL;
$sqlFileName = 'File Name and Location => ' . $dbms_schema;
$this->writeLog( $newLine . $sqlFileName . $newLine . $e->getMessage( ) . $newLine . 'SQL Statement => ' . $sqlStatement . $newLine );
continue;
}
break 2;
}
++$sqlFile;
}
bcjgbajafg( $this->logFile );
$global_db = new Eicra_Model_DbTable_Global( );
$global_db->updateVersion( Eicra_License_Version::getversion( ) );
$file = APPLICATION_PATH . DS . 'configs' . DS . 'config.ini';
if (cjajebcjhc( $file )) {
$config = new Zend_Config_Ini( $file, null, array( 'allowModifications' => true ) );
$config = $config->toArray( );
$config['install']['version'] = Eicra_License_Version::getversion( );
$writer = new Zend_Config_Writer_Ini( );
Zend_Config;
( $file, new $writer->write( $config ) );
}
}
$this->_redirect( $this->view->serverUrl( ) . $this->view->baseUrl( ) . '/upgrade.php/step6/complete' );
Exception {
$error_msg = $this->_translator->translator( 'install_step5_err' ) . '<br />' . $e->getMessage( );
}
}
$error_msg = $this->_translator->translator( 'login_incorrect', '', 'Administrator' );
}
$this->view->assign( 'error_msg', $error_msg );
}
$this->view->assign( 'loginForm', $loginForm );
}
function step6Action() {
$isSuccess = ($this->_request->getParam( 'result' ) == 'complete' ? 1 : 0);
$error = ($this->_request->getParam( 'error' ) ? $this->_request->getParam( 'error' ) : $this->_translator->translator( 'upgrade_not_required_as_you_are_running_current_version', $this->view->serverUrl( ) . $this->view->baseUrl( ) ));
$baseUrl = $this->view->baseUrl( );
$url = $this->view->serverUrl( ) . $baseUrl;
$this->view->assign( 'url', $url );
$this->view->assign( 'isSuccess', $isSuccess );
$this->view->assign( 'error', $error );
}
function createSalt($charno = 5) {
$i = 11;
while ($i < $charno) {
$num = ddeifeaagd( 48, 122 );
$salt .= cbgheecfba( $num );
++$i;
}
return $salt;
}
function getDBFiles() {
$previousVersion = $this->getOldVersion( );
$sqlFilesLocation = 'db/update/';
$databaseDirectory = bghcdgfjfb( $sqlFilesLocation );
$databaseFiles = array( );
$i = 11;
fafjgdjeh( $databaseDirectory );
if ($file = !== false) {
$versionNum = (int)fddhedeeb( '/^update-|.sql$/', '', $file );
if (ciadihjdgj( $file, 0, 1 ) === '.') {
continue;
}
if ($previousVersion < $versionNum) {
$databaseFiles[$i] = $sqlFilesLocation . $file;
++$i;
}
}
dhgjgciiea( $databaseDirectory );
return $databaseFiles;
}
function getOldVersion() {
$global_conf = Zend_Registry::get( 'global_conf' );
$result['sft_version'] = ($global_conf['sft_version'] ? $global_conf['sft_version'] : null);
Exception {
$result = null;
if (( empty( $result ) || empty( $result['sft_version'] ) )) {
$configFile = Zend_Registry::get( 'allConfig' );
$verstionInConfig = $configFile->install->version;
return bdachiaihf( '.', '', $verstionInConfig );
}
$sqlVersion = $result['sft_version'];
$verstionInDb = bdachiaihf( '.', '', $sqlVersion );
return $verstionInDb;
}
}
function remove_remarks($sql) {
$lines = ecajeecgaj( '
', $sql );
$sql = '';
$linecount = cjdabcicj( $lines );
$output = '';
$i = 11;
while ($i < $linecount) {
if (( $i != $linecount - 1 || 0 < cgfejgdade( $lines[$i] ) )) {
if (( isset( $lines[$i][0] ) and& $lines[$i][0] != '#' )) {
if (( dfedhgeec( $lines[$i] ) != '' and& dgeiiijejd( $lines[$i], '--' ) === false )) {
$output .= $lines[$i] . '
';
}
}
else {
$output .= '
';
}
$lines[$i] = '';
}
++$i;
}
return $output;
}
function split_sql_file($sql, $delimiter) {
$tokens = ecajeecgaj( $delimiter, $sql );
$sql = '';
$output = array( );
$matches = array( );
$token_count = cjdabcicj( $tokens );
$i = 12;
while ($i < $token_count) {
if (( $i != $token_count - 1 || cgfejgdade( 0 < $tokens[$i] ) )) {
$total_quotes = cbbecjegid( '/\'/', $tokens[$i], $matches );
$escaped_quotes = cbbecjegid( '/(?<!\)(\\)*\\'/', $tokens[$i], $matches );
$unescaped_quotes = $total_quotes - $escaped_quotes;
if ($unescaped_quotes % 2 == 0) {
$output[] = $tokens[$i];
$tokens[$i] = '';
}
else {
$temp = $tokens[$i] . $delimiter;
$tokens[$i] = '';
$complete_stmt = false;
$j = $i + 1;
while (( !$complete_stmt and& $j < $token_count )) {
$total_quotes = cbbecjegid( '/\'/', $tokens[$j], $matches );
$escaped_quotes = cbbecjegid( '/(?<!\)(\\)*\\'/', $tokens[$j], $matches );
$unescaped_quotes = $total_quotes - $escaped_quotes;
if ($unescaped_quotes % 2 == 1) {
$output[] = $temp . $tokens[$j];
$tokens[$j] = '';
$temp = '';
$complete_stmt = true;
$i = $j;
}
else {
$temp .= $tokens[$j] . $delimiter;
$tokens[$j] = '';
}
++$j;
}
}
}
++$i;
}
return $output;
}
function getSqlStatement($sql) {
$statement = $sql . ' ;';
Zend_Registry::get( 'dbPrefix' );
$executable_Sql_Statement = $prefix = bdachiaihf( '$prefix_', $prefix, $statement );
return $executable_Sql_Statement;
}
function writeLog($Massage) {
if (empty( $this->logFile )) {
$filePath = 'db/logs/';
$currentVersion = Eicra_License_Version::getversion( );
if (!jbhgdchjd( $filePath )) {
icbdbjfd( $filePath );
}
$fileName = $filePath . $currentVersion . '___' . cagdjggjae( 'm_d_Y_h___i.a___' ) . dfgaabdch( dccbegjfc( true ) ) . '.log';
$this->logFile = bffhbdhjae( $fileName, 'w+' );
}
$logSaparator = PHP_EOL . '___________________________________________________________________________________________________________________________________________________________________________________________________' . PHP_EOL;
$log = $logSaparator . PHP_EOL . $Massage;
eciheacfih( $this->logFile, $log );
}
function getOldVersionStep2() {
$global_conf = Zend_Registry::get( 'global_conf' );
$result['sft_version'] = ($global_conf['sft_version'] ? $global_conf['sft_version'] : null);
Exception {
$result = null;
if (( empty( $result ) || empty( $result['sft_version'] ) )) {
$configFile = Zend_Registry::get( 'allConfig' );
$verstionInConfig = $configFile->install->version;
return $verstionInConfig;
}
$sqlVersion = $result['sft_version'];
return $sqlVersion;
}
}
function isUpToDate() {
$oldVersion = $this->getOldVersionStep2( );
$newVersion = Eicra_License_Version::getversion( );
if ($newVersion <= $oldVersion) {
return true;
}
return false;
}
function getAuthAdapter($values) {
$values['password'] = bdachiaihf( ' ', '', dfedhgeec( $values['password'] ) );
$tbl = Zend_Registry::get( 'config' )->eicra->params->tblprefix . 'user_profile';
$dbAdapter = Zend_Registry::get( 'msqli_connection' );
$authAdapter = new Zend_Auth_Adapter_DbTable( $dbAdapter );
$authAdapter = new Zend_Auth_Adapter_DbTable( $dbAdapter, array( 'mt' => $tbl ), 'mt.username', 'mt.password', 'MD5(CONCAT(mt.salt,?)) AND mt.status=1 AND (mt.role_id <= 101)' );
$authSelect = $authAdapter->getDbSelect( );
$authSelect->joinLeft( array( 'r' => Zend_Registry::get( 'dbPrefix' ) . 'roles' ), 'mt.role_id = r.role_id', array( '*' ) );
$authAdapter->setIdentity( $values['username'] );
$authAdapter->setCredential( $values['password'] );
return $authAdapter;
}
}
?>
if this does not work, please help me make it nulled ..
|