mirror of
https://github.com/processwire/processwire.git
synced 2025-09-01 18:53:06 +02:00
Improve phpdoc for /api/ref/ of ProcessLogin module
This commit is contained in:
@@ -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 = "<p><a href='./?logout=$user->name'>Logout</a></p>";
|
||||
* }
|
||||
*
|
||||
* // render errors, warnings and messages
|
||||
* foreach($notices as $notice) {
|
||||
* $text = $sanitizer->entities($notice->text);
|
||||
* echo "<p class='$notice->className'>$text</p>";
|
||||
* }
|
||||
*
|
||||
* // 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).
|
||||
|
Reference in New Issue
Block a user