Monday, June 30, 2014

cake 2.5.2 installation ok, but not working


It drives me nuts.

I installed sucessfully a clean copy of cake 2.5.2 on my developer system. Yes, im on to get a pretty nice new page. I like the cake, to cook and to bake.
But something won`t work.

As I uploaded the new page from my local server to a testserver i couldn`t find out what was wrong with the login. Thats why i cleaned all up and started a new clean copy of the cake 2.5.2, including the DebugKit. (the green picture) Some more steps, only to check if all the system is working, users and posts controller, and some basic stuff. acessing the index.ctp of the UsersController i get the output of the red-colored image while I expect the output of the blue picture (i took the screenshot of an other server)

Whats wrong? What can be wrong?

Any hint or help is welcome!


Many thanks in advance

Loucode














--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Cakephp website/app to a new domain and hosting

Can I take it that you have had this site built for you, but are not the original developer? If this is the case you would be wise to find someone local to assist you. Some hosting companies will offer to move a site like this for you. The one we frequently use here in New Zealand will do exactly that.

You will need to acquire the Database, and all of the files from the current hosting solution.

If you want to move the site yourself, you have no other choice than to read the very good documentation that can be found here: http://book.cakephp.org/2.0/en/installation.html this will help you source a server that can host it and will give you the information you need to set up the config files to the new server/database details.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP Login redirect

Are you certain the Auth->logout action is being called? Is the session clear (destroyed) after logout?

On 28 Jun 2014, at 12:54, Gagik Navasardyan <gagnav@gmail.com> wrote:

Hi everyone.

I have one question.

I'm working on an application which is working in local network and acting as POS(Point of Sale). As you understand it's based on CakePHP framework.
Now I'm encountering a strange behaviour, and I don't know is it a bug or not, so I've decided to ask you a question here.

- I'm using CakePHP 2.4.2 and the built-in AuthComponent for authentication

- The thing is, after user logs out and another user logs in (using the same computer and browser), he is being redirected to the page on which the previous user was when logged out. Instead of being redirected to the URL defined in 'loginRedirect'

- In this application I'm using role based user permissions system, and the most of time system throwing permission error, because newly logged in user doesn't have permission to view the page on which previous user was when logged out.

This behaviour is very strange to me, because as I know the logout function is destroying session, but it seems keeping the last visited URL of the previous user in the 'Auth.redirect' property in the new session.
This seems a little bit strange to me, because I'm expecting this kind of redirect in a few cases like:
- If user session expired and user have to login again.
- user trying to access to a page which is requiring authentication. 

I analised the code and clearly the problem is in the framework core, and there is no way to rewrite the 'Auth.redirect' property either before or after the 'logout' function call (in any case the session being destroyed and as I understand CakePHP taking and writing the last visited page URL to the new session from HTTP REFERER).


So question:
Is this a Normal behaviour, and there are some reason why this must be this way, or this is a bug?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

CakePHP NEWBIE needs help w/ international phone number add on contact form...

Hi, 

   Please bear with me! Total newbie in the CakePHP world.
I need to be able to provide the option to add an international phone number on my customers registration form page. 
  Currently, only a US 10 digit phone number is being allowed to be entered. I really need to be able to provide the capability of entering in either styles, US or
international numbers.


Here's a snippet from the ctp file that I thought has to do with phone number section, but I do not see where I change anything to make a difference.

<tr style="height:30px;">
<td align="left"> Phone Number <span class="starr">*</span>  </td>
<td align="left" class="tdwidth"> <?php echo $form->input('Member.phone',array('label'=>'','div' => '','class'=>'phone required','id'=>'phone')); ?> </td>
</tr>
<tr style="height:30px;">


Then here is a snippet from the ctp file that information is displayed on. Though I am not sure if this is relevant?

    <div class="propertyviewinpt">
                    <div class="propertyviewContainerLeft" > Phone  <span class="starr"> * </span> </div>
                    <div class="propertyviewContainerRight">
                    <?php echo  $form->input('phone',array('label'=>'','div'=>'', 'class'=>'required phone', 'size' => '20')); ?>
                        
                    </div>


Should I be looking for another ctp file that has solely form information on it or can I change the code provided above to include international numbers?

