Jul 05, 2009, 09:35 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: 1 ... 3 4 [5] 6 7 ... 13   Go Down
  Print  
Author Topic: WebLoginPE 1.3.0 Bug Reports  (Read 27994 times)
0 Members and 1 Guest are viewing this topic.
MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #60 on: Oct 12, 2007, 04:58 AM »

Hi Scotty,

it was already mentioned in this thread, but once again:

Changing of the userimage is not possible if the type of the new image is .jpg.  I already tried to add another mime type like this:

Code:
switch ($_FILES['photo']['type'])
{
case 'image/jpeg':
$image = imagecreatefromjpeg($userImage);
$ext = '.jpg';
break;

case 'image/jpg':
$image = imagecreatefromjpeg($userImage);
$ext = '.jpg';
break;

But with no luck... At registration everything is okay. You can also try this at your demo site.
Logged

Taff
Sr. Member
****
Posts: 462


Lovin' ModX


WWW
« Reply #61 on: Oct 17, 2007, 08:20 AM »

Is anyone else having issues with dob not being saved to the

{prefix}web_user_attributes database correctly? I'm not sure why but when using the default templates and saving a date in the format it states I just get the first bit of the date saved.

I looked at the MakeDateForDb function, and it states that the date needs to be in an alternative format to the one being stated in the template (Template says day first, function says month first). Either way it is still only saving the first part of the date to the database i.e.  $dateArray[0]

Now if I copy the function into a new php file e.g.

Code:
<?php
function MakeDateForDb($date '11-12-1969')

{
// $date is a string like 01-22-1975.
if (strpos($date'-'))
{
$dateArray explode('-'$date);
}
else if (strpos($date'/'))
{
$dateArray explode('/'$date);
}
else
{
return $this->FormatMessage($this->LanguageArray[27]);
}

$dateArray explode('-'$date);
// $dateArray is somethink like [0]=01, [1]=22, [2]=1975
// make a unix timestamp out of the original date string.
$timestamp mktime(000$dateArray[0], $dateArray[1], $dateArray[2]);
echo $timestamp;
}

MakeDateForDb();
?>

it seems to output a correct timestamp like -4323600.

Any ideas why?
Logged

Me: www.adrianlawley.com ::

Just started on: www.softselect.de, a Business Software Selection and Consultancy Company. English Version is available as of today, hoping for a relaunch asap...to get rid of those pesky frames.

Just finished (more or less) http://www.trendlux.de
MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #62 on: Oct 17, 2007, 08:53 AM »

I think you try it with this format : 07/13/1967. This doesn´t work because of an error in the function.

Just comment out this line:

Code:
$dateArray = explode('-', $date);

because it overrides the if clauses above.
Logged

MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #63 on: Oct 18, 2007, 08:44 AM »

Quote
it was already mentioned in this thread, but once again:

Changing of the userimage is not possible if the type of the new image is .jpg.
   

Solved. Occured only with IE6 which handles jpegs as image/pjpeg  Roll Eyes Which surprise that this §"$"§$ Browser doesn´t even handle the file types correctly.

Solution: Add this case to the image switch (around line 2850):
   
Code:
case 'image/pjpeg':
$image = imagecreatefromjpeg($userImage);
$ext = '.jpg';
break;
Logged

Taff
Sr. Member
****
Posts: 462


Lovin' ModX


WWW
« Reply #64 on: Oct 18, 2007, 09:13 AM »

I think you try it with this format : 07/13/1967. This doesn´t work because of an error in the function.

Just comment out this line:

Code:
$dateArray = explode('-', $date);

because it overrides the if clauses above.

That was it...It was exploding the array during the if else function and then line 2471 was exploding it again thus returning only a value of the first array...

Code:
function MakeDateForDb($date)
{
// $date is a string like 01-22-1975.
if (strpos($date, '-'))
{
$dateArray = explode('-', $date);
}
else if (strpos($date, '/'))
{
$dateArray = explode('/', $date);
}
else
{
return $this->FormatMessage($this->LanguageArray[27]);
}

$dateArray = explode('-', $date);
// $dateArray is somethink like [0]=01, [1]=22, [2]=1975
// make a unix timestamp out of the original date string.
$timestamp = mktime(0, 0, 0, $dateArray[0], $dateArray[1], $dateArray[2]);
return $timestamp;
}
needs to become
Code:
function MakeDateForDb($date)
{
// $date is a string like 01-22-1975.
if (strpos($date, '-'))
{
$dateArray = explode('-', $date);
}
else if (strpos($date, '/'))
{
$dateArray = explode('/', $date);
}
else
{
return $this->FormatMessage($this->LanguageArray[27]);
}

// $dateArray is somethink like [0]=01, [1]=22, [2]=1975
// make a unix timestamp out of the original date string.
$timestamp = mktime(0, 0, 0, $dateArray[0], $dateArray[1], $dateArray[2]);
return $timestamp;
}

Hence the line around 2471 needs deleting or commenting out.

Danke Marc!!!

Taff
Logged

Me: www.adrianlawley.com ::

Just started on: www.softselect.de, a Business Software Selection and Consultancy Company. English Version is available as of today, hoping for a relaunch asap...to get rid of those pesky frames.

Just finished (more or less) http://www.trendlux.de
Soshite
Committed to MODx
*****
Posts: 923



WWW
« Reply #65 on: Oct 20, 2007, 10:30 AM »

I noticed another bug this morning, dealing with the viewprofile service.

It seems that in the Userlist, WLPE properly parses HTML, such as <br />. As an example, Scotty's "signature" on my website's WLPE install. Now, in the viewprofile page, the HTML is not parsed, and it shows the HTML.

Maybe this is due to a line of code being in the Userlist function, but not being in the viewprofile function? It's probably an easy fix, but I don't have the time ATM to debug it. If someone could find a fix for this, I'd be very grateful. Smiley

(If a user does a normal manual line break (pressing the Enter key), it works fine, btw. It just does this w/ HTML.)
Logged

My Snippets
-> PopUpChunk v1.0

Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #66 on: Oct 29, 2007, 10:58 AM »

Changing of the userimage is not possible if the type of the new image is .jpg.  I already tried to add another mime type like this:
Code:
switch ($_FILES['photo']['type'])
{
case 'image/jpeg':
$image = imagecreatefromjpeg($userImage);
$ext = '.jpg';
break;

case 'image/jpg':
$image = imagecreatefromjpeg($userImage);
$ext = '.jpg';
break;
Good thing Smiley
A little tip Smiley You can do the same thing with fewer line Wink
Code:
switch ($_FILES['photo']['type'])
{
case 'image/jpeg':
case 'image/jpg':
$image = imagecreatefromjpeg($userImage);
$ext = '.jpg';
break;
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #67 on: Oct 29, 2007, 04:02 PM »

Hi all,

I found 2 bugs.

1) BUG : The dob is 01-01-1970 by default, I think we should be able not to specify it.
SOLUTION : In webloginpe.class.php, approx the line 1773, find this code
Code: (php)
$modx->setPlaceholder('user.'.$key, strftime('%m-%d-%Y', $value));
and replace it with
Code: (php)
// CREDIT : Guillaume for not format an empty date
$value==0?'':$modx->setPlaceholder('user.'.$key, strftime('%m-%d-%Y', $value));

2)BUG : When you want delete data from your profile you can't : it is impossible to leave blank a field which was not empty.
SOLUTION :  In webloginpe.class.php, in SaveUserProfile(), approx the line 880, replace the following code
Code: (php)
foreach ($generalElementsArray as $id => $field)
{
if ($field == 'photo')
{
if ($_FILES['photo']['name'] !== '' && !empty($_FILES['photo']['name']))
{
$_POST['photo'] = $this->CreateUserImage();
if (!empty($this->Report))
{
return;
}
}
}
if (isset($_POST[$field]) && ($_POST[$field] !== ''))
{
if ($field == 'dob')
{
$_POST['dob'] = $this->MakeDateForDb($_POST['dob']);
}
// CREDIT: Mike Reid (aka Pixelchutes) for the string escape code.
$generalElementsUpdate[] = " `".$field."` = '".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES)))."'";
}
else
{
unset ($generalElementsArray[$id]);
}
}
and replace it with
Code: (php)
// CREDIT: Guillaume to delete data and for code optimisation
foreach ($generalElementsArray as $field)
{
if ($field == 'photo')
{
if ($_FILES['photo']['name'] !== '' && !empty($_FILES['photo']['name']))
{
$_POST['photo'] = $this->CreateUserImage();
if (!empty($this->Report))
{
return;
}
}
}
if ($field == 'dob' && trim($_POST['dob'])!='') // for not format an empty date else date is 0 (01-01-1970)
{
$_POST['dob'] = $this->MakeDateForDb($_POST['dob']);
}
if ($field!='photo' || ($_FILES['photo']['name'] !== '' && !empty($_FILES['photo']['name']))) // for update db with value and blank value (except if the field is 'photo')
// CREDIT: Mike Reid (aka Pixelchutes) for the string escape code.
$generalElementsUpdate[] = " `".$field."` = '".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES)))."'";
}
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Dr. Scotty Delicious
Moderator
*
Posts: 1,183


