Re: Sending email using HTTP fx sendgrid

2013-06-15 Thread Henrik Gemal
hough I haven't actually attempted to craft one. > > If you do go down that route, would be great if you share the code :) > > > On Fri, Jun 14, 2013 at 7:10 PM, Henrik Gemal > > > wrote: > >> Hi >> >> We use latest CakePHP 2.3.6 >> >&

Sending email using HTTP fx sendgrid

2013-06-14 Thread Henrik Gemal
Hi We use latest CakePHP 2.3.6 We are sending emails using SMTP to sendgrid. The configuration is really easy in CakePHP Now we are looking into switching to using SendGrids HTTP interface for sending email, since it's a lot faster than SMTP. How would we implement this in CakePHP? Fx how wo

Rest Auth and cookie

2012-06-07 Thread Henrik Gemal
I'm building a pure REST application which only supports Basic authentication. But CakePHP 2.1.3 keeps insisting on sending out a Cookie on all reponses. My setup is something like this - CakePHP 2.1.3 app with Basic authentication - After authenticating the user I return the XML to the user So

CakePHP 2.1 Basic Auth and Security. All requests are blackholed

2012-06-05 Thread Henrik Gemal
I'm developing a App that ONLY uses Basic Auth as authentication I want to specify some methods that requires authentication So I have something like: $this->Auth->authenticate = array("Basic"); $this->Auth->allow("info", "check") $this->Security->requireAuth("check"); when ever I call the

Log off other users with Auth

2011-02-03 Thread Henrik Gemal
I use Auth on one of my websites. When I change another users password I like the other user to get logged off. How do I do that? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others

Client specific translations?

2010-11-05 Thread Henrik Gemal
I need to have client specific translations in a project of mine. The project is already translated into 2 languages "eng" and "dan". The project serves different clients. Now a client of my wants to have a different translations for some strings. I'm thinking about implementing like this: Fir

Validate REST input

2010-05-21 Thread Henrik Gemal
I have a controller which is being called with different paramters like: /test/do?start=2010-01-01&end=2011-01-01&test=1&super=8 Now I like to user cake to validate the input parameters. How do I do that? I like to specify that start and end are dates and test is numeric and super is also numeric

Re: Validate CC field

2010-04-15 Thread Henrik Gemal
php.org/view/150/Custom-Validation-Rules > > Enjoy, >    John > > On Apr 15, 6:10 pm, Henrik Gemal wrote: > > > Is there a way to validate a form entry where people can enter one or > > more email addresses? > > > In the form like: > > t...@test.com, te.

Validate CC field

2010-04-15 Thread Henrik Gemal
Is there a way to validate a form entry where people can enter one or more email addresses? In the form like: t...@test.com, te...@test.com Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are

Validate query params

2010-04-15 Thread Henrik Gemal
In my CakePHP application I have an action that sends an mail. To use this action you must POST some required fields like "to", "from", "cc", "subject" and like. How do I go around a validate those parameters? Since the mail isn't going to be saved into the database I cant use the normal "$valid

Fatal error: Class 'String' not found in D:\cake\1.2.6\cake\libs\controller\components\security.php on line 671

2010-03-18 Thread Henrik Gemal
Using the "security" module I get a error: Fatal error: Class 'String' not found in D:\cake\1.2.6\cake\libs \controller\components\security.php on line 671 Use the following controller and the load the test method http://localhost/test/test Simple controller code: Security->loginOptions = arra

Update now save