Thanks!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: using "like " in find()

You can do something like the following:

$this->find('all', array(
    'conditions' => array(
        'Employee.email LIKE' => 'A%'
    )
));

On 28 June 2014 17:12, jim murray <jim@jim-murray.com> wrote:
I want to do the equivalent of "select * from employees where EMAIL like 'A%'
I have been reading the documentation for Model.find() but can't figure it out.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.



--
Kind Regards
 Stephen Speakman

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP 2.5.2 - Wizard previous step reload by ajax.


No, I didn't use session in wizard. My question is "How do I reload my saved data to my wizard form by ajax".
On Monday, 30 June 2014 15:33:35 UTC+5:30, Andras Kende wrote:
do you also use Sessions on that wizard ?

Andras Kende


On Jun 30, 2014, at 2:36 AM, Archana Goyal <archana...@gmail.com> wrote:

Hi,

I am create wizard form. On every next steps of form my data saved in database by ajax. But I am not able to reload form data on previous botton.How do I load form on previous step to stop saving duplicate data in database.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP 2.5.2 - Wizard previous step reload by ajax.

do you also use Sessions on that wizard ?

Andras Kende


On Jun 30, 2014, at 2:36 AM, Archana Goyal <archanagoyal07@gmail.com> wrote:

Hi,

I am create wizard form. On every next steps of form my data saved in database by ajax. But I am not able to reload form data on previous botton.How do I load form on previous step to stop saving duplicate data in database.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

CakePHP 2.5.2 - Wizard previous step reload by ajax.

Hi,

I am create wizard form. On every next steps of form my data saved in database by ajax. But I am not able to reload form data on previous botton.How do I load form on previous step to stop saving duplicate data in database.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: cross tables in cake 1.3

Looking at this you have the User model and for example UserStatusPost model, I would assume that the user_status_posts table has a field 'user_id'.

If that's the case, why would you not use that model by calling $this->User->UserStatusPost? I guess the same would apply to most of the other models.

Be careful about having too many methods in your users controller, if you can separate logic to separate controllers it would be better I think, and then use routes to change the url mapping of these controllers if you wish.


On 30 June 2014 09:19, Jeremy Burns : Class Outfit <jeremyburns@classoutfit.com> wrote:
That is A LOT of models to load and there is almost certainly a better way of cracking your nut. What are you trying to achieve?

On 30 Jun 2014, at 08:33, 'Chris' via CakePHP <cake-php@googlegroups.com> wrote:

hi guys,.. I'm using to many cross tables in a controller,... and getting memory error not enough bites,... 

  var $uses = array('User', 'Friend', 'FriendRequest', 'UserInvisiblePoint', 'UserStatusPost', 'StatusLike', 'StatusNotification', 'ZodiacType', 'Point', 'ProfileComment', 'Gift', 'Guest', 'Resume', 'UserBan', 'Invitation', 'Report', 'Photo', 'PhotoFavorite', 'PhotoLike', 'PhotoRating', 'PhotoComment', 'Blog', 'BlogComment', 'BlogFavorite', 'BlogLike', 'Group', 'GroupFavorite', 'GroupDiscussion', 'GroupMember', 'GroupPhoto', 'GroupLike', 'GroupComment', 'Dba', 'DbaFavorite', 'DbaLike', 'Video', 'VideoFavorite', 'VideoLike', 'VideoComment', 'Classified', 'Event', 'Notification', 'ProfileNotification', 'Bookmark', 'Message', 'Alert', 'Signin', 'Signin');

how can I avoid this doing from "user.php" model,...? 

thanks in advance,... 


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.



--
Kind Regards
 Stephen Speakman

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: cross tables in cake 1.3

That is A LOT of models to load and there is almost certainly a better way of cracking your nut. What are you trying to achieve?

On 30 Jun 2014, at 08:33, 'Chris' via CakePHP <cake-php@googlegroups.com> wrote:

