I partially solved the problem with this:
function MYTHEME_preprocess_html(&$vars){
global $user;
foreach ($user->roles as $role) {
$vars['classes_array'][] = 'role-current-' . strtolower(str_replace(' ', '-', $role));
}
if(arg(1) && arg(0)=='user'){
$account=user_load(arg(1));
foreach ($account->roles as $role) {
$vars['classes_array'][] = 'role-visited-' . strtolower(str_replace(' ', '-', $role));
}
}
}
with this CSS:
.role-current-beta-tester .content_left .user_picture_block img,
.role-visited-beta-tester .user-profile .field-name-ds-user-picture img{
border: 17px #019E96 solid;
background: white;
}
.role-current-moderator .content_left .user_picture_block img,
.role-visited-moderator .user-profile .field-name-ds-user-picture img{
border: 17px #37A962 solid;
background: white;
}
.role-current-administrator .content_left .user_picture_block img,
.role-visited-administrator .user-profile .field-name-ds-user-picture img{
border: 17px #517180 solid;
background: white;
}
.role-current-usuario-profesional .content_left .user_picture_block img,
.role-visited-usuario-profesional .user-profile .field-name-ds-user-picture img{
border: 17px #8A101C solid;
background: white;
}
.role-current-usuario-no-profesional .content_left .user_picture_block img,
.role-visited-usuario-no-profesional .user-profile .field-name-ds-user-picture img{
border: 17px #A8CE3D solid;
background: white;
}
but that only works for the border of the picture displayed by the user-picture-block module and the picture of each user's profile (formatted with Display Suite). I still have the problem of the forums, my user search view and a small block that display user's latest comments on the forums (the default one of Advanced Forum module).