« first day (1375 days earlier)      last day (3558 days later) » 
02:00 - 18:0018:00 - 23:00

6:03 PM
In other words.. after you scrap your car write a report on soil erosion, and then get me a coffee.
 
Is anyone here using Vagrant? I just checked out a lot of configurations but there are two things I really don't get:
- so much bloat, there is not a single simple one that just gives the basic stack
- not a single one that creates a custom base box that speeds up stuff instead of downloading and configuring everything again and again...
 
look at this puphpet.com
 
partly addresses my first point. nothing on the second
 
6:19 PM
typically you configure one yourself that is tailored to how you work and then just re-use it
but I find it a pain in the ass and don't use it
 
because?
 
anu
@kraftner You can try my Vagrant config: wp-vagrant.com. I think it addresses your first point, and I'll get round to creating a new box with the default packages installed soon (or you could just do it yourself)
 
thanks, already had a look at it
I'd like one with Apache. But this probably brings me back to the fact that I just need to create my own to meet my needs...
 
I don't like vbox on windows for one, other developers get confused about it, I don't like fucking around with servers, and I don't see how it saves me any time.
eventually it will get better, I just want to click a button and the program figures out what I want
 
@Wyck have you set something up with puphpet that works?
 
6:26 PM
when it first came out I tried it, maybe it's better now
I need some convincing on why I would want to actually use it
 
- not spoil your dev machine with stuff you just need for one project
- still work locally
- easily move the complete environment to another machine
- be hip!
;)
 
none of those things are a concern for me, I make sites using WordPress not Ruby har har
I understand if you building an app by all means or some massive multi-environment setup, but that's hardly the case
 
@MichaelEcklund No, my login DOES have the required capability, yet sometimes it redirects me to the correct page, sometimes it doesn't.
 
Well then you probably really don't need it. :)
I just like to keep stuff separate.
E.g. I recently had to fix some small issues on a really messy WP install from a badly maintained server/install. So having this sandboxed in a VM instead of directly on my machine or dev server was really nice.
 
@Wyck Another nice thing is if you switch systems (e.g. your computer broke, you upgraded, whatever), you just pull your stuff in and an hour later you are ready to go.
 
6:40 PM
So @kaiser I'm not sure if we talked about this before. Custom Vagrant Config or something ready-made?
 
color me ignorant, but what's the advantage of a vagrant vs a manual XAMP/LAMP install?
 
pro - portability and shareability between machines. con - headaches of virtual stuff
 
Right, never thought about the sharing bit.
 
I just listed the reasons some messages above
 
oh sorry I didn't read much further up
 
6:50 PM
Personally I have no headaches of virtual stuff. My problem mostly is how to integrate the complete process into a normal setup. WP and the plugin architecture really makes it kinda hard for me. Still got missing pieces.
 
23 mins ago, by kraftner
- not spoil your dev machine with stuff you just need for one project
 
but thanks to @rarst for replying anyhow
 
I dabbled with virtual years ago the whole vagrant bandwagon :) not my thing, I prefer to be cloe and personal to my hardware
 
@kaiser Can you explain?
 
// the "ideal" setup
\ root
 |- plugins
 |- themes
 |- muplugins
 |- wp
 |- config for VM
 |- config for build process
 
6:54 PM
okay, makes sense. but...?
 
Look at Chassis (which I think is one of the better solutions so far): The root is messed up. Then there are gitmodules and tons of places to look for wp-config-*.php
 
well the way I currently work is separate wordpress installs, tables and directories, which works fine and I just go localhost/www.project1.org localhost/www.project2.org a valid approach, right?
 
yes. had that for a long time.
 
of course I check everything necessary in to a svn rep
 
svn
ok
 
6:55 PM
@kaiser hehe :D
 
ohh that's a strong reaction
bad?
 
@s1lv3r have you considered exchanging your last user name char with a n ?
@s1v3n
 
@kaiser Are we talking about Vagrant now or a complete WP Stack?
 
@s1lv3r are you currently loading a gun?
@kraftner Vagrant
 
@kraftner vagrant, I just hijacked it for a bit, stoping now
 
6:58 PM
So what does this have to do with gitmodules and wp-config locations then?
 
@kaiser na, just thinking ... - but I think I prefer it the way it is. :)
 
@kraftner in an "ideal" setup you have everything in parallel. and in one config folder you just define the setup. everything else is exchangeable.
 
@mebu83 not at all, but nowadays all the fancy devs are on git. ;-)
 
why aren't we on Darcs?
 
@kaiser I don't get your point. Is there anything that keeps you from putting all stuff relevant for vagrant in one folder?
 
7:02 PM
@s1lv3r well there I have to pay for private rep. there and on my NAS I can have as many as I like, not making any 'real' money on this so I have to be economical about this
 
