/ Published in: PHP
Credit goes to François Nonnenmacher.
Expand |
Embed | Plain Text
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "<$mt:AdminCGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<mt:BlogID>&jsonp=mtSetUserOrLogin"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIE, $_SERVER["HTTP_COOKIE"]); curl_close($ch); $session = json_decode($json, true); if ($session['can_comment'] == 0) { header("Location: <$mt:AdminCGIPath$><$mt:CommentScript$>?__mode=login&blog_id=<mt:BlogID>&return_url=".rawurlencode($_SERVER["REQUEST_URI"])); } ?>
You need to login to post a comment.
