/** * default check if it is allowed to delete the OXID of the current table * * @param string $sId object id * * @throws Exception on no access * * @return null */ public function checkForDeletion($sId) { if (!isset($sId)) { throw new Exception("Missing ID!"); } // malladmin can do it if ($oUsr = oxUser::getAdminUser()) { if ($oUsr->oxuser__oxrights->value == "malladmin") { return; } } try { $this->getObjectForDeletion($sId); } catch (oxSystemComponentException $e) { if ($e->getMessage() == 'EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND') { $this->_directSqlCheckForDeletion($sId); } else { throw $e; } } }
/** * Init ERP Framework parameters * Creates Objects, checks Rights etc. * * @param mixed $sUserName user name * @param mixed $sPassword password * @param integer $iShopID shop ID * @param integer $iLanguage language ID * * @return boolean */ public function init($sUserName, $sPassword, $iShopID = 1, $iLanguage = 0) { $myConfig = oxConfig::getInstance(); $mySession = oxSession::getInstance(); $oUser = oxUser::getAdminUser(); if ($oUser->oxuser__oxrights->value == "malladmin" || $oUser->oxuser__oxrights->value == $myConfig->getShopID()) { $this->_sSID = $mySession->getId(); $this->_blInit = true; $this->_iLanguage = oxLang::getInstance()->getBaseLanguage(); $this->_sUserID = $oUser->getId(); //$mySession->freeze(); } else { //user does not have sufficient rights for shop throw new Exception(self::ERROR_USER_NO_RIGHTS); } $this->_resetIdx(); return $this->_blInit; }