kolewu
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by kolewu
-
Yes, as suggested by SiNNuT in post #2 -- but I don't like this solution: you do have contradictory settings in two different places: configuration has view-rights for guest, template has the opposite if you don't have one main template you have to make sure to include this everywhere it is needed you don't get the right result from $pages->get("somePage")->viewable I would like a setting in one central place most! Either (my favorite) a setting this is a private site that changes the behavior of the guest rights setting or a module like above that together with the change that enables redirection settings every time.
-
A workaround for now: remove the view access from the guest user and change the redirect settings. Then restore the view access for guest and save the changes. With this workaround the following module (made from ryans code above) make your site a members only site. <?php class AccessMembersOnly extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'MembersOnly module', 'version' => 1, 'summary' => 'prevent guest access to the site', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHookAfter('Page::viewable', $this, 'hookPageViewable'); } public function hookPageViewable(HookEvent $event) { if($event->return === true) { $page = $event->object; if($page->template == 'admin') return; if(wire('user')->isGuest()) $event->return = false; } } } I think the redirect settings should not be hidden at all because there may be more reasons for not giving access to any user than only with access rules.
-
But how can I change the redirection target? The configuration is only visible if I remove the view acces to guest -- but this cannot be saved. It looks like the redirectLogin setting is only for the guest, so I have found no way to specify another target. Maybe it would be possible to make the Homepage a login and build the site with another tree under it. Then when the user is already logged in, she can be redirected to the real home. So this is really a lot of work, to only work around the restriction for the home page access rights? Could we get a site setting private site meaning: there is no guest access beside the login page(s) (admin and possibly frontend).
-
Custom string in names of database tables
kolewu replied to Michal Gancarski's topic in Wishlist & Roadmap
AFAIK the customizable table prefix is not at all meant to be a security feature. It's for hosting provider where you only got one (or a small number of) database(s). Whithout you can't use applications that accidentally use some tables with equal names. -
Maybe the concept of a focal point fits in here nicely? Here is a post about using this concept for cropping layout images for responsiveness: Focal Point: Intelligent Cropping of Responsive Images
-
Nice and restrained design -- I like it! Do you know, that the frontpage doesn't work well without javascript? That's a very common misconfiguration of a slider. See this page http://www.wildroses...e/galerie.shtml where I tried to gracefully degrade the presentation wihtout javascript. (for reference see Unobtrusive Javascript from wikipedia)
-
But there is a preview. Just click More Reply Options and then you see a preview and can renew the preview with clicking on Preview Post.
-
Have you seen this line from the License at http://imperavi.com/redactor/license/ Looks like a real showstopper ... It seems like this license is introduced for the current version 8.1.0. The older version 8.0.3 is available as a free download from http://imperavi.com/...edactor/getold/ but has no license included and links to the same license page quoted above. Unfortunately the wayback machine knows nothing about imperavi.com and so I was not able to find out about the changes introduced on October 10, 2012. Candycms uses the older version not the current 8.1.0, but also not the one under CC BY-NC 3.0. (some of this thoughts can be found in this thread, too: Redactor - WYSIWYG editor on jQuery)
-
OK, here I am again. The import has been successfully carried out with the help of the links above but after solving some problems ... The first step was to convert the old guestbook to json and after it was converted to CSV this web app http://www.cparker15...es/csv-to-json/ Then I spent some time to work around the scripting problems but with this template, the json file was successfully converted to comments. <?php # moderation of comments must be disabled before running this script # likewise the email sending for a comment should be switched off $file = './guestbook.json'; $data = json_decode(file_get_contents($file), true); if(!$data || $data == false) throw new WireException("Can't load data from $file."); $p = $wire->pages->get("/gaestebuch/"); $p->setOutputFormatting(false); foreach (array_reverse($data) as $item) { $c = new Comment(); $c->text = trim($item['text']); $c->cite = trim($item['name']); $c->email = trim($item['email']); $c->homepage = trim($item['website']); $c->created = strtotime(trim($item['date'])); # setting status has no effect if moderation is set to "only new" $c->status = 1; $p->comments->add($c); } $p->save('comments'); $p->setOutputFormatting(true); echo 'import successful'; The following problems had to be solved json_decode() only returns an array with the data and not with any metadata, so the result is the return value and not in $data['status']. Output formatting has to be disabled around the save. If moderation for the comments is set to always or only new, setting status doesn't has any effect -- so the moderation mode must be set to none before the import. If email notification for comments is enabled, every new comment triggers an email -- so it would be wise to disable email notification before import. Now I only miss a field for a website and since it is part of the roadmap for the next PW version I would like to know if there is a (preliminiary) implementation that I can use to import this field in a compatible manner. May this be helpful to anyone.
-
Thank you Mats! I wonder how I have not found this ... maybe I have only searched the site and not the forums. Will try to use the infos as soon as possible -- unfortunately the old guestbook is not from a CMS but an hardwired cgi-script and I have to convert the HTML table, but this is not a PW problem
-
Hello, I'm new into ProcessWire and I love it! Originally I have planned to evaluate several CMS and then decide which one to use -- but after some hours with PW I decided not to look any further But now I'm stuck with the guestbook from the old site and beg for help: How can I import the old postings with the correct date into comments? Since they have their own database table and are not organized as (sub)pages, I cannot use the import module, right? And because the old guestbook has had an optional website field: how can I preserve this? I know that the comments should be enhanced with this type of field sometimes (+1 from me for this feature!) ... Thank you Uwe