View Liferay Groovy output file
#############
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.dao.orm.*;
final def SCRIPT_ID = "MYSCRIPT"
outputFile = new File("""${System.getProperty("liferay.home")}/logs/out-${SCRIPT_ID}.txt""")
out.println(outputFile.text)
View JournalFolderTree.groovy
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portlet.journal.service.*;
import com.liferay.journal.service.impl.*;
import com.liferay.journal.service.*;
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.dao.orm.*;
final def SCRIPT_ID = "MYSCRIPT1"
outputFile = new File("""${System.getProperty("liferay.home")}/scripting/out-${SCRIPT_ID}.txt""")
View .groovy
import java.util.ArrayList
import java.util.Iterator
import java.util.List
import java.util.ListIterator
import com.liferay.portal.service.ResourcePermissionLocalServiceUtil
import com.liferay.portal.service.RoleLocalServiceUtil
import com.liferay.portal.model.ResourceConstants
import com.liferay.portal.model.ResourcePermission
import com.liferay.portal.model.Role
View Liferay Groovy update Agreed To Terms Of Use
//import com.liferay.portal.service.ServiceContext;
//import com.liferay.portal.util.*;
//import com.liferay.portal.service.*;
//import com.liferay.portal.service.impl.*;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.util.*;
import com.liferay.portal.kernel.service.*;
import com.liferay.portal.kernel.service.impl.*;
View regex
<INTERN_NUMMER>(.*)</INTERN_NUMMER>\n^(.*)<ACHTERNAAM>Diwali</ACHTERNAAM>\n^(.*)<VOORNAAM>Sunder</VOORNAAM>\n^(.*)<GESLACHT>V</GESLACHT>\n^(.*)<TAAL>NL</TAAL>\n^(.*)<EMAIL>(.*)</EMAIL>
<INTERN_NUMMER>\1</INTERN_NUMMER>\n\2<ACHTERNAAM>Diwali</ACHTERNAAM>\n\3<VOORNAAM>Sunder</VOORNAAM>\n\4<GESLACHT>V</GESLACHT>\n\5<TAAL>NL</TAAL>\n\6<EMAIL>\1@hema.whatever</EMAIL>
View Liferay Remove and add UserGroup.grv
import com.liferay.portal.service.*;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.util.*;
try{
serviceContext = new com.liferay.portal.service.ServiceContext()
long companyId = PortalUtil.getDefaultCompanyId()
employee = com.liferay.portal.service.UserGroupLocalServiceUtil.getUserGroup(companyId,"EMPLOYEE");
fired = com.liferay.portal.service.UserGroupLocalServiceUtil.getUserGroup(companyId,"FIRED_EMPLOYEE");
View vulnerability.js
alert('Hi there this is not wat you want at all');
window.location='https://www.hackthissite.org/';
View updatePasswordReset.groovy
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.*;
import com.liferay.portal.service.*;
import com.liferay.portal.service.impl.*;
try {
companyId = companyId = PortalUtil.getDefaultCompanyId();
sc = new com.liferay.portal.service.ServiceContext()
users = UserServiceUtil.getCompanyUsers(companyId, -1,-1 )
println(users.size())
View LiferayReindexSpecificUser.groovy
import com.liferay.portal.kernel.search.IndexerRegistryUtil;
import com.liferay.portal.kernel.search.Indexer
import com.liferay.portal.model.User
import com.liferay.portal.util.*;
import com.liferay.portal.service.*
import com.liferay.portal.service.ServiceContext;
try {
long companyId = PortalUtil.getDefaultCompanyId();
User user = UserLocalServiceUtil.getUserByScreenName(companyId, "sasupport" );