hi guys,.. I'm using to many cross tables in a controller,... and getting memory error not enough bites,... 

  var $uses = array('User', 'Friend', 'FriendRequest', 'UserInvisiblePoint', 'UserStatusPost', 'StatusLike', 'StatusNotification', 'ZodiacType', 'Point', 'ProfileComment', 'Gift', 'Guest', 'Resume', 'UserBan', 'Invitation', 'Report', 'Photo', 'PhotoFavorite', 'PhotoLike', 'PhotoRating', 'PhotoComment', 'Blog', 'BlogComment', 'BlogFavorite', 'BlogLike', 'Group', 'GroupFavorite', 'GroupDiscussion', 'GroupMember', 'GroupPhoto', 'GroupLike', 'GroupComment', 'Dba', 'DbaFavorite', 'DbaLike', 'Video', 'VideoFavorite', 'VideoLike', 'VideoComment', 'Classified', 'Event', 'Notification', 'ProfileNotification', 'Bookmark', 'Message', 'Alert', 'Signin', 'Signin');

how can I avoid this doing from "user.php" model,...? 

thanks in advance,... 


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

cross tables in cake 1.3

hi guys,.. I'm using to many cross tables in a controller,... and getting memory error not enough bites,... 

  var $uses = array('User', 'Friend', 'FriendRequest', 'UserInvisiblePoint', 'UserStatusPost', 'StatusLike', 'StatusNotification', 'ZodiacType', 'Point', 'ProfileComment', 'Gift', 'Guest', 'Resume', 'UserBan', 'Invitation', 'Report', 'Photo', 'PhotoFavorite', 'PhotoLike', 'PhotoRating', 'PhotoComment', 'Blog', 'BlogComment', 'BlogFavorite', 'BlogLike', 'Group', 'GroupFavorite', 'GroupDiscussion', 'GroupMember', 'GroupPhoto', 'GroupLike', 'GroupComment', 'Dba', 'DbaFavorite', 'DbaLike', 'Video', 'VideoFavorite', 'VideoLike', 'VideoComment', 'Classified', 'Event', 'Notification', 'ProfileNotification', 'Bookmark', 'Message', 'Alert', 'Signin', 'Signin');

how can I avoid this doing from "user.php" model,...? 

thanks in advance,... 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Sunday, June 29, 2014

Re: database table locking across supported database

Now you changed your requirement to not only being one column.

Does you solution include a lot of transactions taking place in the table, in your case "x"?

Locking "x" would just make it a slower solution in total for other users.

Have you considered another solution, that makes your calculations independent of what others are doing in table "x"?

Enjoy, John

Ps. if your original post is a request for a feature, then probably the CakePHP core group is a better forum.
Please correct me if I am wrong :)

On Sunday, 29 June 2014 18:27:05 UTC+3, Prashant wrote:
Hi,

On Sun, Jun 29, 2014 at 8:45 PM, John Andersen <j.ande...@gmail.com> wrote:
>
> Put a unique index on your receipt_number column, then when you
> grab the highest receipt_number, increases it and saves it, you will either
> succeed or get an error.

Thats one way of doing it.

But I have faced this issues at few other places also. For eg : I want
to read a huge number of rows from table 'x' and I want to do some
calculations on it and then save the result in the table 'y'. Now I
dont want anyone else to add or remove removes from the table 'x'
until I have finished writing the result to table 'y'.

Having support for locking will really help and make it easier for me
do deal with the concurrency issues.

Regards.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: database table locking across supported database

Hi,

On Sun, Jun 29, 2014 at 8:45 PM, John Andersen <j.andersen.lv@gmail.com> wrote:
>
> Put a unique index on your receipt_number column, then when you
> grab the highest receipt_number, increases it and saves it, you will either
> succeed or get an error.

Thats one way of doing it.

But I have faced this issues at few other places also. For eg : I want
to read a huge number of rows from table 'x' and I want to do some
calculations on it and then save the result in the table 'y'. Now I
dont want anyone else to add or remove removes from the table 'x'
until I have finished writing the result to table 'y'.

Having support for locking will really help and make it easier for me
do deal with the concurrency issues.

Regards.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: database table locking across supported database

Put a unique index on your receipt_number column, then when you grab the highest receipt_number, increases it and saves it, you will either succeed or get an error.

The error you have to catch, and redo the process, until you successfully have saved your new receipt_number.

Just my thoughts :) Enjoy, John