D.F.P.A.


WWW
« Reply #68 on: Oct 29, 2007, 08:15 PM »

Awesome!
Thanks for posting those solutions.

-sD-
Dr. Scotty Delicious, DFPA.
Logged

Dimmy
Testers
*
Posts: 1,898


Я не говорю по-русски 私は日本語を話さない


WWW
« Reply #69 on: Oct 30, 2007, 07:39 AM »

@Scotty:

any new versions? I am moving to a new server with alll my sites now it runs php 5 so I hope that this wil help.

Dimmy
Logged

"They say if you play a Microsoft CD backwards, you hear satanic messages. That's nothing, because if you play it forwards, it installs Windows."
Nederlands beste portal voor pda en mobiel internet
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #70 on: Oct 30, 2007, 05:13 PM »

Hi,

I think this is a bug. Maybe not...

In the snippet call, when you set parameter like this
Code:
&liHomeId=`57` &loHomeId=`58`
we can see the default tpl before to be redirect to the page 57 or 58.
If you want to display directely the page 57 or 58 (not to see the default template before), in webloginpe.class.php, find this code in functions  LoginHomePage() and LogoutHomePage() :
Code:
modx->sendRedirect($url,0,'REDIRECT_REFRESH');
and replace by
Code:
$modx->sendRedirect($url,0,'REDIRECT_HEADER'); // CREDIT: Guillaume to redirect directely
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
sottwell
Documentation Team
*
Posts: 8,837



