Add hook before create user

This commit is contained in:
Marco Antonio Nina
2013-03-20 13:31:32 -04:00
parent e380b8b272
commit e577dac1a2
2 changed files with 9 additions and 6 deletions

View File

@@ -193,12 +193,14 @@ class RbacUsers extends BaseRbacUsers
public function create($aData) public function create($aData)
{ {
$pluginRegistry = & PMPluginRegistry::getSingleton(); if (class_exists('PMPluginRegistry')) {
if ($pluginRegistry->existsTrigger(PM_BEFORE_CREATE_USER)) { $pluginRegistry = & PMPluginRegistry::getSingleton();
try { if ($pluginRegistry->existsTrigger(PM_BEFORE_CREATE_USER)) {
$pluginRegistry->executeTriggers(PM_BEFORE_CREATE_USER); try {
} catch(Exception $error) { $pluginRegistry->executeTriggers(PM_BEFORE_CREATE_USER);
throw new Exception($error->getMessage()); } catch(Exception $error) {
throw new Exception($error->getMessage());
}
} }
} }
$oConnection = Propel::getConnection(RbacUsersPeer::DATABASE_NAME); $oConnection = Propel::getConnection(RbacUsersPeer::DATABASE_NAME);

View File

@@ -68,6 +68,7 @@ foreach ($_POST['aUsers'] as $sUser) {
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => $oError->getMessage()) ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => $oError->getMessage()) );
G::RenderPage("publish", "blank"); G::RenderPage("publish", "blank");
die();
} }
$aData['USR_STATUS'] = 'ACTIVE'; $aData['USR_STATUS'] = 'ACTIVE';
$aData['USR_UID'] = $sUserUID; $aData['USR_UID'] = $sUserUID;