/** * Event handler for registration attempts; rejects the registration * if email field is missing. * * @param RegisterAction $action * @return bool hook result code */ function onStartRegistrationTry($action) { $email = $action->trimmed('email'); if (empty($email)) { $action->showForm(_m('You must provide an email address to register.')); return false; } // Default form will run address format validation and reject if bad. return true; }
<?php require dirname(__FILE__) . '/init.inc.php'; global $_tpl; $_register = new RegisterAction($_tpl); $_register->_action(); $_tpl->display('register.tpl');
<?php require 'init.inc.php'; global $templates; $register = new RegisterAction('register.tpl'); $register->Action(); $templates->display('register.tpl');