From 9b1fa290f1df30052a5fb738f32eaefc1bd91579 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 29 Aug 2025 17:30:15 -0400 Subject: [PATCH] Improve phpdoc for /api/ref/ of ProcessLogin module --- .../Process/ProcessLogin/ProcessLogin.module | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/wire/modules/Process/ProcessLogin/ProcessLogin.module b/wire/modules/Process/ProcessLogin/ProcessLogin.module index a58fcc97..3a078d96 100644 --- a/wire/modules/Process/ProcessLogin/ProcessLogin.module +++ b/wire/modules/Process/ProcessLogin/ProcessLogin.module @@ -3,14 +3,37 @@ /** * ProcessWire Login Process * - * Provides Login capability for ProcessWire Admin + * #pw-summary Provides Login capability for ProcessWire * - * For more details about how Process modules work, please see: - * /wire/core/Process.php - * - * ProcessWire 3.x, Copyright 2023 by Ryan Cramer + * ProcessWire 3.x, Copyright 2025 by Ryan Cramer * https://processwire.com * + * #pw-body = + * Example of simple front-end login, logged-in, and logout flow: + * ~~~~~~~ + * $login = $modules->get('ProcessLogin'); + * $login->allowEmail = 0; // 0=login w/username, 1=login w/email, 2=either + * + * if(!$user->isLoggedin()) { + * $out = $login->execute(); + * } else if($input->get('logout') === $user->name) { + * $out = $login->executeLogout(); + * } else { + * $login->message("Welcome $user->name you are logged in"); + * $out = "

Logout

"; + * } + * + * // render errors, warnings and messages + * foreach($notices as $notice) { + * $text = $sanitizer->entities($notice->text); + * echo "

$text

"; + * } + * + * // output markup for login form, etc. + * echo $out; + * ~~~~~~~ + * #pw-body + * * @property bool $allowForgot Whether the ProcessForgotPassword module is installed. * @property bool|int $allowEmail Whether or not email login is allowed (0|false=off, 1|true=Yes, 2=Yes or name also allowed) * @property string $emailField Field name used for email login (when enabled).