fredbob
Members-
Posts
26 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
fredbob's Achievements
Jr. Member (3/6)
3
Reputation
-
Hi All, Just wondering if anyone has succ essfully run ProcessWire on an Azure App Service, Linux not Windows. Started off with a fresh install: Uploaded site files Setup Azure MySQL server Ran installer During the installer I get this error: Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 247 Warning: session_name(): Cannot change session name when headers already sent in /home/site/wwwroot/wire/core/Session.php on line 251 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 257 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 258 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 259 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 260 Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /home/site/wwwroot/wire/core/Session.php on line 272 Then I proceed to login ProcessWire: ProcessLogin: This request was aborted because it appears to be forged. DEBUG MODE BACKTRACE ($config->debug == true): #0 /home/site/wwwroot/wire/modules/Inputfield/InputfieldForm.module(155): ProcessWire\SessionCSRF->validate() #1 /home/site/wwwroot/wire/core/Wire.php(397): ProcessWire\InputfieldForm->___processInput(Object(ProcessWire\WireInputData)) #2 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___processInput', Array) #3 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\InputfieldForm), 'processInput', Array) #4 /home/site/wwwroot/wire/modules/Process/ProcessLogin/ProcessLogin.module(362): ProcessWire\Wire->__call('processInput', Array) #5 /home/site/wwwroot/wire/core/Wire.php(394): ProcessWire\ProcessLogin->___execute() #6 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #7 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessLogin), 'execute', Array) #8 /home/site/wwwroot/wire/core/ProcessController.php(337): ProcessWire\Wire->__call('execute', Array) #9 /home/site/wwwroot/wire/core/Wire.php(394): ProcessWire\ProcessController->___execute() #10 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #11 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessController), 'execute', Array) #12 /home/site/wwwroot/wire/core/admin.php(153): ProcessWire\Wire->__call('execute', Array) #13 /home/site/wwwroot/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/home/site/wwwr...') #14 /home/site/wwwroot/site/templates/admin.php(15): require('/home/site/wwwr...') #15 /home/site/wwwroot/wire/core/TemplateFile.php(318): require('/home/site/wwwr...') #16 /home/site/wwwroot/wire/core/Wire.php(394): ProcessWire\TemplateFile->___render() #17 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___render', Array) #18 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #19 /home/site/wwwroot/wire/modules/PageRender.module(536): ProcessWire\Wire->__call('render', Array) #20 /home/site/wwwroot/wire/core/Wire.php(397): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #21 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___renderPage', Array) #22 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #23 /home/site/wwwroot/wire/core/WireHooks.php(924): ProcessWire\Wire->__call('renderPage', Array) #24 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #25 /home/site/wwwroot/wire/modules/Process/ProcessPageView.module(213): ProcessWire\Wire->__call('render', Array) #26 /home/site/wwwroot/wire/core/Wire.php(397): ProcessWire\ProcessPageView->___execute(true) #27 /home/site/wwwroot/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___execute', Array) #28 /home/site/wwwroot/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #29 /home/site/wwwroot/index.php(55): ProcessWire\Wire->__call('execute', Array) #30 {main} I've changed permissions Checked .htaccess Set PHP session path Azure - ARR affinity (Improve performance of your stateless app by turning Affinity Cookie off, stateful apps should keep this setting on for compatibility. Learn more) Azure - Always on (Prevents your app from being idled out due to inactivity) Envirnomnet Web Server - Azure App Service (Linux) https://docs.microsoft.com/en-us/azure/app-service/containers/ PHP - 7.2 (7.2-apache), also tried 7.3 (7.3-apache) MySQL - 5.7 https://docs.microsoft.com/en-us/azure/mysql/ If anyone has gotten this to work some pointers would be great! I've decided I don't want to run it on a Windows App Service, as I would have to convert .htaccess to web.config and ProcessWire is designed and supported for Apache / Linux web servers. Any help is appreciated!
-
this request was aborted because it appears to be forged
fredbob replied to joshuag's topic in General Support
Did you ever work this one out? I'm trying to run Processwire on Azure App Service (Linux), file permissions are set correct, and I have set the PHP session path. I get the same errors on installation, then I can't looking due to the "ProcessWire: ProcessLogin: This request was aborted because it appears to be forged." error. -
_main.php AdminThemeUikit - using multi instance
fredbob replied to fredbob's topic in API & Templates
I think that was just me when I was pasting it in. I still get the same error... -
_main.php AdminThemeUikit - using multi instance
fredbob replied to fredbob's topic in API & Templates
Bump, I haven't made any progress on this. I am sure its something to do with the way that the core classes are included. But I am not sure. Cheers. -
I left this for a while, and have just come back to it. @BitPoet That creates the user okay, but doesn't allow to change the name, email, pass etc (in my testing anyway), it just created the user with today's date and time. For anyone who is interested, this is my solution. $u = $pw2->wire(new User()); $u->of(false); $u->name = $username; $u->email = $email; $u->pass = $password; $u->addRole("client"); $u->admin_theme = ("AdminThemeUikit"); $u->save(); $u->of(true); Credit from
-
Hi! So I am trying to pull some information from another ProcessWire installation within the admin area (_main.php / page tree from the AdminThemeUikit module). $pwpath = "/path/"; $pwurl = "https://url.example"; $pw = new ProcessWire($pwpath , $pwurl); which then gives me this error I then read that if it is not already in a ProcessWire environment that I would have to include the core, require('/path/to/wire/core/ProcessWire.php'); Which I tried, and makes sense that it already says it is included. So what now? Here is my _main.php from the AdminThemeUikit module (work in progress), just for reference
-
Is it possible to create users from another ProcessWire instance. This is my code for a registration page, it creates the user, but doesn't update it with the username, password and email. I presume this is because $u is on the current page, and not in the instance, and when $u is saved its not updating it on the other instance. I can't figure it out, if anyone has any ideas thy would be greatly appreciated. <?php if ($input->post->submit) { $username = $sanitizer->username($input->post->username); $email = $sanitizer->email($input->post->email); $password = $input->post->password; echo $username; echo $email; $clientbp = new ProcessWire('/path/', 'http://domain.com'); $u = $clientbp->wire(new User()); $u->of(false); $u->name = $username; $u->email = $email; $u->pass = $password; $u->addRole("guest"); $u->save(); $u->of(true); } ?> <form action="./" accept-charset="UTF-8" autocomplete="off" method="post"> <input type="text" name="username" placeholder="Username"> <input type="text" name="email" placeholder="Email"> <input type="password" name="password" placeholder="Password"> <button type="submit" name="submit" value="register">Register</button> </form>
-
I am a bit silly, $client = $pages->get("name=" . $user->name); Replaced $client = $pages->find("name=" . $user->name); Which now means I can go <?php foreach($client->find("template=bob") as $bob): echo $bob->title; endforeach; ?> I feel a bit silly about that, it was a simple fix between find() and get().
-
I have a couple of questions about the module, I am using multisite 0.0.6 (unsure if this is the latest?) in conjunction with Admin Restrict Branch, in the admin area I am going to have a couple of admin listing pages that will, for example list all the pages with the template 'bob'. The admin restrict is setup so when 'user1' logs in they can only see the user1 branch, and same for 'user2' and so on. Each users domain is setup so it is 'user1.example.com'. What I am after is when a user logs in and goes to the listing page, it will find all of the template 'bob' but only in their brand. <?php foreach($pages->find("template=bob") as $bob): echo $bob->title; endforeach; ?> Right now this code, displays all of the pages that have the 'bob' template not just the ones in the restricted branch. Any ideas? This works to find the 'user1' page if user1 is logged in. But I can't figure it out. <?php // This is the variable for the root users page (i.e the users home page) $userroot = $pages->find("name=" . $user->name); ?> Also, I would like the same in the frontend, so when a user goes to 'user1.example.com' and I run the same code as above it will do the same thing. For now, I have done this, which works. I don't know if this is good practice or not? <?php $pages = $page->rootParent; ?> -main --user1 ---Page1 (template=bob) ---Page2 (template=bob) --user2 ---Page3 (template=bob) ---page4 (template=bob) -Admin --Listing Page -Trash
-
Do you think it would be wise to use multiple sites in that way? Because each site is completely separate from every other site essentially. But I also need to be able to manege them all (updates, users etc) Originally, I was going to have separate cPanel account and PW installations for each user. But this is difficult to manage future updates (from PW and myself), and share user data from the user list on the main website (like password sync etc). However, the site folder and wire folder will remain THE SAME for each install, the only difference will be the data, pages etc.
-
Hi! Basically I have created a website 'builder' , in ProcessWire, and how I would like it to work, is that a user signs up, on the main website, and it creates their account, which then gives them access to the website builder being their own website. Similar to how Square Space works. I'm not sure how to go about the multiple sites at all, if anyone could give me some pointers? Cheers, Sam.
-
Hi, I am trying to create a frontend form that allows the user to create a page with a specific template (and fill out the fields) I have started to use code from this post This is my current code <?php $p = $pages->get(1029); $template = $p->template->name; // this is the template where we will get the fields from // make a form $form = $modules->get('InputfieldForm'); $form->method = 'post'; $form->action = './'; $form->attr("id+name",'subscribe-form'); // add the page's fields to the form $fields = $p->fieldgroup; foreach($fields as $field) { $inputfield = $fields->{$field->name}->getInputfield($p); $form->append($inputfield); } // add a submit button to the form $submit = $modules->get('InputfieldSubmit'); $submit->name = 'save_service'; $submit->attr("value", "Go"); $form->append($submit); // process the form if it was submitted if($this->input->post->save_service) { // now we assume the form has been submitted. // tell the form to process input from the post vars. $form->processInput($this->input->post); // see if any errors occurred if( count( $form->getErrors() )) { // re-render the form, it will include the error messages echo $form->render(); } else { // successful form submission $np = new Page(); // create new page object $np->template = 'service'; // set template $np->parent = $pages->get($user); // set the parent $np->of(false); // turn off output formatting before setting values $np->save(); foreach($np->fields as $f) { $np->set($f->name, $form->get($f->name)->value); } $np->save(); //create the page echo "<p>Page saved.</p>"; } } else { echo $form->render(); } And I am getting this error, I can't figure out what it is. Error: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in /home/dev/public_html/wire/core/Selectors.php line 396) #0 /home/dev/public_html/wire/core/Selectors.php(439): ProcessWire\Selectors->create('41', '', '') #1 /home/dev/public_html/wire/core/Selectors.php(159): ProcessWire\Selectors->extractString('41') #2 /home/dev/public_html/wire/core/Selectors.php(145): ProcessWire\Selectors->setSelectorString(Object(ProcessWire\User)) #3 /home/dev/public_html/wire/core/PagesLoader.php(217): ProcessWire\Selectors->init(Object(ProcessWire\User)) #4 /home/dev/public_html/wire/core/Pages.php(232): ProcessWire\PagesLoader->find(Object(ProcessWire\User), Array) #5 /home/dev/public_html/wire/core/Wire.php(383): ProcessWire\Pages->___find(Object(ProcessWire\User), Array) #6 /home/dev/public_html/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___find', Array) #7 /home/dev/public_html/wire/core/Wire.php(439): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'find', Ar This error message was shown because: you are logged in as a Superuser. Error has been logged.
- 1 reply
-
- 1
-
That actually worked thank you!
-
Hi, In the custom PHP selector code for a PageField how do I go about selecting pages that have a field that is the page that I am currently editing. $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->name == 'field2') { $page = $event->arguments('page'); $event->return = $event->pages->find('template=template1, field1=$page'); } });
-
ProcessWire database installation / softaculous
fredbob replied to fredbob's topic in General Support
Basically I would like to know what would cause this error: