Jump to content
MakeWebGames

Block multiple logins


Haunted Dawg

Recommended Posts

I have not really looked into this matter. But im sure it's also pretty easy. I want to stop multiple login's on same account. But i do not want to use mysql querys.

Maybe session registered function to check if the session is registered for that account? I do not want to use cookie's because cookies are not 100% safe to go through.

Any idea's or any pointer's on how i can do it?

Link to comment
Share on other sites

Re: Block multiple logins

Why dont you just save the session id in the database? Lets say for example user 'A' comes to your site and is assigned a session id... If they log in successfuly then save the session id in the database in the users table. Every page they request check that their session id matches the one in the users table. If it doesn't present another log in screen. If they log in successfully then save the new session id in the db. This way only one person can be logged in at one time from one browser on one machine...

The Database structure for this particular code the table would probably be something like;

 

CREATE TABLE `sessions` (
`member_id` INT( 11 ) NOT NULL ,
`session_id` VARCHAR( 32 ) NOT NULL ,
`created` TIMESTAMP( 14 ) NOT NULL
) ENGINE = MYISAM ;

Not sure... I just done it now, may be wrong. Feel free to correct me.

Remember to put it into a seperate file (e.g. check_login.php) and then pull this into the webpages you want to secure using the require() or include() functions so its more conveniant and you can edit it in one page... Unless you want to spend hours editing all scripts :-P

- Rainbow -

Link to comment
Share on other sites

Re: Block multiple logins

I was answering his question. I think its pointless just giving him the modification as he probably wont even bother to look at it and learn from it. I replied originally to his title and his opening posts which was how to block multiple logins, and I think I gave an adequate explanation :-P

https://code.zikula.org/svn/core/tags/P ... r/user.php

Press Control + F and search 'added to prevent multiple automated signups'

It should be there somewhere, and it will be an easy solution. Although its better to prevent multiple simultaneous logins, as there are circumstances where people may need to create more than one account on a website on the same PC, not necessarily for the wrong reasons.

- Rainbow -

Link to comment
Share on other sites

Re: Block multiple logins

Rainbow, i am sure you do not know me. But all i wanted was to know how to set it up, i was going to go with Session registered but being on shared host does not allow me to go into the session's folder.

So i actualy bought cronus's mod and saved me about 10 minute's to create it.

How ever i did look over cronus's code and to be honest, the code work's but just does not suite the way i code. Plus he is using the * in the mysql which personally i do not like.

So i will recode this and let cronus sell the mod, as i will not resell any of his idea's. Personal referance.

Link to comment
Share on other sites

Re: Block multiple logins

That doesnt make any sense. What has your 'style' got to do with the function of the modification. I have not seen it, but from your description you admit it does the job that initially was required to be done. So it is quite bizzare to think where your style comes into this... You wont need to edit it as it does what you specified for, and also he offers support for his modifications so if you had queries you could ask him. Why would you need to even re-code it when it follows the specific details you asked for and is the solution to your problem?

 

But all i wanted was to know how to set it up, i was going to go with Session registered but being on shared host does not allow me to go into the session's folder.

You seem pretty ignorant then, as I tried to do my best to explain. And what you are trying to say is that what I said did not help you at all? Anyway the shared host restriction is not my problem.

I dont know how old you are, but it seems to me that you dont seem to grasp the fact that money is money no matter how much the amount, it still has to be earned. And I dont think you should just waste it like that, when you look at the code and not even bother to analyse it and learn from it, and most importantly not use it. But I guess its not my place to intervene, so best of luck finding a script your 'style' - as you will need it, each person has his own.

- Rainbow -

Link to comment
Share on other sites

Re: Block multiple logins

I am 16. Very known, just ask around. I am very hated by some and very liked by more. If i was hated more than liked i would not have 190 people on msn making me change msn eh?

I have made modification's of up to 5,000 line's. This mod is 50 line's. You think it will take me long to code it?

You might think i am 16 and can't code for shit. Your wrong there. Go look through my recent topic's about mod's i have made and thing's, then you might reconsider stepping up saying i do not analyse code.

