Location: PHPKode > projects > IntraMessenger > distant/include/get_options_1_role.inc.php
<?php
/*******************************************************
 **                  IntraMessenger - server          **
 **                                                   **
 **  Copyright:      (C) 2006 - 2011 THeUDS           **
 **  Web:            http://www.theuds.com            **
 **                  http://www.intramessenger.net    **
 **  Licence :       GPL (GNU Public License)         **
 **  http://opensource.org/licenses/gpl-license.php   **
 *******************************************************/

/*******************************************************
 **       This file is part of IntraMessenger-server  **
 **                                                   **
 **  IntraMessenger is a free software.               **
 **  IntraMessenger is distributed in the hope that   **
 **  it will be useful, but WITHOUT ANY WARRANTY.     **
 *******************************************************/
//
if ( !defined('INTRAMESSENGER') )
{
  exit;
}
//
if ( (!isset($_GET['iu'])) or (!isset($_GET['ip'])) or (!isset($_GET['v'])) ) die();
//
$ip = 			  f_decode64_wd($_GET['ip']);
$n_version = 	intval($_GET['v']);
$id_user =	  intval(f_decode64_wd($_GET['iu']));
$id_user = 		(intval($id_user) - intval($action));
//
if (preg_match("#[^0-9]#", $id_user)) $id_user = "";
//
if ( ($id_user > 0) and ($n_version > 0) and ($ip != "") and (_ROLES_TO_OVERRIDE_PERMISSIONS != "") )
{
  require ("../common/acces.inc.php");
  f_verif_ip($ip);
  //
  require ("../common/sql.inc.php");
  require ("../common/roles.inc.php");
  $id_role = f_role_of_user($id_user);
  //
  if ($id_role > 0)
  {
    $t_allow_change_contact_nickname = f_role_permission($id_role, "ALLOW_CHANGE_CONTACT_NICKNAME", _ALLOW_CHANGE_CONTACT_NICKNAME);
    $t_allow_change_email_phone = f_role_permission($id_role, "ALLOW_CHANGE_EMAIL_PHONE", _ALLOW_CHANGE_EMAIL_PHONE);
    $t_allow_change_function_name = f_role_permission($id_role, "ALLOW_CHANGE_FUNCTION_NAME", _ALLOW_CHANGE_FUNCTION_NAME);
    $t_allow_change_avatar = f_role_permission($id_role, "ALLOW_CHANGE_AVATAR", _ALLOW_CHANGE_AVATAR);
    $t_allow_conference = f_role_permission($id_role, "ALLOW_CONFERENCE", _ALLOW_CONFERENCE);
    $t_allow_email_notifier = f_role_permission($id_role, "ALLOW_EMAIL_NOTIFIER", _ALLOW_EMAIL_NOTIFIER);
    $t_allow_invisible = f_role_permission($id_role, "ALLOW_INVISIBLE", _ALLOW_INVISIBLE);
    $t_allow_send_to_offline_user = f_role_permission($id_role, "ALLOW_SEND_TO_OFFLINE_USER", _ALLOW_SEND_TO_OFFLINE_USER);
    $t_allow_smileys = f_role_permission($id_role, "ALLOW_SMILEYS", _ALLOW_SMILEYS);
    $t_allow_use_proxy = f_role_permission($id_role, "ALLOW_USE_PROXY", _ALLOW_USE_PROXY);
    $t_allow_rating = f_role_permission($id_role, "ALLOW_USER_RATING", _ALLOW_USER_RATING);
    $t_user_cannot_history_messages = f_role_permission($id_role, "ALLOW_USER_TO_HISTORY_MESSAGES", _ALLOW_USER_TO_HISTORY_MESSAGES);
    if ($t_user_cannot_history_messages == "") $t_user_cannot_history_messages = "X";   else  $t_user_cannot_history_messages = "";   // (option inversée !!!)
    //$t_censor_messages = f_role_permission($id_role, "CENSOR_MESSAGES", _CENSOR_MESSAGES);
    if (_CRYPT_MESSAGES != "") 
      $t_log_messages = 1;
    else
      $t_log_messages = f_role_permission($id_role, "LOG_MESSAGES", _LOG_MESSAGES);
    //
    $t_max_nb_contact_by_user = f_role_permission($id_role, "MAX_NB_CONTACT_BY_USER", _MAX_NB_CONTACT_BY_USER);
    //
    // 30 :
    $t_lock_user_contact_list = f_role_permission($id_role, "LOCK_USER_CONTACT_LIST", _LOCK_USER_CONTACT_LIST);
    $t_lock_user_options = f_role_permission($id_role, "LOCK_USER_OPTIONS", _LOCK_USER_OPTIONS);
    $t_lock_user_profil = f_role_permission($id_role, "LOCK_USER_PROFILE", _LOCK_USER_PROFILE);
    // 40 :
    $t_group_user_can_join = f_role_permission($id_role, "GROUP_USER_CAN_JOIN", _GROUP_USER_CAN_JOIN);
    //if (PENDING_USER_ON_COMPUTER_CHANGE != '')
    //if (USER_HIEARCHIC_MANAGEMENT_BY_ADMIN != '')
    $t_srv_list_status = f_role_permission($id_role, "SERVERS_STATUS", _SERVERS_STATUS);
    // 50 :
    $t_bookmarks = f_role_permission($id_role, "BOOKMARKS", _BOOKMARKS);
    $t_bookmarks_allow_vote = f_role_permission($id_role, "BOOKMARKS_VOTE", _BOOKMARKS_VOTE);
    $t_bookmarks_need_approval = f_role_permission($id_role, "BOOKMARKS_NEED_APPROVAL", _BOOKMARKS_NEED_APPROVAL);
    // 60 :
    $t_allow_shoutbox = f_role_permission($id_role, "SHOUTBOX", _SHOUTBOX);
    $t_shoutbox_allow_vote = f_role_permission($id_role, "SHOUTBOX_VOTE", _SHOUTBOX_VOTE);
    $t_shoutbox_need_approval = f_role_permission($id_role, "SHOUTBOX_NEED_APPROVAL", _SHOUTBOX_NEED_APPROVAL);
    $t_shoutbox_refresh_delay = f_role_permission($id_role, "SHOUTBOX_REFRESH_DELAY", _SHOUTBOX_REFRESH_DELAY);
    // 100 :
    $t_role_get_admin_alert_msg = f_role_permission($id_role, "ROLE_GET_ADMIN_ALERT_MESSAGES", ""); // c'est un role, pas une option !
    $t_role_send_alert_to_admin = f_role_permission($id_role, "ROLE_SEND_ALERT_TO_ADMIN", ""); // c'est un role, pas une option !
    $t_role_broadcast_alert_to_group = f_role_permission($id_role, "ROLE_BROADCAST_ALERT_TO_GROUP", ""); // c'est un role, pas une option !
    $t_role_broadcast_alert = f_role_permission($id_role, "ROLE_BROADCAST_ALERT", ""); // c'est un role, pas une option !
    //
    //$xxxxxxxxxxxxxxxxxxxxxxxxx = f_role_permission($id_role, "XXXXXXXXXXXXXXXXX", _XXXXXXXXXXXXXXXX);
    //$xxxxxxxxxxxxxxxxxxxxxxxxx = f_role_permission($id_role, "XXXXXXXXXXXXXXXXX", _XXXXXXXXXXXXXXXX);
    //
    //if (_PWD_NEED_DIGIT_LETTER != '')                     $t_pass_need_digit_and_letter = "X"; else $t_pass_need_digit_and_letter = "";
    //if (_PWD_NEED_UPPER_LOWER != '')                      $t_pass_need_upper_and_lower = "X"; else $t_pass_need_upper_and_lower = "";
    //if (_PWD_NEED_SPECIAL_CHARACTER != '')                $t_pass_need_special_character = "X"; else $t_pass_need_special_character = "";
    //
    mysql_close($id_connect);
    //
    // on renvoi les valeurs des options suivant le role :
    echo ">F05#OK#" . $t_allow_change_contact_nickname . "#" . $t_allow_change_email_phone . "#" . $t_allow_change_function_name . "#";
    echo $t_allow_change_avatar . "#" . $t_allow_conference  . "#" . $t_allow_email_notifier . "#" .$t_allow_invisible . "#";
    echo $t_allow_send_to_offline_user . "#" . $t_allow_smileys . "#" . $t_allow_use_proxy . "#";
    echo $t_allow_rating . "#" . $t_user_cannot_history_messages . "##" . $t_log_messages . "#" . $t_max_nb_contact_by_user . "########";
    // 30 :
    echo $t_lock_user_contact_list . "#" . $t_lock_user_options . "#" . $t_lock_user_profil . "#####";
    // 40 :
    echo $t_group_user_can_join . "#". "#". "#".  $t_srv_list_status . "###";
    // 50 :
    echo $t_bookmarks . "#" . $t_bookmarks_allow_vote . "#" . $t_bookmarks_need_approval . "#####";
    // 60 :
    echo $t_allow_shoutbox . "#" . $t_shoutbox_allow_vote . "#" . $t_shoutbox_need_approval . "#" . $t_shoutbox_refresh_delay . "####";
    echo "####################" ;
    // 100 :
    echo $t_role_get_admin_alert_msg . "#" . $t_role_send_alert_to_admin  . "#" . $t_role_broadcast_alert_to_group . "#" .  $t_role_broadcast_alert . "#####";
    //echo $xxxxxxxxxxxxxxxxxx . "#" . $xxxxxxxxxxxxxxxxx . "#" . $xxxxxxxxxxxxxx . "#";
    //echo $xxxxxxxxxxxxxxxxxx . "#" . $xxxxxxxxxxxxxxxxx . "#" . $xxxxxxxxxxxxxx . "#";
    echo "#################" ;
  }
  else
  {
    mysql_close($id_connect);
    echo ">F05#SO#"; // no role
  }
}
else
  echo ">F05#KO#";
?>
Return current item: IntraMessenger