authentication - As an authorized user on a site with Wordpress? -


have site on wordpress. in short: need authenticate user site without using function in wordpress.

user authorization did so:

$time = time() + 2 * 86400000; $data = 'adminjdwd|'.$time; $key = '$l*gvjdckiub;.sj<code>=tpvo)mykm%lbh{<e?b3_%$l2eqwo2z/iukc|&fbo|</code>mq>e'; $salt = 's[rr@?wa7k]qmdboi9e?k<code>mdrpg+1!w?&u)devf-p^0h;od6.x+xbdygf4^l:y</code>c'; $key = hash_hmac('md5', $data, $key.$salt); $hash = hash_hmac('md5', 'admin|'.$time, $key); $cookie = 'admin|'.$time.'|'.$hash; setcookie('wordpress_logged_in_'.md5('http://wp.ru'),$cookie,$time,'/','.wp.ru'); 

user authorizes no problems, if user administrator, control panel not let me. cookies register authorize administrator?

there separate cookie /wp-admin pages.

i'm not sure how admin cookie constructed, should in right direction.

try:

setcookie('wordpress_'.md5('http://wp.ru'),$admincookie,$time,'/wp-admin','.wp.ru'); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -