Exemplo n.º 1
0
 public function activatePendingConfirmationUser($confirmationCode)
 {
     /* @var User $userModel */
     $userModel = $this->userModel;
     if (!($userData = $this->getPendingConfirmationData()) || !($uid = fnGet($userData, $this->uidKey)) || $confirmationCode != fnGet($userData, 'confirmation_code') || $userModel::findFirstSimple([$this->uidKey => $uid])) {
         return false;
     }
     /* @var User $user */
     $user = new $this->userModel();
     $user->setData($userData)->setData('confirmed', true);
     if (!$user->save()) {
         Log::error('User activation failed on save: ' . var_export($user->getStringMessages(), true));
         return false;
     }
     $this->removePendingConfirmationData();
     $this->setUserAsLoggedIn($user);
     return $user;
 }
Exemplo n.º 2
0
 public function stop($instance = 'current')
 {
     parent::stop($instance);
     if ($serviceInfo = $this->getServiceInfo($instance)) {
         list(, , $port) = array_values($serviceInfo);
         $this->showStatus($port, false, $error);
         $retry = 10;
         while (!$error) {
             usleep(100000.0);
             $this->showStatus($port, false, $error);
             --$retry;
         }
         $error or Log::error('Unable to stop instance: ' . $instance);
     }
 }