Access helper's functions in controller for cakephp 3.x

2015-09-02 Thread Dhingani Yatin
I have stucked in my cakephp3 code where I want to use the helper in my controller. I have done it in cakephp 2 using below code and want to convert this in cakephp3 standard so can you please help me out to resolve this issue which will be really great for me. CAKEPHP2 CODE -

Get blackholed all my forms functions on servers

2014-06-03 Thread Victor Vargas
Hi all!, This is my problem, I have try on my local server simple forms with the security component, and they work perfectly. But I try this on my 1and1 server and i get blackholed this form. Any idea? -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.co

Re: 3.0 - Getting variables into anonymous functions

2014-06-02 Thread Dakota
I was on my mobile at the time of posting the reply, otherwise I'd have given you an example as well :) Glad I could help! On Tuesday, 3 June 2014 07:17:58 UTC+2, Reuben wrote: > > Oh, that's handy. As you can see, I've zero experience in anonymous > functions. > >

Re: 3.0 - Getting variables into anonymous functions

2014-06-02 Thread Reuben
Oh, that's handy. As you can see, I've zero experience in anonymous functions. For those at home: $name = 'CakePHP'; $query = $articles->find(); $query->matching('Tags', function($q) use ($name){ return $q->where(['Tags.name' => $

3.0 - Getting variables into anonymous functions

2014-06-02 Thread Dakota
Use the use statement. See http://www.php.net/manual/en/functions.anonymous.php example 3 for an example. -- 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 "CakePH

3.0 - Getting variables into anonymous functions

2014-06-02 Thread Dakota
Use the use statement. See http://www.php.net/manual/en/functions.anonymous.php example 3 for an example. -- 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 "CakePH

3.0 - Getting variables into anonymous functions

2014-06-02 Thread Reuben
Hi In the example from the CakePHP 3 Book, how would one replace 'CakePHP' with a variable (i.e. $name), and have that passed from the calling code? Would is be via a call back, or property set on the $query, and accessible via $q? $query = $articles->find();$query->matching('Tags', function(

Re: [SOLVED] Calling functions in other controllers

2013-02-27 Thread lirc201
the best place to start is with the book. http://book.cakephp.org/2.0/en/index.html Read through and work through the example applications On Wednesday, February 27, 2013 12:10:27 PM UTC-5, Ganapathi Raman wrote: > > Hi Friends, > >I am new to the Cake-PHP...I don't know how to start and whe

Re: [SOLVED] Calling functions in other controllers

2013-02-27 Thread Ganapathi Raman
Hi Friends, I am new to the Cake-PHP...I don't know how to start and where to start...So,Please guide me.. Regards, Ganapathi Raman.p -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are su

[SOLVED] Calling functions in other controllers

2013-02-27 Thread lirc201
Hello David, Thanks very much for jogging my memory. I was not trying to do anything out of scope but just have re-usable functions that I can call in other controllers. I moved the getCart, and totals into the cart model and was able to greatly simplify my code. Everything is working like

Re: Calling functions in other controllers

2013-02-27 Thread david . suna
On Wednesday, February 27, 2013 6:33:41 AM UTC+2, Yasir Arafat wrote: > > Hello, > Before calling make sure you load the model of your cart model > like > > $this->loadModel('Cart'); > > > Since he is already including Cart in the $uses variable he does not need to call loadModel. Also, the not

Re: Calling functions in other controllers

2013-02-27 Thread david . suna
Sorry - noticed a couple of typos 1. The $uses variable indicates which other models this controller will use 2. you may need to find the cart you are looking for and pass that information into the total() call On Wednesday, February 27, 2013 3:03:24 PM UTC+2, david...@gmail.com wrote: > > > On

Re: Calling functions in other controllers

2013-02-27 Thread Jonathan Sundquist
I might also suggest not using get by itself. You should use meaningful action names. Like getCart or getData. On Wed, Feb 27, 2013 at 7:03 AM, wrote: > > On Wednesday, February 27, 2013 2:55:53 AM UTC+2, lirc201 wrote: >> >> I'm in 2 different controllers. In the checkout controller, I'm tr

Re: Calling functions in other controllers

2013-02-27 Thread david . suna
On Wednesday, February 27, 2013 2:55:53 AM UTC+2, lirc201 wrote: > > I'm in 2 different controllers. In the checkout controller, I'm trying to > call a function in the cart controller. > > Are you sure that the function is in the cart controller? The $uses variable indicates which other models

Re: Calling functions in other controllers

2013-02-26 Thread lirc201
this->cart->get() > On Feb 26, 2013 6:32 PM, "lirc201" > > wrote: > >> I'm still working in cake 1.3.15 (going to upgrade soon) but running into >> an issue. I'm setting up a shopping cart so I have functions in my >> cart_controller like &g

Re: Calling functions in other controllers

2013-02-26 Thread Jonathan Sundquist
If you are in the function trying to call another function just do $this->get() not $this->cart->get() On Feb 26, 2013 6:32 PM, "lirc201" wrote: > I'm still working in cake 1.3.15 (going to upgrade soon) but running into > an issue. I'm setting up a shop

Calling functions in other controllers

2013-02-26 Thread lirc201
I'm still working in cake 1.3.15 (going to upgrade soon) but running into an issue. I'm setting up a shopping cart so I have functions in my cart_controller like Cart get() Cart total() When I attempt to call these functions in my checkout_controller ... var $uses =

CakePHP : problems with controllers functions in external php files

2013-02-09 Thread yucodev
Hi guys ! This is my situation: 1) a simple_php.php file in webroot folder 2) the users_controller.php in the app/controllers 3) the follow function in the users_controller.php : link User->find('first', array('conditions' => array('User.id' => $use

RE: Un-related models / functions

2012-12-11 Thread Advantage+
Thanks man :) Good looking out. -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of lowpass Sent: Tuesday, December 11, 2012 3:35 PM To: cake-php@googlegroups.com Subject: Re: Un-related models / functions keep "last" On Tue, De

Re: Un-related models / functions

2012-12-11 Thread lowpass
reak; > } > > So remove the ?url=$1 or ?url=$1 last ? > > Thanks, > > Dave > -Original Message- > From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf > Of lowpass > Sent: Tuesday, December 11, 2012 3:09 PM > To: cake-php@g

RE: Un-related models / functions

2012-12-11 Thread Advantage+
: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of lowpass Sent: Tuesday, December 11, 2012 3:09 PM To: cake-php@googlegroups.com Subject: Re: Un-related models / functions On Mon, Dec 10, 2012 at 2:50 PM, Advantage+ wrote: > > Forbidden > > Error: The reque

Re: Un-related models / functions

2012-12-11 Thread lowpass
On Mon, Dec 10, 2012 at 2:50 PM, Advantage+ wrote: > > Forbidden > > Error: The requested address '/products/feature?url=products%2Ffeature' was > not found on this server. Cake throws a 404 on internal errors when debug = 0. Set debug to 2 to see what the problem is. > And whats with the crazy

RE: Un-related models / functions

2012-12-10 Thread Advantage+
idden Error: The requested address '/products/feature?url=products%2Ffeature' was not found on this server. And whats with the crazy url? From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Piotr Beschel Sent: Monday, December 10, 2012 5:31 AM To: cake-php@

Re: Un-related models / functions

2012-12-10 Thread Piotr Beschel
read about Controller::requestAction(*string $url*, *array $options*) http://book.cakephp.org/2.0/en/controllers.html W dniu poniedziałek, 10 grudnia 2012 03:35:05 UTC+1 użytkownik advantage+ napisał: > > I have a footer which has a featured product and recent news. > > What is the best way to

Un-related models / functions

2012-12-09 Thread Advantage+
I have a footer which has a featured product and recent news. What is the best way to call these actions getFeatured(), and getNews() when there is no related model to use as they are permanent "blocks" in the footer in default.ctp layout? Thanks, Dave -- Like Us on FaceBook https://www.fa

Re: Including an External Library file that has functions that aren't in a class?

2012-11-29 Thread bluesclues9
brary-file-that-has-functions-that-aren-t-in-a-class-tp1331401p5712502.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 t

Re: Including an External Library file that has functions that aren't in a class?

2012-11-29 Thread lowpass
Might it be better to create a component? You could have AppController load it so that it's always available. On Wed, Nov 28, 2012 at 10:20 PM, bluesclues9 wrote: > Hi > I ran into a similar situation in which I need to write up my own functions > that are to be used in multipl

Re: Including an External Library file that has functions that aren't in a class?

2012-11-28 Thread bluesclues9
Hi I ran into a similar situation in which I need to write up my own functions that are to be used in multiple views(jquery calls). For example: I need to check existence of a file in my file library and I need to do this in multiple controllers. I am thinking of writing commonly used functions

Re: Auth allow for shared functions in Appcontroller

2012-11-23 Thread MetZ
Like this: *AppController* public $components = array( 'Acl', 'Auth' => array( 'loginAction' => '/', 'loginRedirect' => '/users/dashboard', 'logoutRedirect' => array('admin'=>false,'controller'=>'pages','action'=>'home'), 'autoRedirect' => false, 'auth

Re: Auth allow for shared functions in Appcontroller

2012-11-23 Thread lowpass
On Fri, Nov 23, 2012 at 5:37 AM, MetZ wrote: > > So, what to put where? > > eg: PageController > $this->allowedActions = array_merge($this->allowedActions, $args); No, no. This line is from AuthComponent. I just mentioned it to point out that calling allow() in AppController *and* your regular co

Re: Auth allow for shared functions in Appcontroller

2012-11-23 Thread MetZ
riend in >> Postscontroller. >> >> And if I need it in PageController, I need to put in Auth allow >> TellaFriend >> >> in Pagecontroller also, and so on. >> >> >> >> Since this is a shared function, I was wondering, is it possible to >> add it

Re: Auth allow for shared functions in Appcontroller

2012-11-23 Thread MetZ
> >> I refer to my first post for the basic controller setup in use today > (except > >> anything Auth allow in AppController, If I put anything like the > mentioned > >> string in AppController, App does not work at all). > >> > >> -Tom >

Re: Auth allow for shared functions in Appcontroller

2012-11-22 Thread lowpass
ing Auth allow in AppController, If I put anything like the mentioned >> string in AppController, App does not work at all). >> >> -Tom >> >> >> kl. 20:33:21 UTC+1 torsdag 22. november 2012 skrev cricket følgende: >>> >>> He means that he wants his App

Re: Auth allow for shared functions in Appcontroller

2012-11-22 Thread lowpass
;> >> He means that he wants his AppController actions Auth::allow()ed globally. >> >> I've never run into this personally; don't know if it's a bug. Are >> these *actions* or just global functions that your controllers call >> internally? The latter I&#

Re: Auth allow for shared functions in Appcontroller

2012-11-22 Thread MetZ
:allow()ed globally. > > I've never run into this personally; don't know if it's a bug. Are > these *actions* or just global functions that your controllers call > internally? The latter I've done many times. There's no need to allow > them as they&#

Re: Auth allow for shared functions in Appcontroller

2012-11-22 Thread lowpass
He means that he wants his AppController actions Auth::allow()ed globally. I've never run into this personally; don't know if it's a bug. Are these *actions* or just global functions that your controllers call internally? The latter I've done many times. There's no need

Re: Auth allow for shared functions in Appcontroller

2012-11-22 Thread Jeremy Burns : Class Outfit
I hope I haven't misunderstood what you are trying to do... If they are shared functions just put and allow them in app controller and call them from any other controller like so: $this->myFunctionName(). On 22 Nov 2012, at 16:04, MetZ wrote: > Hi. > > Anyone know how I can

Auth allow for shared functions in Appcontroller

2012-11-22 Thread MetZ
Hi. Anyone know how I can auth allow shared functions in appcontroller? Appcontroller: public function beforeFilter() { $this->Auth->allow('SharedFunction'); OtherController.php public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('

Re: Can share common functions across different tables?

2012-11-08 Thread euromark
/... actions) and its controllers inheriting those then. Am Donnerstag, 8. November 2012 04:06:43 UTC+1 schrieb Sam: > > Dear CakePHP gurus, > > I am using CakePHP ver2.2.1 > > The different tables in my database share similar functions which I am > using for web services. For e

Can share common functions across different tables?

2012-11-07 Thread Sam
Dear CakePHP gurus, I am using CakePHP ver2.2.1 The different tables in my database share similar functions which I am using for web services. For example, the add, edit, view and delete functions are similar across different tables. The only changes to be made is that the table or object

Re: How include external file (contains functions only ) in controller

2012-11-07 Thread sathishbabu R
All functions are based on same logic.. But I have replicate that based on role level. Here I have 5 roles in my tool. For that I have copy the function and do some changes based on role.. That what I need all function should be in same controller but from differnt external sources.. On Wed, Nov

Re: How include external file (contains functions only ) in controller

2012-11-07 Thread Jeremy Burns : Class Outfit
Use one or more components. On 7 Nov 2012, at 16:01, Steve Babs wrote: > > Hi , > > I have created User controller . In that I implemented so many function. Due > to that the no.of codes increase to 20,000. Because of that I cannot able to > open that file any editor. Please give me a sugges

How include external file (contains functions only ) in controller

2012-11-07 Thread Steve Babs
Hi , I have created User controller . In that I implemented so many function. Due to that the no.of codes increase to 20,000. Because of that I cannot able to open that file any editor. Please give me a suggestion to insert code from diffrent file. Thanks, -- Like Us on FaceBook https://www

Custom functions on Models are not working

2012-10-30 Thread Jipson
Hi All, I am trying to create a project using cakephp 2.2. On my local xaamp it is working fine, but on my server it shows like models are not included. For exampla, the searchprojects function defined on model user and if I am calling the function from users controller like $this->User->search

Re: PHP functions in controller

2012-08-29 Thread Nareh Tarasyan
Yeah, Mark, I also thought so and tried, but it doesn't work. Doesn't echo anything :/ -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, send email to cak

Re: PHP functions in controller

2012-08-29 Thread Mark Wratten
$this->set('randword', $this->Word->findById(rand(1,$this->Word->find('count'; On Wednesday, August 29, 2012 10:24:26 AM UTC-4, Nareh Tarasyan wrote: > > Thanks Marcus > > but u know what I did here... see: > > $this->set('rand', rand(1,$this->Word->find('count'))); > $this->

Re: PHP functions in controller

2012-08-29 Thread Jeremy Burns | Class Outfit
Read. The. Manual. Jeremy Burns Class Outfit http://www.classoutfit.com On 29 Aug 2012, at 15:24:26, Nareh Tarasyan wrote: > Thanks Marcus > > but u know what I did here... see: > > $this->set('rand', rand(1,$this->Word->find('count'))); > > $thi

Re: PHP functions in controller

2012-08-29 Thread Nareh Tarasyan
Thanks Marcus but u know what I did here... see: $this->set('rand', rand(1,$this->Word->find('count'))); $this->set('randword', $this->Word->findById()); I want ID= value of rand function, but don know how to write it. -- You received this message because you are subscribed to

Re: PHP functions in controller

2012-08-29 Thread AD7six
all hope is lost On Wednesday, 29 August 2012 15:27:06 UTC+2, Nareh Tarasyan wrote: > > how can I use usual PHP functions in controller? > > for example i use > $rand=rand(1,$number) > > in View/index.ctp > > but don know how to use in controller? > -- You receive

Re: PHP functions in controller

2012-08-29 Thread Marcus James
Hi, You can use any PHP function in your controller just like you use it in your normal PHP code. It same in controller too :- function index() { $rand=rand(1,$number); } Enjoy , Marcus -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to

PHP functions in controller

2012-08-29 Thread Nareh Tarasyan
how can I use usual PHP functions in controller? for example i use $rand=rand(1,$number) in View/index.ctp but don know how to use in controller? -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email t

Re: How to access base model functions from a related behavior model

2012-08-20 Thread Tilen Majerle
Ok..than its better if you create new behavior and functions you pass into it..and ijclude this behavior to all models where you need this function..:) Dne ponedeljek, 20. avgust 2012 je pošiljatelj kevin.ncbible < ke...@ncbible.com> napisal: > Thank you, Tilen -- I really appreciate yo

Re: How to access base model functions from a related behavior model

2012-08-20 Thread kevin.ncbible
Thank you, Tilen -- I really appreciate you sharing your time and talents: if you have associated Topic and TopicTree, than you can access in > controller with $this->TopicTree->Topic This first approach seems the most "elegant," but should I be trying to associate two models based on the same

Re: How to access base model functions from a related behavior model

2012-08-20 Thread Tilen Majerle
if you have associated Topic and TopicTree, than you can access in controller with $this->TopicTree->Topic, if you don't have accociated this 2 models, than you can use $this->loadModel('Topic'); in your controller, and then $this->Topic->myFunction(); -- Lep pozdrav, Tilen Majerle http://majerle.e

Re: How to access base model functions from a related behavior model

2012-08-20 Thread kevin.ncbible
oops: in above, it should have read: e.g., my Clause model, with a one-to-one association to *Topic* -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com. To unsubscribe from this group, sen

How to access base model functions from a related behavior model

2012-08-20 Thread kevin.ncbible
Hi. Thank you, again, for helping. I have a basic model (Topic), with functions, e.g., MyFunction(), and another model that is a behavior (TopicTree), based on the same underlying table: public $useTable = 'topics'; public $name = 'TopicTree'; public $actsAs

Re: Plugin Model Custom functions not accessible in controller

2012-08-08 Thread Luis Cano
It looks like this... public $hasAndBelongsToMany = array( 'Something' => array( 'className' => 'Something', 'joinTable' => 'other_models', 'foreignKey' => 'dog_id', 'associationForeignKey' => 'something_id', 'unique' => false

Re: Plugin Model Custom functions not accessible in controller

2012-08-08 Thread lowpass
What do the associations look like in Dog.php? On Tue, Aug 7, 2012 at 4:41 PM, Luis C wrote: > Ok, > It is even worse now. > > Let's say I have a hasAndBelongsToMany association in Dog.php with another > table (Model). And then in the Controller I have the following > > $this->Dog->find('all'); >

Re: Plugin Model Custom functions not accessible in controller

2012-08-08 Thread Steve Found
On 07/08/12 21:41, Luis C wrote: Ok, It is even worse now. Let's say I have a hasAndBelongsToMany association in Dog.php with another table (Model). And then in the Controller I have the following $this->Dog->find('all'); print_r($this->OtherModel); exit; Instead of getting an instance of Ot

Re: Plugin Model Custom functions not accessible in controller

2012-08-08 Thread Steve Found
On 07/08/12 19:29, Luis C wrote: Hello, I got a weird issue in CakePHP 2.2. I have created a plugin, let's call it PluginName, and within PluginName I have the following: Controller: - DogsController - CatsController Model - PluginNameAppModel.php - Dog.php - Cat.php (all mode

Re: Plugin Model Custom functions not accessible in controller

2012-08-07 Thread Luis C
Ok, It is even worse now. Let's say I have a hasAndBelongsToMany association in Dog.php with another table (Model). And then in the Controller I have the following $this->Dog->find('all'); print_r($this->OtherModel); exit; Instead of getting an instance of OtherModel and all of the associations

Plugin Model Custom functions not accessible in controller

2012-08-07 Thread Luis C
Hello, I got a weird issue in CakePHP 2.2. I have created a plugin, let's call it PluginName, and within PluginName I have the following: Controller: - DogsController - CatsController Model - PluginNameAppModel.php - Dog.php - Cat.php (all models extend the PluginNameAppModel.php

Re: Overriding cakephp core functions

2012-06-12 Thread Chris Cinelli
This is a old thread but latest news made it relevant. Last September I decided to drop it because people seems a little too opinionated and willing not listening. I hope that after the Linkedin's leak of 6.5M hashs and crack of a few of the associated passwords (see http://shiflett.org/blog/2012/j

Re: cakephp 1.3 charting functions

2012-05-15 Thread Jeremy Burns | Class Outfit
: >> >> >> >> >> >> >> >>> Hello everybody, I'm developing a web site with cakephp 1.3, and I >>> need to use charting functions, which one do you recommend me? >> >>> I need to display a lot of data (differen

Re: cakephp 1.3 charting functions

2012-05-15 Thread David
23, David wrote: > > > > > > > > > Hello everybody, I'm developing a web site with cakephp 1.3, and I > > need to use charting functions, which one do you recommend me? > > > I need to display a lot of data (different kind of charts and >

Re: cakephp 1.3 charting functions

2012-05-15 Thread Jeremy Burns | Class Outfit
eremy Burns Class Outfit http://www.classoutfit.com On 15 May 2012, at 13:07:23, David wrote: > Hello everybody, I'm developing a web site with cakephp 1.3, and I > need to use charting functions, which one do you recommend me? > > I need to display a lot of data (differ

cakephp 1.3 charting functions

2012-05-15 Thread David
Hello everybody, I'm developing a web site with cakephp 1.3, and I need to use charting functions, which one do you recommend me? I need to display a lot of data (different kind of charts and different lenght of time) -- Our newest site for the community: CakePHP Video Tutorials

examples on how to create my own magic functions

2012-04-24 Thread bs28723
I tried to find the code that implements the magic functions findBy* and findAllBy* but I got lost. Can someone point me to the code or an example of how to replicate this? I may have a need to create my own set of functions like this, and would like to see how to parse the method name and

Re: Global functions

2012-04-09 Thread luca capra
My fault, but you can find in the manual too: $this->Form->value('Patient.bloodgroup'); Please reply to the list not directly to me to have more responses than mine (I'm not a cakephp guru nor your assistance help desk :) ) Bye, Luca Il 10/04/2012 07:23, alexkd ha scritto: While debug( $thi

Re: Global functions

2012-04-04 Thread luca capra
Sorry I've not understand what the problem is. The select doesn't prepopulate well? Try checking what the value of debug( $this->request->data('Patient.bloodgroup') ); If it is a text value you need to give the right key to the select $_bloodgroup = array_flip( $bloodgroup ); echo $this->For

Re: Global functions

2012-04-04 Thread JunLe Li
why not use array? $output = array('Rh A+', 'Rh A-','Rh B+', 'Rh B-', 'Rh AB+', 'Rh AB-'); > if (isset($output[ $patient['Patient']['bloodgroup'] ])) { > echo $output[ $patient['Patient']['bloodgroup'] ]; > } > -- liju...@gmail.com | Public Key

Re: Global functions

2012-04-04 Thread euromark
you can also use some kind of enum like I do: http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/ echo Patient::bloodgroups($patient['Patient']['bloodgroup']); anywhere in your application (in this case the view template) Am Mittwoch, 4. April 2012 12:14:21 UTC+2 s

Re: Global functions

2012-04-04 Thread luca capra
Il 04/04/2012 11:27, alexkd ha scritto: In my patient form one blood group select box. ... Can I place a function globally to return bloodgroup when id is passed? If so what can I do for it? Thanks. You can move the code in a Helper book.cakephp.org/2.0/en/views/helpers.html#creating-helpers O

Global functions

2012-04-04 Thread alexkd
In my patient form one blood group select box. My view.ctp is as follows, Can I place a function globally to return bloodgroup when id is passed? If so what can I do for it? Thanks. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Qu

Common functions

2012-04-02 Thread alexkd
As I am a beginner in CakePHP my problem is How can I create common functions in a class like in VB modules and call this or is this conventional to CakePHP to allocate repeated function in a class and call. thanks -- Our newest site for the community: CakePHP Video Tutorials http

Re: How to make and use your own functions

2012-02-17 Thread arron
> > and how do i use function variables within other functions? > > I understand for example i have to edit a record i would do > > public function edit($id = null) { > > I guess I'm just confused > > On Feb 16, 5:33 pm, jeremyharris wrote: > > > > >

Re: How to make and use your own functions

2012-02-17 Thread jeremyharris
In the view you would create a helper that had the function on it. Your controller includes that helper. I'm not trying to be mean here, but even to use CakePHP you have to have a semi-decent grasp on programming PHP. Understanding functions, classes, scope (the $this keyword) are all

Re: How to make and use your own functions

2012-02-17 Thread arron
Thank you for your advice, I will try that. I would still like to know if I made a custom function how would i call it in the view echo $this->Getback ? and how do i use function variables within other functions? I understand for example i have to edit a record i would do public funct

Re: How to make and use your own functions

2012-02-16 Thread jeremyharris
Well, just think of how the function will be used. In CakePHP, you can split things up into components, helpers and behaviors as well. CakePHP is just PHP so you can technically put the function anywhere. If you put it in your AppController all of your controllers will have access to it. If you

How to make and use your own functions

2012-02-16 Thread arron
I am using Ajax paginate it works great. when a new record is created i would like them to be redirected back the last page there where at. So I created a function called GetBack. I cant figurer how to use my getback function. So basically how do i use a function ? if i just add $this->Session

Re: Overriding cakephp core functions

2011-09-14 Thread Tonu Tusk
Chris, if you are saying that a system that has a repo / db of sha1 passwords is vulnerable * ONLY * based on the fact that someone has access to the app server (to acquire the salt), then your bcrypt doesn't help in many siutations either. If somebody had access to your server, what is stopping t

Re: Overriding cakephp core functions

2011-09-13 Thread Ryan Schmidt
On Sep 13, 2011, at 19:47, Chris Cinelli wrote: > if it is your argument and you feel strong on how difficult is to access you > DB, why don't you store the passwords in clear in your DB? So that, when I browse my database, I can't read my users' passwords. Thank you by the way for bringing up

Re: Overriding cakephp core functions

2011-09-13 Thread Greg Skerman
As a serious aside... if the Auth component/hashPasswords won't do it for you, could you not subclass the auth component: BcryptAuthComponent extends AuthComponent { } and replace the 'offending' bits of the code so it *does* work for you? again, never tried (never saw the need) but if there is

Re: Overriding cakephp core functions

2011-09-13 Thread Greg Skerman
I don't assume my system is invulnerable.. just as you should not assume bcrypt is invulnerable (its at least as vulnerable as everything else from the perspective of brute forcing/attacking at the login form). I do however take reasonable steps to reduce the risk of my system being attacked r

Re: Overriding cakephp core functions

2011-09-13 Thread Chris Cinelli
Again, if you assume that your system is invulnerable, why complicating your life using hashed passwords in the database, then? Put them in DB in clear. I understand that getting the DB and the salt may not be trivial. However every once in a while vulnerabilities are discovered and bad guys can be

Re: Overriding cakephp core functions

2011-09-13 Thread Greg Skerman
The inference is that every cake application is magically vulnerable to an attack predicated on ridiculously weak passwords and the highly unlikely occurance that the attacker has both the salt and unfettered access to the database. If you are so convinced, couldn't you override AuthComponent::has

Re: Overriding cakephp core functions

2011-09-13 Thread Chris Cinelli
Or maybe, Paypal is using bcrypt. :-P Yes, of course you need the user table in the DB, but if it is your argument and you feel strong on how difficult is to access you DB, why don't you store the passwords in clear in your DB? I am not saying that it is easy to do, but in case it happen (see Rock

Re: Overriding cakephp core functions

2011-09-13 Thread Greg Skerman
On Wed, Sep 14, 2011 at 8:33 AM, Chris Cinelli < chris.cine...@formativelearning.com> wrote: > > > According to: http://research.microsoft.com/pubs/74164/www2007.pdf *~20% > of Fidelity, ~20% of NY Times, ~15% of Paypal* have a password with bit > strength of 30 or less. According to that study, t

Re: Overriding cakephp core functions

2011-09-13 Thread Greg Skerman
**nothing** absolutely protects you from brute force. your bcrypt is just as vulnerable to a plain jane dictionary attack as anything else. If you have generated all possible passwords, its just a case of (painstakingly slow) trail and error to get you in. Changing the hashing approach wont change

Re: Overriding cakephp core functions

2011-09-13 Thread Chris Cinelli
If you have the access to the DB, you have probably have the access to the salt too. Salts protect you against rainbow tables, not against brute forcing. While to brute force a 46 character password would take more than the life of our sun, you have to consider what is the bit strength of the avera

Re: Overriding cakephp core functions

2011-09-13 Thread AD7six
On Sep 13, 3:02 pm, AD7six wrote: > On Sep 13, 3:21 am, Chris Cinelli > > wrote: > > Read the link I posted. 40 secs to bruteforce crack an hash > > How about: how long on average to brute force a sha1-ed 46 char a-zA- > Z0-9 string? > > That's the default hash for cake 1.3, and the length of t

Re: Overriding cakephp core functions

2011-09-13 Thread AD7six
On Sep 13, 3:21 am, Chris Cinelli wrote: > Read the link I posted. 40 secs to bruteforce crack an hash How about: how long on average to brute force a sha1-ed 46 char a-zA- Z0-9 string? That's the default hash for cake 1.3, and the length of the salted string with a 6 char (weak) password. Quo

Re: Overriding cakephp core functions

2011-09-13 Thread WebbedIT
> > > > > > chris.cine...@formativelearning.com> wrote: > > Read the link I posted. 40 secs to bruteforce crack an hash > > On Sep 12, 2011 5:17 PM, "Ryan Schmidt" > > wrote: > > > > On Sep 12, 2011, at 18:01, Chris Cinelli wrote

Re: Overriding cakephp core functions

2011-09-12 Thread Greg Skerman
mativelearning.com> wrote: > Read the link I posted. 40 secs to bruteforce crack an hash > On Sep 12, 2011 5:17 PM, "Ryan Schmidt" > wrote: > > > > On Sep 12, 2011, at 18:01, Chris Cinelli wrote: > > > >> Nowadays, normal hash functions like SHA

Re: Overriding cakephp core functions

2011-09-12 Thread Chris Cinelli
Read the link I posted. 40 secs to bruteforce crack an hash On Sep 12, 2011 5:17 PM, "Ryan Schmidt" wrote: > > On Sep 12, 2011, at 18:01, Chris Cinelli wrote: > >> Nowadays, normal hash functions like SHA1 are good for sessions and caching but not for storing passwords.

Re: Overriding cakephp core functions

2011-09-12 Thread Ryan Schmidt
On Sep 12, 2011, at 18:01, Chris Cinelli wrote: > Nowadays, normal hash functions like SHA1 are good for sessions and caching > but not for storing passwords. Doing that is pretty much equivalent to having > passwords in clear on the DB. Do you have documentation for this claim?

Re: Overriding cakephp core functions

2011-09-12 Thread Chris Cinelli
The problem is that if you want to use bcrypt ( http://codahale.com/how-to-safely-store-a-password/ ), the returned value is always different. bcrypt works with 2 functions: 1) bcrypt_hash($new_password); and 2)bcrypt_check($entered_password, $password_in_DB); Cake auth module has the

Re: Overriding cakephp core functions

2011-09-12 Thread Everton Yoshitani
If you are using Auth component you could do it by this way: http://book.cakephp.org/view/1254/Change-Hash-Function Hope it's helps. On Tue, Sep 13, 2011 at 6:43 AM, chaitanya mutyala wrote: > Hello, > > Can someone suggest the best way to override the core 'hash' function > ( /lib/cake/Utili

Re: Overriding cakephp core functions

2011-09-12 Thread Tilen Majerle
nopee... -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/9/12 chaitanya mutyala > Hello, > > Can someone suggest the best way to override the core 'hash' function > ( /lib/cake/Utility/Security.php ) without touching any of the core > files? I want to write my own custom hash function. >

Overriding cakephp core functions

2011-09-12 Thread chaitanya mutyala
Hello, Can someone suggest the best way to override the core 'hash' function ( /lib/cake/Utility/Security.php ) without touching any of the core files? I want to write my own custom hash function. Thanks, Chaitanya -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp

  1   2   3   4   5   6   >