Пример #1
0
 public function run()
 {
     $this->action = $this->http->router->get('action');
     $this->alias = $this->http->router->get('alias');
     $this->view->addView('theme/post-edit.html');
     if ($this->action === 'delete' && $this->alias) {
         $controller = new Command(new Posts());
         $controller->findOneBy(['alias' => $this->alias])->remove();
         Server::headerLocation($this->url('admin-post-list', ['action' => 'view']));
     }
 }
Пример #2
0
 public function run()
 {
     Server::setReferData(['form' => 'remind']);
     if ($this->registry->get('user')->isUserLoggedIn()) {
         Server::headerLocationReferer();
     }
     $controller = new Command(new Users());
     $controller->findOneBy(['email' => $this->http->request->get('userEmail')]);
     if ($controller->entity() === null) {
         // If email not exists
         Server::setReferData(['error' => ['findEmail' => 1]]);
         Server::headerLocationReferer();
     } else {
         $this->setRandomPasword();
         $this->updatePassword($controller);
         $this->sendMail($controller);
         Server::setReferData(['remindSuccess' => 1]);
         Server::headerLocationReferer();
     }
 }