[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/people/controller/ -> PhabricatorPeopleWelcomeController.php (source)

   1  <?php
   2  
   3  final class PhabricatorPeopleWelcomeController
   4    extends PhabricatorPeopleController {
   5  
   6    private $id;
   7  
   8    public function willProcessRequest(array $data) {
   9      $this->id = $data['id'];
  10    }
  11  
  12    public function processRequest() {
  13      $request = $this->getRequest();
  14      $admin = $request->getUser();
  15  
  16      $user = id(new PhabricatorPeopleQuery())
  17        ->setViewer($admin)
  18        ->withIDs(array($this->id))
  19        ->executeOne();
  20      if (!$user) {
  21        return new Aphront404Response();
  22      }
  23  
  24      $profile_uri = '/p/'.$user->getUsername().'/';
  25  
  26      if ($request->isFormPost()) {
  27        $user->sendWelcomeEmail($admin);
  28        return id(new AphrontRedirectResponse())->setURI($profile_uri);
  29      }
  30  
  31      return $this->newDialog()
  32        ->setTitle(pht('Send Welcome Email'))
  33        ->appendParagraph(
  34          pht(
  35            'This will send the user another copy of the "Welcome to '.
  36            'Phabricator" email that users normally receive when their '.
  37            'accounts are created.'))
  38        ->appendParagraph(
  39          pht(
  40            'The email contains a link to log in to their account. Sending '.
  41            'another copy of the email can be useful if the original was lost '.
  42            'or never sent.'))
  43        ->appendParagraph(
  44          pht(
  45            'The email will identify you as the sender.'))
  46        ->addSubmitButton(pht('Send Email'))
  47        ->addCancelButton($profile_uri);
  48    }
  49  
  50  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1