powered by Jive Software

Clear openfire roster cache automatically

Hi guys, i run openfire 3.6.3 with OpenLDAP , all is working fine, here is a one problem, when i add new member in ldap, it takes some

time to show in roster, i want immedidate results, so i clear roster cache, and re login so new member show, i want to make a short

script like to clear the openfire roster automatically after i required, so i not want to login to web page and click here and there, here below

the below php code i try, but it not works . Any suggestion and idea regarding clear roster cache automatically is greatly appreciated

PHP code

<?php # function destroy_cache($password, $username, $domain, $cookie) { $password = "xxxx"; $username = "ldapuser1"; $domain = "[https://myhost.com:9091/](https://myhost.com:9091/)"; $cookie = "cookie_openfire.txt"; $POST ="login.jsp&login=true&username=".$username."&password=".$password; $page_ = $domain."login.jsp"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $page_); curl_setopt( $session, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt($ch, CURLOPT_POSTFIELDS, $POST); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); $data = curl_exec($ch); curl_close($ch); echo $data; for($i = -1; $i<=32; $i++){ $cacheID[] = $i; } $POST = join("&cacheID=", $cacheID); $POST = $POST."&clear=Clear+Selected"; $page_ = $domain."system-cache.jsp"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $page_); curl_setopt( $session, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt($ch, CURLOPT_POSTFIELDS, $POST); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); $data = curl_exec($ch); curl_close($ch); echo $data."Called"; } destroy_cache($password, $username, $domain, $cookie); ?>

Regards

Muzammel

$POST ="login.jsp?login=true&username=…