Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: jdev - kesäkuu 23, 2011, 08:32:58 AP

Otsikko: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 23, 2011, 08:32:58 AP
I've looked everywhere for this option to remove it. I don't like this feature and would like to remove it. I want my users to be log in and remain logged in until they choose to log out. I don't want them to have to specify a time to stay logged in. There's got to be an option I've overlooked to make this log in field disappear! Will someone please help me? I've gone cross-eyed trying to figure it out.

Sincerely,
jdev
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 23, 2011, 02:25:47 IP

You can do a simple code edit to remove the input option and set the session length to Forever.  IIRC, it's in Register.template.php - would have to look for it.  Which version are you running?

Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 29, 2011, 04:47:26 AP
I'm running 1.1.14, I believe. Whichever one is available from GoDaddy. Sorry just now seeing your reply, I forgot to hit "notify". What you said in your response was Greek to me. I know nothing of php, code, nothing.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 29, 2011, 01:54:06 IP

Attach your Register.template.php.

Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 29, 2011, 01:57:12 IP
Thank you so much for your help, but I don't even know what that is or where to find it. I was just hoping there was a check box somewhere I could check to make that go away. I don't want to go to any trouble (or you to any trouble) doing this. I really and truly appreciate your offer to help! :)
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 29, 2011, 02:24:50 IP
AFAIK, you can't remove the option without doing a code edit in Register.template.php.  You can go to Admin -> Server Settings -> Feature Configuration and set Default login cookies length (in minutes) to a high number, which will keep your users logged in, but won't eliminate the option. 
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 01:42:45 IP
Okay, Krash, I found the template. What do I change?? This blind squirrel just found his nut! LOL
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 30, 2011, 03:16:40 IP

Speaking of blind squirrels , the correct file is Login.template.php.

Find this:



// Now just get the basic information - username, password, etc.
echo '
</tr><tr class="windowbg">
<td width="50%" align="right"><b>', $txt[35], ':</b></td>
<td><input type="text" name="user" size="20" value="', $context['default_username'], '" /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[36], ':</b></td>
<td><input type="password" name="passwrd" value="', $context['default_password'], '" size="20" /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[497], ':</b></td>
<td><input type="text" name="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '"', $context['never_expire'] ? ' disabled="disabled"' : '', ' /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[508], ':</b></td>
<td><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked="checked"' : '', ' class="check" onclick="this.form.cookielength.disabled = this.checked;" /></td>
</tr><tr class="windowbg">';
// If they have deleted their account, give them a chance to change their mind.
if (isset($context['login_show_undelete']))
echo '
<td align="right"><b style="color: red;">', $txt['undelete_account'], ':</b></td>
<td><input type="checkbox" name="undelete" class="check" /></td>
</tr><tr class="windowbg">';
echo '
<td align="center" colspan="2"><input type="submit" value="', $txt[34], '" style="margin-top: 2ex;" /></td>
</tr><tr class="windowbg">
<td align="center" colspan="2" class="smalltext"><a href="', $scripturl, '?action=reminder">', $txt[315], '</a><br /><br /></td>
</tr>
</table>

<input type="hidden" name="hash_passwrd" value="" />
</form>';




Change to this:



// Now just get the basic information - username, password, etc.
/// Remove session length options - set 'cookielength' to '-1' in hidden input to login Forever

echo '
</tr><tr class="windowbg">
<td style="padding-top:20px;" width="40%" align="right"><b>', $txt[35], ':</b></td>
<td style="padding-top:20px;"><input type="text" name="user" size="20" value="', $context['default_username'], '" /></td>
</tr><tr class="windowbg">
<td align="right"><b>', $txt[36], ':</b></td>
<td><input type="password" name="passwrd" value="', $context['default_password'], '" size="20" /></td>
</tr>
<tr class="windowbg">';

// If they have deleted their account, give them a chance to change their mind.
if (isset($context['login_show_undelete']))
echo '
<td align="right"><b style="color: red;">', $txt['undelete_account'], ':</b></td>
<td><input type="checkbox" name="undelete" class="check" /></td>
</tr><tr class="windowbg">';
echo '
<td align="center" colspan="2"><input type="submit" value="', $txt[34], '" style="margin-top: 2ex;" /></td>
</tr><tr class="windowbg">
<td align="center" colspan="2" class="smalltext"><a href="', $scripturl, '?action=reminder">', $txt[315], '</a><br /><br /></td>
</tr>
</table>
<input type="hidden" name="cookielength" value="-1" />
<input type="hidden" name="hash_passwrd" value="" />
</form>';




This is from 1.1.13, but should be the same in .14.  It eliminates both session length prompts, sets the session length to forever, and reformats the login window.

Make a backup before you change it.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 03:23:25 IP
Thanks so much. It shouldn't interfere with my captcha or logic tests should it?
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 30, 2011, 03:24:43 IP

No, it has no effect on anything but the login session length.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 03:27:54 IP
Okay, dang, I'm in godaddy in the files and can't find the page you said to find. So much for my nut.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 03:30:13 IP
Best I can find is LogInOut.php in the Sources folder.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 30, 2011, 03:54:35 IP

Login.template.php is in /Themes/default/, same directory where you found Register.template.php.

Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 04:00:19 IP
I actually didn't find it, I was just being hopeful.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 30, 2011, 10:30:01 IP

"Those who live in hope, die in despair."

Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 10:41:24 IP
Your quote is poppycock. Poppycock, I say.

Krash, I've looked in all my files at godaddy. Also in all the files in the actual admin section of the forum. I can't find it.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: mashby - kesäkuu 30, 2011, 11:07:58 IP
LogInOut.php is indeed in the Sources folder, so go up a folder, find Themes and then default. Do you see a Login.template.php file?
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 11:09:59 IP
All I see is LoginOut.php in godaddy. In my forum there is nothing like that.
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: mashby - kesäkuu 30, 2011, 11:12:31 IP
Can you define the interface of godaddy? The file you are referencing is in the Sources folder of SMF. If you went up one level (which would be the root of wherever you have SMF installed), you should see a Themes folders and in there a default folder where the Login.template.php file should be. Could you possibly provide a screen shot of what you're looking at?
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Sir Osis of Liver - kesäkuu 30, 2011, 11:15:01 IP

Do you have an FTP client?  GoDaddy's website is a nightmare, but you can access your account directly via FTP.

Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 11:21:27 IP
Found it. Had no idea I needed to go that deeply. :)
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: jdev - kesäkuu 30, 2011, 11:26:33 IP
Implemented Krash's change, tested, and it works. Thanks to both of you!
Otsikko: Re: How to remove "Stay Logged In For" Prompt
Kirjoitti: Aleksi "Lex" Kilpinen - heinäkuu 01, 2011, 12:34:40 AP
That's great :) Marking this solved then.