1
Niltsiar
Help with getting account files to a txt
  • 2004/6/13 10:04

  • Niltsiar

  • Just popping in

  • Posts: 5

  • Since: 2004/6/13


i need a php that takes my registered users and users that changed their passwords usernames and passwords and write them in a txt file in this format
[username]
PASSWORD=blah blah
it's very important forme cause i have a game server and i want to make a auto account system from my XOOPS site and activate instantly their game account anyone can help?

2
Mithrandir
Re: Help with getting account files to a txt

Add this somewhere in edituser.php - "saveuser" clause (after the error checking would be best)

//Filename should point a writeable file on the webserver
$file fopen($filename'a');
$content "[".$xoopsUser->getVar('uname')."]n";
$content .= "PASSWORD=".$password
fwrite($file$content);
fclose($file);


Several concerns, though: If the file you write to is not protected and is accessible from the web, anyone can read the passwords of your users = not good.

Preferably the file is placed outside the web root, but since it will be read by the game server, this may not be feasible.

3
Niltsiar
Re: Help with getting account files to a txt
  • 2004/6/13 11:19

  • Niltsiar

  • Just popping in

  • Posts: 5

  • Since: 2004/6/13


Thanks for help

4
Niltsiar
Re: Help with getting account files to a txt
  • 2004/6/14 4:52

  • Niltsiar

  • Just popping in

  • Posts: 5

  • Since: 2004/6/13


Quote:

$place='c:\\blahblah';
$fd = fopen ($place, "a+");
fwrite ($fd,"\n[". $xoopsUser->getVar('uname') ."]\n");
fwrite ($fd,"PASSWORD=" . $pass . "\n");
fwrite ($fd,"\n");
fclose($fd);

it works now but my only problem is when a user edit his profile but don't change his password his game password is becoming blank and his game account can be easly hacked by other users how can i fix it?

5
Mithrandir
Re: Help with getting account files to a txt

if (isset($pass) && $pass != "") {
//code goes here
}

6
Niltsiar
Re: Help with getting account files to a txt
  • 2004/6/15 1:46

  • Niltsiar

  • Just popping in

  • Posts: 5

  • Since: 2004/6/13


it's now working correctly but now another problem occured
after i send that php i cannot even login to administration menu from site when i press the button it says:
Quote:
This is your first time to enter the administration section. Press the button below to proceed.
submit cancel

but it isn't i've logged in the administration menu 24651358 times before and that was working.
when i press submit it says logging in and then the same dialog again everything is working on my page but only i can't login there.

7
Niltsiar
Re: Help with getting account files to a txt
  • 2004/6/16 14:11

  • Niltsiar

  • Just popping in

  • Posts: 5

  • Since: 2004/6/13


Also i have another problem with the edituser.php i have two different servers and wnat to make txt creation for two different files i've tried this one Quote:

if (isset($pass) && $pass != ""){
//Fist one working ==> This is working.
$yerio='c:\\blahblah\\blahblah.txt';
$ft = fopen ($yerio, "a+");
fwrite ($ft,"\n[". $xoopsUser->getVar('uname') ."]\n");
fwrite ($ft,"PASSWORD=" . $pass . "\n");
fwrite ($ft,"\n");
fclose($ft);
}
//This one is not Damn it !
$yeri='c:\\a.txt';
$fd = fopen ($yeri, "a+");
fwrite ($fd,"\n[". $xoopsUser->getVar('uname') ."]\n");
fwrite ($fd,"PASSWORD=" . $pass . "\n");
fwrite ($fd,"\n");
fclose($fd);

Mithrandir i need your might :)

8
Mithrandir
Re: Help with getting account files to a txt

For administration menu loop - check if a software firewall is blocking your HTTP referrer and that the cache folder is writeable by the server.

Likewise with the text files, they must be placed in folders writeable by the server.

9
cryogenic
Re: Help with getting account files to a txt
  • 2005/2/6 6:00

  • cryogenic

  • Just popping in

  • Posts: 13

  • Since: 2005/1/10


This thread solved half of my problem which can be seen in this thread, but still i'm in need of an register.php hack.

With the only edituser.php hack, site users should change their password once to make their game account to be activated. But with the register.php hack, whenever a user registers to site, he/she also will be registered to game with an (auto)activated account and whenever he/she edits his/her user info (password), his/her game password will be synchronized with the one in sites database...phew..

Any help would be appreciated, thank you.

Login

Who's Online

275 user(s) are online (225 user(s) are browsing Support Forums)


Members: 0


Guests: 275


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits