Can

Members
  • Content count

    349
  • Joined

  • Last visited

Community Reputation

263 Excellent

About Can

  • Rank
    Sr. Member
  • Birthday 01/17/1988

Contact Methods

  • Website URL
    http://www.HappyGaia.com

Profile Information

  • Gender
    Male
  • Location
    Perú

Recent Profile Visitors

4,259 profile views
  1. haven't tested it but you should be able to replace this $value->getLanguageValue($user->language) with this $value
  2. @Slav only this gist https://gist.github.com/CanRau/662a559a07d6d7c492159d1cd497944f
  3. @ngrmm just bumped the version to 0.3.2 including a little fix so it show up again, please let me know if it works @CalleRosa40 Just checked on pw 2.8.62 and 3.0.62, cookies are created as expected..have you checked console in dev tools? it should show something..and it could be interesting to check network tab in dev tools, too, to see if it actually sends the ajax request
  4. Could you solve it? Have you tried disabling ajax? I'm really short on time at the moment :/
  5. great info thanks @kixe and @Robin S logging out could be an option..could be a little confusing though..maybe combined with some notification..thought an extra input would be more understandable
  6. Hey guys, I'm building a module to keep a user logged in until manual logout. I know about Login Persist, but this one stopped working for me a while ago and it might not even be compatible with pw3 (haven't tested this) as it's not being updated for 3 years Anyways, the module works, and now I want to secure user edit screens namely ProcessPageEdit (any user template, as there might be multiple) and ProcessProfile by requiring the current password.. I know how to add the additional input (added by hooking into ProcessProfile::execute and ProcessPageEdit::buildForm or Page::render) but I don't know how to intercept the saving and canceling the save if password doesn't match I thought about emptying $input->post (don't even know if this works?) if not valid but would be nice not to loose the changed data but instead just notify user about a wrong password.. would love to get some thoughts and input on this
  7. interesting approach thanks for sharing think the first subselector could be a nice addition to simplify things ;-)
  8. would love that too, could use it on a table field to know while searching if the first/last entry matches
  9. $user = $users->get("email=".$input->post->email('email')); this will email sanitize the email input field value combining WireInput and WireSanitizer ;-)
  10. great idea..thinking about playing with jasonette too but lend my phone to a friend for some days^^ tried you rss reader..home screen is loading but none of the feeds is...loading icon circles infinite?
  11. you don't need another template..you can use urlSegments for this and then if /amp/ is appended to the url you output amp content..without the url segment you can then output normal html which is recommended (to have both)
  12. haven't checked this threat actually, but as far as i understand i'm doing the same?! ;-)
  13. if anyone wants to allow e-mail and name in admin login with PW 3.x (and i guess 2.8) the module from @mindplay.dk wasn't working for me, i guess because ProcessLogin::execute is not pageName sanitizing the name.. this one works for me (PW 3.0.51) and allows either name or e-mail (you could change the name label to reflect this too of course) // change login name input label to e-mail-address $wire->addHookAfter('ProcessLogin::buildLoginForm', function(HookEvent $event) { // on liner as we don't change anything else $event->return->get('login_name')->set('label', $event->_('E-Mail-Address')); }); // hook into session::login to get user by mail $wire->addHookBefore('Session::login', function(HookEvent $event) { // need to get email from $input as processLogin::execute is pageName sanitizing $email = $event->input->post->email('login_name'); // stop here if login_name not a valid email if (!$email) return; // new selector arrays don't seem to work on $user so using $pages here $user = $event->pages->get([['email', $email]]); // if valid user set login name argument if ($user->id) $event->setArgument('name', $user->name); }); i've got those in a _hooks.php included in my site/init.php but you could of course outsource it into a separate module etc..
  14. as far as I know (never used it so far) it works on newly created files only (so after enabling pagefileSecure) and changes file urls, think by adding a hyphen or something which I guess .htaccess blocks already..have a look at wire/config.php excerpt: /** * Secure page files? * * When, true, prevents http access to file assets of access protected pages. * * Set to true if you want files on non-public or unpublished pages to be * protected from direct URL access. * * When used, such files will be delivered at a URL that is protected from public access. * * @var bool * */ $config->pagefileSecure = false; /** * Prefix for secure page files * * One or more characters prefixed to the pathname of secured file dirs. * * If use of this feature originated with a pre-2.3 install, this may need to be * specified as "." rather than "-". * */ $config->pagefileSecurePathPrefix = '-'; to get it working you need to block access by guest role for those templates, have a read at https://processwire.com/talk/topic/5292-proctecting-files-from-non-logged-in-users/ might be of interest: https://processwire.com/talk/topic/15622-pagefilesecure-and-pageispublic-hook-not-working/
  15. hey guys..just stumbled upon this and i think it might be interesting, at least worth a read ;-) https://medium.freecodecamp.com/how-to-build-cross-platform-mobile-apps-using-nothing-more-than-a-json-markup-f493abec1873#.az40aujdt