From 278baba292ef17f19c1fd36579fdc603b2ba625e Mon Sep 17 00:00:00 2001 From: dougplant Date: Sat, 31 Mar 2018 22:52:11 -0700 Subject: [PATCH] change use of 'admin' to the setting value for the privileged user, also added some error trapping --- modules/contentclass/index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/contentclass/index.php b/modules/contentclass/index.php index e225245..2fa5964 100755 --- a/modules/contentclass/index.php +++ b/modules/contentclass/index.php @@ -268,7 +268,12 @@ private function removeFromGroup( $classIdentifier, $groupIdentifier ) //-------------------------------------------------------------------------- private function createClass( $displayName, $classIdentifier, $groupIdentifier, $groupId ) { - $adminUserObject = eZUser::fetchByName( "admin" ); + $adminUserObject = eZUser::fetch( eepSetting::PrivilegedAccountId ); + if( null === $adminUserObject ) + { + throw new Exception( "eepSetting::PrivilegedAccountId value of " . $eepSetting::PrivilegedAccountId . " is invalid. Exiting." ); + exit( 1 ); + } $adminUserObject->loginCurrent(); $adminUserId = $adminUserObject->attribute( 'contentobject_id' ); $language = eZContentLanguage::topPriorityLanguage();