On Sunday, 29 June 2014 08:34:14 UTC+3, Prashant wrote:
Hi,

On Sun, Jun 29, 2014 at 11:01 AM, Prashant Shah <pshah....@gmail.com> wrote:
> Hi,
>
> http://docs.doctrine-project.org/en/2.0.x/reference/transactions-and-concurrency.html
>

Check the Locking support section.

There are many such use cases within my application that I need
locking at database level.

Regards.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Cakephp website/app to a new domain and hosting

I want to move my cakephp website to a new domain and vps hosting  , any help would be greatly appreciated

Please I have no knowledge in CakePHP.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Saturday, June 28, 2014

Re: database table locking across supported database

Hi,

On Sun, Jun 29, 2014 at 11:01 AM, Prashant Shah <pshah.mumbai@gmail.com> wrote:
> Hi,
>
> http://docs.doctrine-project.org/en/2.0.x/reference/transactions-and-concurrency.html
>

Check the Locking support section.

There are many such use cases within my application that I need
locking at database level.

Regards.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: database table locking across supported database

Hi,

On Wed, Jun 18, 2014 at 1:34 PM, José Lorenzo <jose.zap@gmail.com> wrote:
> Why do you want to lock it?

let assume a database schema : id (primary, auto inc), receipt_number
(varchar), amount (float)

The "receipt_number" is to be incremented on every insert. This is not
the id field which is auto incremented by the database itself. Its a
different field from 'id' that can have numbers, characters, special
characters, etc. The receipt_number has to be incremented in the code
and cannot be done automatically for various other reasons.

Now let say I want to insert a row, I will read the last
receipt_number, increment it and write the new row back to database.
At the same time another user is also inserting a row, he read the
last entry receipt_number which is the same as I read since I have not
yet written the new row. He will also increment to the same value and
write it back. This will lead to a conflict. That is why I need a
reliable way to lock the table so that no one else can read/write to
the table until I have finished with reading and writing the new row
as one atomic operation.

http://docs.doctrine-project.org/en/2.0.x/reference/transactions-and-concurrency.html

Regards.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

what is the current method to use Jgraph with cakephp 2.x

Hi,

How is Jpgraph supposed to integrate with cakephp? In the controller or the view do i place the code to construct the jpgraph  ?
The old way is to display a jgraph with an image which is a call to another view but that way doesnt appear to work with currect cakephp.


The problem is that jpgraph examples for cakephp is for older versions and there is no update for jpgraph with newer cakephp versions that I can find. The only solution I have found is from the stackoverflow post.

The jpgraph does work if I place the graph code in the controller like the hack solution but that isnt how it is supposed to work according to the docs. I didnt get the  requestHandler as explained in the stackoverflow post to have any effect  but anyway I cant find anything in the cakephp docs.


http://bakery.cakephp.org/articles/cguyer/2007/12/26/using-jpgraph
http://stackoverflow.com/questions/9936890/cakephp-2-0-jpgraph

?php  App::import('Vendor', 'Jpgraphs/jpgraph');  App::import('Vendor', 'Jpgraphs/jpgraph_line');    $ydata = array(11,11,11);    // Create the graph.  $graph = new Graph(350,250);  $graph->SetScale("textlin");  $graph->img->SetMargin(30,90,40,50);  $graph->xaxis->SetFont(FF_FONT1,FS_BOLD);  $graph->title->Set("Example 1.1 same y-values");    // Create the linear plot  $lineplot=new LinePlot($ydata);  $lineplot->SetLegend("Test 1");  $lineplot->SetColor("blue");  $lineplot->SetWeight(5);    // Add the plot to the graph  $graph->Add($lineplot);    // Display the graph  $graph->Stroke();        ?>    // ]]>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

what is the currect method to disolay jgraph with cakephp

Hi,

How is Jpgraph supposed to integrate with cakephp? In the controller or the view do i place the code to construct the jpgraph  ?
The old way is to display a jgraph with an image which is a call to another view but that way doesnt appear to work with currect cakephp.


The problem is that jpgraph examples for cakephp is for older versions and there is no update for jpgraph with newer cakephp versions that I can find. The only solution I have found is from the stackoverflow post.