2009-10-13 Thread Henrik Gemal
I have a table with: name, hour, status hour is the hour of the time. So I have to check each hour that name is ok and set the status. So eventually I get a table like: test, 1, 1 test, 2, 0 test, 3, 0 test, 23, 1 If I use: $data = array("Name" => array("status" => $status, "name"

function both called from controller and model

2009-09-18 Thread Henrik Gemal
I have a function need to call both from the controller and from two models. How do I share that function between both the controller and the models? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. T

Re: Release: CakePHP 1.2.5

2009-09-18 Thread Henrik Gemal
Is there a way to get notified about new CakePHP releases? Like a CakePHP announe malinglist? On Sep 9, 5:54 pm, mark_story wrote: > The CakePHP development team is happy to announce CakePHP 1.2.5[1]. > 1.2.5 is a bug fix release of the latest stable branch. Check the > changelog[2] for all the

admin application

2009-09-01 Thread Henrik Gemal
I need to write an admin application where user can only see their own stuff and admins can see all the stuff. But I am a bit confused which way I need to look. Should I look into using ACLs or ? Think of a book site where users can only see and edit the books they posted and admins can see

Keep getting new CAKEPHP cookie

2009-06-09 Thread Henrik Gemal
Is it normal that you keep getting new CAKEPHP cookies? Try loading http://ketchup.book.dinnerbooking.com/ and click on a date. A set-cookie header is sent every time. Is that normal? --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Multiple databases with different column

2009-06-08 Thread Henrik Gemal
I'm accessing databases stored on difference computers. Everything works just fine now since all the databases have the same columns on the different computers. So no problem now. But we need to upgrade the databases. This we cant do all at once, so we will be running with different databse for m

Multi language and invalid Config.language

2009-05-15 Thread Henrik Gemal
I have a multi language site where people can change language using the P28nController and P28nComponent. I bootstrap.php I set a default language. The problem right now is that somehow I got an invalid Config.language setting. If I in my code do: --- print_r($this->Session->read("Confi

log fatal php errors

2009-04-22 Thread Henrik Gemal
On my production server I have: In core.php in Cakephp: Configure::write('debug', 0); In PHP.ini: error_reporting = E_ALL display_errors = Off log_errors = On error_log = "\phperror.log" Consider the following PHP code and memcache ISN'T installed: On m

$html->link but dont encode the URL

2009-04-15 Thread Henrik Gemal
I'm using the MailtoHelper to encode a mailto address to avoid spammers. the code is something like: $mail = $html->link($m, $mailto->encode($m)); the problem is now that the mailto address is already encoded so I dont want html->link to reencode (html entities) since this messes up my mailto ad

info from database error?

2009-04-03 Thread Henrik Gemal
In my controller I'm doing: $ok = $test->deleteAll($conditions, false); where $test is my model this normally works just fine, but this was failing for some unknown reason. Now I want to be able to debug why this was failing. Is there a way to get the last error? I've only seen the problem in

.mo files vs cache

2009-04-01 Thread Henrik Gemal
do I need to generate the .mo file from my locale? cakephp seems to cache the language file in a cake_core_default_eng file in the cache directory. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. T

Fatal error = blank page

2009-03-24 Thread Henrik Gemal
if I'm running debug=0 and get a: "Fatal error: Call to undefined method" I get a blank page. Can I somehow show an error page instead? I've tried using ErrorDocument 500 /error/ but that doesn't work. My site seems to return a "200 OK" with the "fatal error" --~--~-~--~~-

Re: 1.2.2.8120 and "Undefined variable: html"

2009-03-20 Thread Henrik Gemal
class BookingsController extends AppController { rite? On Mar 20, 10:48 am, "jitka (poLK)" wrote: > > class TestController extends Controller { > > Guess what is wrong in this line. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: 1.2.2.8120 and "Undefined variable: html"

2009-03-20 Thread Henrik Gemal
Any idea why this worked in "1.2.1.8004" and not "1.2.2.8120" ? What has changed? On Mar 20, 9:46 am, Sergei wrote: > I think you need to merge your $helpers variable, because you variable > in testcontroller overwrites one in appcontroller. > > On 20 мар, 16:

1.2.2.8120 and "Undefined variable: html"

2009-03-20 Thread Henrik Gemal
I just tried to upgrade to CakePHP 1.2.2.8120 and now I'm getting "Undefined variable: html" My app_controller.php: class AppController extends Controller { var $components = array("P28n"); var $helpers = array("Html", "Form", "Javascript", "Session"); } My test_controller.php:

persistent when database are not local but remote

2009-03-12 Thread Henrik Gemal
My web application has to connect to a remote database over a openvpn connection. Should I use "persistent" connections? Are there any disadvantages by doing so? I also looked into added support for compression to the mysql driver in cakephp. Should be pretty simple. Just add "MYSQL_CLIENT_COMPR

Help with left join

2009-03-03 Thread Henrik Gemal
Hi I'm having a little problem with converting an old sql request to use cakephp. The sql is: select name, if(module_id is null,0,1) activated from module left join active_modules on (id = module_id and res_id = $id) I have something like: var $useTable = "modules"; var $be

Re: Change database of models

2009-02-16 Thread Henrik Gemal
what should I set as the default "useDbConfig" in my model? Say I have a model called "x". This model is located in database which I dont know the name of when loading the model uses "uses" I first know the database name after I query the first name where I get the name of the database. So shou

Change database of models

2009-02-13 Thread Henrik Gemal
In my controller I first need to query a database which holds information about which database all of the models should use. I'm not sure how to do this. When the models get initialized by the uses array I haven't yet determined what database they should use. Any clue in which direction I should

ClassRegistry::init vs loadModel

2009-02-09 Thread Henrik Gemal
I'm not sure what the "most" correct way to dynamicly load a model is: ClassRegistry::init("model_name") or loadModel("model_name") ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this

Validation rule with or

2009-02-09 Thread Henrik Gemal
I have a form where you have to enter either ("firstname" AND "lastname" AND "phone") OR ("companyname" AND phone") how do I make a validate rule like that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" g

Call function in controller from model

2009-01-30 Thread Henrik Gemal
In my model I want to call a debug function in the controller. But how do I do that? Something like: $ok = $waitlist->save($data); if (!$ok) { parent::errorlog("waitlist save not ok"); or is this the wrong way to do thing? Should I use a completely different approche? --~--~-~

share function in views

2009-01-12 Thread Henrik Gemal
I have a custom html escape function that I like to be able to use in two views. What's the best way to share function between views? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this gr

Using begin/commit/rollback with transaction

2009-01-12 Thread Henrik Gemal
If I am to use begin() commit() rollback() do I need to set the $transactional property on the model first? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-ph

Re: disable dbo_source_php include from my views

2009-01-12 Thread Henrik Gemal
I think you can change the line: Configure::write('debug', 2); in core.php to: Configure::write('debug', 0); * CakePHP Debug Level: * 0: No error messages, errors, or warnings shown. Flash messages redirect. * 1: Errors and warnings shown, model caches refreshed, flash messages halt

Re: Rollback on multiple models

2009-01-11 Thread Henrik Gemal
t; > best regards... > > On Jan 9, 12:47 pm, Henrik Gemal wrote: > > > I have a function in a model which contains multiple save operations > > also in different models. > > > So my function in model x does something like: > > > x->save() > > y->s

Rollback on multiple models

2009-01-09 Thread Henrik Gemal
I have a function in a model which contains multiple save operations also in different models. So my function in model x does something like: x->save() y->save() z->save() so it's only if all of the saves success that I want to commit. But can I do something like: x->begin() x->save() y->sa

validate and allow only specified fields

2008-12-18 Thread Henrik Gemal
Is there a way in the model to say that it should only be possible to submit these values in the post? I want to disallow the user posting any other form fields that I have specified in the model's validate array? --~--~-~--~~~---~--~~ You received this message bec

Change database and host from the Controller

2008-12-04 Thread Henrik Gemal
I need to change the host and the database from the controller. The controller will read some config vars in the local database and the then needs to connect to the host and database specified in the config vars. These config vars changes all the time. So how do I dynamically change the database

PHP generated JavaScript

2008-12-03 Thread Henrik Gemal
I need to include a JavaScript URL on my page. The JavaScript needs to be generated by PHP. How do I do that? The PHP needs to read from the database to generate the JavaScript --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google