WWW
« Reply #71 on: Oct 30, 2007, 11:49 PM »

Ah! Thank you, that's been bugging me a lot!  Cool
Logged

sottwell.com has moved to a lovely Solaris 10 server!
Log in username guest, password guestuser.
Templates are now becoming available at http://sottwell.com/templates.html
pixelchutes
Coding Team
*
Posts: 839



WWW
« Reply #72 on: Oct 31, 2007, 01:52 AM »

Good catch, Guillaume.

I previously suggested to Scotty a few locations where 'REDIRECT_HEADER' seems to make more sense than 'REDIRECT_REFRESH', glad to see that others agree! Cool
Logged

Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.
Guillaume
Moderators
*
Posts: 711


The future is built today.


« Reply #73 on: Oct 31, 2007, 06:08 AM »

REDIRECT_HEADER permits to redirect directely to another page but REDIRECT_REFRESH waits the end of all the php script (end of php code) before to redirect.
REDIRECT_REFRESH is interesting to refresh (not to redirect) the same page with new parameters or not.
REDIRECT_HEADER is to redirect to another page.

There has long, I had the same problem for a professional application Wink
Logged

Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
Soshite
Committed to MODx
*****
Posts: 923



WWW
« Reply #74 on: Oct 31, 2007, 06:32 AM »

Methinks we should have a WLPE v1.3.1 that collects all of these bugfixes together, for the newbies that download the script and don't notice all of these bugfixes, and would comment on things already fixed.
Logged

My Snippets
-> PopUpChunk v1.0

Pages: 1 ... 3 4 [5] 6 7 ... 13   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!