The jpgraph does work if I place the graph code in the controller like the hack solution but that isnt how it is supposed to work according to the docs. I didnt get the  requestHandler as explained in the stackoverflow post to have any effect  but anyway I cant find anything in the cakephp docs.


http://bakery.cakephp.org/articles/cguyer/2007/12/26/using-jpgraph
http://stackoverflow.com/questions/9936890/cakephp-2-0-jpgraph

?php  App::import('Vendor', 'Jpgraphs/jpgraph');  App::import('Vendor', 'Jpgraphs/jpgraph_line');    $ydata = array(11,11,11);    // Create the graph.  $graph = new Graph(350,250);  $graph->SetScale("textlin");  $graph->img->SetMargin(30,90,40,50);  $graph->xaxis->SetFont(FF_FONT1,FS_BOLD);  $graph->title->Set("Example 1.1 same y-values");    // Create the linear plot  $lineplot=new LinePlot($ydata);  $lineplot->SetLegend("Test 1");  $lineplot->SetColor("blue");  $lineplot->SetWeight(5);    // Add the plot to the graph  $graph->Add($lineplot);    // Display the graph  $graph->Stroke();        ?>    // ]]>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP download function returns 'empty' file

<pre class="cake-error">
$file = object(File) {
Folder =&gt; object(Folder) {}
name =&gt; &#039;200323860053ad7ddaaaddd.png&#039;
info =&gt; array(
&#039;dirname&#039; =&gt; &#039;/var/www/upfree/up-free.com/files/posts/attach&#039;,
&#039;basename&#039; =&gt; &#039;200323860053ad7ddaaaddd.png&#039;,
&#039;extension&#039; =&gt; &#039;png&#039;,
&#039;filename&#039; =&gt; &#039;200323860053ad7ddaaaddd&#039;,
&#039;filesize&#039; =&gt; (int) 10026,
&#039;mime&#039; =&gt; &#039;image/png&#039;
)
handle =&gt; resource
lock =&gt; null
path =&gt; &#039;/var/www/upfree/up-free.com/files/posts/attach/200323860053ad7ddaaaddd.png&#039;
}
$range = null
$compress = false
$end = false
$start = false
$bufferSize = (int) 8192</pre><pre class="stack-trace">set_time_limit - [internal], line ??
CakeResponse::_sendFile() - CORE/Cake/Network/CakeResponse.php, line 1375
CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 425
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 169
require - APP/webroot/index.php, line 97
[main] - ROOT/index.php, line 13</pre></div></pre>‰PNG

пятница, 27 июня 2014 г., 1:24:55 UTC+3 пользователь AD7six написал:


On Friday, 20 June 2014 20:05:55 UTC+2, Alexandr Pirogov wrote:
Help me, please, to resolve my small problem! I have next function in my PostsController:

public function download() {      if (isset($this->request->query['file']) && is_file(POST_ATTACH_PATH . $this->request->query['file'])) {          $file = $this->request->query['file'];          $output_name = 'up_free_' . rand();            $this->response->file(POST_ATTACH_PATH . $file, array(              'download' => true, 'name' => $output_name          ));            return $this->response;      } else {          $this->redirect(array('controller' => 'posts', 'action' => 'index'));      }  }

The problem is that my download function returns me 'empty' file! For example, if I have attached an image to the post and click the download button, my image downloads! But downloaded file is 'empty', I can't open it and if it is .jpg file it has the size of 132 KB.

Thank You!


132KB is not empty - try opening it as a text file - it probably contains error messages.

AD 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

using "like " in find()

I want to do the equivalent of "select * from employees where EMAIL like 'A%'
I have been reading the documentation for Model.find() but can't figure it out.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

CakePHP Login redirect

Hi everyone.

I have one question.

I'm working on an application which is working in local network and acting as POS(Point of Sale). As you understand it's based on CakePHP framework.
Now I'm encountering a strange behaviour, and I don't know is it a bug or not, so I've decided to ask you a question here.

- I'm using CakePHP 2.4.2 and the built-in AuthComponent for authentication

- The thing is, after user logs out and another user logs in (using the same computer and browser), he is being redirected to the page on which the previous user was when logged out. Instead of being redirected to the URL defined in 'loginRedirect'

