예제 #1
0
파일: actions.php 프로젝트: pari/rand0m
     $checked = get_POST_var("chk");
     $MU = new ManageUsers();
     $MU->userId = $user;
     $MU->update_Privilege($priv, $checked);
     send_Action_Response('Success', '1');
     break;
 case 'updateRoomPriv':
     $roomid = get_POST_var("roomid");
     $user = get_POST_var("user");
     $checked = get_POST_var("chk");
     $MU = new ManageUsers();
     $MU->userId = $user;
     if ($checked == '0') {
         $MU->Remove_AccessToRoom($roomid);
     } else {
         $MU->Allow_AccessToRoom($roomid);
     }
     send_Action_Response('Success', '1');
     break;
 case 'LeaveRoom':
     $uid = get_POST_var("uid");
     $rid = get_POST_var("rid");
     $MU = new ManageUsers();
     $MU->userId = $CURRENT_USERID;
     $res = $MU->Logout_fromRoom($rid);
     send_Action_Response('Success', '1');
     break;
 case 'updateChatMessageBookMark':
     $msgid = get_POST_var("msgid");
     $roomId = get_POST_var("roomId");
     $T_MB = new ManageBookMarks();
예제 #2
0
 public function create_Room($title, $Description, $AllowedUsers)
 {
     // TODO for sagar
     // sagar this function should return false on error and return true on successfull creation of a Room
     // And You Should do a Validation for $title to make sure it does not contain invalid characters
     // the only Characters allowd in a room title should be A-Za-z0-9 and a space
     // TODO for sagar
     // we need a similar class method to update the existing room's title, description and members
     $MU = new ManageUsers();
     $MU->userId = $_SESSION['empl_id'];
     // check if user can create New Rooms
     if (!($MU->isAdminUser() || $MU->has_Privilege('Can Create New Rooms'))) {
         return false;
     }
     // Create the room
     $success = execute_sqlInsert('tblRooms', array('roomName' => $title, 'roomDesc' => $Description, 'roomCreatedBy' => $_SESSION['empl_id']));
     $newRoomId = mysql_insert_id();
     // add given users to the created room
     foreach ($AllowedUsers as $this_user) {
         $MU->userId = $this_user;
         $MU->Allow_AccessToRoom($newRoomId);
     }
     return true;
 }