293201
Boobtoob
Re: remembering logins?
  • 2003/4/23 1:33

  • Boobtoob

  • Friend of XOOPS

  • Posts: 202

  • Since: 2001/12/22


just as an fyi, this is a nice hack that works but remember that when you update your XOOPS installation from CVS or fix packs that these files will probably get over written. Keep that in mind and remember to patch any files or you will be pulling your hiar out next time.



293202
sylvainb
Re: remembering logins?
  • 2003/4/22 20:51

  • sylvainb

  • Not too shy to talk

  • Posts: 168

  • Since: 2003/2/11


And voila!
Quote:
File: user.php
==============
After:
------
setcookie($xoopsConfig['session_name'], '', time()- 3600, '/', '', 0); (line +/- 74)
Add:
----
//autologin code//
setcookie ("uid", "", time() - 3600);
setcookie ("pass", "", time() - 3600);
//end autologin code//




File: common.php
================
After:
------
$sess_handler =& xoops_gethandler('session'); (line +/- 127)
Add:
----
//autologin code//
if(empty($HTTP_SESSION_VARS['xoopsUserId']) && !empty($HTTP_COOKIE_VARS['uid']))
{
$passSQL = "select uid from ".$xoopsDB->prefix("users")." where pass = '".$HTTP_COOKIE_VARS['pass']."' and uid = ".$HTTP_COOKIE_VARS['uid'];
@$passQry = $xoopsDB->query($passSQL);
$passRst = $xoopsDB->fetchArray($passQry);
if ($passRst['uid'] == $HTTP_COOKIE_VARS['uid'])
{
$HTTP_SESSION_VARS['xoopsUserId'] = $HTTP_COOKIE_VARS['uid'];
$xoopsUser =& $member_handler->getUser($HTTP_SESSION_VARS['xoopsUserId']);
$HTTP_SESSION_VARS['xoopsUserGroups'] = $xoopsUser->getGroups();
}
else
{
setcookie ("session_name", "", time() - 3600);
setcookie ("uid", "", time() - 3600);
setcookie ("pass", "", time() - 3600);
}
}
//end autologin code//
After:
------
setcookie($xoopsConfig['session_name'], session_id(), time()+(60*$xoopsConfig['session_expire']), '/', '', 0); (line +/- 172)
Add:
----
if(!empty($HTTP_COOKIE_VARS['pass']) && !empty($HTTP_COOKIE_VARS['uid'])) // check or cookies already exist
{
// Cookie Set Code for autologon //
$passSQL = "select pass from ".$xoopsDB->prefix("users")." where uid = ".$HTTP_SESSION_VARS['xoopsUserId'];
@$passQry = $xoopsDB->query($passSQL);
$passRst = $xoopsDB->fetchArray($passQry);
setcookie('uid',$HTTP_SESSION_VARS['xoopsUserId'],time()+(60*60*24*365), '/', '', 0);
setcookie('pass',$passRst['pass'],time()+(60*60*24*365), '/', '', 0);
// Cookie Set Code for autologon //
}





Template: system_block_login.html
=================================
Add:
----
Remember me?





File: include/checklogin.php
============================
After:
------
setcookie($xoopsConfig['session_name'], session_id(), time()+$xoopsConfig['session_expire'], '/', '', 0);
Add:
----
if($rememberme == "On") // check or user has checked the checkbox, if not do nothing
{
// == Cookie Set Code for AutoLogon == //
$passSQL = "select pass from ".$xoopsDB->prefix("users")." where uid = ".$HTTP_SESSION_VARS['xoopsUserId'];
@$passQry = $xoopsDB->query($passSQL);
$passRst = $xoopsDB->fetchArray($passQry);
setcookie('uid',$HTTP_SESSION_VARS['xoopsUserId'],time()+(60*60*24*365), '/', '', 0);
setcookie('pass',$passRst['pass'],time()+(60*60*24*365), '/', '', 0);
// == Cookie Set Code for AutoLogon == //
}

But it's still on koudanshi's site THERE



