Creating a complete login workflow
<?php
namespace CherrycakeApp\LoginGuide;
class LoginGuide extends \Cherrycake\Module {
protected $dependentCoreModules = [
"HtmlDocument",
"Login"
];
}<?php
namespace CherrycakeApp\LoguinGuide;
class LoginGuide extends \Cherrycake\Module {
protected $dependentCoreModules = [
"HtmlDocument",
"Login"
];
public static function mapActions() {
global $e;
$e->Actions->mapAction(
"loginGuideHome",
new \Cherrycake\Actions\ActionHtml([
"moduleType" => \Cherrycake\ACTION_MODULE_TYPE_APP,
"moduleName" => "LoginGuide",
"methodName" => "home",
"request" => new \Cherrycake\Actions\Request([
"pathComponents" => [
new \Cherrycake\Actions\RequestPathComponent([
"type" => \Cherrycake\REQUEST_PATH_COMPONENT_TYPE_FIXED,
"string" => "login-guide"
])
]
])
])
);
}
function home() {
global $e;
$e->Output->setResponse(new \Cherrycake\Actions\ResponseTextHtml([
"code" => \Cherrycake\RESPONSE_OK,
"payload" =>
$e->HtmlDocument->header().
($e->Login->isLogged() ?
"You are logged in"
:
"You are not logged in"
).
$e->HtmlDocument->footer()
]));
}
}

Adding a logout button
Encrypting user passwords
Last updated