@mebu83 It's like in the '90 everyone used CVS, in 2000 everyone ported to SVN and since 2010 everyone is on git - but no need to follow that trend really ... ;)
 
@kraftner not in one folder. in a lot of folders in parallel.
the plan would be to separate everything, not combine it.
 
I use git-->beanstalk (with hipchat) and i'm happy with it , I don't see a need for anything else at this point
 
so I can pull in everything from different repos but have things separated. if I exchange something, it doesn't collide or forces me to move everything out and back in again
 
you mean a separate folder for vagrant config, or multiple folder for various aspects of that vagrant config?
 
7:08 PM
@StephenHarris Thanks for the advice, I have made the suggested changes. But that doesn't solve the problem that is killing me. Any ideas?
 
@kaiser ... Did you already thought of using a custom vagrant provisioning bash script that symlinks all the things? docs.vagrantup.com/v2/provisioning/shell.html
 
@kraftner separate folders like I sketched out above: everything in a sub dir - including the whole VM.
@s1lv3r bash script? no thanks. :)
but yes, @s1lv3r I started working on my own VM setup, but haven't got time to finish it. I just waste all those precious minutes discussing what I could do with you guys :D
 
:)
 
@kaiser ... you are more into the C-based shells? :)
 
So you're problem isn't that it isn't possible but just that none of the vagrant configs that exist do it that way. Right?
 
