-
Posts
1,554 -
Joined
-
Last visited
-
Days Won
48
Everything posted by gebeer
-
SOLVED: LOGIN/REGISTER/PROFILE - LoginRegister - Show RegisterForm
gebeer replied to DV-JF's topic in General Support
@flydev I was a minute faster there -
SOLVED: LOGIN/REGISTER/PROFILE - LoginRegister - Show RegisterForm
gebeer replied to DV-JF's topic in General Support
The module looks for a GET parameter register. When this is set to 1, it renders the login form. So what you could do is in the temnplate where you render the login form // set GET parameter register to 1 $input->get->register = 1; // render the form $content = $modules->get('LoginRegister')->execute(); I just tried it and it seems to work. -
Have you tried to do $page->of(false) before you add the image? $page->of(false); $page->filepreviews->add($img); $success = $page->save(); EDIT: this would explain why the first did not get added but the follwing did. Because of() was only set to false after adding the first image
-
Modyfikacja por roku i odziezy najwyzszej jakosci
gebeer replied to james smith's topic in General Support
If your PW version is >=3.0.95 you could try the soundex search code in this thread. Not sure if the soundex algorithm can be of help in your case but maybe worth a try. Implementation is quite simple. -
To send emails from the template you would use WireMail, accessible in the API through $mail To get values for your image and other fields, just use regular $page->image, $page->title etc. The hardest part will be the cross-client responsive Email template. This is not a trivial thing to do. Some resources: http://leemunroe.github.io/responsive-html-email-template/email.html http://tedgoas.github.io/Cerberus/ If you send emails from ProcessWire and want to send them in plain text and in HTML, you typically construct the HTML email first and then convert that to a plain text version with something like $emailMessageAdminHtml = "<h1>Some HTML</h1><p>with paragraph</p>"; $emailMessage = str_replace( "<br>", "\n", strip_tags($emailMessageAdminHtml, '<br>') ); // construct email $mail->to($recipient); $mail->from($sender); $mail->subject($subject); $mail->body($emailMessage); $mail->bodyHTML('<html><body>' . $emailMessageAdminHtml . '</body></html>'); // send $mail->send();
-
Check out https://github.com/mrclay/minify But I don't know if it is worth the effort. For in the backend I wouldn't mind having multiple files loaded even if some of them have only one line.
-
Have you tried to check the "Add DROP TABLE / VIEW / PROCEDURE..." Option when exporting from phpMyAdmin? EDIT: It is in your screenshot above under "Object Creation Options"
-
You might want to have a look at my REST API tutorial. It implements basic HTML authentication which is a standard that is quite secure when used over SSL. If you use that appoach, then you need to to send base64-encoded credentials (username:password) when your App authenticates with PW. Then on the PW side you need to decode those into username and password. See how this is done in the Rest Helper php Then do the login attempt with $session->login('username', 'password'); to see whether the credentials are valid.
-
Yes, this would be the correct way to implement. You can find some responsive site profiles in this thread: https://processwire.com/talk/forum/12-themes-and-profiles/ Here's a BS4 site profile in the module's directory: https://modules.processwire.com/modules/process-wire-bootstrap4/ You can have a look at some of those profiles to get a better idea about implementation. The beautiful thing about ProcessWire is that there is no single correct way to do things. It leaves structural decisions up to the developer.
-
@bernhard Understood, never mind. Its only that I get requests from my clients to implement recaptcha. Otherwise I would stick to honeypot as well. Also, on one of the sites where recaptcha V2 is implemented, I still get some Spam. Not more or fewer than on sites with honeypot. But try to explain this to clients who want something specific because they heard the buzz word recaptcha...
-
@bernhard this looks very promising, thank you for sharing! It would be great if you could add Recaptcha V2 support. I was once struggling on getting it to work with a Nette Form implementation for a project. Here is the most up to date and seemingly well maintained Nette extension I could find: https://packagist.org/packages/contributte/reCAPTCHA
-
I thin what you are looking for is the "Custom PHP code" in the Input tab of the field cnfiguration screen for your programs_list field In my case the field name is "myplaces" Now Go and insert this hook into site/ready.php $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'programs_list') { $page = $event->arguments('page'); $event->return = $event->pages->find("template=yourTemplateForProgramPages, program_id={$page->legacy_id}); } }); This gets the legazy_id of the page that you are currently editing and then finds all program pages with that id in field program_id.
-
@flydev this is what I call a thorough explanation Thank you for taking the time and sharing your knowledge!
-
Today I got the same error. Only on my local dev environment. Live site is fine. PW 2.7.2. In my case it is related to SessionHandlerDB module. When I uninstall it, the error is gone. The request http://utg.local/utgcontrol/page/list/?id=1&render=JSON&start=0&lang=0&open=undefined&mode=actions returns {"page":{"id":1,"label":"<span class='label_title'>Tao Yoga<\/span>","status":9,"numChildren":25,"path":"\/","template":"home","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1"}]},"children":[{"id":1391,"label":"<span class='label_title'>homepage-teaser<\/span>","status":1025,"numChildren":6,"path":"\/homepage-teaser\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1391"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/homepage-teaser\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1391"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1391","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1391","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1391","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1391","ajax":true}}}]},{"id":1392,"label":"<span class='label_title'>Philosophie<\/span>","status":1,"numChildren":10,"path":"\/philosophie\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1392"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/philosophie\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1392"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1392","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1392","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1392","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1392","ajax":true}}}]},{"id":1393,"label":"<span class='label_title'>Mantak Chia<\/span>","status":1,"numChildren":2,"path":"\/mantak-chia\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1393"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/mantak-chia\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1393"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1393","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1393","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1393","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1393","ajax":true}}}]},{"id":1394,"label":"<span class='label_title'>Universal HEALING TAO System<\/span>","status":1,"numChildren":9,"path":"\/universal-tao\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1394"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/universal-tao\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1394"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1394","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1394","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1394","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1394","ajax":true}}}]},{"id":1029,"label":"<span class='label_title'>Lehrer<\/span>","status":1,"numChildren":51,"path":"\/lehrer\/","template":"members","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1029"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/lehrer\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1029"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1029","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1029","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1029","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1029","ajax":true}}}]},{"id":1395,"label":"<span class='label_title'>Workshops<\/span>","status":1,"numChildren":430,"path":"\/workshops\/","template":"events","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1395"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/workshops\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1395"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1395","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1395","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1395","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1395","ajax":true}}}]},{"id":1403,"label":"<span class='label_title'>Ausbildung<\/span>","status":1,"numChildren":3,"path":"\/ausbildung\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1403"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/ausbildung\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1403"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1403","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1403","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1403","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1403","ajax":true}}}]},{"id":1396,"label":"<span class='label_title'>Links<\/span>","status":1,"numChildren":11,"path":"\/links\/","template":"links","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1396"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/links\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1396"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1396","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1396","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1396","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1396","ajax":true}}}]},{"id":1399,"label":"<span class='label_title'>Suche<\/span>","status":1,"numChildren":0,"path":"\/suche\/","template":"search-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1399"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/suche\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1399"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1399","ajax":true},"hide":{"cn":"Hide","name":"Verstecken","url":"\/utgcontrol\/page\/?action=hide&id=1399","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1399","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1399","ajax":true}}}]},{"id":1544,"label":"<span class='label_title'>Kontakt<\/span>","status":1025,"numChildren":0,"path":"\/kontakt\/","template":"contact","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1544"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/kontakt\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1544"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1544","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1544","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1544","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1544","ajax":true}}}]},{"id":1397,"label":"<span class='label_title'>Impressum<\/span>","status":1025,"numChildren":0,"path":"\/impressum\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1397"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/impressum\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1397"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1397","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1397","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1397","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1397","ajax":true}}}]},{"id":1398,"label":"<span class='label_title'>Taoismus<\/span>","status":1025,"numChildren":6,"path":"\/taoismus\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1398"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/taoismus\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1398"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1398","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1398","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1398","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1398","ajax":true}}}]},{"id":1401,"label":"<span class='label_title'>Pressespiegel<\/span>","status":1025,"numChildren":2,"path":"\/pressespiegel\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1401"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/pressespiegel\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1401"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1401","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1401","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1401","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1401","ajax":true}}}]},{"id":1402,"label":"<span class='label_title'>Lesetipps<\/span>","status":1025,"numChildren":1,"path":"\/lesetipps\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1402"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/lesetipps\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1402"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1402","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1402","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1402","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1402","ajax":true}}}]},{"id":1781,"label":"<span class='label_title'>Orte<\/span>","status":1025,"numChildren":46,"path":"\/orte\/","template":"places","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1781"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1781"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1781","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1781","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1781","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1781","ajax":true}}}]},{"id":1035,"label":"<span class='label_title'>Helpers<\/span>","status":1025,"numChildren":5,"path":"\/helpers\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1035"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/helpers\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1035"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1035","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1035","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1035","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1035","ajax":true}}}]},{"id":1390,"label":"<span class='label_title'>Module<\/span>","status":1025,"numChildren":8,"path":"\/modules\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1390"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/modules\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1390"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1390","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1390","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1390","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1390","ajax":true}}}]},{"id":1490,"label":"<span class='label_title'>Kontrollzentrum<\/span><i class='PageListStatusIcon fa fa-fw fa-key'><\/i>","status":1025,"numChildren":6,"path":"\/dashboard\/","template":"dashboard","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1490"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/dashboard\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1490"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1490","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1490","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1490","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1490","ajax":true}}}],"addClass":"PageListAccessOff"},{"id":1026,"label":"<span class='label_title'>login<\/span>","status":1025,"numChildren":0,"path":"\/login\/","template":"login","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1026"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/login\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1026"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1026","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1026","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1026","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1026","ajax":true}}}]},{"id":1027,"label":"<span class='label_title'>reset-pass<\/span>","status":1025,"numChildren":0,"path":"\/reset-pass\/","template":"reset-pass","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1027"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/reset-pass\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1027"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1027","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1027","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1027","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1027","ajax":true}}}]},{"id":1400,"label":"<span class='label_title'>import<\/span>","status":3073,"numChildren":0,"path":"\/import\/","template":"import","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1400"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/import\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1400"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"pub":{"cn":"Publish","name":"Ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=pub&id=1400","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1400","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1400","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1400","ajax":true}}}]},{"id":1431,"label":"<span class='label_title'>Nutzungsbedingungen Newsletter<\/span>","status":1025,"numChildren":0,"path":"\/nutzungsbedingungen-newsletter\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=1431"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/nutzungsbedingungen-newsletter\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=1431"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=1431","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=1431","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=1431","ajax":true},"trash":{"cn":"Trash","name":"<i class='fa fa-trash-o'><\/i> Papierkorb","url":"\/utgcontrol\/page\/?action=trash&id=1431","ajax":true}}}]},{"id":27,"label":"404 Seite nicht gefunden","status":1035,"numChildren":0,"path":"\/http404\/","template":"basic-page","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=27"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/http404\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=27"},{"cn":"Move","name":"Bewegen","url":"#"},{"cn":"Extras","name":"<i class='fa fa-angle-right'><\/i>","url":"#","extras":{"unpub":{"cn":"Unpublish","name":"Nicht ver\u00f6ffentlichen","url":"\/utgcontrol\/page\/?action=unpub&id=27","ajax":true},"unhide":{"cn":"Unhide","name":"Nicht verstecken","url":"\/utgcontrol\/page\/?action=unhide&id=27","ajax":true},"lock":{"cn":"Lock","name":"Sperren","url":"\/utgcontrol\/page\/?action=lock&id=27","ajax":true}}}],"type":"System"},{"id":2,"label":"<span class='label_title'>Admin<\/span><i class='PageListStatusIcon fa fa-fw fa-key'><\/i>","status":1035,"numChildren":7,"path":"\/utgcontrol\/","template":"admin","actions":[{"cn":"Edit","name":"Bearbeiten","url":"\/utgcontrol\/page\/edit\/?id=2"},{"cn":"View","name":"Anzeigen","url":"http:\/\/utg.local\/utgcontrol\/"},{"cn":"New","name":"Neu","url":"\/utgcontrol\/page\/add\/?parent_id=2"},{"cn":"Move","name":"Bewegen","url":"#"}],"addClass":"PageListAccessOff","type":"System"},{"id":7,"label":"Papierkorb<i class='PageListStatusIcon fa fa-fw fa-trash-o'><\/i>","status":1039,"numChildren":6,"path":"\/trash\/","template":"admin","actions":[{"cn":"Empty","name":"Leeren","url":"\/utgcontrol\/page\/trash\/"}],"addClass":"PageListAccessOff","type":"System","note":"< Papierkorb offen: Seiten hierher verschieben um sie wegzuwerfen"}],"start":0,"limit":50} Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'data' at row 1' in /var/www/utg.local/wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module:109 Stack trace: #0 /var/www/utg.local/wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module(109): PDOStatement->execute() #1 [internal function]: SessionHandlerDB->write('sj6ovgbs6l6btf4...', 'Session|a:13:{s...') #2 [internal function]: session_write_close() #3 {main} thrown in /var/www/utg.local/wire/modules/Session/SessionHandlerDB/SessionHandlerDB.module on line 109 So it seems DB related in this case. DB -Client Version: libmysql - mysqlnd 5.0.12-dev - 20150407. Guess I should update my local dev MySQL version... EDIT: DB Version actually is Server-Version: 5.7.21 - MySQL Community Server (GPL) Deleting all entries in seesion table doesn't help
-
Look at 3.2 in the first post, I use basic HTTP authentication which, in combination with SSL, was save enough for that application. If you need more sophisticated auth scenarios, have a look at JSON Web Tokens. @thomasaull implements it in his REST-Api site profile.
-
Thanks for that hint. My site is running on 3.0.62. That explains why it is not working for me. Will look at upgrading. @Robin S Interesting approach, thank you! Would this add significant performance overhead with using soundex() and metaphone() on the PHP side rather than in MySQL?
-
@BitPoet Thank you very much for the code! I put it in ready.php and my find logic inside a custom ProcessPageAdd::executeMembersExist hook looks like this $selector = 'template=member'; $firstname = $this->wire('sanitizer')->text($this->wire('input')->get('firstname')); $lastname = $this->wire('sanitizer')->text($this->wire('input')->get('lastname')); if($firstname) $selector .= ", soundex.firstname={$firstname}"; if($lastname) $selector .= ", soundex.lastname={$lastname}"; $selector .= ', include=all'; $users = $this->wire('users')->find($selector); I always get an error: Field does not exist: soundex Full backtrace: ProcessPageAdd: Field does not exist: soundex DEBUG MODE BACKTRACE ($config->debug == true): #0 /var/www/uhtinew.dev/wire/core/Wire.php(386): ProcessWire\PageFinder->___getQuery(Object(ProcessWire\Selectors), Array) #1 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___getQuery', Array) #2 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'getQuery', Array) #3 /var/www/uhtinew.dev/wire/core/PageFinder.php(391): ProcessWire\Wire->__call('getQuery', Array) #4 /var/www/uhtinew.dev/wire/core/PageFinder.php(391): ProcessWire\PageFinder->getQuery(Object(ProcessWire\Selectors), Array) #5 /var/www/uhtinew.dev/wire/core/Wire.php(386): ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors), Array) #6 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___find', Array) #7 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'find', Array) #8 /var/www/uhtinew.dev/wire/core/PagesLoader.php(248): ProcessWire\Wire->__call('find', Array) #9 /var/www/uhtinew.dev/wire/core/PagesLoader.php(248): ProcessWire\PageFinder->find(Object(ProcessWire\Selectors), Array) #10 /var/www/uhtinew.dev/wire/core/Pages.php(232): ProcessWire\PagesLoader->find('template=member...', Array) #11 /var/www/uhtinew.dev/wire/core/Wire.php(386): ProcessWire\Pages->___find('template=member...', Array) #12 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___find', Array) #13 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'find', Array) #14 /var/www/uhtinew.dev/wire/core/PagesType.php(260): ProcessWire\Wire->__call('find', Array) #15 /var/www/uhtinew.dev/wire/core/PagesType.php(260): ProcessWire\Pages->find('template=member...', Array) #16 /var/www/uhtinew.dev/site/modules/ProcessUhtiPageAddMember/ProcessUhtiPageAddMember.module(231): ProcessWire\PagesType->find('template=member...') #17 /var/www/uhtinew.dev/wire/core/WireHooks.php(782): ProcessWire\ProcessUhtiPageAddMember->membersExist(Object(ProcessWire\HookEvent)) #18 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageAdd), 'executeMemberse...', Array) #19 /var/www/uhtinew.dev/wire/core/ProcessController.php(244): ProcessWire\Wire->__call('executeMemberse...', Array) #20 /var/www/uhtinew.dev/wire/core/ProcessController.php(244): ProcessWire\ProcessPageAdd->executeMembersexist() #21 /var/www/uhtinew.dev/wire/core/Wire.php(380): ProcessWire\ProcessController->___execute() #22 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___execute', Array) #23 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array) #24 /var/www/uhtinew.dev/wire/core/admin.php(113): ProcessWire\Wire->__call('execute', Array) #25 /var/www/uhtinew.dev/wire/core/admin.php(113): ProcessWire\ProcessController->execute() #26 /var/www/uhtinew.dev/site/modules/AdminThemeCustom/controller.php(13): require('/var/www/uhtine...') #27 /var/www/uhtinew.dev/site/templates/admin.php(520): require('/var/www/uhtine...') #28 /var/www/uhtinew.dev/wire/core/TemplateFile.php(268): require('/var/www/uhtine...') #29 /var/www/uhtinew.dev/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #30 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #31 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #32 /var/www/uhtinew.dev/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #33 /var/www/uhtinew.dev/wire/modules/PageRender.module(514): ProcessWire\TemplateFile->render() #34 /var/www/uhtinew.dev/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #35 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___renderPage', Array) #36 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #37 /var/www/uhtinew.dev/wire/core/WireHooks.php(782): ProcessWire\Wire->__call('renderPage', Array) #38 /var/www/uhtinew.dev/wire/core/WireHooks.php(782): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent)) #39 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #40 /var/www/uhtinew.dev/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array) #41 /var/www/uhtinew.dev/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Page->render() #42 /var/www/uhtinew.dev/wire/core/Wire.php(383): ProcessWire\ProcessPageView->___execute(true) #43 /var/www/uhtinew.dev/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___execute', Array) #44 /var/www/uhtinew.dev/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #45 /var/www/uhtinew.dev/index.php(56): ProcessWire\Wire->__call('execute', Array) #46 /var/www/uhtinew.dev/index.php(56): ProcessWire\ProcessPageView->execute(true) #47 {main} It seems like the hook never gets called, although I can see it in Tracy Hooks Triggered I tried to add a low hook priority 10 but it doesn't make a difference. Also tried to add the hook in admin.php, since I only need it there. Same results. Do you have this working in one of your projects and what could be wrong here?
-
Hello all, I'd like to revive this thread as I could use such functionality for a project with more than 2000 users round the world. When new users are added I'd like to perform a fuzzy search on text fields firstname and lastname to avoid accidental duplicate entries. @teppo thanks a lot for the code examples. Everything is basically there to perform soundex search. But how would one implement this today without hacking the core? Would that be possible in a module that extends classes Selector and DatabaseQuerySelectFulltext? Or an additional option to $pages->find(), e.g. ['fuzzy' =>true]? I'm not that experienced at OOP yet, so any pointers on how to approach this would be very much appreciated.
-
@Batyr Happy you like the tutorial. Could you please be more specific about what exactly is not working: Do you get any error messages? Then post them. Do you have correct JSON in the body field of the REST Client Addon? Pls post a screenshot of how the REST Client window looks when you try to send the PUT request. Then I might be able to help.
-
SVG-based image lazyloading as a matter of enjoyable UX
gebeer replied to Andreas Augustin's topic in Showcase
great writeup on the svg lazyloading. Thank you very much for that. Very inspiring. -
In the first post of my REST API tutorial I link to clsource's REST helper class. You could use that one or lend some code from it.
-
Is it possible to use HTML tags in log files and how?
gebeer replied to Juergen's topic in General Support
I had this problem once and solved it with JSON. It is quick and simple. In your case $logmsg = array( 'Email' => $emailvalue, 'Betreff' => $subjectvalue, 'Nachricht' => $commentsvalue ); $log->save('contact-form', json_encode($logmsg)); -
Custom User Types, Page Edit vs. Profile Edit
gebeer replied to ethanbeyer's topic in General Support
@ethanbeyer As I mentioned above, I have a custom dashboard process module with links to the areas that members are allowed to view/edit. One is the edit page for their profile at /access/users/edit/?id=xxxx. I then redirect them to the dashboard upon login through a hook so they never see the page tree. $this->addHookBefore('ProcessHome::execute', $this, 'rootPage'); /** * Redirect users with custom role to another page after login */ public function rootPage(HookEvent $event) { if($this->config->ajax) return; // this is needed so that ajax background tasks still work $user = $this->user; if($user->isSuperuser() || !$user->hasRole('member')) return; if($user->hasRole('member')) { $url = $user->statusPageUrl; // custom property added via hook that returns the dashboard URL } $this->session->redirect($url); } I also have a hook that prevents them from viewing the page tree (and other pages, if required). $this->addHookAfter('Page::viewable', $this, 'viewable'); /** * Give only superusers access to certain pages */ public function viewable(HookEvent $event) { if($this->config->ajax) return; // this is needed so that ajax background tasks still work $page = $event->object; if($this->user->isSuperuser() || $page->template != 'admin') return; $denyPages = array(3); // 3=page list if (in_array($page->id, $denyPages)) { $this->session->redirect($this->user->statusPageUrl); } } I then deactivated Breadcrumbs for the member users so they don't see what else would be available. The whole logic sits on top of a custom admin theme which is based on Reno theme. But I think this is not necessary at all. It just made it easier to remove the main navigation and other stuff that I didn't need. With all that in place the members can now only see what they need to. And I can use the dashboard to render some summary information about their profile etc. This was quite some work to setup but in the end it seemed more feasible to go that route rather than trying to change the core profile edit page functionalities. But I still can't see the security benefits that come through the current restrictions in the profile edit page. If that page allows users to change their password why not allow them to change other information? EDIT: Setting up a custom dashboard process module actually isn't that hard and can be fun @bernhard wrote a great tutorial about it.- 7 replies
-
- 2
-
-
- custom user
- repeater
-
(and 4 more)
Tagged with:
-
Custom User Types, Page Edit vs. Profile Edit
gebeer replied to ethanbeyer's topic in General Support
@ethanbeyer Did you manage to work around the profile edit screen limitations? I have a directory site where users are the directory pages. Their profiles have lots of fields, including tabs andf repeaters. Since it was not possible to use the native profile edit process, I needed to find a workaround. I have a custom Dashboard page in the admin where users have a link to their user page edit screen URL like /access/users/edit/?id=1377 To have this profileEditUrl easily available for every user, I added it as a custom property via a hook: $this->addHookProperty('User(template=member)::profileEditUrl', $this, 'addPropertyProfileEditUrl'); /** * adds profile edit URL property to every member user * * @param HookEvent $event * */ public function addPropertyProfileEditUrl($event) { $user = $event->object; $event->return = $this->pages->get('template=admin, name=users')->url . "edit/?id={$user->id}"; } I had to give the member role page edit permissions for the member template. So I needed a way to make sure that they could not access other members' edit urls by just changing the id parameter in the URL. My hook for that looks like /** * prevent member user from editing other member pages */ $this->addHookAfter('ProcessPageEdit::loadPage', function(HookEvent $event) { $id = $event->arguments[0]; $user = $this->user; if($user->isSuperuser()) return; $editPage = $this->wire('pages')->get((int) $id); if($editPage->template != 'member') return; // normal members can only edit their own profile if($editPage->id != $user->id) wire('session')->redirect($user->profileEditUrl); }); Could also have hooked into Page::editable and apply logic there, I guess...- 7 replies
-
- 3
-
-
- custom user
- repeater
-
(and 4 more)
Tagged with:
-
Custom User Types, Page Edit vs. Profile Edit
gebeer replied to ethanbeyer's topic in General Support
@Zekathanks for pointing me there. I wasn't even aware that this issue exists. Otherwise I wouldn't have created my issue regarding tabs not being displayed correctly.- 7 replies
-
- 1
-
-
- custom user
- repeater
-
(and 4 more)
Tagged with: