function uncopyHackedFiles() { $filestoreplace = XiptHelperInstall::_getJSPTFileList(); if ($filestoreplace) { foreach ($filestoreplace as $sourceFile => $targetFile) { $targetFileBackup = $targetFile . '.jxibak'; // delete this file // Only delete if you have backup copy if (JFile::exists($targetFile) && JFile::exists($targetFileBackup)) { JFile::delete($targetFile); JFile::move($targetFileBackup, $targetFile) || XiptError::raiseError('XIPT-UNINSTALL-ERROR', 'Not able to restore backup : ' . __LINE__); } } } // TODO : also remove previous profiletypes and template library fields files }
function com_install() { // if(XiptHelperInstall::check_version() == false) // JError::raiseWarning('INSTERR', "XIPT Only support Jomsocial 1.8 or greater releases"); XiptHelperInstall::ensureXiptVersion(); if (XiptHelperInstall::setup_database() == false) { JError::raiseError('INSTERR', "Not able to setup JSPT database correctly"); } /* When you have old JSPT version * then apply migration on 'avatar' coloumn of 'xipt_profiletype' table */ XiptHelperInstall::changeDefaultAvatar(); if (XiptHelperInstall::copyAECfiles() == false) { JError::raiseError('INSTERR', "Not able to replace MI files, Check permissions."); } if (XiptHelperInstall::installExtensions() == false) { JError::raiseError('INSTERR', "NOT ABLE TO INSTALL EXTENSIONS"); return false; } XiptHelperInstall::show_instruction(); XiptHelperInstall::updateXiptVersion(); return true; }