Jump to content
jonatan

S.O.S I f***** up... I enabled access control for the "process" field = 503 error!

Recommended Posts

So... I thought (for some stupid reason I can't even recall now no wait now I remember.. I wanted to hide the "Trash" for "editor" role users) that it'd be super duper smart to "Enable access control" for the field "process" on the admin template.... Really really stupid.... Now all I get is:

528107441_Skrmbillede2020-10-02kl_19_10_55.thumb.png.d56ff4223eafd353e5d671092c20acf8.png

 

 

 

– when I go to mywebsitedomain.com/admin

but.... my website domain.com and all its subpages works perfectly fine! So it's ONLY the /admin (processwire) which throws a 503 at me. 

🥵🤯☠️💩😭😱

S.O.S.

Share this post


Link to post
Share on other sites

I just tried restoring the "wire" folder to a previous state... no luck. Didn't change a thing

Share this post


Link to post
Share on other sites

A long shot, but... if you open Adminer or phpMyAdmin, what does it show in the table "templates" for id 2?

pw-sql-template-admin.thumb.PNG.5605f9a2f0484f19d680b12b428d7ede.PNG

afaik, useRoles should be set to 1, and noGlobal set to 1 too (the rest shouldn't matter).

Replacing the wire folder won't help, cause the changes you made are stored in the DB (and even if it would be stored to the file-system, it would under site/).

Share this post


Link to post
Share on other sites
2 minutes ago, jonatan said:

HEUREKA!!!!!

Well, care to share the solution?

Share this post


Link to post
Share on other sites

So.. for anyone else being as stupid as I:

VERY luckily I had a previous .sql database export from when I moved from dev to prod site!

So I exported the current site's db and compared the two .sql files.

1330671675_Skrmbillede2020-10-02kl_19_35_34.thumb.png.40d5c28e455d9be0bdf93364a631131d.png

And I noticed this difference.

INSERT INTO `fieldgroups_fields` (`fieldgroups_id`, `fields_id`, `sort`, `data`) VALUES
(2, 2, 1, NULL)

I changed '{\"flagsAdd\":32}' back to NULL. Anddd ... drumrolll..... 

192853867_Skrmbillede2020-10-02kl_19_37_59.thumb.png.039c7109c4bcafd3fc070ecccebde761.png

 

Back was my beautiful AdminThemeBoss dearly beloved and missed PW adminarea loginscreen!

 

(Sorry for the inconvience and S.O.S signals... But you know.. maybe someone else will be as idiotic as me one day and find this useful?)

 

  • Like 1

Share this post


Link to post
Share on other sites
8 minutes ago, dragan said:

A long shot, but... if you open Adminer or phpMyAdmin, what does it show in the table "templates" for id 2?

afaik, useRoles should be set to 1, and noGlobal set to 1 too (the rest shouldn't matter).

Replacing the wire folder won't help, cause the changes you made are stored in the DB (and even if it would be stored to the file-system, it would under site/).

But thanks a thousand times though for the extremely quick S.O.S response @dragan !!! ❤️ Lots of love from here!

  • Like 1

Share this post


Link to post
Share on other sites

So I guess I learned now that

{"flagsAdd":32}

in the "field groups_fields" table's "data" column means Enable access control...

1968938327_Skrmbillede2020-10-02kl_19.47_19.thumb.png.13888a4c97a40eeac4fdc60103c8aa28.png

Share this post


Link to post
Share on other sites
1 minute ago, Robin S said:

FYI, you can disable trash for non-superusers in the ProcessPageList module settings: https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#trash-for-all

Thanks @Robin S! I know and that's exactly the feature I had activated.. 😄 I wanted the non-superusers to be able to trash items, but not be able to see the "TRASH" page... But then again when I think about it know I guess it's perhaps stupid to have the ability to trash pages but not see the trash....?

The reason why was that I just wanted to make it easy for them to "bulk delete" a lot of pages... Or not really bulk but at least only having to hover over the page > ">" > "TRASH" which is easier than "EDIT" > "DELETE"(tab) > confirm > save.

And I guess I thought it to be easier for them / more user-friendly if they wouldn't be bothered with seeing the pages they've just trashed. But well then again I guess it's useful to see the trash if you delete something by accident

Share this post


Link to post
Share on other sites

Personally, I don't allow non-superusers to see the trash and I like that they have to navigate to the Delete tab because I want them to think very carefully before they delete a page.

5 minutes ago, jonatan said:

Or not really bulk but at least only having to hover over the page > ">" > "TRASH" which is easier than "EDIT" > "DELETE"(tab) > confirm > save.

If you want to hide Trash (as per the setting mentioned above) but want to let non-superusers trash pages from Page List then you could look at this module:

 

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, Robin S said:

If you want to hide Trash (as per the setting mentioned above) but want to let non-superusers trash pages from Page List then you could look at this module:

Awesome! thanks! 😄 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      Sorry for the convoluted title. I have a problem with Process modules that define a custom page using the page key through getModuleInfo (as demonstrated in this excellent tutorial by @bernhard). Those pages are created automatically when the module is installed. The problem is that the title of the page only gets set in the current language. That's not a problem if the current language (language of the superuser who is installing the module) is the default language; if it isn't, the Process page is missing a title in the default language. This has the very awkward effect that a user using the backend in the default language (or any other language) will see an empty entry in the setup menu:

      This screenshot comes from my Cache Control module which includes a Process page. Now I realize the description sounds obscure, but for us it's a common setup: We a multiple bilingual sites where the default language is German and the second language is English. While the clients use the CMS in German, as a developer I prefer the English interface, so whenever I install a Process module I get this problem.
      As a module author, is there a way to handle this situation? I guess it would be possible to use post-installation hooks or create the pages manually, but I very much prefer the declarative approach. The page title is already translatable (through the __ function), but of course at the time of installation there is no translation, and as far as I'm aware it's not possible to ship translations with a module so they are used automatically. Could this situation be handled better in the core? I would prefer if the module installation process would always set the title of the Process page in the default language, instead of the language of the current user.
    • By MoritzLost
      Process Cache Control
      This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Plans for improvements
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots


    • By Macrura
      This is the new topic for the Settings Factory module (formerly known as Settings Train).
      Repo:
      https://github.com/outflux3/SettingsFactory
      I'm not sure what versions this is compatible with, it has only been tested on 3.x branch;
      it is not namespaced, and i'm not sure if namespacing is necessary or a benefit for this module; if any namespace or module gurus can weigh in on this, let me know. I'm also not sure if there needs to be a minimum php version;
      I have one live site using this now and it's working great; But before submitting to mods directory, would be better if there was some additional testing by other users.
    • By prestoav
      Hi all,
      PW: 3.0.42
      I'm trying to have responsive images in the body field. First I need to stop the image tag generated by CKEditor adding the width attribute to the image tag on insertion. I found the 'Skip width attributes on image tags?' in the settings of ProcessPageEditImage and that suggests it does exactly what I'm after.
      Sadly, even when this checkbox is checked and a new image is inserted the width attribute is still added.
      Am I missing something?
      TIA.

    • By Martin Muzatko
      Hello!
      I'm trying to use the data I create in Processwire as much as possible.
      So for a form, I try to use the fields description, name and also its built-in validation rules I defined in ProcessWire on the front-end. (minlength, ranges, patterns, etc)
      I already looked into this tutorial, but it is using external resources to validate the form.
      Since ProcessWire does all the heavy lifting, when processing data, I don't have to sanitize anything - ___processInput should do the job just fine.
      However, it is not actually working correctly. 
      $fields = $templates->get('user')->fields; $submission = $input->post; foreach ($submission as $key => $value) { $field = $fields->{$key}; if ($field instanceof Field) { $field = $field->getInputfield($user); $field->___processInput(new WireInputData([$key => $value])); var_dump($field->getErrors(true)); // retrieve validation error } } This works for some constraints, but the values are not correctly validated.
      Example: 

      All the fields are required and zip is an integer field.
      Yet, I get no validation error for zip, although it was entered as a string, and not an integer. Funny enough: if I provide a number outside the range, I get "Specified value 2 removed because it is out of bounds (min=1000, max=99999)".
      firstname will not return any error for being a required field.
      From what I have looked through the source code, there is no check for "required". Some fields only validate on setAttribute. Am I missing anything or am I doomed to build my own validation process?
      Thank you in advance!
      Best,
      Martin
×
×
  • Create New...