Jump to content

Andudi

Members
  • Posts

    4
  • Joined

  • Last visited

Andudi's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. dear devs I try to add some pages to the admin path, e.g. at "/processwire/subadmin/" for some subadmin stuff. I do not give this page a process to keep it simple, but I want to use my own template like "subadmin" that I can control the access with a role for some users. The problem now is that "/processwire/subadmin/" is automatically replaced from the LanguageSupportPageNames module with "/de/processwire/subadmin/" (de is my default language) and this is not what I wanted. Digging the modules code, I found in the file: pw2.6.21/wire/modules/LanguageSupport/LanguageSupportPageNames.module on line 226 why this path replacement is normally skipped for admin pages: if($page->template == 'admin') return ''; My proposition is now to add the following line after the $conifg definition at line 230: if ($page->rootParent->path == $config->urls->admin) return ''; Then, the replacement is only done for normal pages and not for pages under the admin path... what do you think about that? or, how could I fix this with a simple module/hook trick? And yes, when I use just no language string for the default language it works as well, but I hope to find an even better solution... thanks for your help!
  2. hm, seems not to be that simple... and I think to extend ProcessLogin and call the setLoginURL method is not the right way to do it... Next I tried to hook the ___execute() method of ProcessLogin and call setLoginURL there... works but then I have no information about the user and I failed to create a filter. Now my solution is to hook ___loginSuccess($user) of the Session class... now I have access to the user and can use $session->redirect depending of the users settings (defined with an additional field at the user page). For me this topic can be closed. But I think since I found a bunch of forum questions about that (since I do not want to rewrite the login page, they do not really help me) that it could be explained somewhere how this is meant by the devs. thank you for your great work, since PW is much more intuitive than any other CMS I tried! Andreas
  3. thank you for your answer LostKobrakai my idea was too simple tough... but yes, now I got it: the process field in the edit page of /admin/login... setting to my new class (ProcessLoginRedirect) overwrites the one of the core module (ProcessLogin)... ... and it works fine now... but only for the admin user! If I login as normal user I get the following Error in the header: TemplateFile: You don't have permission any good idea wher I should digg? thanks in advance. Andreas
  4. dear all I try to implement another kind of login/logout redirection in a module. I have found some concerning methodes in ProcessLogin that I try to call in the init() methode of my module: class ProcessLoginRedirect extends ProcessLogin { public static function getModuleInfo() { return array( 'title' => 'Login Redirect', 'version' => 1, 'summary' => 'Define constant redirect page for login and logout process.', 'autoload' => true ); } public function init() { parent::init(); // required $this->setLoginURL('/'); $this->setLogoutURL('/'); } } for testing, I try to redirect to the homepages frontend ('/'), but this does not work at all... I suppose, that this code is not called at all... what do I wrong? what could I do for debugging? thanks for help
×
×
  • Create New...