- In this application I'm using role based user permissions system, and the most of time system throwing permission error, because newly logged in user doesn't have permission to view the page on which previous user was when logged out.

This behaviour is very strange to me, because as I know the logout function is destroying session, but it seems keeping the last visited URL of the previous user in the 'Auth.redirect' property in the new session.
This seems a little bit strange to me, because I'm expecting this kind of redirect in a few cases like:
- If user session expired and user have to login again.
- user trying to access to a page which is requiring authentication. 

I analised the code and clearly the problem is in the framework core, and there is no way to rewrite the 'Auth.redirect' property either before or after the 'logout' function call (in any case the session being destroyed and as I understand CakePHP taking and writing the last visited page URL to the new session from HTTP REFERER).


So question:
Is this a Normal behaviour, and there are some reason why this must be this way, or this is a bug?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Friday, June 27, 2014

Re: Alternative to loggedIn()

Okay. I'll check it out. Thanks :)

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: How its better?

I will do this! Thankyou!

Em quinta-feira, 26 de junho de 2014 10h17min18s UTC-3, euromark escreveu:
Just use admin prefix

and /normal/stuff + /admin/administrative/stuff

no need to have two applications.

mark


Am Donnerstag, 26. Juni 2014 06:11:30 UTC+2 schrieb Mauricio Fritsch:
How it's better?

I want to develop a system of sales (a hotsite), and develop too a administration of these  page(s). 

First i think have two installations of cake using the same base, and reading more some people say to use plugins for develop the adminstration like a subsytem.

Someone here was developed something like this?

Thankyou!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Alternative to loggedIn()

Use AuthComponent::user() or the session directly
loggedIn() was just a wrapper for it


Am Freitag, 27. Juni 2014 07:43:49 UTC+2 schrieb Oluwasegun Adeleye Isaac:
Now that the method loggedIn() is now deprecated and will be removed in 3.0, what will or can be used in place of this.

Thanks.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP download function returns 'empty' file

Wow!!! This is very interesing! I didn't know about it!

Here is error messages:

<pre class="cake-error">...

$file = object(File) {
Folder =&gt; object(Folder) {}
name =&gt; &#039;200323860053ad7ddaaaddd.png&#039;
info =&gt; array(
&#039;dirname&#039; =&gt; &#039;/var/www/upfree/up-free.com/files/posts/attach&#039;,
&#039;basename&#039; =&gt; &#039;200323860053ad7ddaaaddd.png&#039;,
&#039;extension&#039; =&gt; &#039;png&#039;,
&#039;filename&#039; =&gt; &#039;200323860053ad7ddaaaddd&#039;,
&#039;filesize&#039; =&gt; (int) 10026,
&#039;mime&#039; =&gt; &#039;image/png&#039;
)
handle =&gt; resource
lock =&gt; null
path =&gt; &#039;/var/www/upfree/up-free.com/files/posts/attach/200323860053ad7ddaaaddd.png&#039;
}
$range = null
$compress = false
$end = false
$start = false
$bufferSize = (int) 8192</pre><pre class="stack-trace">set_time_limit - [internal], line ??
CakeResponse::_sendFile() - CORE/Cake/Network/CakeResponse.php, line 1375
CakeResponse::send() - CORE/Cake/Network/CakeResponse.php, line 425
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 169
require - APP/webroot/index.php, line 97
[main] - ROOT/index.php, line 13</pre></div></pre>‰PNG

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP download function returns 'empty' file

