Jump to content

Search the Community

Showing results for tags 'Admin'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. When a PageTable field in a specific template is being edited I need to know the Page that contains the PageTable so I can fill in hidden fields in the PageTable. I can capture the page being edited via: // $this->addHookBefore('ProcessPageEdit::execute', ... public function pageEditExecuteBefore(HookEvent $e) { $p = $e->object->getPage(); if ($p->template !== 'rtw-product') return; // $p is the page being edited } I can intercept PageTable entry being saved: // $this->addHookBefore('Pages::save' public function savePageBefore (HookEvent $e) { $p = $this->wire('page')->id; $page = $e->arguments('page'); $obj = $e->object; $name = $page->name; // page name of PageTable page $template = $page->template->name; // template of PageTable page $parent = $page->parent->name; // parent directory for PageTable items What I am trying to find is the page in which the PageTable field is located. I've also tried having pageEditExecuteBefore() saving $p in $this->context and then accessing that in savePageBefore() but it's a different instance of the class because $this->context is null when it gets to savePageBefore(). I could save the page ID in session, but that seems error prone. Does anyone know how to achieve this?
  2. I have to languages - english and russian. I need russian language to be set as default for admin panel. How to do it? Thanks!
  3. Hello! How can I add custom Content to the Admin Theme Footer or Header? Is this possible with a hook? I want also to can upgrade easy and don't touch core files...
  4. Posting in the hope this helps someone out of a hole! Having built 20+ sites on PW in the last couple of years (and loving it...) I came across a really odd situation recently. The client's IT company and I 've been battling for a couple of weeks and today, finally, we have an answer! The site is built and temporarily housed on a shared hosting account we have for development. All tested well here so Access was granted to the client to start adding content. The next day I get a call from the client to say the admin side of the site is logging them out every 30-40 seconds and they have to log back in again each time to continue. I tested again from our office with their login but all worked as expected. Other browsers, PCs etc. were all tried by the client but the problem persisted. So, I get in my car and drive to the client's site. Sure enough, I see the issue on one of their iMacs. So I open up my MBP, connect to their network, log in as them and the problem is there. So, next, I came off of their network and onto my tethered iPhone on 4G. Bingo! The problem goes away. So it's their network that's the issue. Their IT company were called and, with us helping them wherever possible, they worked on it for 2 weeks to find the problem. I captured the port numbers in use by PW admin (60992, 60993, 61000, 61001, 61002, 61003 by the way) and the IT company opened those ports on the router but still, the problem remained :-( And then the breakthrough... They have two VDSL lines into the building that feed their router through a load balancer. It seems that their setup meant that responses to outbound traffic did not necessarily come back in via the same line. Processwire admin does not like this! So, the IT company put in a rule to direct all traffic from the IP of the shared hosting through the same route in and out of the building and BOOM! it all works as expected. Phew! All's well that end's well but it certainly put us through the wringer tracking it down. Actually, I think it's pretty cool that PW does this. A good extra security measure. Several other CMSs (no names...) worked just fine with this scenario but not PW. Anyway, happy client, happy me. Hopefully, this story helps someone else here too.
  5. Micro Contexts (aka field value contexts) Change any context-enabled setting in your page editor/template based on the value of a page reference field. Why use this? Say you have a template that is controlling some generic part of your website, like a section on the homepage, a widget, or an item in a media library. If you are using the various fields on this template in different ways depending on an option (page select) such as 'widget_type', 'media_type', etc, you can hot-switch the template context based on the field's value. Why not use template, like just change the template? Unfortunately, most of my clients would probably break down in tears if i tried to explain what a template is, or how to change it. This also allows you to have better more relevant labels, descriptions and notes based on any page ref field value on your template, as well as be able to show/hide fields based on that value, or even move fields around to make some more prominent or visible. How to use this 1.) Create a new template: 1a) Use the following name structure: mc-[field_name]-[field_value]-[any_memo_here] where [field_name] is the field that will control the micro context, and the [field_value] is the required value (page id) that the controller field must equal/have in order to trigger the virtual template context. The last part of the template name should be used for the page name, or some memo to make it easier to know from the templates list what field value will trigger the micro context, since the template name does require the ID value of the field, not the name. 1b) Make sure to specify the template you are contextualizing under "Duplicate fields used by another template" before clicking save! 1c) Edit your field settings for this template, for when your fieldname=value as specified in the template name (labels, descriptions, notes, visibility, field order etc.) 2.) Place this code in your ready.php file: wire()->addHookAfter('ProcessPageEdit::loadPage', null, function (HookEvent $e) { $page = $e->return; $mcPlates = $this->wire('templates')->find("name^=mc-"); if(!count($mcPlates)) return; foreach($mcPlates as $mcPlate) { $nameParts = explode('-', $mcPlate->name); // expected format: mc-[field_name]-[page-id]-[anything-you-want-here] $mc_field = $nameParts[1]; // the field controlling the micro context $mc_value = $nameParts[2]; // page id has to be the 3rd part of the template name $controllerField = $page->fields->get($mc_field); //if we find a matching controller field from the template name... if($controllerField) { $f_value = $page->get($controllerField->name); $proceed = false; if( ($f_value instanceof PageArray) || ($f_value instanceof Page) ) $proceed = true; // this only works with page reference fields. if(!$proceed) continue; // the page corresponding to the required value (page id) specified in the mc template name, to change micro context $mc_page = wire('pages')->get((int) $mc_value); // if the value specified in the mc template name matches the current value of the page reference field, change the // fieldgroup context $proceed = false; if( $f_value instanceof PageArray && $f_value->has($mc_page) ) $proceed = true; if( $f_value instanceof Page && $f_value == $mc_page ) $proceed = true; if($proceed) { $tName = $mcPlate->name; $mc_template = wire('templates')->find("name=$tName")->first(); if($mc_template) { $mc_fieldgroup = $mc_template->fieldgroup; $page->template->fieldgroup = $mc_fieldgroup; } } } } }); Caveats This probably needs more work to be fully usable, and may need more bullet proofing in terms of checking for valid template name, etc. You can only have this work with 1 page reference field per template. This has been tested and is being used on at least 2 live sites, but caution should be used, and the functionality should be tested before using on a live site. Screenshots: 1) a default widget with no field value context enabled fields 2.) A field value context enabled edit page for the 'Widget Type', the template controlling this is now 'mc-widget_type-1054-text', but the template of the page stays as 'widget'; only the fieldgroup context is changed when the page is loaded to get the contextual settings: 3.) the context for when the page reference field called 'widget_type' has the value of 1150, which is a video widget type (template name is 'mc-widget_type-1150-video'). Convenient Module edition coming soon!
  6. When I delete a page name, e.g, /cart/, using the admin interface it goes into trash and gets the name /trash/2573.1.11_cart/ . I see that, with the Pages::trashed hook that the previous page name (previousPage) can be accessed. Where can I more information about what happens when a page is put into trash and what the name means?
  7. Hey Guys! Im new to PW and am working on a website built on PW. Im trying to understand how sessions work in PW. Specifically what exactly is happening when session expires. The thing is that my client wants to be redirected to homepage whenever session expires, so basically he doesnt want to be redirected to admin login page when he's in the admin environment of PW(he doesnt want his clients to see the admin login page for whatever reason). Is it possible to hook to the session expiration and redirect to a specific url? And what is the correct way to do it in PW? I would appreciate the help! Cheers!
  8. I'd really like Processwire to have a robust page based permissions system rather than just template based out of the box. If the page tree is compared to a file system, it would be nice to be able to set owner (user), group (role) and public permissions on a page and have this propagate to sub-pages unless explicitly over-ridden. With a large site, it's quite possible to have multiple sections that use the same templates, but where editing needs to be assigned to different people, for different parts of a site. I've seen some proofs of concept that have never been updated or maintained, so I'm sure it can be done, but this is a bit of a show-stopper for me with an otherwise excellent CMS. I might be able to have a go at something myself, but since this is security related, and I haven't had a go at module development before, it would be really handy to have something robust that just works.
  9. I have a PW page that is about 2 - 3 Years old . After an upgrade to Version 2.6 all Pages and modules where gone in Admin backend. As i had no time to look after the page i left it like it was for quite a while. Now that i needed to get the Page online again i searched whith google anf fount that i should upgrade the page to PW 2.7.3 As the Upgrade to 2.6 was done in a hurry , its perfectly possible that i accidentallly upgraded from 2.0 to 2.6. Please have a look at the images to see the desaster in full color ....
  10. Weirdest thing just happened to me. I updated blank site from 3.0.42 to 3.0.61 then started adding fields. I have two instances of FieldsetOpen areas in the template, and a few CKEditor textareas (both inside those fieldsets and outside). I added an image field to the template and placed it near the top of the template fields. Once I did that I was unable to toggle either Fieldset, and the CKEditor stopped working. When I moved the image field to the bottom of the template fields, the CKEditor loaded, but the fieldsets still wouldn't toggle. When I deleted the image field, the editor and toggle return to normal. (Adding a new image field re-introduces the issues.) I've tried adjusting the settings on the image field but the result is the same - even with all default settings. I tried adding an image field to a different template - same result. What am I missing here?
  11. Hi All, I was playing around with the settings for various templates as I had created a new role and have inadvertantly locked myself out. I changed some of the settings on the Admin template, so I assume this is what has caused the lock out. I have direct access to the database but I have no idea what I would need to change in it to regain access. Probably also worth mentioning that all the existing pages are still accessible, but /processwire throws a 404.
  12. Do any experts have experience with the level of stability and/or support for turning on $config->advanced? I ask because of the warning at the bottom of the System tab "Please note that all of these system settings are intended for ProcessWire system development (not site development). Use them at your own risk." It provides two facilities that are invaluable to me (maybe because I don't know how to do them any other way). 1) Disable Settings Tab on a per template basis 2) Page Class Name - this makes it tweak a page while relying on the underlying Page class for the majority of functions. Are others using this setting in production? Have you used it over an extended time and seen that it is not changed often or at all?
  13. How can I check if the user is in the admin enviroment of processwire? At the moment I'm using some buggy url check but I figure that there must be something in processwire itself to check for that. I don't want to check if the user has administrator privileges, just if the user is visiting an admin url. Because the admin url can be changed from the admin panel I don't want to check on something hard coded as well. What is the best way to check for an admin page?
  14. Hi all, I'm creating a website for a magazine publisher. This will include a supplier section with press releases attached to company profiles. The idea is that companies can register and manage their profile and press releases (CRUD) via a dashboard. The dashboard is a Process module. Ben Byford's RedirectAdminPages module is being used to lock out the rest of the backend, with a few modifications. The following code should redirect every admin page to the dashboard page but still allowing logging out. However logging out just redirects to the dashboard page: // do not redirect if page matches: if($this->page->template != "admin" // any non-admin page || $this->page->is($this->redirectPage) // the dashboard page (prevent infinite loop) || $this->page->parent->is('/admin/login/') // various attempts to allow logging out || $this->wire("process") == 'ProcessLogin' || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false ) { return; } // find roles set in module configuration and create array $roles = explode(',', $this->userRoles); // for each user in module config check to see if current user foreach ($roles as $key => $val) { // get a role from the roles array $roles[$key] = trim($roles[$key]); // if current user found with role then redirect if($this->user->hasRole($roles[$key])){ // redirect session to page stored in config $this->session->redirect($this->redirectPage); // code should never get here but this is a simple fallback break; } } } } I'm surprised that this URL matching doesn't work: || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false Because this does work for allowing page edit: || strpos($this->page->url, $this->wire('config')->urls->admin . 'page/edit') !== false Any ideas? That issue aside, as a learning process I'm going to re-implement the dashboard as front-end pages. I guess that the advantage of using the ProcessWire back-end is most of the functionality is already there, you don't need to create forms and handle the processing, create / import css etc. So it'll be interesting to see how much of a difference this makes, and how much control each approach provides. I'd love to have some thoughts and feedback from those of you who've tried both methods? PS this will be my third website created with ProcessWire and it's already been a lot of fun, and as a CMS it 'just feels right', so a big thanks to Ryan and everyone who has contributed. Thanks
  15. Hello Community, I have read that I get no support on GitHub. For this reason I am here for the second time. The thing is that I enabled a fresh Processwire installation and under https://processwire.wpzweinull.ch/processwire no page is found. The admin login is thus not possible. How can I fix the problem? Thanks in advance, Alexander
  16. Hi all, I have created a new admin page which just lists some form submission details, it works as expected so I'm pretty happy with it. The only thing I can't figure out is how to now add a new tab which links to this custom page. From what I have read it seems like most people do this by including it as part of a module, I would like to avoid creating this a page as a module as it is specific to this website and has no reusability. However I am yet to find any documentation stating whether this is even possible without going down the module route. Any help would be much appreciated.
  17. Hi! Upgraded my development environment from 2.x to 3.x and everything works fine there, so I continued with copying my development site (files) and database to my production environment and suddenly Pages and Modules are not showing up (see screenshot). After clicking around a bit, suddenly it worked and pages and modules appeared. But after logging out and in again, the issue had returned. I tested with different browsers and cleared my cache and cookies, but that didn't help. What could be causing this, what should I look for? Thanks in advance, Jasper
  18. I cannot manage to delete this page upon uninstallation of a Process module I have that was working previously. I thought the only difference would be that I added `namespace ProcessWire;` to the start of the module PHP, however I've tried without it and still I get It is an admin page. Right now I have $get = 'template=admin, parent!=trash, name=importall, include=all'; $gp = wire('pages')->get($get); if($gp->id) { wire('log')->save($log, "$gp->id".get_class($gp).__NAMESPACE__); $gp->delete(); if(!wire('pages')->get($get)->id) wire('log')->save($log, "Deleted Imports page."); } previously $gp = $this->pages->get('template=admin, parent!=trash, name=importall'); if($gp->id) { $this->pages->delete($gp, true); $this->log->save($log, "Uninstalled ". get_class()); } Why will it no longer delete? I can't even do so by the GUI.
  19. Hi guys I've a PW site running real slow in the back end and was wondering about diagnostic tools. It's fine on the front end but takes about 12+ seconds to even load a page once I click edit. I often get 504 Gateway Time-out messages too. I have Tracey Debugger installed but I'm not really sure which options I need to check etc. Having cherry-picked a few and loaded a page in the front end, I only have one error (a missing include file) which doesn't affect my site. PHP 7.0.12 PW 3.040 MySQL: 5.5.41-1 Any tips? Thanks Peter
  20. [Edit: this issue was fixed in PW 3.0.40] I've recently noticed a small bug, but my Google-fu didn't find any mention of it anywhere else: When using the long-click modal window to edit a page from the Admin page tree, if there is a field submission error (e.g., a required field is missing/incorrectly formatted etc), the "Save" button completely disappears, preventing the page from being saved at all. I think it is a javascript issue because it only happens when fields are validated with the HTML5 required attribute (in the field settings the "also use HTML5 'required' attribute" option is checked). HTML5 validation halts browser submission, but I suspect the javascript is still submitting the form (but sadly, not saving it!), hence the button vanishing. It's not really a big issue, you can just not use the long-click edit modal (or not use HTML5 validation, but I like the convenience of it), but I thought it ought to be mentioned. Not really sure what the solution is either. I've observed this in: PW version 3.0.39 dev (was using ver. 3.0.34 where I first noticed the problem, I updated specifically to see if it already been fixed). Browsers tested: Firefox and Chrome - both have the same issue.
  21. Hello, this is a small request, but since a while I develop exclusive in Google Chrome and if I have the developer tools open and try to access the back end, I always get following notification: It seems like the Chrome developer tools are looking for a css map file inside the AdminThemeReno, which is not present. Maybe this doesn't bother anybody and it is rare, that I try to access the back end with the developer tools, but I just wanted to point this out. Regards, Andreas
  22. Attempting to download AdoptDefaultsFromParents (or any module) in PW3 admin produces the following slew of errors: The site/modules permissions = 755, allow_url_fopen & curl = on. How could this be? Why doesn't the download URL come through properly? I sorely miss the splendid convenience of this capability.
  23. I hid/set aside the old /wire/, index.php, and .htaccess, as well as /site/config.php. Debug=1. $config->urls->admin = /pw/, as it's set as. I'm finding that others are encountering a similar issue but haven't found any solution yet, at least none that works for me. Please help, thanks much
  24. I am new to PW and have a client who use it for their website. I am trying to figure out where do I place the GA code and Ad Roll code in PW? Any help would be appreciated. Thanks, John
  25. I've got my first Processwire site all set up and everything was pretty much straight forward, but I am stuck on literally the last thing I have to do which is locking down some of the features within the admin area. I have three users, a Superuser, an Admin and a guest. The Superuser account is for me so that I can make higher level changes, and the regular Admin user is for the person who manages the copy on the site, so ideally they will only have the ability to add, edit or delete pages, and not be able to mess with any of the settings such as templates or fields. So I would like to be able to hide three of the top navigation tabs from the Admin user (Setup, Modules and Access). I've tried making the pages hidden in their settings tabs, but even as the Superuser, the page is locked for edits.
×
×
  • Create New...