getPrincipalByPath('principals/'.$user); if(!isset($foo)){ OC_Connector_Sabre_Principal::addPrincipal(array('uid'=>$user)); } } echo "done";