After he sent me the mod i looked through it and never liked the style. For example.

my style:

 

if( isset($_SESSION['registrar']) )
{
    echo 'Registrar is set.';
    $h->endpage();
    exit;
}

 

Correct me if i am wrong here cronus but this is his way.

 

if($_SESSION['registrar'])
{
print / echo "Registrar is set.";
$h->endpage();
exit;
}

 

Which way is easier to code? I am sure and majority off the people here will say my way. As it is layed out neater. You might think, wow 5 - 8 line's big fuss. But when it come's to 5k line's and tabbing your coding. It make's like a hell lot easier.

Now another thing i dislike about his way of coding.

mysql_query("SELECT * FROM users");

We have about 67 field's in the user's table if i am correct? Using the * selector we selecting all 67 field's when all he want's to do is count the ID being in the user's table.

My way:

mysql_query("SELECT userid FROM users");

way much faster than his way.

Run them on a big game and you will notice a huge difference.

And since we all know. Single quote's (' ') or marginally faster than double quote's (" ").

Critizise me as much as you like. I honestly do not care about your opinion nor your thousand worded post's you make each time ;)

Link to comment
Share on other sites

Re: Block multiple logins

Firstly I dont understand what my length of posts has to do with anything. I tried and I will establish myself as a good member around here adding value to the forum, building a solid foundation for myself as someone who is valued for his presence here.

The manner in which society constructs your obsession with this forum stands directly to influence policy that is not only in reference to the addictive properties of this forum and the community overall, but the pathologization of behaviour that certain groups of influence find unacceptable, or simply different. And I personally had nothing against you, but you took that for granted and just added yet another person to the list of people that dont particulary like you. All I did was say that your decision was bizzare... and it was.

 

Run them on a big game and you will notice a huge difference.

And since we all know. Single quote's (' ') or marginally faster than double quote's (" ").

It is marginally faster as you said and will not have a big affect. And for the other comment with your pure arrogance and ignorance and simply inability to consider other peoples opinions you will never achieve anything, apart from a few dollars which you may regard as a fortune. Also in what position are you to say that the ' and " have a difference, Cronus, has a relatively higher proffesional status than you and owns a reasonably big game, and even he did not notice the difference. Let me tell you this; you wont be able to notice the difference, unless you are in someway special and have special senses in timing.

 

Which way is easier to code? I am sure and majority off the people here will say my way. As it is layed out neater. You might think, wow 5 - 8 line's big fuss. But when it come's to 5k line's and tabbing your coding. It make's like a hell lot easier.

You dont need to code it, you listed specific details on the modification you required and he provided you with it. Why would you not use it and say its not your style? That is just a totally idiotic statement, your style has nothing to do with it, and besides everyone would have a different style anyway.

 

Critizise me as much as you like. I honestly do not care about your opinion nor your thousand worded post's you make each time

I did not critisise you, I critisised your statement. You asked a question and I gave my opinion on the solution, which had infact not occured to you. I did not ask you to care about my opinion, and the truth is that you do; or else you would not of made this come back.

Now this is what I think of you now; You are an immature, ignorant and arrogant kid. Who takes money for granted and has no idea about the real world, you are so obssessed with the website that you care of what people think of you on it, like you have a reputation. You abuse the privledge of having excessive Internet acces and I think you probably suffer from health problems like obesity due to lack of physical activity. You are probably a fat kid, depressed kid, one that sacrifises sleep to spend some time on CE, and you are preoccupied with getting back online when away from the computer daydreaming about what mod to create to satsify yourself. Clearly you have trouble distinguishing between the virtual world and the real world. I suggest you get a girlfriend and make some friends, and ofcourse go on a diet to loose weight :-D

- Rainbow -

Link to comment
Share on other sites

Re: Block multiple logins

Also sorry for the double post but; "I have made modification's of up to 5,000 line's. This mod is 50 line's. You think it will take me long to code it?"

If you are so god damn clever ans so good then why did you make this topic? Surely you could of done it yourself? Prat... Simple as.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...