Jump to content

androbey

Members
  • Content Count

    39
  • Joined

  • Last visited

Community Reputation

11 Good

About androbey

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ok I found the reason why my modal does not really look like it should but I don't know why the condition is not met: https://github.com/processwire/processwire/blob/master/wire/modules/Jquery/JqueryUI/JqueryUI.module#L44 $adminTheme obviously does not evaluate to true, hence the vex theme is not set. But as I am in admin backend, it should evaluate to true, shouldn't it?
  2. This is strange. "vex" is defined and trying "ProcessWire.alert('test');" leads to a similiar result as in my screenshot above.
  3. Hi everybody, I am currently developing a configurable module (no ProcessModule). Some time ago I stumbled upon a forum post about using the VEX library in the backend. Now, I wanted to try this in my module. But with the example code I get an almost useless dialog: <?php //in init method $this->modules->get('JqueryUI')->use('vex'); //javascript ProcessWire.confirm('Are you sure you want to continue?', function() { //ok },function() { // canceled }); leads to following screen: There are no erros in console. I am using ProcessWire 3.0.148. Did I miss something or doing something wrong?
  4. @ro-bo, I tried it with ProcessWire version 3.0.148, hook code placed in ready.php and it works without any problems. Maybe a good idea is to use Tracy debugger, to get a hint where the problem lies.
  5. Hi Robert, on first look I didn't look to close to your code. Please try the following: wire()->addHookAfter("Pages::saveReady", function (HookEvent $event) { $page = $event->arguments("page"); if ( $page->hasField('my_repeater') ) { $repeater = $page->my_repeater; foreach ( $repeater as $item ) { $dateStart = $item->date_start; $dateEnd = $item->date_end; if ( $dateStart && $dateEnd && $dateStart >= $dateEnd ) { $item->date_end = ''; $item->save(); throw new WireException('start date must be earlier than end date'); }//endif }//endforeach }//endif }); Hope it helps.
  6. What does not work? Do you get any error? If you want to save the "date_end" field: Did you try to save the repeater item (also with output formating set to false)?
  7. Same as @Zeka I only have a related info (in this case a module). This would involve some (a lot) more work, since you would have to build your Idendity Provider (IDP) yourself, but may still be worth to check it out. https://modules.processwire.com/modules/saml-auth/
  8. I would suggest you to use the fantastic Tracy Debugger tool and try to find out whats going on. Maybe there is something else wrong. Does the page load normally if you comment those lines out where you are trying to get file URL?
  9. Hi @JeevanisM, did you declare $pagefile before the call of "httpUrl()"? Maybe there are even log entries which give more information. In general it depends on wether you set a specific format for that specific field (single element or array) how to get the URL of the file. Assuming that your file field is named "pdffile": Case 1 - Single element $pdfUrl = $page->PDFFILE->httpUrl(); Case 2 - Array You either have to loop through all files or e.g. to get the first file: $pdfUrl = $page->PDFFILE->first()->httpUrl(); You can check format settings on details tab of your field.
  10. Hi @Torsten Baldes, I am also not really a pro, but maybe it can help nevertheless. Did you already try to hook after Pages::saved and filter to only run for user template? This way the hook runs only if the user page is saved and you can get all changed fields.
  11. Hi @teppo, I recently thought about writing a small module to record the last login of a user, in order to show the user when he logged in the last time before the current login. The data, which is necessary for this feature, is already built in your module. What do you think, would that be a good addition to your module? So maybe a public function which just returns the second recent login. Just thought it may be useful for someone else, too.
  12. Hi @horst, thank you for your fast implementation! Looks good on my end. However, I had to remove the creation of "hn_basic" (I think it's not intended to be there, is it?). Thank you and have a nice weekend 🙂
  13. In addition to @louisstephens response: I think number 2 is more likely to be an input place for other meta tags (see overview). There you can also find info about what "robots" tag is used for and also info about "canonical". As for your other question on how to "improve your SEO": you may find more info when looking up the meta tags. Not all of them are used by search engines for the ranking (if this is your primary concern).
  14. Hi @horst, I just wanted to draw attention to a problem that might affect some in the future if TLS (or STARTTLS) is used. I wasn't sure where to put my concerns, so I decided to write them down in the support forum. Some email hosting providers will shut down TLS 1.0 support in the future (or already did so). The way your module currently relies on the SMTP class (when using PHP version >= 5.6.7) it only (and exclusively) supports TLS version 1.0 (see here https://github.com/horst-n/WireMailSmtp/blob/master/smtp_classes/smtp.php#L1295). The issue is better described by one comment on the PHP forum: https://www.php.net/manual/en/function.stream-socket-enable-crypto.php#119122. Can you maybe integrate an option to allow specifying one of the available PHP crypto type constants? Hopefully I don't bother you with this and maybe it is useful for somebody. Thank you for your work in any case!
  15. Hi everybody, unfortunately I am facing an issue, which I am both not able to resolve and don't know if here is the "right" place to ask for help. However, I am hoping that some of you can give me advice. To summarize what I want to do: From inside a template file I want to get page content from a file which is outside the site directory and using current ProcessWire session information (to "authenticate" the user, or rather just check if user is logged in or not). The external script is in a folder which lies on the same level as site and wire directories. Inside my template file I have: <?php function getContents($url){ $c = curl_init($url); curl_setopt($c, CURLOPT_VERBOSE, 1); curl_setopt($c, CURLOPT_COOKIEJAR, '/tmp/cookies.txt'); curl_setopt($c, CURLOPT_COOKIEFILE, '/tmp/cookies.txt'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE']); $content = curl_exec($c); curl_close($c); return $content; } $url = $config->externalURL . 'data/getEntries.php'; $response = getContents($url); From inside the external script ("getEntries.php") I "check" if user is logged in like: <?php namespace ProcessWire; //bootstrapping ProcessWire require('../../index.php'); function getAccessStatus(){ $session = wire('session'); //following does not work, because $session is empty, also $_SERVER['HTTP_COOKIE'] is null. if(wire('user')->isLoggedin() == true){ $res['success'] = true; $res['status'] = 'OK'; }else{ $res['success'] = false; $res['status'] = 'No Auth'; } return $res; } Am I missing something or is what I want to achieve not possible this way? Hopefully someone can help. Thank you, Andreas
×
×
  • Create New...