• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Permanent nickname and password login

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
9 posts • Page 1 of 1

Postby Kraven » Tue Jul 27, 2010 7:04 am

Is there a way to permanently store a user name and password at login?
I would like users to be able to change their nick to any unused one while using the chat, so they can be anon, but I would also like to register user names with a password, so users are unable to pose as someone else.... for obvious reasons.

If anyone can point me in the right direction, even to other scripts that I could incorporate with PFC that would accomplish this.. it'd be much appreciated.

Thanks,
Kraven
Kraven
New member
 
Posts: 9
Joined: Fri Jul 23, 2010 7:09 pm
Top

Postby todhend » Thu Jul 29, 2010 6:52 pm

I built my own, try it here its not real easy for the beginner, it just uses a flat file to hold the user name and is encrypted


http://chat.tdah.us
Last edited by todhend on Thu Jul 29, 2010 6:54 pm, edited 1 time in total.
http://nflpick.net free football picks
http://tdah.us free webmail script
todhend
Member
 
Posts: 83
Joined: Tue Jan 19, 2010 9:03 pm
Location: Missouri
  • Website
Top

Postby Kraven » Fri Jul 30, 2010 7:50 am

Thanks todhend, that's pretty close to what I'm looking to do.
I haven't a clue as to how to tie the form to the chat.
If I saw an example of the code, and the files I would need to create, it would help.
I've been looking through the pfc files for the default nick registration form, without success.
I figure if I can get a look at that, it might be a start to understanding what I need to do.
If you could point me to those files, it'll save me a lot of time, and would be much appreciated.

You've done a nice job with your alterations.

Thanks again,

Kraven
Kraven
New member
 
Posts: 9
Joined: Fri Jul 23, 2010 7:09 pm
Top

Postby todhend » Wed Aug 11, 2010 9:02 pm

this is a very basic explanation

if your familiar with sessions, any login script with sessions will work to replace the nick parameter
so you would include the login.php on the chat index page at the top then add whatever the login script uses as the user session to the chat index like so

require("./login.php"); //holds the user session

my login script is pretty intensive so the user login session is ($_SESSION['ls_user']);

now add that to here in the chat index

$params["nick"] = $_SESSION['ls_user']; // setup the initial nickname


so what happens is when you reach the chat index the login script pulls you to its page, after you log in it creates the login session redirects you back to the index and the chat converts that to its user name in the chat
Last edited by todhend on Wed Aug 11, 2010 9:03 pm, edited 1 time in total.
http://nflpick.net free football picks
http://tdah.us free webmail script
todhend
Member
 
Posts: 83
Joined: Tue Jan 19, 2010 9:03 pm
Location: Missouri
  • Website
Top

Postby waiheke » Mon Sep 13, 2010 3:02 pm

Another way is to use a MySQL database and then you can pre-assign levels of control.
That is, a registered user can OP themselves instantly if you set the parameter in the database

There's great merit in this - no one can login in and then change their nick to pretend to be someone they're not
That means disabling the change nickname

The database has name, password and user_level.
The initial login screen asks for name and password - and if correct, checks for their status, which to keep it simple, is say a 0 or a 1:

$checkUser = "SELECT user_level,password FROM chat_users WHERE name='$formName' LIMIT 1";

If it's a 0, they are presented with a regular help menu, but if it's a 1 they are presented with an OP menu.

if(!isset($_GET['f'])) {
if($userArray['user_level'] == 1) {
include('menu1.php');
} else {
include('menu.php');
}
}
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby waiheke » Mon Sep 13, 2010 4:56 pm

Oh I forgot to add the code to allow OP status

$getAdmins = "SELECT name,password FROM chat_users WHERE user_level = 1";
$getAdminsResult = mysql_query( $getAdmins, $db );

while($row = mysql_fetch_array($getAdminsResult)) {
$params['admins'][$row['name']] = $row['password'];
}
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby Zippo » Sat Nov 06, 2010 7:19 pm

I have installed the Mysql container.
I use the chat for a game clan, so I would like password only access.

I am a totally nooby at this....
Can somebody tell step for step what to do?
Zippo
New member
 
Posts: 6
Joined: Sat Nov 06, 2010 7:13 pm
Top

Postby OldWolf » Sat Nov 06, 2010 8:27 pm

Zippo wrote:I have installed the Mysql container.
I use the chat for a game clan, so I would like password only access.

I am a totally nooby at this....
Can somebody tell step for step what to do?

So you just want to set it up so they have to know a password to access the chat?
In that case, all you really need to do is have them go to an "unlock" page, where they submit a password. The page checks the password, and if it's accurate, set a timestamp into something like $SESSION['unlocked']. On the chat page, check that value, and make sure it's within however long you're willing to allow the login to be good for.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby Zippo » Fri Nov 26, 2010 6:13 pm

Thanks!
Zippo
New member
 
Posts: 6
Joined: Sat Nov 06, 2010 7:13 pm
Top


Post a reply
9 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 24 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub