Exemplo n.º 1
0
 /**
  * Create an admin account. Will prompt for email address and password.
  */
 public function executeCreateAdmin()
 {
     do {
         if (!empty($email_input)) {
             $this->out('That is not a valid email.');
         }
         $email_input = $this->readline('Email: ');
     } while (!($email = Scrub::email($email_input)));
     do {
         $password = $this->readline('Password: '******'success']) {
         $user = UserModel::loadById($res['data']);
         $user->setType(UserModel::TYPE_ADMIN);
     } else {
         $this->out('Failed to create user.');
     }
 }