Jump to content

flydev

Members
  • Posts

    1,366
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by flydev

  1. It work, just test it. The only thing which could confuse the user, its the phrase, maybe its possible to hook into the ForgotPassword module to change that. Otherwise everything is fine.
  2. Hi @suntrop by default you have to enter an username, not an email , and this user/email should exist in the system ?
  3. At this moment, you should upgrade the module by downloading it directly from Github then install GeneralSettings.module and ProcessGeneralSettings.module
  4. Then with a hook, you can remove them, look : On a module : $this->addHookAfter('LoginRegister::buildProfileForm', $this, 'renderProfileForm'); protected function renderProfileForm($event) { $form = $event->return; foreach ($form->children as $field) { if ($field instanceof InputfieldEmail || $field instanceof InputfieldPassword) { $form->remove($field); } } } or in ready.php : wire()->addHookAfter('LoginRegister::buildProfileForm', function($event) { $form = $event->return; foreach ($form->children as $field) { if ($field instanceof InputfieldEmail || $field instanceof InputfieldPassword) { $form->remove($field); } } });
  5. I think I didn't understood all the problem here but I am trying to answer anyway ? From what I understand, you are trying to update the page JohnDoe (a page under Employees parent which act as a profile page) for the user JohnDoe - correct ? My question is, why you do not use the user profile ? If your problem is the password field, you can remove it from the list of the editable fields in the LoginRegister module - as you can choose which field can be edited by the user.
  6. You should share your custom module code to get better support @MarcoPLY
  7. As the error say, you have a write permission issue on your server. What is the server version ? It is managed by Plesk ? About the web.config file, once you get your install up and working, you will get a 404 page for the frontend and backend, so just insert this block in your web.config (tested on IIS-8) : <rewrite> <rules> <rule name="Handle request for missing favicon.ico" stopProcessing="true"> <match url="favicon\.ico"/> <action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="The requested file favicon.ico was not found" statusDescription="The requested file favicon.ico was not found"/> </rule> <rule name="Handle request for missing robots.txt" stopProcessing="true"> <match url="robots\.txt"/> <action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="The requested file robots.txt was not found" statusDescription="The requested file robots.txt was not found"/> </rule> <rule name="Access Restrictions: Keep web users out of directories"> <match url="(^|/)\." ignoreCase="false"/> <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden"/> </rule> <rule name="Access Restrictions: Protect ProcessWire system files" stopProcessing="true"> <match url="^.*$" ignoreCase="false"/> <conditions logicalGrouping="MatchAny"> <add input="{URL}" pattern="(^|/)site/assets/(cache|logs|backups|sessions|config|install)($|/.*$)" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)site/install($|/.*$)" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)site/config\.php$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)(wire|site)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)site/templates($|/|/.*\.(php|html?|tpl|inc))$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)site/assets($|/|/.*\.php)$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)wire/(core|modules)/.*\.(php|inc|tpl|module)$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)site/modules/.*\.(php|inc|tpl|module)$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)(COPYRIGHT|INSTALL|README|htaccess)\.txt$" ignoreCase="false"/> <add input="{URL}" pattern="(^|/)site-default/" ignoreCase="false"/> </conditions> <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden"/> </rule> <rule name="ProcessWire Rewrite" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false"/> <conditions logicalGrouping="MatchAll"> <add input="{URL}" pattern="^/~?[-_.a-zA-Z0-9/]*$" ignoreCase="false"/> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/> <add input="{REQUEST_FILENAME}" pattern="(favicon\.ico|robots\.txt)" ignoreCase="false" negate="true"/> <add input="{URL}" pattern="\.(gif|jpg|png|ico)$" negate="true"/> </conditions> <action type="Rewrite" url="index.php?it={R:1}" appendQueryString="true"/> </rule> </rules> </rewrite>
  8. Is your module autoload property set to true ? if not, then set 'autoload' => true in the module info or if you want your module to be an autoload only on the admin area, then set autoload to : 'autoload' => function () { return (wire('page')->template == 'admin'); }
  9. Welcome to the forum ? Create a file in site/template called admin.php with this code : <?php namespace ProcessWire; require($config->paths->adminTemplates . 'controller.php');
  10. Hi, check @adrian's answer there : You can also make a small autoload module which check the user's roles then redirect him accordingly.
  11. flydev

    So happy :)

    Yes I should take the time to write a showcase, I am sure that our use of ProcessWire will interest a lot of people!
  12. flydev

    So happy :)

    I'm so glad I wanted to share that with you today. Since November 2017, all of the company's infrastructure is built on ProcessWire. Whether it is the showcase website or the millions of transactions recorded in the database as pages or all the custom modules to interact with the company's data. Just to say that I feel lucky to work all the day with what I love, and when I remember that I was demoralized thinking I had to learn Wordpress or I don't know what, because before ProcessWire I never worked with a CMS and it was becoming vital. Then I stumbled on ProcessWire (hooray!). And now, a new step for me appeared yesterday. I have a trainee for a month. And my task is to teach him how to work with ProcessWire! This make me really proud ! Have a nice day everyone and again, thanks to this community and this software! ?
  13. Yeah check your PHP settings, maybe your have output_buffering = Off in place. Did you tried my second example ?
  14. Try like that : <?php sleep(3); // sleep 3 seconds echo "wake up<br>"; if (ob_get_length()) { ob_end_flush(); flush(); } sleep(3); echo "hello world<br>"; if (ob_get_length()) { ob_end_flush(); flush(); } sleep(3); or with implicit flush : $hello = ['I', 'love', 'ProcessWire', 'the end']; ob_implicit_flush(true); ob_end_flush(); for($i = 0; $i < count($hello); $i++) { echo $hello[$i].'<br>'; sleep(1); }
  15. Thanks for your time @Macrura - PR merged !
  16. Looking at the code, it seem not : public function getMatchQuery($query, $table, $subfield, $operator, $value) { // we don't allow this field to be queried throw new WireException("Field '{$query->field->name}' is runtime and not queryable"); }
  17. I just tested and it work well. And yes, look a cool module ?
  18. Although I never used this module , you can try : $page->of(false); $page->my_field = '22223333'; $page->save(); // or $page->save('my_field'); // will save only this field $page->of(true); return ""; http://cheatsheet.processwire.com/page/built-in-methods-reference/page-setoutputformatting-true-false/
  19. Nop, you have to use the name of the button. The name attribute is used to send data. Not sure I understand, but serialize in JavaScript just take the form data and put them into a string, eg: "var1=val1&var2=val2" If you pass your params from jQuery, then you can use this function to transform your string into "params" : http://www.php.net/manual/en/function.parse-str.php Otherwise In PHP you access data with $_POST, $_GET. As I said in my previous post, use the name of the field, the ProcessWire standard way.. Which one ? ?
  20. Hi marco, to populate the profile, just set and save the user information page, eg : if($input->post->checkout_submit) { // the checkout form submit action //instantiate variables taking in the form data $cart = $sanitizer->text($input->post->cart); // set other profile var... // update user details $user->of(false); $user->cart = $cart; // update the "cart" field $user->save(); $user->of(true); } As you said, you will need to add the fields to the user profile.
  21. Damn the <div class="dropdown"> is missing. echo "<div class='dropdown'> <div class'gf-flags-wpr'> ... </div> </div>"; It should work now, if not, then rename the class .dropdown to .lang-dropdown and replace each occurrence in the CSS code I give you.
  22. You could also try this before going further ( I made a small mistake on the markup) : <?php $homepage = $pages->get('/'); $langswitch = ''; foreach($languages as $language) { if(!$page->viewable($language)) continue; // is page viewable in this language? if($language->id == $user->language->id) { // current user language $langswitch .= "<li class='current'>"; } else { $langswitch .= "<li>"; } $url = $page->localUrl($language); $hreflang = $homepage->getLanguageValue($language, 'name'); $langswitch .= "<a hreflang='$hreflang' href='$url'>$language->title<b class='gf-if gspr {$language->name}'></b></a></li>"; } echo "<div class='gf-flags-wpr'> <a role='button' class='thrd' title='Language' href='#' id='gf-fbtn'> {$user->language->title} <b class='gf-if gspr {$user->language->name}'></b> <b id='gf-fbtn-arr' class='down-s-b'></b> </a> <div id='gf-f' style='display: none;'> <ul class='gf-ful' role='navigation'> {$langswitch} </ul> </div> </div>";
  23. I can see a flag on the dropdown, now if you understand how it work, you can go to https://www.flag-sprites.com/ to build your own flag sprite, its shipped with the CSS file, include it and you have to build relation between your language title (in processwire) and the CSS class. After that it will work, but you have to do some work now ? It seem that the framework Bootstrap is overriding some CSS. For more facility, follow this blog post : http://favbulous.com/post/1006/create-custom-icons-for-twitter-bootstrap-easily
×
×
  • Create New...