private static function deleteOldActivations(Module_Register $module) { $cut = time() - $module->getActivationThreshold(); self::log('Deleting user activations older than ' . GWF_Time::displayTimestamp($cut)); $table = new GWF_UserActivation(false); $result = $table->deleteWhere("timestamp<{$cut}"); if (0 < ($nDeleted = $table->affectedRows($result))) { self::log(sprintf('Deleted %d old user activations.', $nDeleted)); } }
private static function onActivated(Module_Register $module, GWF_User $user) { if (false === GWF_Hook::call(GWF_Hook::ACTIVATE, $user, array(true))) { return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__)); } if ($module->wantAutoLogin()) { if (false === GWF_Session::onLogin($user)) { return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__)); } GWF_Website::redirect(GWF_WEB_ROOT . 'welcome'); } else { return $module->message('msg_activated'); } }