Usability - Adding a login form whenever there is a _NOT_AUTH message

Locked
User avatar
machadoug
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 107
Joined: Fri Jun 23, 2006 4:41 pm
Location: Curitiba - PR - Brazil
Contact:

Usability - Adding a login form whenever there is a _NOT_AUTH message

Post by machadoug » Wed Oct 11, 2006 4:11 pm

Whenever there is a private link that I'm not allowed to see as a registered user Joomla! shows:
You are not authorized to view this resource.
You need to login.
Usually there is no login form anywhere around and I have to go to the main page and then I see the mod_login!!!

In order to make Joomla! meet usability standards I've changed function mosNotAuth() located in the /includes/joomla.php, please take a look and take it under consideration for future versions:

Code: Select all

function mosNotAuth() {
	global $my;

	echo _NOT_AUTH;
	if ($my->id < 1) {
		echo "<br />" . _DO_LOGIN;
		/**
Modified by Douglas de Senne Machado
Used a few lines from component com_login
		**/
		?>
		<br />
		<br />
		<br />
		<form action="<?php echo sefRelToAbs( 'index.php?option=login' ); ?>" method="post" name="login" id="login">
				<div class="componentheading">Efetue o Login</div>
				<br />
					<label for="username"><?php echo _USERNAME; ?>
						<input name="username" id="username" type="text" class="inputbox" size="25" style="display:block" />
					</label>
					<label for="passwd"><?php echo _PASSWORD; ?>
					<input name="passwd" id="passwd" type="password" class="inputbox" size="25" style="display:block" />
					</label>
					
					<br/>
					<label style="display:block">
					<input type="checkbox" name="remember" class="inputbox" value="yes" style="width:12px;height:12px" />
					<?php echo _REMEMBER_ME; ?>
					</label>
					
					<a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&task=lostPassword' ); ?>">
					<?php echo _LOST_PASSWORD; ?>
					</a>
						<br />
						<?php echo _NO_ACCOUNT; ?>
						<a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&task=register' ); ?>">
						<?php echo _CREATE_ACCOUNT;?>
						</a>
					<br />
					<br />
					<input type="submit" name="submit" class="button" value="<?php echo _BUTTON_LOGIN; ?>" />
			<noscript>
			<?php echo _CMN_JAVASCRIPT; ?>
			</noscript>
		<input type="hidden" name="op2" value="login" />
		</form>
		<?php
	}
}
I'm more a user than a programmer, so - of course - there are a lot of improvements to be made, however it's a start point!

Best regards,
Douglas Machado :: Joomla Extension Developer :: [<o>]
My Joomla Extensions: https://IdealExtensions.com

User avatar
eyezberg
Joomla! Hero
Joomla! Hero
Posts: 2859
Joined: Thu Aug 25, 2005 5:48 pm
Location: Geneva mostly
Contact:

Re: Usability - Adding a login form whenever there is a _NOT_AUTH message

Post by eyezberg » Wed Oct 11, 2006 7:23 pm

very nice idea, make it easy for the users! ;)
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.[URL banned].com for J! 1.5 screenshots
http://www.eyezberg.com

User avatar
machadoug
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 107
Joined: Fri Jun 23, 2006 4:41 pm
Location: Curitiba - PR - Brazil
Contact:

Re: Usability - Adding a login form whenever there is a _NOT_AUTH message

Post by machadoug » Wed Oct 11, 2006 7:39 pm

Hopefully someone one day will make include something similar in the out of the box installation!

BTW, Thanks for putting up your http://joomla15.[URL banned].com, I haven't installed 1.5 just yet. But will do tomorrow (Beta release date)!!! The JPGs files did not show in Firefox... I had to go open IE in order to view them!

Regards,
Douglas Machado :: Joomla Extension Developer :: [<o>]
My Joomla Extensions: https://IdealExtensions.com

User avatar
eyezberg
Joomla! Hero
Joomla! Hero
Posts: 2859
Joined: Thu Aug 25, 2005 5:48 pm
Location: Geneva mostly
Contact:

Re: Usability - Adding a login form whenever there is a _NOT_AUTH message

Post by eyezberg » Wed Oct 11, 2006 9:09 pm

Strange, I use the site with FF all the time..
Sometimes one pays most for the things one gets for nothing.
The important thing is not to stop questioning. Curiosity has its own reason for existing. AE
http://joomla15.[URL banned].com for J! 1.5 screenshots
http://www.eyezberg.com

stackedsax
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Thu Mar 02, 2006 8:09 am

Re: Usability - Adding a login form whenever there is a _NOT_AUTH message

Post by stackedsax » Fri May 25, 2007 7:05 am

I think there's an easier way of doing it:

Code: Select all

       
 echo _NOT_AUTH;
        if ($my->id < 1) {
                echo "<br />" . _DO_LOGIN;
                include ( $GLOBALS['mosConfig_absolute_path'] . '/components/com_login/login.html.php');
                include ( $GLOBALS['mosConfig_absolute_path'] . '/components/com_login/login.php');
        }
And you're done...?


Locked

Return to “Design and Accessibility - Archived”