Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Front End User Login Plugin (XML Or Database - ver: 3.0)
really nice, thank you for this simple answer Big Grin

I'll stay tuned for version 3.1, even I need to adapt all changes I did.
Reply
Hi again,

when i loggin with a name called 'BjÖrn' for example, the 'Ö' isn't display right. Also with ö, ä, ü.
Please note this on version 3.1

Regards,
SlazZe.
Reply
mvlcek Wrote:
lrsk Wrote:I am having some trouble adding I18N functionality to another plugin I'm using (user-login). I have previously hard-coded messages to the user etc, but would now like to add a language switching capability.

I decided to use I18N for this, and I followed the instructions here to be able to call e.g. i18n_r("user-login/REGISTER_MSG"). This works to a degree, but I am not able to switch between languages.

At first, everything was always English, confirmed by dumping $LANG to the screen. Then I decided to add $LANG = "nb_NO"; To my gsconfig.php file. This made everything Norwegian. The user-login plugin is using the language files I made in user-login/lang/ but I don't understand how to make the ?setlang=en/nb work with it.

Thanks for a great plugin. Hoping for a quick resolution.

The Front End User Plugin does not support the I18N plugin but relies on the $LANG variable.
Depending on how the Front End User Plugin works internally, you might have success with adding the following somewhere to the top of your template:
Code:
<?php global $language; $LANG = $language == 'nb' ? 'nb_NO' : 'en_US'; ?>
(of course this will not work, if the plugin loads the language texts before the template is executed)


I have tried adding this code in the header.php file that I use for the template, but the setlang functionality is still not working right with the user-login plugin. I have tried adding the code:

Code:
if (function_exists('i18n_load_texts')) {
    i18n_load_texts('user-login');
  } else {  
    i18n_merge('user-login', substr($LANG,0,2)) || i18n_merge('user-login', 'en');
  }

into the plugin file, but it still won't work correctly. In fact, it does work if I set the language using setlang and then navigate to a different page or refresh the login page. I have dug deeper into the code and found that $LANG does not change until after I navigate to a different page or rerun the same page, nor does $_SESSION['language']. I thought about setting $LANG = $language in the i18n_load_texts() function or something, but the $language variable is empty there for some reason.

I don't want to create a solution that is so hacky that I can't maintain the site...
Reply
Quote:Frad wrote

i get this message when i want to add an user:
"Username Already Taken"
GetSimple: 3.1
Frontend User 3.0

Hi,

To solve this problem, create a directory which name is "site-users" on the data directory (/data/site-users/).
Doing this, each user data created will be stored on it in a xml file.

Hope it help,

Simply enjoy get simple!
Reply
How can i place the login form on my start page - not on the sidebar?

If i place this code in the "Edit Protected Message" source code

<?php echo show_login_box(); ?>

IT doesn´t work...

Any idea?
Reply
thanks mckael !!! it works fine...
Reply
FRAD Wrote:How can i place the login form on my start page - not on the sidebar?

If i place this code in the "Edit Protected Message" source code

<?php echo show_login_box(); ?>

IT doesn´t work...

Any idea?
You have a few ways to accomplish this.
  • 1. The Normal Way: Put the function in your template file.
  • 2. Put the php code in a component and use the dynpages plugin to place the component in your page
  • 3. If you want to only display the login form only on your homepage you could place somthing like the below coding into your template file:
Code:
<?php
if(!isset($_GET['id']) || $_GET['id'] == 'index')
{
    echo show_login_box();
}
?>
Reply
hi,

i had the sam idea but when i insert this in the source code "Edit Protected Message" nothing works

{% loginform %}

I see this on my frontend page: {% lwz_start %}

dynpages are installed....
Reply
FRAD Wrote:hi,

i had the sam idea but when i insert this in the source code "Edit Protected Message" nothing works

{% loginform %}

I see this on my frontend page: {% lwz_start %}

dynpages are installed....
That is because the dynpages checks the content of the page for components, not my plugins protected message node. There is currently no way to place the login form *inside* the actual protected message without editing the core plugin.
Reply
ok thanks!! great job. It works very well for me!
Reply
FRAD Wrote:ok thanks!! great job. It works very well for me!
NP, if you really feel it necessary to have the login form directly above or in between the protected message, let me know and I will instruct you on editing the plugin files.

Also if there is any capabilities you find would be useful, feel free to suggest them.
Reply
Not sure why I cant add new users.
This is the error message returned for any user and configuration.
[Image: DJACH.jpg]
Any ideas how I can fix this?
ty
Reply
roy_b8te Wrote:Not sure why I cant add new users.
This is the error message returned for any user and configuration.
[Image: DJACH.jpg]
Any ideas how I can fix this?
ty
What more than likely happened is the data/site-users directory was not created. Create the directory and it should work fine
Reply
I can now create a new user in the Admin page but not from the live webpage.
I receive confirmation of new-user + login but see no new users in my list.
When I look in site-users I only see the user(s) created from Admin.

Thanks again for any insight.
Reply
roy_b8te Wrote:Hrm seems like I spoke too soon.
I can now create a new user in the Admin page but not from the live webpage.
I receive confirmation of new-user + login but see no new users in my list.
When I look in site-users I only see the user(s) created from Admin.

Thanks again for any insight.