Yes, still have this problem :(

My view looks like:

<?php elseif (isset($post)): ?>
    <div class="post single">
        <div class="post-description">
            <?php echo $post['Post']['description']; ?>
            <?php if (isset($post['Post']['attach'])): ?>
                <a class="free-button" href="/posts/download?file=<?php echo $post['Post']['attach']; ?>">Free download</a>
            <?php else: ?>
                <a class="free-button" href="/">< Go back</a>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP download function returns 'empty' file

<?php elseif (isset($post)): ?>
    <div class="post single">
        <div class="post-description">
            <?php echo $post['Post']['description']; ?>
            <?php if (isset($post['Post']['attach'])): ?>
                <a class="free-button" href="/posts/download?file=<?php echo $post['Post']['attach']; ?>">Free download</a>
            <?php else: ?>
                <a class="free-button" href="/">< Go back</a>
            <?php endif; ?>
        </div>
    </div>
<?php endif; ?>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

RE: Auth Component

Hi Matt,

You can check array $user['User'], there is company and person found?

After that we will check more.

Regards
Saran

From: Matt Myers
Sent: ‎27-‎06-‎2014 12:46 PM
To: cake-php@googlegroups.com
Subject: Auth Component

I've been hitting my head over this for quite some time now. When I login using the Auth Component as such:

$this->Auth->login()

It will login just fine and define the following authUser:

User
User.Person
User.Company

But when I login in another situation like so:

$this->Auth->login($user['User'])

This will log them in just fine, but define the following authUser:

User

* Without User.Person or User.Company

Does anyone know why this is? How can I get the same behavior across the board? I would like he User.Person and User.Company in both instances.

Thanks in advance.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Use 2 tables for update

Hello.
What you mean by look at saveAll?
This is the code where is save all, but in the UsersDetail it's making
insert instead of update
if ($this->User->saveAll($this->request->data)) {
move_uploaded_file($tmp_name, $uploads_dir);
$this->Session->setFlash(__('The user has been updated.'));
return $this->redirect(array('action' => 'account'));
}



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Use-2-tables-for-update-tp5718641p5718667.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Auth Component

What happens if, when you define $user, you also include (contain?) the Person and Company models and log in with that $user variable?

On 27 Jun 2014, at 00:57, Matt Myers <spartacus4@gmail.com> wrote:

I've been hitting my head over this for quite some time now. When I login using the Auth Component as such:

$this->Auth->login()

It will login just fine and define the following authUser:

User
User.Person
User.Company

But when I login in another situation like so:

$this->Auth->login($user['User'])

This will log them in just fine, but define the following authUser:

User

* Without User.Person or User.Company

Does anyone know why this is? How can I get the same behavior across the board? I would like he User.Person and User.Company in both instances.

Thanks in advance.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Thursday, June 26, 2014

Re: Use 2 tables for update

You have to look for saveall function


El jueves, 26 de junio de 2014 13:19:23 UTC+2, CUCULEAC STEFAN escribió:
No one?



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Use-2-tables-for-update-tp5718641p5718652.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Alternative to loggedIn()

Now that the method loggedIn() is now deprecated and will be removed in 3.0, what will or can be used in place of this.

Thanks.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: Use 2 tables for update

Not without an original post to work from.

On Thursday, 26 June 2014 21:19:23 UTC+10, CUCULEAC STEFAN wrote:
No one?



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Use-2-tables-for-update-tp5718641p5718652.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Auth Component

I've been hitting my head over this for quite some time now. When I login using the Auth Component as such:

$this->Auth->login()

It will login just fine and define the following authUser:

User
User.Person
User.Company

But when I login in another situation like so:

$this->Auth->login($user['User'])

This will log them in just fine, but define the following authUser:

User

* Without User.Person or User.Company

Does anyone know why this is? How can I get the same behavior across the board? I would like he User.Person and User.Company in both instances.

Thanks in advance.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Re: CakePHP download function returns 'empty' file



On Friday, 20 June 2014 20:05:55 UTC+2, Alexandr Pirogov wrote:
Help me, please, to resolve my small problem! I have next function in my PostsController:

public function download() {      if (isset($this->request->query['file']) && is_file(POST_ATTACH_PATH . $this->request->query['file'])) {          $file = $this->request->query['file'];          $output_name = 'up_free_' . rand();            $this->response->file(POST_ATTACH_PATH . $file, array(              'download' => true, 'name' => $output_name          ));            return $this->response;      } else {          $this->redirect(array('controller' => 'posts', 'action' => 'index'));      }  }

The problem is that my download function returns me 'empty' file! For example, if I have attached an image to the post and click the download button, my image downloads! But downloaded file is 'empty', I can't open it and if it is .jpg file it has the size of 132 KB.

Thank You!


132KB is not empty - try opening it as a text file - it probably contains error messages.

AD 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.