Jump to content

Lars282

Members
  • Posts

    144
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    London, UK; Frankfurt, Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lars282's Achievements

Sr. Member

Sr. Member (5/6)

24

Reputation

  1. Thanks, rick. It seems I only had to update the config with the new DB details. Anything I could have missed in the htaccess? Saw this part, but did not need to change anything: RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] # ----------------------------------------------------------------------------------------------- # 500 NOTE: If using VirtualDocumentRoot: comment out the one above and use this one instead. # ----------------------------------------------------------------------------------------------- # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA]
  2. Hi all, We currently have two websites (domain1.com and domain2.com) running on PW with 2 separate hosting accounts. As domain2.com is no longer regularly used (but should be kept online for reference), the plan is to move it as an add-on domain to the hosting of domain1.com (domain2.com will stay in used, but use a subfolder of domain1.com). After setting up the add-on domain, can I just migrate the files of domain2.com (old PW 2.4) into the subfolder of domain1.com, and copy over the database? Or do I need to take extra steps to make sure that the two instances of PW do not interfere, e.g. in the config files? Thanks a lot for your help and Best Lars
  3. Hi. For some reason, without doing any changes on my part to the PW install over the last 2 years, the image extra field that I had set up disappeard just now from the edit page: I have setup the image field with a custom text input as follows: But I do not see this with the image when editing a page: In the database, the field is available and filled for all "old" pages that were created a while back: [Note: I have just now, after the issue occured, manually changed the default in the table from None to "" as it otherwise would not have allowed me to upload any new images] Did anyone encounter this before? How do I get the field back to show when editing pages? Any help would be highly appreciated! Best Lars
  4. I haven’t touched the install at all ... Where do you see this? Is there a (temporary) „quick fix“ that you can see? Change this column to optional? Change the database column to accept null values and put default to null? Will also move this to the image extra spaces. Thanks a lot for your help, highly appreciated!
  5. Hi. I am suddenly receiving an error on a production site that has worked perfectly over the past years. When uploading an image to a field called article_images, I receive the following error: I had set up this field to accept an additional value for "Credits" with each image: This is also reflected in the database: I have not made any changes to the setup/settings in the past years. Does anyone have an idea on where this could be coming from now and how to fix it? Any help would be highly appreciated! Lars
  6. Thanks! Seems to be the issue that render check if the page is viewable, as when the page is in any other status, the code works fine. Still surprised that this returns a 500 internal server error. If $page->render checks if the page is viewable, is there any other way to display an unpublished page? Publishing and keeping the page hidden might work, but will involve additional steps of hiding / unhiding the page ...
  7. Hi, I am trying to give my editors the option to share unpublished pages with externals for review, without moving or copying the actual page in the admin. I have now created a draft template, that has one field (a page). Whenever the draft template is accessed, it should render the page selected in that field. This works fine as long as I am logged in. When I am not logged in, the $page->render() on the unpublished pages leads to 500 internal server error. Any idea why? Below the code I am using. Can I use $page->render() on unpublished pages? Thanks! Lars <?php if($page->draft_article) { //draft_article is the field where I select the article to be shown $out = $page->draft_article->render(); //when the page selected in draft_article is unpublished, guests get a 500 error with this line echo $out; } else { echo 'No article selected.'; } ?>
  8. So I have created a small module to do this. In addition to preventing users from logging in, I also want to log out everyone, but cannot get this to work - does anyone have an idea why it does not log users out with the code below? Preventing login works fine. Am I hooking wrong? Thanks! <?php /** * */ class SessionLoginDisable extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Session Login Disable', 'version' => 001, 'summary' => 'Provides option to disable login for all users except superusers.', 'author' => 'Lars Bergemann', 'autoload' => TRUE, 'singular' => TRUE ); } public function init() { $this->addHookBefore('Session::allowLogin', $this, 'allowLogin'); $this->addHookAfter('Session::isValidSession', $this, 'isValidSession'); //no effect currently $this->addHookBefore('ProcessLogin::execute', $this, 'disableLoginNotice'); } public function allowLogin($event) { $name = $event->arguments[0]; $user = strlen($name) ? $this->wire('users')->get("name=$name") : null; if(count($this->disable) > 0 && $user && $user->id && !$user->isSuperuser()) { $event->replace = true; return false; } return null; } public function isValidSession($event) { if ($event->return) { $userID = $event->arguments[0]; $user = wire('users')->get($userID); if (count($this->disable) > 0 && $user && $user->id && !$user->isSuperuser()) { $event->return = false; } } } public function disableLoginNotice($event) { $this->error("Login currently disabled."); return null; } }
  9. The maintenance mode module handles this on a per role basis so far more than what I would need. I'll use the hack for now and might make a small module for the future.
  10. Hi all, Is there a way to easily lock out all from login into the admin except superusers? I could not find anything on this issue. I could write a small module, but I am sure that i am not the first person that needs this? We have a larger site with multiple users maintaining content. I want to copy the entire site to a staging server, make some changes (setup of fields), test them, and copy the site back to production. I want to temporarily lock all users out so that the content does not change on production system between the copies. Or is there a better way to do this? Thanks Lars
  11. For the PageTable field, when allowing lots of templates, I think there should be some space between the rows of buttons. See for example:
  12. disallowedContent: *[*]{*} is what I would use. Does that make sense?
  13. Maybe I just don't get it ... but following this logic, how do I strip all style attributes from all tags? Would *[*]{*} work? Edit: seems to work - or do you see any issues with this?
  14. I have tried adding disallowedContent: *[style] to the Custom Config Options with ACF on, but it throws a JSON validation error. Where am I wrong?
×
×
  • Create New...