7:16 PM
I'm back. And it still isn't working
:(
Anyone else want to have a look?
0
Q: current_user_can not always working properly

Ben WainwrightI have a custom Wordpress theme that includes a members only section. In order to implement this, I have the following code at the top of my restricted pages. <?php if ( ! current_user_can ('view_players_area') ) { header('Location: ' . wp_login_url( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_U...

 
@kraftner yes
 
I will give a backrub to anyone that can help me :D
 
@s1lv3r C ... not hipster enough
More like C-Nerd-Nerd
 
@kaiser Wow, chat really is an ineffective way to communicate...
 
1 min ago, by kaiser
@kraftner yes
(making it more efficient)
 
7:20 PM
I got your answer. Just that it took me half an hour (and multiple messages) to understand what you mean...
 
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'puphpet/ubuntu1204-x64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'puphpet/ubuntu1204-x64'
    default: URL: vagrantcloud.com/puphpet/ubuntu1204-x64
==> default: Adding box 'puphpet/ubuntu1204-x64' (v1.2) for provider: virtualbox
    default: Downloading: vagrantcloud.com/puphpet/ubuntu1204-x64/version/2/provider/…
@Wyck I'm giving a default Puphpet VM now a try. Just to see if it starts.
 
@kaiser It's okay to use it if you are using composer, node, grunt, bower and Sass at the same time to keep your hipster level up. :)
 
What I wanted to say previously is that all the Puphpet files are programatically generated and so messed up that it's impossible to debug any problems.
 
it's like you need a package manager for your package managers
2
 
@Wyck +1
 
7:24 PM
that's what task runner is for. task runner runs package managers.
 
but who is running the task runner
 
@Rarst yeah, for that reason you need grunt ...
 
madness...
Sometimes I wish we were back in notepad+ftp times...
 
@Wyck cron? :)
 
I manage scripts that manage cron jobs, that manage task runners that manage package managers. - next time someone asks what I do just say "manager"
 
7:28 PM
no, manager is who manages you to manage that.
 
Today I explained it to someone and compared it to the software automation that writes the software for the Mars rover. That worked out well.
←[0m←[0mult: Progress: 100% (Rate: 649k/s, Estimated time remaining: --:--:--)
==> default: Successfully added box 'puphpet/ubuntu1204-x64' (v1.2) for 'virtualbox'!
There are errors in the configuration of this machine. Please fix
the following errors and try again:

shell provisioner:
* The following settings shouldn't exist: run
@Wyck That much about Puphpet :D
> The following settings shouldn't exist: run
 
That much about shell provisioners ... - go and fix it :D
 
your rover just ran into a crater
 
Thanks @kaiser. One more off my list.
 
I actually considered vmware and then I realized ..why am I even doing this
 
7:32 PM
vagrant destroy
 
@BenWainwright Don't you need to call exit()? (Also you might want to use wp_redirect( $url ); exit();)
 
@StephenHarris LOL. Now I'm getting a redirect loop...
 
@BenWainwright Well, we're getting somewhere ;)
You may want to check if it's a logged-in page. If I recall correctly they are not 'admin' pages.
 
Code now looks like this
<?php

function redirect_restricted_areas( $query )
{
if ( !is_admin() && $query->is_main_query() )
{
if ( ! current_user_can( 'view_players_area' ) && (
$query->is_singular ('player-page') ||
$query->is_post_type_archive ('player-page')
) )
{
wp_redirect ( "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" );
exit;
}
}

}

add_action ( 'pre_get_posts', 'redirect_restricted_areas' );
Oh that doesn't look pretty
 
I'll post answer....
 
7:45 PM
Oh I see your point, it's still running on the login page
Nope. Still redirect loop.
@StephenHarris Still leads to redirect loop :(
 
Please see updated answer. Fixed some errors. Works for me now.
 
@StephenHarris Ok. The redirect loop is gone, but the original problem remains :/
 
8:01 PM
@BenWainwright can you determine where in the logic it deviates from what you expect?
 
@StephenHarris This is the problem. The bug is erratic so I'm finding it really hard to debug.
 
@BenWainwright Have you tried disabling all other plug-ins and theme?
 
@StephenHarris I just deactivated the two plugins I was running. Had no effect
@StephenHarris I'm wondering if it might be a problem with the host?
 
@BenWainwright Can't see why it would be. Next thing to check is if the user has the capability. Take a look at WP_User:has_cap() to see where it's going wrong.
 
@StephenHarris I definitely do. And the reason I know I do is that sometimes it works...
 
8:15 PM
Well, you could test on a localhost machine. But WordPress is pretty accommodating when it comes to server environments. And I'd expect a server issue to be consistent. There's not much to checking capabilities - it's a convoluted database look-up.
... a wait, you said is_user_logged_in() was playing up to...?
 
It was indeed
 
Could this be some sort of cookie issue? If the user is never logged in in the first place, then looking at WP_User:has_cap() is far too down the line to matter :)
 
Except in the past, when I've used it, I've been able to go straight into the dashboard afterwards
Uh. That's odd. I can't replicate the bug anymore
I wonder if there is some caching going on on my host that I don't know about
 
I've had browser caching issues when dealing with redirects. It could have been on your end.
 
Never mind, the bug is still there
 
8:23 PM
Did you try a different browser?
 
@MichaelEcklund Yup. Same problem in Safari and Chrome
@StephenHarris Yeah, just checked this. Loading restricted area redirects me to login page. Typing login redirects me back to login page. But if I then type '/wp-admin/' into the location bar, the dashboard loads fine with me fully logged in
 
So to verify... All you want to do is, check if the users is logged in and has the view_players_area capability... and if they aren't logged in or don't have the capability, you want to send them to the login page?
 
Why send a logged in user WITHOUT the capability to the login page?
They're already logged in.
Send them somewhere else.
So try redirecting to a different page, and test again.
My guess is, the user account you're using doesn't have the capability. Which is why you're getting redirected.
Verify your user account you're testing with has the correct capability.
 
It really does. As I have said several times, I know it does because I set it, and because sometimes this works
 
8:28 PM
Well if the user is logged in, and the user has the correct capability... There's no reason they should be getting redirected anywhere.
 
@BenWainwright I would advise you to replace the redirect logic with a simple "exit()" at first to check if the redirect or the capability check is the problem.
 
@s1lv3r Hmm yes, that's a good idea. That will help me add some debugging code
@MichaelEcklund Yes, that would be why this is frustrating me
 
Look in your database for that user ID, and make sure it has the capability for sure.
do a conditional check and echo yes or no.
 
@BenWainwright is error_reporting active on your setup?
 
@ungestaltbar on my development site, yes
 
8:38 PM
and display_errors as well?
so you would see an "headers already sent" error when one occurs?
 
Yes
Ok. So $current_user is NULL after login
 
@BenWainwright ...... :-|
So yes to display_errors or yes to "headers already sent" errors?
 
@s1lv3r yes to both.
@MichaelEcklund I can confirm, as I already knew, that my login does indeed have the required capability
 
@BenWainwright hmm .... basically login-cookies and/or redirect-headers cannot be written when output has already been performed in that request ... basically you can turn off display_errors and see if it works then ...
(that's also what that error message is trying to tell you) ...
 
@s1lv3r I will try that in a bit. But it seems unlikely given that the same bug is present in the live site (it isn't getting users until next week) and that has all the errors turned off.
 
8:47 PM
when your code was in the template you should have seen a headers already sent error
 
@BenWainwright ... maybe, because your live env doesn't have display_errors=on, so the same error occurs but you are not able to see the error message?!
 
9:23 PM
@s1lv3r Tried this. Doesn't make any difference :/
 
9:40 PM
@BenWainwright What's the slug your your private section? Is it "player-page"?
 
10:23 PM
How can anyone be passionate about SEO?
 
10:48 PM
why not? :)
 
@Rarst It's second guessing a computer. I get bored quickly of single player games :)
 
but it's not single player :) you play against other players in same niche and google
 
02:00 - 18:0018:00 - 23:00

« first day (1375 days earlier)      last day (3558 days later) »