293203
ndial
Re: Database problem
  • 2003/4/21 20:58

  • ndial

  • Just popping in

  • Posts: 29

  • Since: 2003/3/3 1


The problem with making a detailed non-technical tutorial is, it probably is different for different web hosts. (Unless you have your own co-located server, and if you're paying that much rent you really ought to know what you're doing or hire somebody who does )

If you get a "can't connect to database server" error and you're using settings that your hosting company told you to use to connect, you should probably contact them because it's probably a server problem.

If you get "unable to create table" it just means you don't have the permissions to create a database, and you'll have to either submit a request to your host to get an admin (or admin script) with more rights than you to make one, or you'll just have to add the tables to a database that you already have (which isn't so bad because XOOPS namespaces everything anyway).



293204
jlm69
Re: Database problem
  • 2003/4/21 20:57

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


You most likely have to have your hosting company create the database and they will give you info like :

database host
database username
database password
database name

Then you just fill in the blanks when you start XOOPS setup.



293205
bjmartin
Re: Database problem
  • 2003/4/21 20:08

  • bjmartin

  • Just popping in

  • Posts: 1

  • Since: 2003/4/21


I am relieved to see someone else having the same problem lol, ie; database creation.

I've read the answers, but it still sounds greek to me??
My host provides MySQL (but not the phpmyadmin).

I get the same error message about the inability to locate the database, and am absolutely stumped on creating one.

Any "Detailed" 4th grade tutorial would be very appreciated lol.




293206
ndial
Re: Database problem
  • 2003/4/21 18:53

  • ndial

  • Just popping in

  • Posts: 29

  • Since: 2003/3/3 1


Wait a minute -- you said you had a phpMyAdmin control panel. Do you mean you've got a hosting setup that provides a phpMyAdmin control panel, or just that you've downloaded the files? If you've got a phpMyAdmin control panel from your hosting company, then you've got a database from them, too. You just need to make sure you're using the right username and password, and pointing to the right place.

Or if your host has some special procedure for creating a database, you may have to fill out a form or something. Or, if you're managing your server yourself and you don't have a database server at all, you still have to install MySQL I'd go with the latest production release, though XOOPS will run just fine with 3.23.



293207
TitaNs
Re: Database problem
  • 2003/4/21 18:20

  • TitaNs

  • Just popping in

  • Posts: 7

  • Since: 2003/4/11


which version of MySQL must i download?

MySQL database server & standard clients:
MySQL 4.0 -- Production release (recommended)
MySQL 4.1 -- Alpha release (use this for new development)
MySQL 5.0 -- Development tree (use this for previewing and testing new features)
MySQL 3.23 -- Older production release
Older releases -- older releases (only recommended for special needs)


I have already downloaded MySQL 4.0 but it is broken file..



293208
Diva
Re: remembering logins?
  • 2003/4/21 17:59

  • Diva

  • Just popping in

  • Posts: 10

  • Since: 2002/12/28


Hey - I can't find that hack that someone listed earlier...the link is invalid. Any idea where it is or what I should search for on the site to find it?

Thanks!



293209
Diva
Re: remembering logins?
  • 2003/4/21 17:47

  • Diva

  • Just popping in

  • Posts: 10

  • Since: 2002/12/28


I just wanted to weigh in, I've set a long time out in the main menu, plus chose the option to store my cookie for a year on my personal profile, and it logs me out if I close the browser, and sometimes even whilst I'm reading the forums.

We've lost a LOT of users in the past two weeks, because people complain that it's losing their login too often.

I like Xoops, and I want to use it, but this is a really important thing. We have a lot of regular users, and it's too much work to relogin in EVERY time you want to post.



293210
yatiohi
Re: (HACK) Prevent Firewall no-login
  • 2003/4/21 9:24

  • yatiohi

  • Just popping in

  • Posts: 5

  • Since: 2003/4/9 7


I m running v2.0.1 but i can't find those files..

Is there a hack for v2?

Thanks in advance!







Login

Who's Online

404 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 404


more...

Donat-O-Meter

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

Latest GitHub Commits