Пример #1
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
define('IN_APP', true);
require_once('./interfase/common.php');
require_once(ROOT . 'interfase/chat.php');

$keepalive = true;

$user->init();
$chat = new _chat();

if ($chat->_setup()) {
	$mode = request_var('mode', '');
	$csid = request_var('csid', '');
	
	$s_process = in_array($mode, array('logout', 'send', 'get'));
	
	if (request_method() == 'post' && !$s_process) {
		redirect(s_link('chat', $chat->data['ch_int_name']));
	}
	
	if (!$user->data['is_member']) {
		do_login('LOGIN_TO_CHAT');
	}
	
	if (!$chat->auth()) {
		trigger_error('CHAT_NO_ACCESS');