Please turn on debug mode, attempt the front end user creation, and report your errors.
Reply
Turned on Debug mode in gsconfig.php and tried another register.
The debug console comes up empty
but I do get this message directly on the User Management tab and directly on the login page.
Quote:Notice: Undefined variable: result in x:\xampp\htdocs\xxxx\plugins\user-login\class\Feul.php on line 343
[Image: 5ZlZr.jpg]

../data/other/logs
[29-Mar-2012 21:29:34] PHP Notice: Undefined index: usernamec in x:\xampp\htdocs\xxxx\plugins\user-login\class\Feul.php on line 510

Your help is much appreciated.
Reply
roy_b8te Wrote:I forgot to add that I tried this on both online and local servers.
I'm going to try defining the var @ line 315
Code:
$result = '';
and see what happens.
Are you using a database or xml for the users storage?
Reply
I tracked the problem down to a simple typeo in username var
located @ Feul.php on line 511.
Code:
$usrfile = strtolower($_POST['usernamec']); // removing the "c" at the end
            $usrfile = strtolower($_POST['username']); // works !
I'm now able to create new users on the web page but not in Admin.
Reply
The post you changed was for the admin form not the front end form. I will look into the original issue tonight
Reply
I tried again with a fresh download of GS3.1 and FEUL3.0 manual install on local and internet servers.
( local server [PHP: 5.3.8] online server [PHP 5.2.17] )


From the User Management tab I can create new users ( local + online servers ).
[Image: L7cjx.jpg]

I add the lines of code to the template file.
Code:
<?php echo show_login_box(); ?>

                <?php echo welcome_message_login(); ?>

                <?php user_login_register(); ?>

I then try to create a new user from the web page ( online server ).
[Image: CI2HN.jpg]

I receive the confirmation message.
[Image: pvxzv.jpg]
Debug messages ( online server ):
Quote:Strict Standards: Feul::processAddUserAdmin() [feul.processadduseradmin]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/server/public_html/gs31/plugins/user-login/class/Feul.php on line 510

Notice: Undefined index: usernamec in /home/server/public_html/gs31/plugins/user-login/class/Feul.php on line 510

When I go back to the User Management tab I see no new user(s).
[Image: TG97M.jpg]

When I look at FTP I see 1 new unnamed XML file was created ( online server ).
[Image: iSDvJ.jpg]

If I open this unnamed XML file, I see the name of the last web based registered user.
Code:
<?xml version="1.0"?>
<item><Username>user</Username><Password>( hash )</Password><EmailAddress>user@user.com</EmailAddress></item>


I then attempt to login as the last registered user ( online server ).
[Image: OXSTh.jpg]

This message is returned to the browser.
[Image: 8mxrH.jpg]


When I change the variable name usernamec in Feul.php
Code:
$usrfile = strtolower($_POST['usernamec']); // from
            $usrfile = strtolower($_POST['username']); // to
I'm able to create new users from the webpage but not the User Management tab.
Heres the message thrown ( local server )
[Image: wS6dQ.jpg]
Messages thrown ( online server )
Quote:Strict Standards: Feul::processAddUserAdmin() [feul.processadduseradmin]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/truedia1/public_html/gs31/plugins/user-login/class/Feul.php on line 510

Notice: Undefined index: username in /home/truedia1/public_html/gs31/plugins/user-login/class/Feul.php on line 510

Strict Standards: Feul::getAllUsers() [feul.getallusers]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/truedia1/public_html/gs31/plugins/user-login/class/Feul.php on line 343

Notice: Undefined variable: result in /home/truedia1/public_html/gs31/plugins/user-login/class/Feul.php on line 343
I hope this full description helps with a possible solution.
Or can you tell me where the code is that names the xml file created from the web register new user form?

Thank you for your support.
Reply
Hi roy_b8te, hi mikeh...

The easiest is that you modify in user_login.php:

1) in function 'function user_login_register()' change everywhere is written $_POST['username'] by $_POST['usernamec'].
I think that there is 4: 3 at the first and other in form...

You do not change anything in Feul.php.

2) in 'function welcome_message_login()' there is other small bug, and link of logout is wrong:
//Display Logout Link
Change:
$logout_link = '<a href="'.$SITEURL.'?logout=yes" class="user-login-logout-link">Logout</a>';
by:
$logout_link = '<a href="'.$_SERVER['REQUEST_URI'].'?logout=yes" class="user-login-logout-link">Logout</a>';

I am playing with this plugin because i am doing other plugin that will work with front-end users plugin

Regards.
Reply
Thanks cumbe for your reply.
I tried everything you said but it only fixes adding users in the User Management page.
There are also $_POST['username'] found in Feul.php on lines: 789,774,771 & 513.
I tried switching these too. Same results.
Reply
Hi,
line 513 must to put: $usrfile = strtolower($_POST['usernamec']);

the other lines do not changes.
Reply
or better,
copy original Feul.php and does not change anyting here.

Only the changes in user_login.php.
Reply
Version 3.1 Has Been Added To Extend
Thank you both for your assistance.
It turned out the problem was the $_POST['usernamec'] on line 525 of Feul.php shouldn't even have been there. There should be no posts in the class file as the variables are passed to the methods from user_login.php.

Changing $_POST['usernamec'] to $username fixed the problem.

I also fixed a few other bugs such the data/site-users directory not being created.
Reply




Users browsing this thread: 1 Guest(s)