コード例 #1
0
ファイル: Logout.php プロジェクト: agentmedia/phine-builtin
 private function HandlePost()
 {
     if (Request::PostData($this->triggerName)) {
         self::Guard()->Logout();
         Response::Redirect($this->RedirectUrl());
     }
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 /**
  * Removes the template if necessary
  */
 protected function BeforeInit()
 {
     if ($this->RemoveTemplate()) {
         Response::Redirect(Request::Uri());
         return true;
     }
     parent::BeforeInit();
 }
コード例 #4
0
 protected function BeforeInit()
 {
     if (!self::Guard()->Allow(BackendAction::Read(), $this)) {
         //TODO: message
         Response::Redirect(BackendRouter::ModuleUrl(new Overview()));
         return false;
     }
     return parent::BeforeInit();
 }
コード例 #5
0
 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();
 }
コード例 #6
0
ファイル: AreaList.php プロジェクト: agentmedia/phine-core
 /**
  * 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();
 }
コード例 #7
0
 /**
  * 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);
 }
コード例 #8
0
 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()));
     }
 }
コード例 #9
0
ファイル: PageTree.php プロジェクト: agentmedia/phine-core
 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();
 }
コード例 #10
0
 /**
  * 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()));
 }
コード例 #11
0
 protected function AfterSave()
 {
     $params = array('navigation' => $this->navi->GetID());
     Response::Redirect(BackendRouter::ModuleUrl(new NavigationTree(), $params));
 }
コード例 #12
0
ファイル: MemberForm.php プロジェクト: agentmedia/phine-core
 /**
  * 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()));
 }
コード例 #13
0
ファイル: UserForm.php プロジェクト: agentmedia/phine-core
 /**
  * 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()));
 }
コード例 #14
0
ファイル: ModuleForm.php プロジェクト: agentmedia/phine-core
 private function DoRedirect(ContentForm $contentForm)
 {
     $params = Request::GetArray();
     Response::Redirect(BackendRouter::ModuleUrl($contentForm, $params));
 }
コード例 #15
0
 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()));
 }
コード例 #16
0
 /**
  * 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());
 }
コード例 #17
0
ファイル: ContentForm.php プロジェクト: agentmedia/phine-core
 /**
  * Called after all saving is performed
  */
 protected function AfterSave()
 {
     Response::Redirect($this->BackLink());
 }
コード例 #18
0
 /**
  * Saves the group
  */
 protected function OnSuccess()
 {
     $this->group->SetName($this->Value('Name'));
     $this->group->Save();
     Response::Redirect(BackendRouter::ModuleUrl(new MembergroupList()));
 }
コード例 #19
0
 /**
  * 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());
 }
コード例 #20
0
 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()));
 }
コード例 #21
0
 /**
  * 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;
 }
コード例 #22
0
ファイル: LayoutForm.php プロジェクト: agentmedia/phine-core
 /**
  * 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));
 }
コード例 #23
0
ファイル: PageForm.php プロジェクト: agentmedia/phine-core
 /**
  * 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());
 }
コード例 #24
0
ファイル: SiteForm.php プロジェクト: agentmedia/phine-core
 /**
  * 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()));
 }
コード例 #25
0
 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()));
     }
 }
コード例 #26
0
ファイル: Login.php プロジェクト: agentmedia/phine-builtin
 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);
     }
 }
コード例 #27
0
ファイル: Content.php プロジェクト: agentmedia/phine-core
 /**
  * Redirects to the next step
  */
 function GotoNext()
 {
     $next = Page::NextStep($this->Step());
     Response::Redirect(Path::AddExtension($next, 'php'));
 }
コード例 #28
0
 private function Redirect()
 {
     $args = array('navigation' => $this->navi->GetID());
     Response::Redirect(BackendRouter::ModuleUrl(new NavigationTree(), $args));
 }