Moderator: moderators
falsadoo wrote:The chat that is in subsonic is very small and can not keep the massages
<?php
/*
* @package AJAX_Chat
* @author Sebastian Tschan
* @copyright (c) Sebastian Tschan
* @license GNU Affero General Public License
* @link https://blueimp.net/ajax/
*/
// List containing the registered chat users:
$users = array();
// Default guest user (don't delete this one):
$users[0] = array();
$users[0]['userRole'] = AJAX_CHAT_USER;
$users[0]['userName'] = null;
$users[0]['password'] = null;
$users[0]['channels'] = array(0);
<?php
include('PATHtoYOUR/chat/lib/data/users.php');
//check existing users
if ($_POST['username'])
{
//if user entered a name
}
//collect information from users.php
$user_amount = count($users);
for ($i=0; $i <=$user_amount;$i++);
{
//check usage of name
if (strtolower($_POST['username']) == strtolower($users[$i]['userName']))
$username_used = 1;
}
//make sure user chose a password
if (!$_POST['password'])
$password_error = 1;
//ensure username avalible and password chosen
if (!$username_used and !$password_error)
{
//present user id accepted message
print 'Your selection '.$_POST['username'].' was accepted... your account was created. You may now login!!!';
$next_user = $user_amount++;
$new_user_information = '
//remote created from '.$_SERVER['REMOTE_ADDR'].'
$users['.$next_user.'] = array();
$users['.$next_user.'][\'userRole\'] = AJAX_CHAT_USER;
$users['.$next_user.'][\'userName\'] = \''.$_POST['username'].'\';
$users['.$next_user.'][\'password\'] = \''.$_POST['password'].'\';
$users['.$next_user.'][\'channels\'] = array(0,1);
?>';
$file_edit = fopen('PATHtoYOUR/chat/lib/data/users.php', 'r+');
fseek($file_edit, -3,SEEK_END);
fwrite($file_edit, $new_user_information);
fclose($file_edit);
}
//end of php
?>
<table border="0" align="center">
<table border="0" align="center">
<tr>
<td>Use the form below to create a Chat user account.</td>
</tr>
<tr>
<td>
<!-- collect username and password information via form -->
<form action="" method="post">
Username:<input name="username" type="text" value="" /> 16 Character Maximum<br>
Password:<input name="password" type="text" value="" /> No requirements.<br>
<input name="submit" type="submit" value="Create" />
</form>
</td>
</tr>
</table>
</table>
SparkyRih wrote:So it just uses a plain PHP file to auth users...
And I can't just trick the file, because I use encrypted passwords instead of plain text passwords in the DB...
But I will see if I can find something to plug a DB into it.......
Edit: I figured it out
It's a matter of time now
Return to Mods, Apps and Clients
Users browsing this forum: No registered users and 21 guests