private function HandlePost() { if (Request::PostData($this->triggerName)) { self::Guard()->Logout(); Response::Redirect($this->RedirectUrl()); } }
protected function OnSuccess() { File::CreateWithText($this->file, $this->Value('Contents', false)); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportLayoutAction($this->layout, Action::Update()); Response::Redirect($this->BackLink()); }
/** * Removes the template if necessary */ protected function BeforeInit() { if ($this->RemoveTemplate()) { Response::Redirect(Request::Uri()); return true; } parent::BeforeInit(); }
protected function BeforeInit() { if (!self::Guard()->Allow(BackendAction::Read(), $this)) { //TODO: message Response::Redirect(BackendRouter::ModuleUrl(new Overview())); return false; } return parent::BeforeInit(); }
protected function Init() { $this->navigation = new ContentNavigation(Request::GetData('navigation')); if (!$this->navigation->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new Overview())); return true; } $this->tree = new NavigationTreeProvider($this->navigation); $this->item = $this->tree->TopMost(); $this->hasItems = (bool) $this->item; return parent::Init(); }
/** * Initializes the list * @return boolean */ protected function Init() { $this->layout = new Layout(Request::GetData('layout')); if (!$this->layout->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new LayoutList())); return true; } $this->listProvider = new AreaListProvider($this->layout); $this->area = $this->listProvider->TopMost(); $this->hasAreas = (bool) $this->area; return parent::Init(); }
/** * Saves the group and redirects to the list */ protected function OnSuccess() { $action = $this->group->Exists() ? Action::Update() : Action::Create(); $this->group->SetName($this->Value('Name')); $this->group->SetCreateContainers((bool) $this->Value('CreateContainers')); $this->group->SetCreateLayouts((bool) $this->Value('CreateLayouts')); $this->group->SetCreateContainers((bool) $this->Value('CreateContainers')); $this->group->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportUserGroupAction($this->group, $action); $target = BackendRouter::ModuleUrl(new UsergroupList()); Response::Redirect($target); }
private function OnSuccess() { $member = $this->confirmer->GetMember(); $member->SetConfirmed(Date::Now()); if ($this->confirm->GetActivate()) { $member->SetActive(true); } $member->Save(); $this->AddGroups($member); if ($this->confirm->GetSuccessUrl()) { Response::Redirect(FrontendRouter::Url($this->confirm->GetSuccessUrl())); } }
protected function Init() { $this->site = new Site(Request::GetData('site')); $selectedID = Request::GetData('selected'); $this->selected = $selectedID ? Page::Schema()->ByID($selectedID) : null; if (!$this->site->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new SiteList())); return true; } $this->tree = new PageTreeProvider($this->site); $this->page = $this->tree->TopMost(); $this->hasPages = (bool) $this->page; return parent::Init(); }
/** * Saves the container */ protected function OnSuccess() { $action = Action::Update(); if (!$this->container->Exists()) { $action = Action::Create(); $this->container->SetUser(self::Guard()->GetUser()); } $this->container->SetName($this->Value('Name')); $this->container->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportContainerAction($this->container, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } Response::Redirect(BackendRouter::ModuleUrl(new ContainerList())); }
protected function AfterSave() { $params = array('navigation' => $this->navi->GetID()); Response::Redirect(BackendRouter::ModuleUrl(new NavigationTree(), $params)); }
/** * Saves the user */ protected function OnSuccess() { $action = $this->member->Exists() ? Action::Update() : Action::Create(); $this->member->SetName($this->Value('Name')); $this->member->SetEMail($this->Value('EMail')); $this->SetPassword(); $this->member->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportMemberAction($thos->member, $action); if ($this->groupsExist && $this->CanAssignGroup()) { $this->SaveGroups(); } Response::Redirect(BackendRouter::ModuleUrl(new MemberList())); }
/** * Saves the area */ protected function OnSuccess() { $action = $this->user->Exists() ? Action::Update() : Action::Create(); $this->user->SetName($this->Value('Name')); $this->user->SetEMail($this->Value('EMail')); $this->user->SetLanguage(new Language($this->Value('Language'))); if ($this->CanChangeIsAdmin()) { $this->user->SetIsAdmin((bool) $this->Value('IsAdmin')); } $this->SavePassword(); $this->user->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportUserAction($this->user, $action); Response::Redirect(BackendRouter::ModuleUrl(new UserList())); }
private function DoRedirect(ContentForm $contentForm) { $params = Request::GetArray(); Response::Redirect(BackendRouter::ModuleUrl($contentForm, $params)); }
protected function OnSuccess() { $postedGroupIDs = $this->PostedGroupIDs(); foreach ($this->currentGroups as $currentGroup) { if (!in_array($currentGroup->GetID(), $postedGroupIDs)) { $this->DeleteGroupAssignment($currentGroup); } } foreach ($postedGroupIDs as $postedGroupID) { if (!$this->HasGroup(new Usergroup($postedGroupID))) { $uug = new UserUsergroup(); $uug->SetUser($this->user); $uug->SetUserGroup(new Usergroup($postedGroupID)); $uug->Save(); } } Response::Redirect(BackendRouter::ModuleUrl(new UserList())); }
/** * Saves the template into the given file name */ protected function OnSuccess() { $newTemplate = $this->Value('Name'); $action = Action::Create(); if ($this->template) { $action = Action::Update(); $this->UpdateUsages($newTemplate); $oldFile = $this->CalcFile($this->template); if (File::Exists($oldFile)) { File::Delete($oldFile); } } $logger = new Logger(self::Guard()->GetUser()); $logger->ReportTemplateAction($this->module->MyType(), $newTemplate, $action); if (!Folder::Exists($this->folder)) { Folder::Create($this->folder); } File::CreateWithText($this->CalcFile($newTemplate), $this->Value('Contents', false)); Response::Redirect($this->BackLink()); }
/** * Called after all saving is performed */ protected function AfterSave() { Response::Redirect($this->BackLink()); }
/** * Saves the group */ protected function OnSuccess() { $this->group->SetName($this->Value('Name')); $this->group->Save(); Response::Redirect(BackendRouter::ModuleUrl(new MembergroupList())); }
/** * Saves the settings */ protected function OnSuccess() { $this->settings->SetLogLifetime((int) $this->Value('LogLifetime')); $this->settings->SetMailFromEMail($this->Value('MailFromEMail')); $this->settings->SetMailFromName($this->Value('MailFromName')); $this->settings->SetSmtpHost($this->Value('SmtpHost')); $this->settings->SetSmtpPort($this->Value('SmtpPort')); $this->settings->SetSmtpUser($this->Value('SmtpUser')); $this->settings->SetSmtpPassword($this->Value('SmtpPassword')); $this->settings->SetSmtpSecurity($this->Value('SmtpSecurity')); Response::Redirect($this->BackLink()); }
protected function OnSuccess() { $this->DeleteUnselected(); $bundles = $this->Bundles(); foreach ($bundles as $bundle) { if ($this->Value($bundle)) { $this->SaveLock($bundle); continue; } $modules = $this->Modules($bundle); foreach ($modules as $module) { if ($this->Value($this->FieldName($bundle, $module))) { $this->SaveLock($bundle, $module); } } } Response::Redirect(BackendRouter::ModuleUrl(new UsergroupList())); }
/** * Can be used to add logic after deletion in using classes; * by default, it redirects to the current url */ protected function AfterRemove() { Response::Redirect(Request::Uri()); return true; }
/** * Saves the layout */ protected function OnSuccess() { $action = Action::Update(); $isNew = !$this->layout->Exists(); if ($isNew) { $action = Action::Create(); $this->layout->SetUser(self::Guard()->GetUser()); } $oldFile = $isNew ? '' : PathUtil::LayoutTemplate($this->layout); $this->layout->SetName($this->Value('Name')); $this->layout->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportLayoutAction($this->layout, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } if ($isNew) { $this->SaveAreas(); } $this->UpdateFiles($oldFile); $args = array('layout' => $this->layout->GetID()); Response::Redirect(BackendRouter::ModuleUrl(new AreaList(), $args)); }
/** * Saves the page */ protected function OnSuccess() { $this->page->SetName($this->Value('Name')); $this->page->SetUrl($this->Value('Url')); $this->page->SetSite($this->site); $this->page->SetTitle($this->Value('Title')); $this->page->SetDescription($this->Value('Description')); $this->page->SetKeywords($this->Value('Keywords')); $this->page->SetLayout(new Layout($this->Value('Layout'))); $this->page->SetMenuAccess($this->Value('MenuAccess')); $this->page->SetGuestsOnly((bool) $this->Value('GuestsOnly')); $this->page->SetPublish((bool) $this->Value('Publish')); $this->page->SetPublishFrom($this->PublishDate('PublishFrom')); $this->page->SetPublishTo($this->PublishDate('PublishTo')); $relevance = (double) $this->Value('SitemapRelevance') / 10; $this->page->SetSitemapRelevance(min(max(0.0, $relevance), 1.0)); $this->page->SetSitemapChangeFrequency($this->Value('SitemapChangeFrequency')); $this->SaveType(); $action = Action::Update(); if (!$this->page->Exists()) { $action = Action::Create(); $this->SaveNew(); } else { $this->page->Save(); } $logger = new Logger(self::Guard()->GetUser()); $logger->ReportPageAction($this->page, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } $this->SaveMemberGroups(); $this->AdjustHtaccess(); Response::Redirect($this->BackLink()); }
/** * Saves the site */ protected function OnSuccess() { $action = Action::Update(); if (!$this->site->Exists()) { $action = Action::Create(); $this->site->SetUser(self::Guard()->GetUser()); } $this->site->SetName($this->Value('Name')); $this->site->SetUrl($this->Value('Url')); $this->site->SetLanguage(Language::Schema()->ByID($this->Value('Language'))); $this->site->SetSitemapActive((bool) $this->Value('SitemapActive')); $this->site->SetSitemapCacheLifetime((int) $this->Value('SitemapCacheLifetime')); $this->site->Save(); $logger = new Logger(self::Guard()->GetUser()); $logger->ReportSiteAction($this->site, $action); if ($this->CanAssignGroup()) { $this->SaveRights(); } Response::Redirect(BackendRouter::ModuleUrl(new SiteList())); }
protected function OnSuccess() { $this->member = new Member(); $this->member->SetEMail($this->Value('EMail')); $this->member->SetName($this->Value('Name')); $password = $this->Value('Password'); $salt = String::Start(md5(uniqid(microtime())), 8); $pwHash = hash('sha256', $password . $salt); $this->member->SetPassword($pwHash); $this->member->SetPasswordSalt($salt); $this->member->SetCreated(Date::Now()); $this->member->Save(); $this->SendConfirmMail(); if ($this->register->GetNextUrl()) { Response::Redirect(FrontendRouter::Url($this->register->GetNextUrl())); } }
protected function OnSuccess() { if (self::Guard()->Accessor()->IsUndefined()) { self::Guard()->Login(array('Name' => $this->Value('Name'), 'Password' => $this->Value('Password'))); } $nextUrl = $this->NextUrl(); if ($nextUrl) { Response::Redirect($nextUrl); } }
/** * Redirects to the next step */ function GotoNext() { $next = Page::NextStep($this->Step()); Response::Redirect(Path::AddExtension($next, 'php')); }
private function Redirect() { $args = array('navigation' => $this->navi->GetID()); Response::Redirect(BackendRouter::ModuleUrl(new NavigationTree(), $args)); }