/** * Searches for users with Ajax */ private function searchUserAjax() { $db = TableMng::getDb(); $username = $db->real_escape_string($_POST['username']); $buttonClass = $db->real_escape_string($_POST['buttonClass']); $users = MessageFunctions::usersGetSimilarTo($username, 10); //output the findings foreach ($users as $user) { echo sprintf('<input id="%sId%s" class="%s" type="button" value="%s"><br />', $buttonClass, $user['userId'], $buttonClass, $user['userFullname']); } }
/** * Checks if the Message-Admin has access to the message [hack-safety] and * if the User got this Message, uses die() on error for Ajax * * @param int(11) $mid * @param int(11) $uid * @return void */ protected function userReturnedMsgCheckEditable($mid, $uid) { try { if (!MessageFunctions::checkIsManagerOf($mid, $_SESSION['uid'])) { die('noManager'); } else { if (!$this->existMessageWithReceiver($mid, $uid)) { die('entryNotFound'); } } } catch (Exception $e) { die('error'); } }