Jump to content

berechar

Members
  • Posts

    28
  • Joined

  • Last visited

berechar's Achievements

Jr. Member

Jr. Member (3/6)

3

Reputation

  1. Hi all, I would like to add a menu item the the 'setup' drop-down menu in the admin (eg. where 'Import Pages from CSV' ends up). This menu item should only function as a button: I would like to click it, run it's function(s), and return to the same page as where I was. I would use it to get some PW data, wrangle it, and save it. Because the information is very static and big, it doesn't have to be reguraly be updated, therefore, a button is enough. Any help, pointers and how to's regarding to make such a module-button would be great. Best, Berechar
  2. Hi Can, Thanks for the reply. Yes, the essays folder is located next to the PW folders 'site' and 'wire'. Unfortunately, your rules result in a (default) blank page, which means that the condition wasn't met. I see in your RewriteRule that you're directly refering to an HTML page. I changed this in my original rule, and now the right page is being served! RewriteCond %{REQUEST_URI} !(^|/)project-[^/]+/([0-9]+)/essay($|/.*$)$ RewriteRule ^project/([0-9]+)/essay($|/.*$)$ http://website.local/essays/$1/index.html [NC,L] Unfortunately, all the resources referrals on this page (images, css, javascript) are now broken. It uses the new URL as the base. Can this be prevented?
  3. Any PW System Administrators in town? I don't seem to get why the page is being forwarded. I'm quite convinced that it's the right pattern for the job... I tried some variations on the previous code, unfortunately without success RewriteCond %{REQUEST_URI} !(^|/)project-[^/]+/([0-9]+)/essay($|/.*$)$ RewriteRule ^project/([0-9]+)/essay($|/.*$)$ http://website.local/essays/$1 [NC,L]
  4. Thanks, the page is on the same site. I came up with the following, but this seems to redirect me to the new URL (which is good), but doesn't save the originial URL (which is bad...) RewriteCond %{REQUEST_URI} !(^|/)project-[^/]+/([0-9]+)/essay$ RewriteRule ^project/([0-9]+)/essay$ /essays/$1 [P] Maybe the [P] flag isn't working? mod_rewrite is on...
  5. hmm, this approach seems to work, but is quite slow if I compare it by going to the actual page.
  6. Hi all, I'm currently in the midst of making pages in PW which route the user to other directories and their index.html files (they are separately created and uploaded to the website). Instead of a redirect, I would like to keep the URL intact because it has valuable information for the PW tree. eg. PW Page (URL): site.local/project/33/essay Referred location (external directory, not part of PW): site.local/essays/33 Hopefully someone could give me some pointers on how to use the .htaccess file properly! Best, Charlie
  7. The access settings are all right. The guest van VIEW any page. When I visit the site as a guest, I can visit the home page, but clicking on a link (eg. /about) sends me back to the home page. When I try to visit a page directly (eg. www.website.local/about) it also sends me back to the home page. The home page is correctly displayed. * This never happened with the PW2.7, so there should be something going on with PW3. Unfortunately I can't find any records of this behaviour....
  8. Every page is published. The modules which I have installed are TemplateEngineFactory and PageReferencesTab. Shouldn't have any businesss with view access... The home-template gives view access to the guest role, all the other templates inherit this. * It seems to be the issue for every browser. Whenever you are logged out (being a guest), you are trapped on the homepage. Is there a way to somehow 'see' what's happening? How this bounce occurs? I couldn't find any message regarding this behaviour in the logs folder.
  9. Thanks AndZyk and Ivan for your replys! It seems that Ivan is right, when I login I'm able to visit each page. But I don't get why I can't visit those pages when I'm a guest. I haven't tinkered with any user settings ;-)
  10. Hi all, I'm currently developing a PW3 site in Firefox, and wanted to see how the site was doing in Chrome + Safari. Unfortunately I can't visit any of the pages, except the homepage. How can this be resolved? I've never seen this behaviour before Best
  11. Hi everyone, A question regarding security/best-practice concerning a simple front-end login through AJAX calls. My plan is to use this kind of module inside a small AngularJS architecture to update the entire application when someone is logged in/out. * I've made a simple HTML form in which the user can login by typing his/her username and password in the corresponding fields. After submitting the form, an Ajax GET request is made with these values to a page which has access to the Processwire API. This page checks if these values (after sanitization) correspond to an existing user in the CMS. If the user and password matches, the user is logged in, and a success message is being returned. If the user and password mismatches, an error message is being returned. * I don't know much about encryption, therefore I highly doubt if this a 'safe' way of doing things. Hopefully someone can give me some pointers on this! Best, berechar
  12. Hi all, A question regarding security/best-practice concerning a simple front-end login through AJAX calls. My plan is to use this kind of module inside a small AngularJS architecture to update the entire application when someone is logged in/out. * I've made a simple HTML form in which the user can login by typing his/her username and password in the corresponding fields. After submitting the form, these values are fetched with jQuery. Then an Ajax GET request is made with these values to a page which has access to the Processwire API. This page checks if these values (after sanitization) correspond to an existing user in the CMS. If the user and password matches, the user is logged in, and a success message is being returned. If the user and password mismatches, an error message is being returned. * I don't know much about encryption, therefore I highly doubt if this a 'safe' way of doing things. Hopefully someone can give me some pointers on this! best, berechar
  13. I've disabled the hooks (thus reverting to 'manual control'), and everything works with no unexpected behavior. So it definitely has something to do with how I was populating automatically. Should I format the Datetime string differently for the [publish_from] field? No 'Y-m-d hh:mm:ss' ?
  14. I though I had resolved this, but the following happenend. Everything works fine when the publish_from datetime is set for the current day with a timestamp that yet has to come on the same day. But, whenever I schedule a page for the following day (so I schedule it before 00:00am), and it needs to be published in the morning, it makes the page corrupt again... not viewable So weird... I though the strtotime($date) worked...
  15. I'm currently finding quite unexpected behaviour with the module, it seems to disable the 'view' option... The button/option simply just vanished... But when you change the page to [unpublished] and save, you can 'view' it again. But when you publish it again (or publish AND hide) it disables the 'view' option again. So the page seems to become 'corrupt'. When I copy all it's content to a new page and just publish it, everything is fine. I'm running ProcessWire 2.5.3 © 2015, maybe there's an issue? The only thing what I maybe do differently from the default, is that I've made a page-save-hook which populates the publish_from field with another date field, and appends a timecode (eg. 08:00:00). I first thought this might be an [user] issue regarding the permissions, but everything worked fine [before] the automatic-publishing. * * * EDIT 1 * * * After much debugging, I think I found the answer. I disabled the page-save-hook which fetched the [date] field and populated the [publish_from] field with an added timestamp (08:00:00). This seemed to 'corrupt' the page, disabling the option to view when published. Conclusion: I think the type of input became a string instead of a date * * * EDIT 2 * * * For anyone interested to prevent yourself from headaches, this is how I end up building a working datetime to work with SchedulePages. $pageDate = date("Y-m-d", $page->getUnformatted("date") ); $publish_from = date( $pageDate . ' 11:00:00'); $this->message( $publish_from ); $page->publish_from = strtotime($publish_from);
×
×
  • Create New...