use scenarios; # main logic if ($app->getObject('user')->hasRight('admin.coses.edit')) { ... } # protocol-specific output code my $phoneNumber = $session->getAttribute('contact', 'sms')->data; # generating a profile page my $homepage = $session->getAttribute('personal', 'homePage')->data; # finding if they want a particular notification my $notification = $session->getAttribute('settings', 'notification'); if ($notification->want($app, $bug)) { ... } # changing (contact type) address # on request: # store in the database the contact name, new address, and a password my $field = $user->getAttribute('contact', $fieldName); my $password = $app->getService('service.passwordGenerator'); my $session = $user->prepareAddressChange($field, $newAddress, $password); # send a message to the new address with the password $app->output($field->protocol, $session)->changeOfAddress($user, $password); # on receipt: # check the password if ($user->doAddressChange($password)) { } # getting a representative hash for generic output $self->output('my.string', {'myData' => $myData, 'user' => $user->hash}); # creating the user object from the input validator $app->addObject($app->getService('user.factory')->getUserByCredentials($input->username, $input->password)); # creating a user to find out his details my $user = $app->getService('user.factory')->getUserByID($userID);